Commit Graph

418140 Commits

Author SHA1 Message Date
Zixu Wang fa331da8fb [FIX][clang-extract-api] Fix scope naming violation 2022-03-16 16:04:44 -07:00
Med Ismail Bennani 0a65112cf7 [lldb/crashlog] Create artificial frames for non-crashed scripted threads
This patch pipes down the `-a|--load-all` crashlog command option to the
Scripted Process initializer to load all the images used by crashed
process instead of only loading the images related to the crashed
thread.

This allows us to recreate artificial frames also for the non-crashed
scripted threads.

rdar://90396265

Differential Revision: https://reviews.llvm.org/D121826

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-16 15:50:10 -07:00
Benjamin Kramer 0c4e9fbf41 [bazel] Port 50f82e6847 2022-03-16 23:46:46 +01:00
Johannes Doerfert a597d6a780 Revert "[OpenMP][FIX] Allow device constructors for AMD GPU"
This reverts commit 07b1766461 as it broke
the buildbots:
    https://lab.llvm.org/buildbot#builders/193/builds/8594
2022-03-16 17:35:54 -05:00
Jakob Johnson 22077627ae Minor refactor and renaming:
- Rename IntelPTManager class and files to IntelPTCollector
  - Change GetTimestampCounter API to general trace counter API,
    GetCounter

Differential Revision: https://reviews.llvm.org/D121711
2022-03-16 15:35:36 -07:00
Zixu Wang 5aab45f430 [clang][extract-api] Add global record support
Add facilities for extract-api:
- Structs/classes to hold collected API information: `APIRecord`, `API`
- Structs/classes for API information:
  - `AvailabilityInfo`: aggregated availbility information
  - `DeclarationFragments`: declaration fragments
    - `DeclarationFragmentsBuilder`: helper class to build declaration
      fragments for various types/declarations
  - `FunctionSignature`: function signature
- Serialization: `Serializer`
- Add output file for `ExtractAPIAction`
- Refactor `clang::RawComment::getFormattedText` to provide an
  additional `getFormattedLines` for a more detailed view of comment lines
  used for the SymbolGraph format

Add support for global records (global variables and functions)
- Add `GlobalRecord` based on `APIRecord` to store global records'
  information
- Implement `VisitVarDecl` and `VisitFunctionDecl` in `ExtractAPIVisitor` to
  collect information
- Implement serialization for global records
- Add test case for global records

Differential Revision: https://reviews.llvm.org/D119479
2022-03-16 15:13:55 -07:00
Johannes Doerfert 07b1766461 [OpenMP][FIX] Allow device constructors for AMD GPU
In AMD GPU device code the globals are in AS(1). Before, we crashed if
the global was a structure. Now we simply cast away the AS before we
generate the code to initialize the global.

Differential Revision: https://reviews.llvm.org/D121837
2022-03-16 17:04:28 -05:00
Jonas Devlieghere ff9e596b10
[lldb] Expose diagnostic events through the SB API
Expose diagnostic events through the SB API. Unlike the progress events,
I opted to use a SBStructuredData so that we can add fields in the
future.

Differential revision: https://reviews.llvm.org/D121818
2022-03-16 15:03:31 -07:00
Craig Topper 74cf8575f7 [RISCV] Remove stale FIXME from a test. NFC 2022-03-16 14:55:11 -07:00
Craig Topper 2e10671ec7 [RISCV] Improve detection of when to skip (and (srl x, c2) c1) -> (srli (slli x, c3-c2), c3) isel.
We have a special case to skip this transform if c1 is 0xffffffff
and x is sext_inreg in order to use sraiw+zext.w. But we were only
checking that we have a sext_inreg opcode, not how many bits are
being sign extended.

This commit adds a check that it is a sext_inreg from i32 so we know for
sure that an sraiw can be created.
2022-03-16 14:54:34 -07:00
River Riddle 50f82e6847 [mlir] Fix missing verification after running an OpToOpAdaptorPass
The current decision of when to run the verifier is running on the
assumption that nested passes can't affect the validity of the parent
operation, which isn't true. Parent operations may attach any number
of constraints on nested operations, which may not necessarily be
captured (or shouldn't be captured) at a smaller granularity.

This commit rectifies this by properly running the verifier after an
OpToOpAdaptor pass. To avoid an explosive increase in compile time,
we only run verification on the parent operation itself. To do this, a
flag to mlir::verify is added to avoid recursive verification if it isn't
desired.

Fixes #54288

Differential Revision: https://reviews.llvm.org/D121836
2022-03-16 14:53:41 -07:00
Mike Rice 79f661edc1 [OpenMP] Initial parsing/sema for the 'omp teams loop' construct
Adds basic parsing/sema/serialization support for the #pragma omp teams loop
directive.

Differential Revision: https://reviews.llvm.org/D121713
2022-03-16 14:39:18 -07:00
Jez Ng f5ddcf25d6 [lld-macho] Extend lto-internalize-unnamed-addr.ll
* Test the case where a symbol is sometimes linkonce_odr and sometimes weak_odr
* Test the visibility of the symbols at the IR level, after the internalize
  stage of LTO is done. (Previously we only checked the visibility of
  symbols in the final output binary.)

Reviewed By: modimo

Differential Revision: https://reviews.llvm.org/D121428
2022-03-16 17:30:31 -04:00
Louis Dionne 197737b539 [libc++][NFC] Reindent release notes bullet points 2022-03-16 17:26:32 -04:00
Arthur Eubanks 2371c5a0e0 [OpaquePtr][ARM] Use elementtype on ldrex/ldaex/stlex/strex
Includes verifier changes checking the elementtype, clang codegen
changes to emit the elementtype, and ISel changes using the elementtype.

Basically the same as D120527.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D121847
2022-03-16 14:11:53 -07:00
Alex Bradbury 65370702b8 [CODE_OWNERS/CREDITS] Update my email address 2022-03-16 21:07:15 +00:00
Alexey Bataev 150ea76543 Revert "[SLP]Do not schedule instructions with constants/argument/phi operands and external users."
This reverts commit 1eeb2bfe72 to fix
a bug reported in https://reviews.llvm.org/D121121
2022-03-16 13:54:59 -07:00
Marek Kurdej dbefb7e86f [clang-format] Reformat. NFC. 2022-03-16 21:54:11 +01:00
Nick Desaulniers 6ede09b6b7 [SCCP] update test to NPM, update_test_checks. NFC
Pre-committing a test update to make changes in D121744 more visible.
2022-03-16 13:51:25 -07:00
Emil Kieri b85922cde6 [flang] Include missing internal interfaces in .mod files
Interfaces which are internal to a procedure need to be included in
module files if (and only if) they are referenced in the interface of
the procedure. That is, they are needed if they are the interfaces of
dummy or return value procedures.

Fixes #53420

Differential Revision: https://reviews.llvm.org/D121738
2022-03-16 21:36:02 +01:00
Thomas Lively 7e8913d775 [WebAssembly] Fix names of SIMD instructions containing '_zero'
Fix the instruction names to match the WebAssembly spec:

 - `i32x4.trunc_sat_zero_f64x2_{s,u}` => `i32x4.trunc_sat_f64x2_{s,u}_zero`
 - `f32x4.demote_zero_f64x2` => `f32x4.demote_f64x2_zero`

Also rename related things like intrinsics, builtins, and test functions to
match.

Reviewed By: aheejin

Differential Revision: https://reviews.llvm.org/D121661
2022-03-16 13:34:57 -07:00
Valentin Clement 65cb2e1ed1
[flang] Lower pack|unpack intrinsics
This patch adds lowering for the `pack` and `unpack`
intrinsics.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: schweitz

Differential Revision: https://reviews.llvm.org/D121823

Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
2022-03-16 21:12:46 +01:00
Florian Hahn 470a975c84
[ConstraintElimination] Add missing dominance check.
When dealing with an unconditional branch, the condition can only added
if BB properly dominates the successor.
2022-03-16 20:01:24 +00:00
Jay Foad fb8d23b8e7 [AMDGPU] Define new feature HasFlatScratchSVSMode. NFC.
This is by analogy with HasFlatScratchSTMode and is slightly more
informative than using isGFX940Plus.

Differential Revision: https://reviews.llvm.org/D121804
2022-03-16 19:54:02 +00:00
Yitzhak Mandelbaum e0aefb4f92 [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components.
This patch introduces `DataflowModel`, an abstract base class for dataflow
"models": reusable analysis components that model a particular aspect of program
semantics.

Differential Revision: https://reviews.llvm.org/D121796
2022-03-16 19:47:57 +00:00
Louis Dionne 4001b82b15 [libc++][NFC] Rename member variables to avoid shadowing conflict in future patch 2022-03-16 15:45:38 -04:00
Valentin Clement 69b3303e6b
[flang] Lower numeric related instrinsics
This patch adds lowering for some numeric related
intrinsics:
- `exponent`
- `floor`
- `fraction`
- `mod`
- `modulo`
- `nint`
- `not`
- `product`

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld, schweitz

Differential Revision: https://reviews.llvm.org/D121828

Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-16 20:43:07 +01:00
Siva Chandra Reddy 2e7cb8c786 [libc] Remove references to the std threads library from __support/threads. 2022-03-16 19:35:40 +00:00
Valentin Clement 8d161c1f80
[flang] Exclude IO test for windows
This test is platform specific. It makes the windows
buildbot fails https://lab.llvm.org/buildbot/#/builders/172/builds/9708
2022-03-16 20:33:50 +01:00
Yonghong Song 98e2274458 [BPF] fix a CO-RE bitfield relocation error with >8 record alignment
Jussi Maki reported a fatal error like below for a bitfield
CO-RE relocation:
  fatal error: error in backend: Unsupported field expression for
  llvm.bpf.preserve.field.info, requiring too big alignment
The failure is related to kernel struct thread_struct. The following
is a simplied example.

Suppose we have below structure:
  struct t2 {
    int a[8];
  } __attribute__((aligned(64))) __attribute__((preserve_access_index));
  struct t1 {
    int f1:1;
    int f2:2;
    struct t2 f3;
  } __attribute__((preserve_access_index));

Note that struct t2 has aligned 64, which is used sometimes in the
kernel to enforce cache line alignment.

The above struct will be encoded into BTF and the following is what
C code looks like and the struct will appear in the file like vmlinux.h.
  struct t2 {
        int a[8];
        long: 64;
        long: 64;
        long: 64;
        long: 64;
  } __attribute__((preserve_access_index));
  struct t1 {
        int f1: 1;
        int f2: 2;
        long: 61;
        long: 64;
        long: 64;
        long: 64;
        long: 64;
        long: 64;
        long: 64;
        long: 64;
        struct t2 f3;
  } __attribute__((preserve_access_index));

Note that after
  origin_source -> BTF -> new_source
transition, the new source has the same memory layout as the old one
but the alignment interpretation inside the compiler could be different.
The bpf program will use the later explicitly padded structure as in
vmlinux.h.

In the above case, the compiler internal ABI alignment for new struct t1
is 16 while it is 4 for old struct t1. I didn't do a thorough investigation
why the ABI alignment is 16 and I suspect it is related to anonymous padding
in the above.

Current BPF bitfield CO-RE handling requires alignment <= 8 so proper
bitfield operatin can be performed. Therefore, alignment 16 will cause
a compiler fatal error.

To fix the ABI alignment >=16, let us check whether the bitfield
can be held within a 8-byte-aligned range. If this is the case,
we can use alignment 8. Otherwise, a fatal error will be reported.

Differential Revision: https://reviews.llvm.org/D121821
2022-03-16 12:16:46 -07:00
Siva Chandra Reddy 9527a2f58f [libc][NFC] Keep the mutex with the base File data structure.
This is now possible because we have a platform independent abstraction
for mutexes.

Reviewed By: lntue, michaelrj

Differential Revision: https://reviews.llvm.org/D121773
2022-03-16 19:05:23 +00:00
Stanislav Mekhanoshin 3a37d08b35 [AMDGPU] Correct gfx940 memory model documentation.
Differential Revision: https://reviews.llvm.org/D121397
2022-03-16 11:59:40 -07:00
Siva Chandra Reddy 2ebe971103 [libc][Obvious] Add missing licence headers and fix an include pattern. 2022-03-16 18:51:37 +00:00
Jessica Clarke 659363c0cc [RISCV] Ensure PseudoLA* can be hoisted
Since we mark the pseudos as mayLoad but do not provide any MMOs,
isSafeToMove conservatively returns false, stopping MachineLICM from
hoisting the instructions. PseudoLA_TLS_GD does not actually expand to a
load, so stop marking that as mayLoad to allow it to be hoisted, and for
the others make sure to add MMOs during lowering to indicate they're GOT
loads and thus can be freely moved.

Fixes https://github.com/llvm/llvm-project/issues/54372

Reviewed By: MaskRay, arichardson

Differential Revision: https://reviews.llvm.org/D121654
2022-03-16 18:45:36 +00:00
Jessica Clarke 883f755639 [NFC][RISCV] Pre-commit tests for hoisting of PseudoLLA/PseudoLA*
Only PseudoLLA is currently hoisted; this will be fixed in a subsequent
commit.
2022-03-16 18:45:19 +00:00
Bill Wendling 114a8903b8 [docs] Fix typo in tutorial
Use "operands" instead of "operators"

Closes #54397
2022-03-16 11:44:23 -07:00
Valentin Clement 24f3d55a5a
[flang] Keep ifdef macro for INT128
This was wrongly removed in 9aeb7f035b
and makes buildbot fail.
2022-03-16 19:11:01 +01:00
Jakub Kuderski 7c285b78cf [bazel] Add build rule for llvm-remark-size-diff
This binary is used in LIT tests.

Test: `bazel run --config=generic_clang -c opt @llvm-project//llvm:llvm-remark-size-diff -- --help`

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D121742
2022-03-16 14:07:07 -04:00
Yonghong Song 212f714ff7 [lldb] add missed handling for new BTFTagAttributed type
Commit 3251ba2d0f ("[Attr] Fix a btf_type_tag AST generation")
added a new type BTFTagAttributedType to the clang AST type
system. There are a few places in lldb needed to handle this type
similar to Attributed type to avoid compilation warning/error
when 'switch' is used to enumerate all types.
2022-03-16 11:00:35 -07:00
Florian Mayer 3b4c59c156 [HWASan] add shortgranule tests to use-after-scope.
Reviewed By: hctim

Differential Revision: https://reviews.llvm.org/D121395
2022-03-16 10:43:04 -07:00
Sanjay Patel 83413bb617 [x86] reduce indentation; NFC
We may be able to refine the conditions for these transforms ( D120648 ).
2022-03-16 13:39:02 -04:00
Kirill Stoimenov d6aa3aa2da [ASan] Added .section statement to each function so they can be removed by --gc-sections.
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D121813
2022-03-16 17:35:15 +00:00
Florian Mayer 448c89415b [HWASan] Update use-after-scope test to use ARM64.
Reviewed By: hctim

Differential Revision: https://reviews.llvm.org/D121394
2022-03-16 10:30:50 -07:00
Andrzej Warzynski 11a12544b5 [flang][lowering] Add support for lowering of the `i{a}char` intrinsics
This patch adds support for lowering of the `i{a}char` intrinsics from
Fortran to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

Differential Revision: https://reviews.llvm.org/D121790

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: zacharyselk <zrselk@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-16 17:15:39 +00:00
Snehasish Kumar 49c048add4 [memprof] Add a test to verify callstack order.
We add to ensure that we are observing the correct callstack order in memprof
during symbolization. There was some confusion whether the order of
DIFrame objects were reversed but in reality the leaf function is at
index 0 so no code changes are required.

Differential Revision: https://reviews.llvm.org/D121759
2022-03-16 10:10:57 -07:00
Petr Hosek 67f53708b2 Revert "[CMake][Fuchsia] Use correct architecture for iossim"
This reverts commit 1b6ff3f4f8 since
it broke Fuchsia's macOS builders.
2022-03-16 10:10:15 -07:00
Andrzej Warzynski 365fcecda7 [flang][lowering] Add support for lowering of the `ibclr` intrinsic
This patch adds support for lowering of the `ibclr` intrinsic from Fortran
to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>

Differential Revision: https://reviews.llvm.org/D121789
2022-03-16 17:05:01 +00:00
Florian Hahn 8a3d75a760
[ASan] Add read to large_func_test.cpp to prevent optimization.
After e5822ded56, the call to LargeFunction can be optimized out, as x
is never accessed in main. This is causing the test to fail, because the
out-of-bounds access won't be executed.

Adding an extra read and returning the value should prevent the
optimizer from removing the call.
2022-03-16 17:00:32 +00:00
Siddharth Bhat e83c6aa91e [MLIR] [LangRef] Clarify parsing of dense<...>
dense<...> expects ... to be a tensor-literal.
Define this in the grammar in BuiltinAttributes.td,
and reflect this in the reference grammar written in
AttributeParser.cpp.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D121048
2022-03-16 22:25:52 +05:30
Nathan Ridge 606ba8a68f [clangd] Handle more than two conflicting semantic tokens in resolveConflict()
Fixes https://github.com/clangd/clangd/issues/1057

Differential Revision: https://reviews.llvm.org/D121775
2022-03-16 12:53:04 -04:00