Valentin Clement [Thu, 17 Mar 2022 06:17:10 +0000 (07:17 +0100)]
[flang] Lower array related intrinsics
This patch adds lowering for somw array related intrinsics:
- `reshape`
- `spread`
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D121841
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
Jonas Devlieghere [Thu, 17 Mar 2022 06:09:59 +0000 (23:09 -0700)]
[lldb] Migrate runtime instrumentation plugins to ReportWarning
Valentin Clement [Thu, 17 Mar 2022 06:13:40 +0000 (07:13 +0100)]
[flang] Lower character related intrinsics
This patch adds lowering for some character related
intrinsics:
- `scan`
- `verify`
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121842
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Jonas Devlieghere [Thu, 17 Mar 2022 06:02:24 +0000 (23:02 -0700)]
[lldb] Remove commented-out code in CommandObjectExpression (NFC)
Jonas Devlieghere [Thu, 17 Mar 2022 05:38:39 +0000 (22:38 -0700)]
[lldb] Migrate condition evaluation failure to ReportError
Migrate to using ReportError to report a failure to evaluate a
watchpoint condition. I had already done so for the parallel code for
breakpoints.
In the process, I noticed that I accidentally regressed the error
reporting for breakpoint conditions by dropping the call to
GetDescription. This patch rectifies that and adds a test.
Because the call to GetDescription expects a Stream*, I also switches
from using a raw_string_ostream to a StreamString for both breakpoints
and watchpoints.
River Riddle [Tue, 22 Feb 2022 22:49:12 +0000 (14:49 -0800)]
[mlir] Refactor DialectRegistry delayed interface support into a general DialectExtension mechanism
The current dialect registry allows for attaching delayed interfaces, that are added to attrs/dialects/ops/etc.
when the owning dialect gets loaded. This is clunky for quite a few reasons, e.g. each interface type has a
separate tracking structure, and is also quite limiting. This commit refactors this delayed mutation of
dialect constructs into a more general DialectExtension mechanism. This mechanism is essentially a registration
callback that is invoked when a set of dialects have been loaded. This allows for attaching interfaces directly
on the loaded constructs, and also allows for loading new dependent dialects. The latter of which is
extremely useful as it will now enable dependent dialects to only apply in the contexts in which they
are necessary. For example, a dialect dependency can now be conditional on if a user actually needs the
interface that relies on it.
Differential Revision: https://reviews.llvm.org/D120367
Jonas Devlieghere [Thu, 17 Mar 2022 05:09:59 +0000 (22:09 -0700)]
[lldb] Fix flakiness in command-disassemble-process.yaml (2/2)
I split up the test so we could stop redirecting stderr to stdout but I
forgot to include that part in the previous commit.
Jacques Pienaar [Thu, 17 Mar 2022 04:57:04 +0000 (21:57 -0700)]
[mlir][vscode] Don't inject inside strings
Avoids matching R"mlir( while already inside a string.
Abinav Puthan Purayil [Tue, 15 Mar 2022 18:14:03 +0000 (23:44 +0530)]
[AMDGPU] Select buffer_atomic_cmpswap* in tblgen
This change replaces the manual selection of buffer_atomic_cmpswap*
instructions in SelectionDAG and GlobalISel with a tblgen based
selection in BUFInstructions.td. This allows us to select the return and
no-return variants in tblgen.
Differential Revision: https://reviews.llvm.org/D121770
Jonas Devlieghere [Thu, 17 Mar 2022 04:27:54 +0000 (21:27 -0700)]
[lldb] Fix flakyness in command-disassemble-process.yaml
Jonas Devlieghere [Thu, 17 Mar 2022 04:21:11 +0000 (21:21 -0700)]
[lldb] Fix flakyness in Minidump/no-process-id.yaml
Jonas Devlieghere [Thu, 17 Mar 2022 03:55:59 +0000 (20:55 -0700)]
[lldb] Update TargetProperties::CheckJITObjectsDir to use ReportError
wangliushuai [Thu, 17 Mar 2022 03:53:44 +0000 (11:53 +0800)]
[LTO][ELF] Add --stats-file= option.
This patch adds a StatsFile option supported by gold to lld, related patch https://reviews.llvm.org/D45531.
Reviewed By: tejohnson, MaskRay
Differential Revision: https://reviews.llvm.org/D121809
Heejin Ahn [Wed, 16 Mar 2022 08:39:30 +0000 (01:39 -0700)]
[WebAssembly] Disable SimplifyDemandedVectorElts after legalization
This fixes a reported bug that caused an infinite loop during the
SelectionDAG optimization phase in ISel, by creating an overridable hook
in `TargetLowering` that allows us to bail out from running
`SimplifyDemandedVectorElts`.
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D121869
Heejin Ahn [Sat, 26 Feb 2022 05:40:27 +0000 (21:40 -0800)]
[WebAssembly] Improve EH/SjLj error messages
This includes a function name and a relevant instruction in error
messages when possible, making them more helpful.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D120678
William S. Moses [Thu, 17 Mar 2022 03:44:52 +0000 (23:44 -0400)]
[NFC][MLIR][Affine] Add todo for adding affine namespace
William S. Moses [Thu, 17 Mar 2022 03:29:42 +0000 (23:29 -0400)]
[MLIR][Affine] Expose region-based isTopLevelValue
This PR exposes the region-based isTopLevelValue,
which is useful for other code that performs Affine transformations,
but is not within AffineOps.cpp
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D121877
William S. Moses [Wed, 16 Mar 2022 16:58:28 +0000 (12:58 -0400)]
[MLIR][Affine] Expose getAffineScope as a utility function
The getAffineScope function is currently internal
to AffineOps.cpp. However, as the comment on the function
itself notes, this is useful in a variety of other places
externally. This PR allows other files to use the function.
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D121827
Christudasan Devadasan [Wed, 16 Mar 2022 12:38:48 +0000 (18:08 +0530)]
[AMDGPU][SIFoldOperands] Consider the alignment constraints
Enforced an alignment check while folding the operands.
Christudasan Devadasan [Wed, 16 Mar 2022 12:03:02 +0000 (17:33 +0530)]
[AMDGPU][MachineVerifier] Alignment check for fp32 packed math instructions
The fp32 packed math instructions are introduced in gfx90a.
If their vector register operands are not properly aligned, the
verifier should flag them. Currently, the verifier failed to
report it and the compiler ended up emitting a broken assembly.
This patch fixes that missed case in TII::verifyInstruction.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D121794
Lian Wang [Thu, 17 Mar 2022 02:04:39 +0000 (02:04 +0000)]
[RISCV][NFC] Replace redundant code with VLOpFrag
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D121783
Evgenii Stepanov [Wed, 16 Mar 2022 01:43:38 +0000 (18:43 -0700)]
Stricter use-after-dtor detection for trivial members.
Poison trivial class members one-by-one in the reverse order of their
construction, instead of all-at-once at the very end.
For example, in the following code access to `x` from `~B` will
produce an undefined value.
struct A {
struct B b;
int x;
};
Reviewed By: kda
Differential Revision: https://reviews.llvm.org/D119600
Evgenii Stepanov [Wed, 16 Mar 2022 01:43:30 +0000 (18:43 -0700)]
Use-after-dtor detection for trivial base classes.
-fsanitize-memory-use-after-dtor detects memory access after a
subobject is destroyed but its memory is not yet deallocated.
This is done by poisoning each object memory near the end of its destructor.
Subobjects (members and base classes) do this in their respective
destructors, and the parent class does the same for its members with
trivial destructors.
Inexplicably, base classes with trivial destructors are not handled at
all. This change fixes this oversight by adding the base class poisoning logic
to the parent class destructor.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D119300
Evgeny Shulgin [Wed, 16 Feb 2022 10:40:05 +0000 (13:40 +0300)]
[Clang] [P2025] More exhaustive tests for NRVO
This is a preliminary patch ahead of D119792 (I'll rebase that one on top of this).
This shows what Clang's _current_ behaviour is for calculating NRVO in various
common cases. Then, in D119792 (and future patches), I'll be able to demostrate
exactly how LLVM IR for each of these cases changes.
Reviewed By: Quuxplusone
Differential Revision: https://reviews.llvm.org/D119927
Zixu Wang [Thu, 17 Mar 2022 00:19:35 +0000 (17:19 -0700)]
[FIX][NFC] Fix a test case in clang/SymbolGraph
The clang/SymbolGraph/global_record.c test case explicitly diffs the
clang version in use, which causes failures. Fix the issue by normalize
the `generator` field before checking the output.
River Riddle [Wed, 16 Mar 2022 00:36:15 +0000 (17:36 -0700)]
[mlir:FunctionOpInterface] Rename the "type" attribute to "function_type"
This removes any potential confusion with the `getType` accessors
which correspond to SSA results of an operation, and makes it
clear what the intent is (i.e. to represent the type of the function).
Differential Revision: https://reviews.llvm.org/D121762
River Riddle [Tue, 8 Mar 2022 03:16:03 +0000 (19:16 -0800)]
[mlir] Move the Builtin FuncOp to the Func dialect
This commit moves FuncOp out of the builtin dialect, and into the Func
dialect. This move has been planned in some capacity from the moment
we made FuncOp an operation (years ago). This commit handles the
functional aspects of the move, but various aspects are left untouched
to ease migration: func::FuncOp is re-exported into mlir to reduce
the actual API churn, the assembly format still accepts the unqualified
`func`. These temporary measures will remain for a little while to
simplify migration before being removed.
Differential Revision: https://reviews.llvm.org/D121266
Martin Erhart [Wed, 16 Mar 2022 23:17:53 +0000 (00:17 +0100)]
[mlir] Add C API for ControlFlow dialect
Add basic C API for the ControlFlow dialect. Follows the format of the other dialects.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D121867
LLVM GN Syncbot [Wed, 16 Mar 2022 23:23:57 +0000 (23:23 +0000)]
[gn build] Port
22077627ae20
Eli Friedman [Wed, 16 Mar 2022 22:35:57 +0000 (15:35 -0700)]
[CodeGen] Inline _byteswap_* builtins.
As discussed in D57915.
Fixes https://github.com/llvm/llvm-project/issues/39999 .
Differential Revision: https://reviews.llvm.org/D121865
Nico Weber [Wed, 16 Mar 2022 23:18:27 +0000 (19:18 -0400)]
[gn build] (manually) port
5aab45f43066 (SymbolGraph)
Nikolas Klauser [Mon, 7 Mar 2022 15:31:33 +0000 (16:31 +0100)]
[libc++] Remove <utility> includes
Reviewed By: ldionne, Quuxplusone, #libc
Spies: libcxx-commits, arphaman
Differential Revision: https://reviews.llvm.org/D121054
Nikolas Klauser [Mon, 14 Mar 2022 13:30:24 +0000 (14:30 +0100)]
[libc++] Add warning pragma macros in the test suite
Reviewed By: ldionne, #libc, EricWF
Spies: EricWF, libcxx-commits
Differential Revision: https://reviews.llvm.org/D121552
Eric Schweitz [Wed, 16 Mar 2022 22:23:25 +0000 (15:23 -0700)]
[flang] Remove unused code and redundant assertion.
Differential Revision: https://reviews.llvm.org/D121864
Zixu Wang [Wed, 16 Mar 2022 23:01:50 +0000 (16:01 -0700)]
[FIX][clang-extract-api] Fix scope naming violation
Med Ismail Bennani [Wed, 16 Mar 2022 22:44:31 +0000 (15:44 -0700)]
[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>
Benjamin Kramer [Wed, 16 Mar 2022 22:46:35 +0000 (23:46 +0100)]
[bazel] Port
50f82e68470c
Johannes Doerfert [Wed, 16 Mar 2022 22:35:25 +0000 (17:35 -0500)]
Revert "[OpenMP][FIX] Allow device constructors for AMD GPU"
This reverts commit
07b176646134c3d88a4cecef5e0058e2de6b2409 as it broke
the buildbots:
https://lab.llvm.org/buildbot#builders/193/builds/8594
Jakob Johnson [Tue, 15 Mar 2022 13:06:55 +0000 (06:06 -0700)]
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
Zixu Wang [Thu, 10 Feb 2022 21:42:35 +0000 (13:42 -0800)]
[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
Johannes Doerfert [Wed, 16 Mar 2022 18:26:25 +0000 (13:26 -0500)]
[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
Jonas Devlieghere [Wed, 16 Mar 2022 17:17:44 +0000 (10:17 -0700)]
[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
Craig Topper [Wed, 16 Mar 2022 21:42:25 +0000 (14:42 -0700)]
[RISCV] Remove stale FIXME from a test. NFC
Craig Topper [Wed, 16 Mar 2022 20:57:21 +0000 (13:57 -0700)]
[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.
River Riddle [Wed, 16 Mar 2022 18:45:14 +0000 (11:45 -0700)]
[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
Mike Rice [Tue, 15 Mar 2022 15:35:59 +0000 (08:35 -0700)]
[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
Jez Ng [Wed, 16 Mar 2022 21:28:31 +0000 (17:28 -0400)]
[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
Louis Dionne [Wed, 16 Mar 2022 21:26:26 +0000 (17:26 -0400)]
[libc++][NFC] Reindent release notes bullet points
Arthur Eubanks [Wed, 16 Mar 2022 18:21:27 +0000 (11:21 -0700)]
[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
Alex Bradbury [Wed, 16 Mar 2022 21:07:15 +0000 (21:07 +0000)]
[CODE_OWNERS/CREDITS] Update my email address
Alexey Bataev [Wed, 16 Mar 2022 20:53:36 +0000 (13:53 -0700)]
Revert "[SLP]Do not schedule instructions with constants/argument/phi operands and external users."
This reverts commit
1eeb2bfe727323332800e8d390f2f8c63c953779 to fix
a bug reported in https://reviews.llvm.org/D121121
Marek Kurdej [Wed, 16 Mar 2022 20:53:52 +0000 (21:53 +0100)]
[clang-format] Reformat. NFC.
Nick Desaulniers [Wed, 16 Mar 2022 20:49:58 +0000 (13:49 -0700)]
[SCCP] update test to NPM, update_test_checks. NFC
Pre-committing a test update to make changes in D121744 more visible.
Emil Kieri [Tue, 15 Mar 2022 17:40:06 +0000 (18:40 +0100)]
[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
Thomas Lively [Wed, 16 Mar 2022 20:34:56 +0000 (13:34 -0700)]
[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
Valentin Clement [Wed, 16 Mar 2022 20:11:57 +0000 (21:11 +0100)]
[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>
Florian Hahn [Wed, 16 Mar 2022 20:01:24 +0000 (20:01 +0000)]
[ConstraintElimination] Add missing dominance check.
When dealing with an unconditional branch, the condition can only added
if BB properly dominates the successor.
Jay Foad [Wed, 16 Mar 2022 14:10:49 +0000 (14:10 +0000)]
[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
Yitzhak Mandelbaum [Mon, 14 Mar 2022 21:16:18 +0000 (21:16 +0000)]
[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
Louis Dionne [Wed, 16 Mar 2022 19:45:02 +0000 (15:45 -0400)]
[libc++][NFC] Rename member variables to avoid shadowing conflict in future patch
Valentin Clement [Wed, 16 Mar 2022 19:40:13 +0000 (20:40 +0100)]
[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>
Siva Chandra Reddy [Wed, 16 Mar 2022 19:33:01 +0000 (19:33 +0000)]
[libc] Remove references to the std threads library from __support/threads.
Valentin Clement [Wed, 16 Mar 2022 19:33:29 +0000 (20:33 +0100)]
[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
Yonghong Song [Mon, 14 Mar 2022 05:30:45 +0000 (22:30 -0700)]
[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
Siva Chandra Reddy [Wed, 16 Mar 2022 06:56:34 +0000 (06:56 +0000)]
[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
Stanislav Mekhanoshin [Thu, 10 Mar 2022 19:22:16 +0000 (11:22 -0800)]
[AMDGPU] Correct gfx940 memory model documentation.
Differential Revision: https://reviews.llvm.org/D121397
Siva Chandra Reddy [Wed, 16 Mar 2022 18:50:58 +0000 (18:50 +0000)]
[libc][Obvious] Add missing licence headers and fix an include pattern.
Jessica Clarke [Wed, 16 Mar 2022 18:45:34 +0000 (18:45 +0000)]
[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
Jessica Clarke [Wed, 16 Mar 2022 18:45:19 +0000 (18:45 +0000)]
[NFC][RISCV] Pre-commit tests for hoisting of PseudoLLA/PseudoLA*
Only PseudoLLA is currently hoisted; this will be fixed in a subsequent
commit.
Bill Wendling [Wed, 16 Mar 2022 18:42:32 +0000 (11:42 -0700)]
[docs] Fix typo in tutorial
Use "operands" instead of "operators"
Closes #54397
Valentin Clement [Wed, 16 Mar 2022 18:10:57 +0000 (19:10 +0100)]
[flang] Keep ifdef macro for INT128
This was wrongly removed in
9aeb7f035bdde83501e5eddd9e6ad175b8ed697f
and makes buildbot fail.
Jakub Kuderski [Wed, 16 Mar 2022 18:05:38 +0000 (14:05 -0400)]
[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
Yonghong Song [Wed, 16 Mar 2022 17:59:35 +0000 (10:59 -0700)]
[lldb] add missed handling for new BTFTagAttributed type
Commit
3251ba2d0fcf ("[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.
Florian Mayer [Tue, 15 Mar 2022 21:21:49 +0000 (14:21 -0700)]
[HWASan] add shortgranule tests to use-after-scope.
Reviewed By: hctim
Differential Revision: https://reviews.llvm.org/D121395
Sanjay Patel [Wed, 16 Mar 2022 15:45:24 +0000 (11:45 -0400)]
[x86] reduce indentation; NFC
We may be able to refine the conditions for these transforms ( D120648 ).
Kirill Stoimenov [Wed, 16 Mar 2022 15:35:12 +0000 (15:35 +0000)]
[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
Florian Mayer [Thu, 10 Mar 2022 18:57:18 +0000 (10:57 -0800)]
[HWASan] Update use-after-scope test to use ARM64.
Reviewed By: hctim
Differential Revision: https://reviews.llvm.org/D121394
Andrzej Warzynski [Wed, 16 Mar 2022 11:30:07 +0000 (11:30 +0000)]
[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>
Snehasish Kumar [Tue, 15 Mar 2022 23:50:19 +0000 (16:50 -0700)]
[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
Petr Hosek [Wed, 16 Mar 2022 17:10:15 +0000 (10:10 -0700)]
Revert "[CMake][Fuchsia] Use correct architecture for iossim"
This reverts commit
1b6ff3f4f89e06af17575627fba3e6d90d1abbc5 since
it broke Fuchsia's macOS builders.
Andrzej Warzynski [Wed, 16 Mar 2022 10:56:38 +0000 (10:56 +0000)]
[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
Florian Hahn [Wed, 16 Mar 2022 17:00:32 +0000 (17:00 +0000)]
[ASan] Add read to large_func_test.cpp to prevent optimization.
After
e5822ded562f, 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.
Siddharth Bhat [Wed, 16 Mar 2022 16:55:46 +0000 (22:25 +0530)]
[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
Nathan Ridge [Wed, 16 Mar 2022 08:01:43 +0000 (04:01 -0400)]
[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
Andrzej Warzynski [Wed, 16 Mar 2022 11:40:05 +0000 (11:40 +0000)]
[flang][lowering] Add support for lowering of the `ieor` intrinsic
This patch adds support for lowering of the `ieor` 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/D121791
Fangrui Song [Wed, 16 Mar 2022 16:48:19 +0000 (09:48 -0700)]
[llvm-objcopy] --weaken-symbol/--weaken: weaken STB_GNU_UNIQUE symbols
STB_GNU_UNIQUE is like STB_GLOBAL with extra semantics:
* gold and ld.lld: changed to STB_GLOBAL if --no-gnu-unique is specified
* glibc: unique even with dlopen `RTLD_LOCAL`, implies DF_1_NODELETE
Therefore, I think it makes sense for --weaken-symbol/--weaken-symbols/--weaken
to change STB_GNU_UNIQUE symbols.
binutils 2.39 will have the same behavior: https://sourceware.org/bugzilla/show_bug.cgi?id=28926
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D120638
Marco Elver [Wed, 16 Mar 2022 16:35:10 +0000 (17:35 +0100)]
[SelectionDAG][NFC] Clean up SDCallSiteDbgInfo accessors
* Consistent naming: addCallSiteInfo vs. getCallSiteInfo;
* Use ternary operator to reduce verbosity;
* const'ify getters;
* Add comments;
NFCI.
Differential Revision: https://reviews.llvm.org/D121820
Daniel Thornburgh [Tue, 15 Mar 2022 23:18:42 +0000 (23:18 +0000)]
[Symbolize] Fix overflow warning on 32-bit hosts.
The inserted cast is a no-op.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D121752
Mark de Wever [Sat, 12 Mar 2022 11:19:13 +0000 (12:19 +0100)]
[libc++][NFC] Add TEST_HAS_NO_INCOMPLETE_RANGES.
This avoids using an libc++ internal macro in our tests.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D121515
David Truby [Wed, 16 Mar 2022 16:39:27 +0000 (16:39 +0000)]
[NFC][clang][SVE] Auto-generate SVE operator tests.
Amir Ayupov [Wed, 16 Mar 2022 16:37:54 +0000 (09:37 -0700)]
[BOLT] Strip redundant AdSize override prefix
Since LLVM MC now preserves redundant AdSize override prefix (0x67), remove it
in BOLT explicitly (-x86-strip-redundant-adsize, on by default).
Test Plan:
`bin/llvm-lit -a bolt/test/X86/addr32.s`
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D120975
Louis Dionne [Tue, 15 Mar 2022 14:49:49 +0000 (10:49 -0400)]
[libc++][tests] Use CMake provided paths for includes and libdir instead of hardcoding them
In the new-style testing configurations, we were hardcoding paths to the
`include` and `lib` directories, which was incorrect but always went
unnoticed because the hardcoded values always happened to match the
actual value.
When using new-style configs with the bootstrapping build, this falls
appart -- and we never noticed this because the bootstrapping build was
still using old style configs.
This patch removes the %{install} substitution, which makes it too
tempting to hardcode installation paths, and it also switches the
bootstrapping build to actually using new-style configs like we
always intended to do.
Differential Revision: https://reviews.llvm.org/D121700
Malhar Jajoo [Fri, 11 Mar 2022 09:35:31 +0000 (09:35 +0000)]
[VPlan] Avoid collecting scalars for SVE
This patch ensures scalars (except for uniforms) are no
longer collected (prior to LVP planning phase) for
scalable vectorization.
This is to avoid the chances of generating scalarized
instructions later (during LVP execute phase) as they
are not supported for scalable vectorization.
Relevant test has also been added.
Differential Revision: https://reviews.llvm.org/D121452
Jonas Devlieghere [Wed, 16 Mar 2022 16:31:24 +0000 (09:31 -0700)]
[lldb] Fix Minidump/no-process-id.yaml
Update warning after
2fc38b2b7bf9896806749655124ea5f13cc6d383.
Andrzej Warzynski [Wed, 16 Mar 2022 13:40:25 +0000 (13:40 +0000)]
[flang][lowering] Add lowering for the `size` intrinsic
This patch adds support for lowering of the `size` 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
Differential Revision: https://reviews.llvm.org/D121803
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
Nikita Popov [Wed, 16 Mar 2022 16:28:17 +0000 (17:28 +0100)]
Revert "[FuzzMutate] Don't insert instructions after musttail call"
This reverts commit
6a23d2764467bd45c2e02828f6175a0b9f9a1005.
The newly added tests fail on the llvm-clang-x86_64-sie-win
buildbot. Not sure why a failure only occurs there, possibly
differen PRNG sequence?
Valentin Clement [Wed, 16 Mar 2022 16:14:20 +0000 (17:14 +0100)]
[flang] Lower shift intrinsics
This patch adds lowering for shift intrinsics:
- `ishft`
- `eoshift`
- `ishftc`
- `cshift`
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121808
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
Co-authored-by: AlexisPerry <aperry@lanl.gov>
Valentin Clement [Wed, 16 Mar 2022 16:10:31 +0000 (17:10 +0100)]
[flang] Lower IO input with vector subscripts
This patch adds lowering for IO input with vector subscripts.
It defines a VectorSubscriptBox class that allow representing and working
with a lowered Designator containing vector subscripts while ensuring
all the subscripts expression are only lowered once.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121806
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Nikita Popov [Wed, 16 Mar 2022 15:10:24 +0000 (16:10 +0100)]
[FuzzMutate] Don't insert instructions after musttail call
Yonghong Song [Fri, 4 Mar 2022 06:34:39 +0000 (22:34 -0800)]
[Attr] Fix a btf_type_tag AST generation
Current ASTContext.getAttributedType() takes attribute kind,
ModifiedType and EquivType as the hash to decide whether an AST node
has been generated or note. But this is not enough for btf_type_tag
as the attribute might have the same ModifiedType and EquivType, but
still have different string associated with attribute.
For example, for a data structure like below,
struct map_value {
int __attribute__((btf_type_tag("tag1"))) __attribute__((btf_type_tag("tag3"))) *a;
int __attribute__((btf_type_tag("tag2"))) __attribute__((btf_type_tag("tag4"))) *b;
};
The current ASTContext.getAttributedType() will produce
an AST similar to below:
struct map_value {
int __attribute__((btf_type_tag("tag1"))) __attribute__((btf_type_tag("tag3"))) *a;
int __attribute__((btf_type_tag("tag1"))) __attribute__((btf_type_tag("tag3"))) *b;
};
and this is incorrect.
It is very difficult to use the current AttributedType as it is hard to
get the tag information. To fix the problem, this patch introduced
BTFTagAttributedType which is similar to AttributedType
in many ways but with an additional BTFTypeTagAttr. The tag itself can
be retrieved with BTFTypeTagAttr.
With the new BTFTagAttributed type, the debuginfo code can be greatly
simplified compared to previous TypeLoc based approach.
Differential Revision: https://reviews.llvm.org/D120296