Fangrui Song [Fri, 16 Dec 2022 20:24:35 +0000 (20:24 +0000)]
[mlir] Drop uses of operator<<(raw_ostream &OS, const Optional<T> &O)
Valentin Clement [Fri, 16 Dec 2022 20:21:00 +0000 (21:21 +0100)]
[flang] Fix fir.dispatch_table generation with derived-type parameter with kind type parameter
When generating the `fir.dispatch_table` operation, the name of the parent
derived-type needs to be mangled. For this the type instantiation
DerivedTypeSpec needs to be retrieved to have the correct kind type parameters.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D140209
Valentin Clement [Fri, 16 Dec 2022 20:19:55 +0000 (21:19 +0100)]
[flang] Unlimited polymoprhic allocation with intrinsic type spec
An unlimited polymoprhic entity can be allocated with a derived type
spec or an intrinsic type spec. This patch add the generation of the
runtime function call when the allocation is done with an intrinsic
type spec.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D140207
Jeffrey Byrnes [Thu, 8 Dec 2022 21:26:59 +0000 (13:26 -0800)]
[AMDGPU][SIFrameLowering] Mark VGPR used for AGPR spills as reserved
Presently, there is an issue on MI100 (and probably other architecture) where the VGPR used for AGPR copies clobbers VGPR used for AGPR spill. AFAICT this is because in processFunctionBeforeFrameIndicesReplaced we think the VGPR register for AGPR spill is unused. This patch aims to correct that. This is a WIP while I work out issues with producing a good test. For now, I'm curious if this is generally a good / bad idea.
Differential Revision: https://reviews.llvm.org/D139673
Roman Lebedev [Fri, 16 Dec 2022 19:53:58 +0000 (22:53 +0300)]
Revert "[SROA] `isVectorPromotionViable()`: memory intrinsics operate on vectors of bytes (take 3)"
While the PPC litte-endian miscompile did get addressed
by https://reviews.llvm.org/D140046
the PPV big-endian bots are still unhappy.
https://lab.llvm.org/buildbot/#/builders/93/builds/12560
This reverts commit
7bd358bcb4e358b4351c69e02ef76939e08acdc7.
Fangrui Song [Fri, 16 Dec 2022 19:57:30 +0000 (19:57 +0000)]
[mlir] Drop uses of operator<<(raw_ostream &OS, const Optional<T> &O)
Fangrui Song [Fri, 16 Dec 2022 19:46:00 +0000 (19:46 +0000)]
[clangd] Migrate uses of operator<<(raw_ostream &OS, const Optional<T> &O) to std::optional
Haowei Wu [Fri, 4 Nov 2022 23:40:10 +0000 (16:40 -0700)]
[vfs] Allow root paths relative to the vfsoverlay YAML file
This change adds 'root-relative' option in vfsoverlay YAML file format
so the root patchs can be relative to the YAML file directory instead of
the current working directory.
Differential Revision: https://reviews.llvm.org/D137473
Nathan Ridge [Wed, 14 Dec 2022 08:18:57 +0000 (03:18 -0500)]
[clangd] Remove ReferenceFinder::Reference::Target
No one was using it
Differential Revision: https://reviews.llvm.org/D139998
Peter Klausler [Sun, 11 Dec 2022 23:17:41 +0000 (15:17 -0800)]
[flang] Don't crash attempting to fold absurdly large TRANSFER()
Apply some sanity checking to the type size and SIZE= values and
avoid crashing on stress tests that attempt to create excessively
large results.
Differential Revision: https://reviews.llvm.org/D140138
Craig Topper [Fri, 16 Dec 2022 18:22:55 +0000 (10:22 -0800)]
[InstCombine] Remove code duplication between InstCombiner.h and InstCombineInternal.h.
The class in InstCombineInternal.h inherits from InstCombiner.h.
I think this split was created when target specific InstCombines
were moved to go through TTI.
I had to update some of the code in InstCombiner.h to match changes
that had been made to InstCombineInternal.h.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D140230
Paul Robinson [Fri, 16 Dec 2022 19:41:28 +0000 (11:41 -0800)]
[fuzzer] Convert tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
Nathan Ridge [Fri, 16 Dec 2022 08:35:42 +0000 (03:35 -0500)]
[CodeComplete] Offer completions for headers with extension .hxx in include directives
Fixes https://github.com/clangd/clangd/issues/1379
Differential Revision: https://reviews.llvm.org/D140191
Fangrui Song [Fri, 16 Dec 2022 19:30:47 +0000 (19:30 +0000)]
[trace] Migrate uses of operator<<(raw_ostream &OS, const Optional<T> &O) to std::optional
Matt Arsenault [Sat, 3 Dec 2022 00:22:54 +0000 (19:22 -0500)]
Function: Respect IgnoreLLVMUsed with addrspacecasted functions
Try to respect IgnoreLLVMUsed if the function was addrspacecasted to
match llvm.used's type.
Paul Robinson [Fri, 16 Dec 2022 19:09:53 +0000 (11:09 -0800)]
[compiler-rt/cfi] Convert tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
David Goldblatt [Fri, 16 Dec 2022 18:52:32 +0000 (10:52 -0800)]
[AA][Intrinsics] Add separate_storage assumptions.
This operand bundle on an assume informs alias analysis that the
arguments point to regions of memory that were allocated separately
(i.e. different heap allocations, different allocas, or different
globals).
As a safety measure, we leave the analysis flag-disabled by default.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D136514
Paul Robinson [Fri, 16 Dec 2022 19:03:30 +0000 (11:03 -0800)]
[compiler-rt/builtins] Convert tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
Sprite [Fri, 16 Dec 2022 18:51:26 +0000 (10:51 -0800)]
Correct typos (NFC)
Just found some typos while reading the llvm/circt project.
compliment -> complement
emitsd -> emits
Peter Klausler [Fri, 16 Dec 2022 17:54:55 +0000 (09:54 -0800)]
[flang] Expunge needless semantics::ProcInterface
The ProcInterface structure is used only by ProcEntityDetails; it represents
what a program might have put in parentheses in a procedure-declaration-stmt,
either the name of a procedure interface or a declaration-type-spec.
If a procedure entity has an implicit interface, the function result
type (if any) can be kept in EntityDetails::type_, which already exists
and is currently redundant for ProcEntityDetails symbols.
All that is really needed is a nullable Symbol pointer in ProcEntityDetails
to point to the procedure's explicit interface, when it has one.
Also, catch the case where a procedure has an explicit interface
and a program attempts to also give it a type.
Differential Revision: https://reviews.llvm.org/D140134
Paul Robinson [Fri, 16 Dec 2022 18:35:06 +0000 (10:35 -0800)]
[asan] Convert more tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
Peiming Liu [Fri, 16 Dec 2022 18:12:05 +0000 (18:12 +0000)]
[mlir][sparse] avoid unnecessary tmp COO buffer and convert when lowering ConcatentateOp.
When concat along dim 0, and all inputs/outputs are ordered with identity dimension ordering,
the concatenated coordinates will be yield in lexOrder, thus no need to sort.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D140228
Vasileios Porpodas [Wed, 7 Dec 2022 21:10:23 +0000 (13:10 -0800)]
[IR][NFC] Cleanup: Remove non-const block iterators to force all updates go through an interface function
Differential Revision: https://reviews.llvm.org/D140154
Peter Klausler [Fri, 16 Dec 2022 17:48:51 +0000 (09:48 -0800)]
[flang] Check for elemental finalizer when defined object has vector subscript
When a defined object is an array with a vector subscript, and it has a
finalizable type, it may have a final subroutine with a matching or
assumed rank dummy argument that cannot be called. Unless there is
also a suitable elemental final subroutine, diagnose such a case
with an error message.
Differential Revision: https://reviews.llvm.org/D140131
Florian Hahn [Fri, 16 Dec 2022 17:52:15 +0000 (17:52 +0000)]
[VPlan] Use macro to define recipe classof implementation (NFC).
Add a VP_CLASSOF_IMPL macro to define common classof implementations for
recipes. This reduces duplication and also adds missing implementations
to existing recipes.
Paul Robinson [Fri, 16 Dec 2022 17:40:51 +0000 (09:40 -0800)]
Undo one llvm::Optional => std::optional
Using std::optional in Support/TypeTraitsTest.cpp causes gcc 7.5 to
complain. No public bots run a gcc that old, but we have internal bots
that do.
/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp: In instantiation of ‘void {anonymous}::triviality::TrivialityTester() [with T = std::optional<int>; bool IsTriviallyCopyConstructible = true; bool IsTriviallyMoveConstructible = true]’:
/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:121:52: required from here
/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:29:3: error: static assertion failed: Mismatch in expected trivial copy construction!
static_assert(llvm::is_trivially_copy_constructible<T>::value ==
^~~~~~~~~~~~~
/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:32:3: error: static assertion failed: Mismatch in expected trivial move construction!
static_assert(llvm::is_trivially_move_constructible<T>::value ==
^~~~~~~~~~~~~
Matt Arsenault [Fri, 16 Dec 2022 17:13:47 +0000 (12:13 -0500)]
AArch64: Stop storing MachineFunction in MachineFunctionInfo
The constructor should not depend on the MachineFunction
Roman Lebedev [Fri, 16 Dec 2022 17:28:08 +0000 (20:28 +0300)]
[NFC] Adjust adjusted manual checklines in DebugInfo to be less sensitive to the Value name
The test was passing for me locally, but fails on bots:
https://lab.llvm.org/buildbot/#/builders/98/builds/29290/steps/10/logs/stdio
Roman Lebedev [Fri, 16 Dec 2022 16:40:16 +0000 (19:40 +0300)]
[NFC][InstCombine] Add miscompile reproducer from https://reviews.llvm.org/D139275#4001580
SimplifyCFG change is correct and not at fault here.
The actual miscompile appears to be happening in InstCombine.
```
$ /builddirs/llvm-project/build-Clang15/bin/opt -load /repositories/alive2/build-Clang-release/tv/tv.so -load-pass-plugin /repositories/alive2/build-Clang-release/tv/tv.so -passes='tv,instcombine,tv' -o /dev/null /repositories/llvm-project/llvm/test/Transforms/InstCombine/D139275_c4001580.ll
----------------------------------------
define float @D139275_c4001580(float %arg) {
%0:
%i = fcmp ugt float %arg, 0.000000
%i1 = fcmp ult float %arg, 1.000000
%i2 = and i1 %i, %i1
%i3 = fcmp uge float %arg, 0.100000
%i4 = xor i1 %i, %i2
%i5 = select i1 %i4, float 0.100000, float 0.000000
%i6 = and i1 %i3, %i2
%i7 = fadd float %arg, -0.100000
%i8 = select i1 %i6, float %i7, float %i5
ret float %i8
}
=>
define float @D139275_c4001580(float %arg) {
%0:
%i = fcmp ugt float %arg, 0.000000
%i1 = fcmp ult float %arg, 1.000000
%i2 = and i1 %i, %i1
%i3 = fcmp uge float %arg, 0.100000
%i7 = fadd float %arg, -0.100000
%i5 = select i1 %i3, float %i7, float 0.100000
%i8 = select i1 %i2, float %i5, float 0.000000
ret float %i8
}
Transformation doesn't verify! (unsound)
ERROR: Value mismatch
Example:
float %arg = #x3dcbb820 (0.
099472284317?)
Source:
i1 %i = #x1 (1)
i1 %i1 = #x1 (1)
i1 %i2 = #x1 (1)
i1 %i3 = #x0 (0)
i1 %i4 = #x0 (0)
float %i5 = #x00000000 (+0.0)
i1 %i6 = #x0 (0)
float %i7 = #xba0a5680 (-0.
000527717173?)
float %i8 = #x00000000 (+0.0)
Target:
i1 %i = #x1 (1)
i1 %i1 = #x1 (1)
i1 %i2 = #x1 (1)
i1 %i3 = #x0 (0)
float %i7 = #xba0a5680 (-0.
000527717173?)
float %i5 = #x3dcccccd (0.
100000001490?)
float %i8 = #x3dcccccd (0.
100000001490?)
Source value: #x00000000 (+0.0)
Target value: #x3dcccccd (0.
100000001490?)
Pass: (anonymous namespace)::TVPass
Command line: '/builddirs/llvm-project/build-Clang15/bin/opt' '-load' '/repositories/alive2/build-Clang-release/tv/tv.so' '-load-pass-plugin' '/repositories/alive2/build-Clang-release/tv/tv.so' '-passes=tv,instcombine,tv' '-o' '/dev/null' '/repositories/llvm-project/llvm/test/Transforms/InstCombine/D139275_c4001580.ll'
Alive2: Transform doesn't verify!
```
Florian Hahn [Fri, 16 Dec 2022 17:19:54 +0000 (17:19 +0000)]
[llvm-profgen] Fix build failure after
5d7950a403bec25e52.
This fixes a build failure with libc++
(`error: no matching function for call to 'max')`
Paul Robinson [Fri, 16 Dec 2022 17:08:01 +0000 (09:08 -0800)]
[asan] Convert tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
Peter Klausler [Sat, 10 Dec 2022 18:59:52 +0000 (10:59 -0800)]
[flang] Catch bad usage of POINTER attribute
Most attributes apply to only object or only procedure entities,
and attempts to apply them to other kinds of symbol table entries
are caught in name resolution when ConvertToObjectEntity() or
ConvertToProcEntity() fails. However, the POINTER attribute can
be applied to both, and name resolution can't perform that conversion
yet, and as a result we don't catch many kinds of silly errors.
Fix by ensuring that the symbol is of a type that could eventually
become an object or procedure entity if it is not one already.
Differential Revision: https://reviews.llvm.org/D140137
LLVM GN Syncbot [Fri, 16 Dec 2022 16:45:18 +0000 (16:45 +0000)]
[gn build] Port
5d7950a403be
Hongtao Yu [Fri, 16 Dec 2022 02:36:52 +0000 (18:36 -0800)]
[CSSPGO][llvm-profgen] Missing frame inference.
This change introduces a missing frame inferrer aiming at fixing missing frames. It current only handles missing frames due to the compiler tail call elimination (TCE) but could also be extended to supporting other scenarios like frame pointer omission. When a tail called function is sampled, the caller frame will be missing from the call chain because the caller frame is reused for the callee frame. While TCE is beneficial to both perf and reducing stack overflow, a workaround being made in this change aims to find back the missing frames as much as possible.
The idea behind this work is to build a dynamic call graph that consists of only tail call edges constructed from LBR samples and DFS-search for a unique path for a given source frame and target frame on the graph. The unique path will be used to fill in the missing frames between the source and target. Note that only a unique path counts. Multiple paths are treated unreachable since we don't want to overcount for any particular possible path.
A switch --infer-missing-frame is introduced and defaults to be on.
Some testing results:
- 0.4% perf win according to three internal benchmarks.
- About 2/3 of the missing tail call frames can be recovered, according to an internal benchmark.
- 10% more profile generation time.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D139367
Kai Nacke [Fri, 16 Dec 2022 14:21:10 +0000 (14:21 +0000)]
[PowerPC][NFC] Fix typos in PPCISelDAGToDAG
Change:
negtive -> negative
is -> are
Thanks to tschuett for finding these.
Roman Lebedev [Fri, 9 Dec 2022 13:25:09 +0000 (16:25 +0300)]
[SROA] `isVectorPromotionViable()`: memory intrinsics operate on vectors of bytes (take 3)
* This is a recommit of
3c4d2a03968ccf5889bacffe02d6fa2443b0260f,
* which was reverted in
25f01d593ce296078f57e872778b77d074ae5888,
because it exposed a miscompile in PPC backend, which was resolved
in https://reviews.llvm.org/D140089 /
cb3f415cd2019df7d14683842198bc4b7a492bc5.
* which was a recommit of
cf624b23bc5d5a6161706d1663def49380ff816a,
* which was reverted in
5cfc22cafe3f2465e0bb324f8daba82ffcabd0df,
because the cut-off on the number of vector elements was not low enough,
and it triggered both SDAG SDNode operand number assertions,
5and caused compile time explosions in some cases.
Let's try with something really *REALLY* conservative first,
just to get somewhere, and try to bump it later.
FIXME: should this respect TTI reg width * num vec regs?
Original commit message:
Now, there's a big caveat here - these bytes
are abstract bytes, not the i8 we have in LLVM,
so strictly speaking this is not exactly legal,
see e.g. https://github.com/AliveToolkit/alive2/issues/860
^ the "bytes" "could" have been a pointer,
and loading it as an integer inserts an implicit ptrtoint.
But at the same time,
InstCombine's `InstCombinerImpl::SimplifyAnyMemTransfer()`
would expand a memtransfer of 1/2/4/8 bytes
into integer-typed load+store,
so this isn't exactly a new problem.
Note that in memory, poison is byte-wise,
so we really can't widen elements,
but SROA seems to be inconsistent here.
Fixes #59116.
Alexander Kornienko [Fri, 16 Dec 2022 15:43:58 +0000 (16:43 +0100)]
Revert "[SimplifyCFG] `FoldBranchToCommonDest()`: deal with mismatched IV's in PHI's in common successor block"
This reverts commit
1bd0b82e508d049efdb07f4f8a342f35818df341, since it leads to
miscompiles. See https://reviews.llvm.org/D139275#3993229 and
https://reviews.llvm.org/D139275#4001580.
Roy Sundahl [Thu, 15 Dec 2022 19:31:44 +0000 (11:31 -0800)]
Revert "[Driver] Remove Joined -X"
This change is breaking internal builds. We use the -Xfoo pattern but can
now no longer manage whether we allow an unused -Xfoo option to pass as a
warning or promote it to an error.
This reverts commit
98615fd376cea15af21e120e0e3ffa5ba68c2b6d.
Reviewed By: davide
Differential Revision: https://reviews.llvm.org/D139717
Nikolas Klauser [Thu, 15 Dec 2022 00:42:12 +0000 (01:42 +0100)]
[libc++] Install llvm-16-dev explicitly until LLVM16 is stable
The clang-tidy checks can't be properly implemented before LLVM16 because the Clang CMake files don't provide the version before.
Reviewed By: Mordante, #libc
Spies: libcxx-commits, arichardson
Differential Revision: https://reviews.llvm.org/D140071
Sjoerd Meijer [Fri, 16 Dec 2022 09:20:37 +0000 (09:20 +0000)]
[TTI] [AArch64] getMemoryOpCost for ptr types
Opaque ptr types have a size in bits of 0. The legalised type is an i64 or
vector of i64s, which do have a size. Because of this difference in size, target
hook getMemoryOpCost modelled stores of ptr types as extending/truncating
load/stores. Now we just check for opaque ptr types and return the legalised
cost. This makes stores of pointers cheaper, and as a result we now SLP
vectorise the changed test case.
Differential Revision: https://reviews.llvm.org/D140193
Lorenzo Chelini [Fri, 9 Dec 2022 17:50:36 +0000 (18:50 +0100)]
[MLIR][Linalg] Use `DenseI64ArrayAttr` in `InterchangeOp` (NFC)
Use op separator to improve code navigation.
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D139917
Sjoerd Meijer [Tue, 13 Dec 2022 14:50:03 +0000 (14:50 +0000)]
[CostModel][AArch64] Precommit opaque ptr store tests. NFC.
HanSheng Zhang [Fri, 16 Dec 2022 15:04:35 +0000 (16:04 +0100)]
[reg2mem] Add special handling to CatchSwitchInst
When promoting a phi in a catchswitch block to memory, we cannot
insert load/store instruction in that block, and need to insert
them inside all successors instead.
Fixes https://github.com/llvm/llvm-project/issues/59185.
Differential Revision: https://reviews.llvm.org/D138641
Nikita Popov [Fri, 16 Dec 2022 08:45:36 +0000 (09:45 +0100)]
[InstCombine] Preserve instruction name in replaceInstUsesWith()
Currently InstCombine folds using the
`return replaceInstUsesWith(V, Builder.CreateFoo())`
pattern do not preserve the original name of the instruction.
To preserve the name, you either have to use something like
`return FooInst::Create(...)` which is usually less nice, or go
out of the way to preserve the name with takeName(). We often
don't do that.
This patch instead preserves the name in replaceInstUsesWith()
when replacing a named instruction with an unnamed instruction.
To be conservative, I also added a zero-use check, which is a
proxy for the case where the instruction was just created, rather
than an existing one reused. Possibly we could drop that part.
As InstCombine tests are robust against renames this does not
cause any test diffs, so I regenerated a random test to show the
effects.
Differential Revision: https://reviews.llvm.org/D140192
Nemanja Ivanovic [Fri, 16 Dec 2022 14:57:11 +0000 (08:57 -0600)]
[PowerPC] Fix up memory ordering after combining BV to a load
The combiner for BUILD_VECTOR that merges consecutive
loads into a wide load had two issues:
- It didn't check that the input loads all have the
same input chain
- It didn't update nodes that are chained to the original
loads to be chained to the new load
This caused issues with bootstrap when
3c4d2a03968ccf5889bacffe02d6fa2443b0260f was committed.
This patch fixes the issue so it can unblock this commit.
Differential revision: https://reviews.llvm.org/D140046
Nikita Popov [Fri, 16 Dec 2022 14:49:50 +0000 (15:49 +0100)]
[SCEV] Add SCEV::operands() method (NFC)
Add an operands() method on SCEV, which forwards to the operands()
method of individual SCEV expressions.
Archibald Elliott [Wed, 7 Dec 2022 10:04:30 +0000 (10:04 +0000)]
[AArch64] Support SLC in ACLE prefetch intrinsics
This change:
- Modifies the ACLE code to allow the new SLC value (3) for the prefetch
target.
- Introduces a new intrinsic, @llvm.aarch64.prefetch which matches the
PRFM family instructions much more closely, and can represent all
values for the PRFM immediate.
The target-independent @llvm.prefetch intrinsic does not have enough
information for us to be able to lower to it from the ACLE intrinsics
correctly.
- Lowers the acle calls to the new intrinsic on aarch64 (the ARM
lowering is unchanged).
- Implements code generation for the new intrinsic in both SelectionDAG
and GlobalISel. We specifically choose to continue to support lowering
the target-independent @llvm.prefetch intrinsic so that other
frontends can continue to use it.
Differential Revision: https://reviews.llvm.org/D139443
Dani Ferreira Franco Moura [Fri, 16 Dec 2022 14:39:15 +0000 (15:39 +0100)]
[clang][dataflow] Remove unused lambda capture
Reviewed By: krasimir
Differential Revision: https://reviews.llvm.org/D140211
Archibald Elliott [Tue, 13 Dec 2022 15:32:54 +0000 (15:32 +0000)]
[AArch64] RASv2 Assembly Support
This feature adds upstream support for FEAT_RASv2 and FEAT_PFAR. Both
are system-register-only, but FEAT_RAS is behind the command-line
extension "+ras", so FEAT_RASv2 is behind "+rasv2".
This patch includes support for ID_AA64MMFR4_EL1. This is an ID system
register so it is not behind any feature flags.
Differential Revision: https://reviews.llvm.org/D139936
Michael Buch [Fri, 16 Dec 2022 14:33:51 +0000 (14:33 +0000)]
[libcxx][Test] Fix expected diagnostics for std types with default integral arguments
The `clang::TypePrinter` has recently been changed to suppress
defaulted integral template parameters in D139986.
Differential Revision: https://reviews.llvm.org/D139986
Nikita Popov [Fri, 16 Dec 2022 14:29:47 +0000 (15:29 +0100)]
[SCEV] Return ArrayRef for SCEV operands() (NFC)
Use a consistent type for the operands() methods of different SCEV
types. Also make the API consistent by only providing operands(),
rather than also providin op_begin() and op_end() for some of them.
serge-sans-paille [Fri, 16 Dec 2022 14:10:34 +0000 (15:10 +0100)]
Use range based loop to iterate over OptTable::PrefixesUnion
And sneak in a small storage optimization of OptTable::PrefixChars
Backl1ght [Fri, 16 Dec 2022 12:53:58 +0000 (20:53 +0800)]
[clang-format] add config parse test for short lambda
Reviewed By: HazardyKnusperkeks, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D140105
Nikita Popov [Fri, 16 Dec 2022 13:14:51 +0000 (14:14 +0100)]
[SCEV] Convert tests to opaque pointers (NFC)
Nikita Popov [Fri, 16 Dec 2022 13:30:40 +0000 (14:30 +0100)]
[SCEV] Name instructions in test (NFC)
Joseph Huber [Fri, 16 Dec 2022 13:04:01 +0000 (07:04 -0600)]
[libomptarget] Add HSA definitions for memory faults to dynamic_hsa
Summary:
We use the dynamic HSA file to forward declare needed definitions from
the HSA runtime if not present at build time. These definitions were not
included so using them caused problems on systems without it if used.
Just add them.
Nikita Popov [Fri, 16 Dec 2022 12:09:05 +0000 (13:09 +0100)]
[SCEV] Convert some tests to opaque pointers (NFC)
Guillaume Chatelet [Thu, 1 Dec 2022 14:50:29 +0000 (14:50 +0000)]
[Alignment] Use Align in SectionRef::getAlignment()
Differential Revision: https://reviews.llvm.org/D139110
Jean Perier [Fri, 16 Dec 2022 11:59:12 +0000 (12:59 +0100)]
[flang] Lower procedure ref to user defined elemental procedures (part 1)
Lower procedure ref to user defined elemental procedure when:
- there are no arguments that may be dynamically optional
- for functions, the result has no length parameters
- the reference can be unordered
- there are not character by value arguments
This uses the recently added hlfir.elemental operation and tools.
The "core" of the argument preparation is shared between elemental
and non elemental calls (genUserCalls is code moved without any
functional changes)
Differential Revision: https://reviews.llvm.org/D140118
Nikita Popov [Fri, 16 Dec 2022 11:22:07 +0000 (12:22 +0100)]
[LAA] Convert tests to opaque pointers (NFC)
Michael Buch [Fri, 16 Dec 2022 11:22:15 +0000 (11:22 +0000)]
[clang][DebugInfo] Add DW_AT_default_value support for template template parameters
After this patch, in the following snippet:
```
template <typename T> Foo {};
template <template <typename T> class CT = Foo> Bar {};
Bar<> b;
```
The debug-info entry for the `CT` template parameter will have
a `DW_AT_default_value (true)` attached to it.
Differential Revision: https://reviews.llvm.org/D139989
Michael Buch [Fri, 16 Dec 2022 11:26:08 +0000 (11:26 +0000)]
[llvm][DebugInfo] Add IsDefault parameter to DIBuilder::createTemplateTemplateParameter
This is in preparation for Clang to emit `DW_AT_default_value`
for defaulted template template parameters.
Differential Revision: https://reviews.llvm.org/D139989
Michael Buch [Tue, 13 Dec 2022 12:15:09 +0000 (12:15 +0000)]
[clang][DebugInfo] Simplify logic to determine DW_AT_default_value for template parameters
DWARFv5 added support for labelling template parameters with
DW_AT_default_value to indicate whether the particular instantiation
defaulted parameter. The current implementation only supports a limited
set of possible cases. Namely for non-value-dependent integral template
parameters and simple type template parameters.
Useful cases that don't work are:
1. Type template parameters with defaults that are
themselves templates. E.g.,
```
template<typename T1, typename T2 = Foo<T1>> class C1;
template<typename T = Foo<int>> class C2;
etc.
```
2. Template template parameters
`clang::isSubstitutedDefaultArgument` already implement the required logic
to determine whether a template argument is defaulted. This patch re-uses
this logic for DWARF CodeGen.
Differential Revision: https://reviews.llvm.org/D139988
Michael Buch [Tue, 13 Dec 2022 14:30:17 +0000 (14:30 +0000)]
[clang][TypePrinter] Teach isSubstitutedDefaultArgument about integral types
This patch handles default integral non-type template parameters.
After this patch the clang TypePrinter will omit default integral
template arguments when the `PrintingPolicy::SuppressDefaultTemplateArgs`
option is specified and sets us up to be able to re-use
`clang::isSubstitutedDefaultArgument` from the DWARF CodeGen
component.
Differential Revision: https://reviews.llvm.org/D139986
Michael Buch [Thu, 15 Dec 2022 21:26:33 +0000 (21:26 +0000)]
[clang][AST][NFC] Expose clang::isSubstitutedDefaultArgument to clang/AST consumers
**Summary**
A use-case has come up in DWARF CodeGen where we want to determine
whether a particular template argument matches the default template
parameter declaration.
Re-using this TypePrinter component there allows us to avoid duplicating
most of this code and immediately allows us to cover a wider range
of use-cases than the DWARF CodeGen does today.
Nikita Popov [Fri, 16 Dec 2022 11:32:18 +0000 (12:32 +0100)]
[LAA] Name instructions in test (NFC)
And regenerate test checks.
Jay Foad [Fri, 16 Dec 2022 10:37:23 +0000 (10:37 +0000)]
[AMDGPU] Generate permlane test checks
Alex Richardson [Fri, 16 Dec 2022 11:10:11 +0000 (11:10 +0000)]
[ASTContext] Avoid duplicating address space map. NFCI
ASTContext was holding onto a pointer to the Clang->LLVM address space map
which is stored inside TargetInfo. Instead of doing this, we can forward to
TargetInfo instead. This change will allow us to eventually remove
getTargetAddressSpace() from ASTContext and only have this information in
TargetInfo.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D138316
Krasimir Georgiev [Fri, 16 Dec 2022 11:21:21 +0000 (11:21 +0000)]
[clang] silence unused variable warning
No functional changes intended.
Dani Ferreira Franco Moura [Fri, 16 Dec 2022 11:07:56 +0000 (12:07 +0100)]
[clang][dataflow] Remove unused argument in getNullability
This change will allow users to call getNullability() without providing an ASTContext.
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D140104
Nikita Popov [Fri, 16 Dec 2022 11:20:51 +0000 (12:20 +0100)]
[GlobalAA] Convert tests to opaque pointers (NFC)
Nikita Popov [Fri, 16 Dec 2022 11:20:01 +0000 (12:20 +0100)]
[LazyCallGraph] Convert tests to opaque pointers (NFC)
Nikita Popov [Fri, 16 Dec 2022 11:18:00 +0000 (12:18 +0100)]
[ValueTracking] Convert tests to opaque pointers (NFC)
Nikita Popov [Fri, 16 Dec 2022 11:12:19 +0000 (12:12 +0100)]
[TBAA] Convert tests to opaque pointers (NFC)
David Spickett [Fri, 16 Dec 2022 11:09:49 +0000 (11:09 +0000)]
[LLVM][objcopy] Fix update-section.test on 32 bit platforms
This used %zu to print a uint64_t type. z is for size_t so on 32 bit
we tried to treat it as a 32 bit number.
Use PRIu64 instead to print as 64 bit everywhere.
Nikita Popov [Fri, 16 Dec 2022 11:11:31 +0000 (12:11 +0100)]
[MemDep] Convert tests to opaque pointers (NFC)
Nikita Popov [Fri, 16 Dec 2022 11:11:01 +0000 (12:11 +0100)]
[MemDep] Run test through instnamer (NFC)
Nikita Popov [Fri, 16 Dec 2022 11:08:39 +0000 (12:08 +0100)]
[Lint] Convert tests to opaque pointers (NFC)
Nikita Popov [Fri, 16 Dec 2022 11:07:56 +0000 (12:07 +0100)]
[IRSimilarity] Convert tests to opaque pointers (NFC)
Nikita Popov [Fri, 16 Dec 2022 10:58:04 +0000 (11:58 +0100)]
[DependenceAnalysis] Convert tests to opaque pointers (NFC)
Daniel Grumberg [Wed, 14 Dec 2022 12:12:26 +0000 (12:12 +0000)]
[clang][ExtractAPI] Fix naming of typedef'd anonymous enums
Anonymous enums that are typedef'd should take on the name of the typedef.
Differential Revision: https://reviews.llvm.org/D140010
David Spickett [Fri, 16 Dec 2022 10:57:13 +0000 (10:57 +0000)]
[LLVM][objcopy] Update Arm XFAIL in update section test
a1b4e13cff2a792571927ee1fc6eebb05e40fae9 updated this to use
the target= syntax.
However the triple for our Arm bots is usually like:
armv8l-unknown-linux-gnueabihf
With "eabihf" on the end. I assume before we just checked for
"linux-gnu" being in the triple at all but now it is a proper
regex match.
Add .* on the end to account for the ABI tag on the end.
Nikita Popov [Fri, 16 Dec 2022 09:56:08 +0000 (10:56 +0100)]
[BasicAA] Convert tests to opaque pointers (NFC)
Kevin Sala [Fri, 16 Dec 2022 10:53:45 +0000 (11:53 +0100)]
Revert "[OpenMP][libomptarget] Add AMDGPU NextGen plugin with asynchronous behavior"
This reverts commit
87e6b96b0009983996bfe0aa27d358008c1d1087.
Weining Lu [Fri, 16 Dec 2022 09:50:17 +0000 (17:50 +0800)]
[LoongArch] Add tests showing the optimization pipeline
Other targets like ARM, AArch64, RISCV and X86 have similar tests.
`O1`, `O2` and `O3` appear to be the same for now. But in future, some
passes may be disabled at lower levels (e.g. `O1`). Hoping we can use
FileCheck prefixes for differences to avoid repeating the contents 3
times.
Reviewed By: xen0n, MaskRay
Differential Revision: https://reviews.llvm.org/D139499
Nikita Popov [Fri, 16 Dec 2022 09:53:30 +0000 (10:53 +0100)]
[BasicAA] Convert some tests to opaque pointers (NFC)
Hui Li [Fri, 16 Dec 2022 09:48:15 +0000 (17:48 +0800)]
[LLDB][LoongArch] Add branch instructions for EmulateInstructionLoongArch
Add conditional and unconditional branch instructions for loongarch64.
Note that this does not include floating-point branch instructions, that will come in a later patch.
Reviewed By: SixWeining, DavidSpickett
Differential Revision: https://reviews.llvm.org/D139833
Nikita Popov [Fri, 16 Dec 2022 09:35:45 +0000 (10:35 +0100)]
[Delinearization] Convert tests to opaque pointers (NFC)
Corentin Jabot [Sun, 30 Oct 2022 22:20:00 +0000 (23:20 +0100)]
[Clang] Allow additional mathematical symbols in identifiers.
Implement the proposed UAX Profile
"Mathematical notation profile for default identifiers".
This implements a not-yet approved Unicode for a vetted
UAX31 identifier profile
https://www.unicode.org/L2/L2022/22230-math-profile.pdf
This change mitigates the reported disruption caused
by the implementation of UAX31 in C++ and C2x,
as these mathematical symbols are commonly used in the
scientific community.
Fixes #54732
Reviewed By: tahonermann, #clang-language-wg
Differential Revision: https://reviews.llvm.org/D137051
Craig Topper [Fri, 16 Dec 2022 08:49:47 +0000 (00:49 -0800)]
[RISCV] Pull out repeated calls to getOperand. NFC
Remove else after return.
Fangrui Song [Fri, 16 Dec 2022 08:49:10 +0000 (08:49 +0000)]
[Support] llvm::Optional => std::optional
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Jean Perier [Fri, 16 Dec 2022 08:24:55 +0000 (09:24 +0100)]
[flang] hlfir.apply codegen
Lower hlfir.apply to hlfir.designate in bufferization.
Differential Revision: https://reviews.llvm.org/D140101
Jean Perier [Fri, 16 Dec 2022 08:20:47 +0000 (09:20 +0100)]
[flang] enable as_expr codegen from array without FortranVariabeInterface
The defining op of HLFIR variables is expected to be visible
in most cases, but HLFIR codegen won't rely on it from a correctness
point of view.
This patch allows building a fir.shape from an hlfir::Entity does not
have a visible FortranVariabeInterface defining op.
Differential Revision: https://reviews.llvm.org/D140099
Jean Perier [Fri, 16 Dec 2022 08:19:07 +0000 (09:19 +0100)]
[flang] hlfir.elemental codegen
Without any optimization or when it cannot be optimized before
bufferization, an hlfir.elemental lowers to an array temporary.
Its codegen consists in:
- allocating a temp given the type, shape, and length parameter arguments.
- generating a loop nest given the elemental shape
- inlining the body of the elemental inside the loops, and replacing the
yield_element by an assignment to an element of the temp.
Differential Revision: https://reviews.llvm.org/D140093
Fangrui Song [Fri, 16 Dec 2022 08:07:07 +0000 (08:07 +0000)]
[trace] Change /sys/bus const char * variables to const char []
Fangrui Song [Fri, 16 Dec 2022 07:56:52 +0000 (07:56 +0000)]
JSON: llvm::Optional => std::optional
Many files are from language servers.
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Fangrui Song [Fri, 16 Dec 2022 07:40:23 +0000 (07:40 +0000)]
Fangrui Song [Fri, 16 Dec 2022 07:34:42 +0000 (07:34 +0000)]
[SelectionDAG] Port ARC/M68k/LoongArch after D140161
Tobias Gysi [Fri, 16 Dec 2022 07:05:34 +0000 (08:05 +0100)]
[mlir][llvm] Fastmath flags import from LLVM IR.
This revision adds support to import fastmath flags from LLVMIR. It
implement the import using a listener attached to the builder. The
listener gets notified if an operation is created and then checks if
there are fastmath flags to import from LLVM IR to the MLIR. The
listener based approach allows us to perform the import without changing
the mlirBuilders used to create the imported operations.
An alternative solution, could be to update the builders so that they
return the created operation using FailureOr<Operation*> instead of
LogicalResult. However, this solution implies an LLVM IR instruction
always maps to exatly one MLIR operation. While mostly true, there are
already exceptions to this such as the PHI instruciton. Additionally, an
mlirBuilder based solution also further complicates the builder
implementations, which led to the listener based solution.
Depends on D139405
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D139620
Carlos Galvez [Tue, 13 Dec 2022 21:06:14 +0000 (21:06 +0000)]
[clang-tidy] Use Python3 for add_new_check.py and rename_check.py
Fixes #58782
Differential Revision: https://reviews.llvm.org/D139966