Amy Kwan [Fri, 11 Feb 2022 07:06:25 +0000 (01:06 -0600)]
[test-release.sh] Add option to disable building clang-tools-extra during release testing.
This patch adds an option (no-clang-tools) to disable building clang-tools-extra when
performing release testing. Prior to this patch, clang-tools-extra was built by default,
but on some platforms (such as AIX), clang-tools-extra is not supported, and so we do
not normally build it. Furthermore, this change should not change the invocation for
targets that build clang-tools-extra normally.
Differential Revision: https://reviews.llvm.org/D119520
Nikita Popov [Fri, 11 Feb 2022 13:25:09 +0000 (14:25 +0100)]
[InstCombine] Check source element type in phi of gep fold
Rather than checking that the type is the same (which is always
the case, given how these are part of the same phi) check that the
source element type is the same. With opaque pointers, this is no
longer implied.
Zakk Chen [Fri, 11 Feb 2022 12:24:37 +0000 (04:24 -0800)]
[RISCV] Add the policy operand for some masked RVV ternary IR intrinsics.
Masked reduction intrinsics are specical cases which don't need to have policy
operand. The mask only affects which elements are read. It doesn't effect the
destination register.
The reduction intrinsics have a dedicated destination operand. If it
is undef, we use tail agnostic. If it not undef we use tail
undisturbed.
Co-Authored-by: Craig Topper <craig.topper@sifive.com>
Differential Revision: https://reviews.llvm.org/D117681
Adrian Kuegel [Fri, 11 Feb 2022 11:53:47 +0000 (12:53 +0100)]
[mlir][MemRef] Fix MemRefCopyOpLowering to use correct number of bytes
When lowering to memrefCopy call, the size for i1 type was calculated as 0.
Instead of using getTypeSizeInBits() and dividing by 8, we should just use getTypeSize().
Differential Revision: https://reviews.llvm.org/D119540
Anton Zabaznov [Mon, 7 Feb 2022 12:45:42 +0000 (15:45 +0300)]
[OpenCL] Add support of language builtins for OpenCL C 3.0
OpenCL C 3.0 introduces optionality to some builtins, in particularly
to those which are conditionally supported with pipe, device enqueue
and generic address space features.
The idea is to conditionally support such builtins depending on the language options
being set for a certain feature. This allows users to define functions with names
of those optional builtins in OpenCL (as such names are not reserved).
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D118605
Nathan Sidwell [Tue, 25 Jan 2022 20:23:31 +0000 (12:23 -0800)]
[demangler] Adjust unqualified name parsing
The unqualified name grammar includes <ctor-dtor-name>, but we handle
that specially in parseNestedName. This is a little awkward. We can
pass in the current scope and have parseUnqualifiedName deal with
cdtors too. That also allows a couple of other simplifications:
1) parseUnqualifiedName can also build up the NestedName, when the
provided scope is non-null. Which means ...
2) parseUnscopedName can pass a "std" scope in (and tailcall).
3) ... and also parseNestedName need not construct the nestedname itself.
4) also parseNestedName's detection of a cdtor-name doesn't have to
rule out a decomposition name anymore.
This change also makes adding module demangling more
straight-forwards, btw.
Reviewed By: ChuanqiXu
Differential Revision: https://reviews.llvm.org/D119154
Nikita Popov [Fri, 11 Feb 2022 12:01:17 +0000 (13:01 +0100)]
[GVN] Store source element type for GEP expressions
To avoid incorrectly merging GEPs with different source types
under opaque pointers.
To avoid increasing the Expression structure size, this reuses the
existing type member. The code does not rely on this to be the
expression result type, it's only used as a disambiguator.
Bradley Smith [Thu, 10 Feb 2022 12:38:02 +0000 (12:38 +0000)]
[AArch64][SVE] Fix selection failure caused by fp/int convert using non-Neon types
Fixes: #53679
Differential Revision: https://reviews.llvm.org/D119428
Adrian Kuegel [Fri, 11 Feb 2022 10:45:47 +0000 (11:45 +0100)]
[mlir][MemRef] Fix MemRefCastOpLowering for 32 bit index type.
The lowering creates llvm.insertvalue with the rank value, so it needs to use
index type instead of 64 bit integer type. Otherwise, we get an error:
llvm.insertvalue' op Type mismatch: cannot insert 'i64' into '!llvm.struct<(i32, ptr<i8>)>'
Differential Revision: https://reviews.llvm.org/D119534
Arjun P [Fri, 11 Feb 2022 11:31:50 +0000 (17:01 +0530)]
[MLIR][Presburger] normalizeDivisionByGCD: fix bug when constant term is negative
Reviewed By: Groverkss
Differential Revision: https://reviews.llvm.org/D119531
Nikita Popov [Fri, 11 Feb 2022 11:25:36 +0000 (12:25 +0100)]
[IR] Check GEP source type when comparing instructions
Two GEPs with same indices but different source type are not the
same.
Worth noting that FunctionComparator already handles this correctly.
Stanislav Gatev [Thu, 10 Feb 2022 16:34:07 +0000 (16:34 +0000)]
[clang][dataflow] Include terminator statements in buildStmtToBasicBlockMap
This will be necessary later when we add support for evaluating logic
expressions such as && and ||.
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.
Reviewed-by: xazax.hun
Differential Revision: https://reviews.llvm.org/D119447
David Spickett [Fri, 11 Feb 2022 11:09:28 +0000 (11:09 +0000)]
[compiler-rt][xray] Disable fdr-reinit test on AArch64
We run bots on a shared machine and under high load
this test sometimes segfaults.
https://lab.llvm.org/buildbot/#/builders/185/builds/1368
==1952234==XRay FDR init successful.
==1952234==XRay FDR: Not flushing to file, 'no_file_flush=true'.
<...>fdr-reinit.cpp.script: line 4: 1952234 Segmentation fault
XRAY_OPTIONS="verbosity=1" <...>/fdr-reinit.cpp.tmp
Looking at the printed output I think it's happening at:
// Finally, we should signal the sibling thread to stop.
keep_going.clear(std::memory_order_release);
Disabling the test while I try to reproduce.
Mirko Brkusanin [Fri, 11 Feb 2022 10:44:50 +0000 (11:44 +0100)]
[AMDGPU][GlobalISel] Fix insert point in FoldableFneg combine
Newly created fneg was built after some of it's uses in some cases.
Now it will be built immediately after instruction whose dst it negates.
Differential Revision: https://reviews.llvm.org/D119459
Marek Kurdej [Fri, 11 Feb 2022 11:00:35 +0000 (12:00 +0100)]
[clang-format] Assert default style instead of commenting. NFC.
Marek Kurdej [Fri, 11 Feb 2022 10:59:58 +0000 (11:59 +0100)]
[clang-format] Simplify conditions in spaceRequiredBetween. NFC.
Konrad Kleine [Fri, 11 Feb 2022 10:50:33 +0000 (11:50 +0100)]
Add cmake to source release tarballs
I've split the git archive generation into three steps:
1. generate pure tarball
2. append top-level cmake directory to all tarballs
3. compress the archive
This was inspired by D118252 and can be considered an alternative
approach for all projects to have access to the shared cmake
directory when building in standalone mode.
When generating source tarballs on my local laptop it takes 9 minutes and 45 seconds WITH this patch applied. When this patch is not applied, it takes 9minutes and 38 seconds. That means, this patch introduces a slowdown of 7 seconds, which seems fair.
Reviewed By: tstellar
Differential Revision: https://reviews.llvm.org/D118481
Simon Pilgrim [Fri, 11 Feb 2022 10:51:34 +0000 (10:51 +0000)]
[clang] VisitCastExpr - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced, so assert the cast is correct (which it should be as we just created that ScalableVectorType) instead of returning nullptr
Simon Pilgrim [Fri, 11 Feb 2022 10:19:25 +0000 (10:19 +0000)]
LoopReroll::isLoopControlIV - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced by isCompareUsedByBranch, so assert the cast is correct instead of returning nullptr
Simon Pilgrim [Fri, 11 Feb 2022 10:17:11 +0000 (10:17 +0000)]
[M68k] Add missing include
Fixup for experimental m68k target after D119359
Sven van Haastregt [Fri, 11 Feb 2022 10:14:14 +0000 (10:14 +0000)]
[OpenCL] Add OpenCL 3.0 atomics to -fdeclare-opencl-builtins
Add the atomic overloads for the `global` and `local` address spaces,
which are new in OpenCL 3.0. Ensure the preexisting `generic`
overloads are guarded by the generic address space feature macro.
Ensure a subset of the atomic builtins are guarded by the
`__opencl_c_atomic_order_seq_cst` and `__opencl_c_atomic_scope_device`
feature macros, and enable those macros for SPIR/SPIR-V targets in
`opencl-c-base.h`.
Also guard the `cl_ext_float_atomics` builtins with the atomic order
and scope feature macros.
Differential Revision: https://reviews.llvm.org/D119420
Tim Northover [Thu, 10 Feb 2022 13:28:50 +0000 (13:28 +0000)]
StackProtector: ignore debug insts when splitting blocks.
When deciding where to split a block to insert stack guard checks, we should
move past any debug instructions we see that might (e.g.) be separating a tail
call from its frame wrangling.
Nikita Popov [Fri, 11 Feb 2022 10:00:31 +0000 (11:00 +0100)]
[SCCP] Check that load/store and global type match
SCCP requires that the load/store type and global type are the
same (it does not support bitcasts of tracked globals). With
typed pointers this was implicitly enforced.
Marek Kurdej [Fri, 11 Feb 2022 09:49:53 +0000 (10:49 +0100)]
[clang-format] Add tests for spacing between ref-qualifier and `noexcept`. NFC.
Cf. https://github.com/llvm/llvm-project/issues/44542.
Cf. https://github.com/llvm/llvm-project/commit/
ae1b7859cbd61d2284d9690bc53482d0b6a46f63.
Balazs Benics [Fri, 11 Feb 2022 09:45:18 +0000 (10:45 +0100)]
[analyzer] Restrict CallDescription fuzzy builtin matching
`CallDescriptions` for builtin functions relaxes the match rules
somewhat, so that the `CallDescription` will match for calls that have
some prefix or suffix. This was achieved by doing a `StringRef::contains()`.
However, this is somewhat problematic for builtins that are substrings
of each other.
Consider the following:
`CallDescription{ builtin, "memcpy"}` will match for
`__builtin_wmemcpy()` calls, which is unfortunate.
This patch addresses/works around the issue by checking if the
characters around the function's name are not part of the 'name'
semantically. In other words, to accept a match for `"memcpy"` the call
should not have alphanumeric (`[a-zA-Z]`) characters around the 'match'.
So, `CallDescription{ builtin, "memcpy"}` will not match on:
- `__builtin_wmemcpy: there is a `w` alphanumeric character before the match.
- `__builtin_memcpyFOoBar_inline`: there is a `F` character after the match.
- `__builtin_memcpyX_inline`: there is an `X` character after the match.
But it will still match for:
- `memcpy`: exact match
- `__builtin_memcpy`: there is an _ before the match
- `__builtin_memcpy_inline`: there is an _ after the match
- `memcpy_inline_builtinFooBar`: there is an _ after the match
Reviewed By: NoQ
Differential Revision: https://reviews.llvm.org/D118388
serge-sans-paille [Wed, 9 Feb 2022 19:00:42 +0000 (20:00 +0100)]
Cleanup MCParser headers
As usual with that header cleanup series, some implicit dependencies now need to
be explicit:
llvm/MC/MCParser/MCAsmParser.h no longer includes llvm/MC/MCParser/MCAsmLexer.h
Preprocessed lines to build llvm on my setup:
after:
1068185081
before:
1068324320
So no compile time benefit to expect, but we still get the looser coupling
between files which is great.
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D119359
Markus Böck [Fri, 11 Feb 2022 09:23:35 +0000 (10:23 +0100)]
[mlir][LLVM] Add support for adding a garbage collector to a LLVM function
This patch simply adds an optional garbage collector attribute to LLVMFuncOp which maps 1:1 to the "gc" property of functions in LLVM.
Differential Revision: https://reviews.llvm.org/D119492
Nikita Popov [Fri, 11 Feb 2022 09:15:17 +0000 (10:15 +0100)]
[InstCombine] Check type compatibility in indexed load fold
This fold could use a rewrite to an offset-based implementation,
but for now make sure it doesn't crash with opaque pointers.
Florian Hahn [Fri, 11 Feb 2022 09:15:41 +0000 (09:15 +0000)]
[LV] Move unrelated tests from first-order-recurrence-chains.ll
Sander de Smalen [Fri, 11 Feb 2022 07:53:20 +0000 (07:53 +0000)]
[AArch64] Emit TBAA metadata for SVE load/store intrinsics
In Clang we can attach TBAA metadata based on the load/store intrinsics
based on the operation's element type.
This also contains changes to InstCombine where the AArch64-specific
intrinsics are transformed into generic LLVM load/store operations,
to ensure that all metadata is transferred to the new instruction.
There will be some further work after this patch to also emit TBAA
metadata for SVE's gather/scatter- and struct load/store intrinsics.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D119319
Mehdi Amini [Mon, 7 Feb 2022 21:10:18 +0000 (21:10 +0000)]
Add a new interface method `getAsmBlockName()` on OpAsmOpInterface to control block names
This allows operations to control the block ids used by the printer in nested regions.
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D115849
Nikita Popov [Fri, 11 Feb 2022 08:38:28 +0000 (09:38 +0100)]
[InstCombine] Require equal source element type in icmp of gep fold
Without opaque pointers, this is implicitly enforced. This previously
resulted in a miscompile.
Nikita Popov [Thu, 27 Jan 2022 14:47:28 +0000 (15:47 +0100)]
[Bitcode] Add partial support for opaque pointer auto-upgrade
Auto-upgrades that rely on the pointer element type do not work in
opaque pointer mode. The idea behind this patch is that we can
instead work with type IDs, for which we can retain the pointer
element type. For typed pointer bitcode, we will have a distinct
type ID for pointers with distinct element type, even if there will
only be a single corresponding opaque pointer type.
The disclaimer here is that this is only the first step of the change,
and there are still more getPointerElementType() calls to remove.
I expect that two more patches will be needed:
1. Track all "contained" type IDs, which will allow us to handle
function params (which are contained in the function type) and GEPs
(which may use vectors of pointers)
2. Track type IDs for values, which is e.g. necessary to handle loads.
Differential Revision: https://reviews.llvm.org/D118694
Nikita Popov [Thu, 10 Feb 2022 09:38:37 +0000 (10:38 +0100)]
[ArgPromotion] Protect harder against recursive promotion (PR42028)
In addition to the self-recursion check, also check whether there
is more than one node in the SCC, which implies that there is a
larger cycle. I believe checking SCC structure (rather than
something like norecurse) is the right thing to do here, because
this is specifically about preventing infinite loops over the SCC.
Fixes https://github.com/llvm/llvm-project/issues/42028.
Differential Revision: https://reviews.llvm.org/D119418
gysit [Fri, 11 Feb 2022 08:20:37 +0000 (08:20 +0000)]
[mlir][OpDSL] Add support for basic rank polymorphism.
Previously, OpDSL did not support rank polymorphism, which required a separate implementation of linalg.fill. This revision extends OpDSL to support rank polymorphism for a limited class of operations that access only scalars and tensors of rank zero. At operation instantiation time, it scales these scalar computations to multi-dimensional pointwise computations by replacing the empty indexing maps with identity index maps. The revision does not change the DSL itself, instead it adapts the Python emitter and the YAML generator to generate different indexing maps and and iterators depending on the rank of the first output.
Additionally, the revision introduces a `linalg.fill_tensor` operation that in a future revision shall replace the current handwritten `linalg.fill` operation. `linalg.fill_tensor` is thus only temporarily available and will be renamed to `linalg.fill`.
Reviewed By: nicolasvasilache, stellaraccident
Differential Revision: https://reviews.llvm.org/D119003
Jay Foad [Tue, 31 Mar 2020 09:28:39 +0000 (10:28 +0100)]
[AArch64] Add a special case for shifting by (BitWidth - 1) - X
Differential Revision: https://reviews.llvm.org/D77316
Jay Foad [Thu, 10 Feb 2022 10:48:21 +0000 (10:48 +0000)]
[AArch64] Pre-commit multi use shift amount tests for D77316
Differential Revision: https://reviews.llvm.org/D119423
Weining Lu [Fri, 11 Feb 2022 08:14:59 +0000 (00:14 -0800)]
[LoongArch] Include missing header files after D119244
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D119514
Mehdi Amini [Fri, 11 Feb 2022 07:14:40 +0000 (07:14 +0000)]
Remove spurious includes and dependencies from Bazel files (NFC)
Differential Revision: https://reviews.llvm.org/D119526
Bill Wendling [Fri, 11 Feb 2022 07:08:11 +0000 (23:08 -0800)]
[X86] Zero out the 32-bit GPRs explicitly
This should ensure that only the 32-bit xors are emitted, and not the
64-bit xors.
Differential Revision: https://reviews.llvm.org/D119523
Shubham Rastogi [Fri, 11 Feb 2022 06:34:37 +0000 (22:34 -0800)]
[NFC] Sort textual headers by alphabetical order
Differential Revision: https://reviews.llvm.org/D119519
Uday Bondhugula [Thu, 10 Feb 2022 08:40:58 +0000 (14:10 +0530)]
[MLIR] Add result status for normalizeAffineFor
Add result status for normalizeAffineFor utility.
Differential Revision: https://reviews.llvm.org/D119413
Konstantin Varlamov [Fri, 11 Feb 2022 04:55:27 +0000 (20:55 -0800)]
[libc++][ranges][NFC] Fix a typo in links on the Ranges status page.
Fangrui Song [Fri, 11 Feb 2022 04:23:22 +0000 (20:23 -0800)]
[Object] Include llvm/Support/MemoryBuffer.h after D119457
libc++ -DLLVM_ENABLE_MODULES=on build needs the complete type. This fixes
error: invalid application of 'sizeof' to an incomplete type 'llvm::MemoryBuffer'
Fangrui Song [Fri, 11 Feb 2022 04:10:12 +0000 (20:10 -0800)]
[RISCV] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds
ZezhengLi [Fri, 11 Feb 2022 03:22:04 +0000 (11:22 +0800)]
[C++20] [Modules] Check if modulemap exists to avoid crash in implicit used C++ module
An impilt used of C++ module without prebuild path may cause crash.
For example:
```
// ./dir1/C.cppm
export module C;
// ./dir2/B.cppm
export module B;
import C;
// ./A.cpp
import B;
import C;
```
When we compile A.cpp without the prebuild path of C.pcm, the compiler
will crash.
```
clang++ -std=c++20 --precompile -c ./dir1/C.cppm -o ./dir1/C.pcm
clang++ -std=c++20 --precompile -fprebuilt-module-path=./dir2 -c
./dir2/B.cppm -o ./dir2/B.pcm
clang++ -std=c++20 -fprebuilt-module-path=./dir2 A.cpp
```
The prebuilt path of module C is cached when import module B, and in the
function HeaderSearch::getCachedModuleFileName, the compiler try to get
the filename by modulemap without check if modulemap exists, and there
is no modulemap in C++ module.
Reviewed By: ChuanqiXu
Differential review: https://reviews.llvm.org/D119426
Rashmi Mudduluru [Fri, 11 Feb 2022 02:49:34 +0000 (18:49 -0800)]
[Analyzer] Re-enables trustnonnullchecker_test.m
Differential review: https://reviews.llvm.org/D119270
Konstantin Varlamov [Fri, 11 Feb 2022 02:43:43 +0000 (18:43 -0800)]
[libc++][ranges][NFC] Update the status of predefined iterators.
`{back,front}_insert_iterator` and `ostream{,buf}_iterator` effectively
fully implement the One Ranges Proposal already, so mark them as done:
- the change to `difference_type` was made by D103273;
- default constructors and the associated default member initializers
were removed by wg21.link/P2325 (implemented by D102468).
Also fix a stale template signature in the `<iterator>` synopsis.
Chris Bieneman [Wed, 19 Jan 2022 23:55:20 +0000 (17:55 -0600)]
[NFC] Make file offsets a regex to handle CRLF
None of these tests are really intended to test the file offset as much
as to test the structure. Making the regex allows this test to work
even if the file is checked out with CRLF line endings.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D119362
Arthur Eubanks [Fri, 11 Feb 2022 02:28:45 +0000 (18:28 -0800)]
[clang][OpaquePtr] Use proper Address constructor in AtomicInfo::getAtomicAddress()
Ben Shi [Thu, 10 Feb 2022 09:29:05 +0000 (09:29 +0000)]
[AVR] Fix a potential assert failure
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D119416
Nico Weber [Fri, 11 Feb 2022 01:59:28 +0000 (20:59 -0500)]
[llvm] Remove unused file MaximumSpanningTree.h
The last use of this file was removed in late 2013 in
ea564946251e.
The last use was in PathProfiling.cpp, which had an overview comment
of the overall approach.
Similar functionality lives in the slight more cryptically named
CFGMST.h in this same directory. A similar overview comment is
in PGOInstrumentation.cpp.
No behavior change.
Nico Weber [Fri, 11 Feb 2022 01:57:03 +0000 (20:57 -0500)]
[llvm] add missing word in a comment
Nico Weber [Fri, 11 Feb 2022 01:56:36 +0000 (20:56 -0500)]
[runtimes] rewrap a comment to 80 columns
Vincent Lee [Thu, 10 Feb 2022 01:05:18 +0000 (17:05 -0800)]
[lld-macho][nfc] Centralize usages of ld64.lld in tests
We have a mix of substituted lld (`%lld`) and hard-coded lld (`ld64.lld`) commands.
When testing with different versions of LLD, this would require going into every place
where lld is hard-coded and changing that. If we centralize it, this'll only require us
to modify it in only one place and will make it easy to run the same test suite. Plus,
this will make it be consistent with how we write other tests.
Reviewed By: #lld-macho, int3, oontvoo
Differential Revision: https://reviews.llvm.org/D119394
Thomas Raoux [Tue, 8 Feb 2022 04:41:05 +0000 (20:41 -0800)]
[mlir][gpu] Add device side async copy operations
Add new operations to the gpu dialect to represent device side
asynchronous copies. This also add the lowering of those operations to
nvvm dialect.
Those ops are meant to be low level and map directly to llvm dialects
like nvvm or rocdl.
We can further add higher level of abstraction by building on top of
those operations.
This has been discuss here:
https://discourse.llvm.org/t/modeling-gpu-async-copy-ampere-feature/4924
Differential Revision: https://reviews.llvm.org/D119191
River Riddle [Fri, 11 Feb 2022 00:59:03 +0000 (16:59 -0800)]
[PDLL] Attempt to fix the gcc5 build by adding this-> to auto lambda
Philip Reames [Thu, 10 Feb 2022 23:52:13 +0000 (15:52 -0800)]
[PSE] Remove assumption that top level predicate is union from public interface [NFC*]
Note that this doesn't actually cause the top level predicate to become a non-union just yet.
The * above comes from a case in the LoopVectorizer where a predicate which is later proven no longer blocks vectorization due to a change from checking if predicates exists to whether the predicate is possibly false.
Sam Clegg [Sun, 30 Jan 2022 19:10:59 +0000 (11:10 -0800)]
[clang][WebAssemmbly] Call TargetInfo::adjust in derived method.
The superclass method handles a bunch of useful things. For example
it applies flags such as `-fnew-alignment` which doesn't work without
this patch.
Differential Revision: https://reviews.llvm.org/D118573
David Blaikie [Thu, 10 Feb 2022 23:48:48 +0000 (15:48 -0800)]
DebugInfo: Don't simplify names referencing local enums
Due to the way type units work, this would lead to a declaration in a
type unit of a local type in a CU - which is ambiguous. Rather than
trying to resolve that relative to the CU that references the type unit,
let's just not try to simplify these names.
Longer term this should be fixed by not putting the template
instantiation in a type unit to begin with - since it references an
internal linkage type, it can't legitimately be duplicated/in more than
one translation unit, so skip the type unit overhead. (but the right fix
for that is to move type unit management into a DICompositeType flag
(dropping the "identifier" field is not a perfect solution since it
breaks LLVM IR linking decl/def merging during IR linking))
Philip Reames [Thu, 10 Feb 2022 23:50:50 +0000 (15:50 -0800)]
[SCEVPredicateRewriter] Remove assumption top level predicate is a union [NFC]
Arthur Eubanks [Thu, 10 Feb 2022 22:24:04 +0000 (14:24 -0800)]
[docs] Replace `opt -analyze` with better alternatives.
`opt -analyze` is legacy PM-specific. Show better ways of doing the same
thing, generally with some sort of `-passes=print<foo>`.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D119486
Adrian Prantl [Thu, 10 Feb 2022 23:37:01 +0000 (15:37 -0800)]
Revert "Add -fmodules-local-submodule-visibility to MANDATORY_MODULE_BUILD_CFLAGS"
This reverts commit
547a667ceeb60dca5447e5bc09165a52b22925eb.
LLVM GN Syncbot [Thu, 10 Feb 2022 23:27:43 +0000 (23:27 +0000)]
[gn build] Port
f92702141069
David Blaikie [Thu, 10 Feb 2022 23:27:14 +0000 (15:27 -0800)]
Fix Windows build that fails if a class has a member with the same naem
Shilei Tian [Thu, 10 Feb 2022 23:20:29 +0000 (18:20 -0500)]
[OpenMP][Offloading] Change the way to compare floating point values in bug49334.cpp
`bug49334.cpp` directly uses `!=` to compare two floating point values,
which is almost wrong.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D119485
Yuanfang Chen [Thu, 10 Feb 2022 23:10:48 +0000 (15:10 -0800)]
Reland "[clang-cl] Support the /JMC flag"
This relands commit
b380a31de084a540cfa38b72e609b25ea0569bb7.
Restrict the tests to Windows only since the flag symbol hash depends on
system-dependent path normalization.
Shilei Tian [Thu, 10 Feb 2022 23:07:39 +0000 (18:07 -0500)]
[OpenMP][CUDA] Remove the hard team limit
Currently we have a hard team limit, which is set to 65536. It says no matter whether the device can support more teams, or users set more teams, as long as it is larger than that hard limit, the final number to launch the kernel will always be that hard limit. It is way less than the actual hardware limit. For example, my workstation has GTX2080, and the hardware limit of grid size is
2147483647, which is exactly the largest number a `int32_t` can represent. There is no limitation mentioned in the spec. This patch simply removes it.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D119313
YASHASVI KHATAVKAR [Thu, 10 Feb 2022 22:58:03 +0000 (17:58 -0500)]
Reverting an entire stack of changes causing build failures
David Blaikie [Thu, 10 Feb 2022 22:40:25 +0000 (14:40 -0800)]
DebugInfo: Don't simplify any template referencing a lambda
Lambda names aren't entirely canonical (as demonstrated by the
cross-project-test added here) at the moment (we should fix that for a
bunch of reasons) - even if the template referencing them is
non-simplified, other names referencing /that/ template can't be
simplified either because type units might cause a different template to
be picked up that would conflict with the expected name.
(other than for roundtripping precision, it'd be OK to simplify types
that reference types that reference lambdas - but best be consistent
between the roundtrip/verify mode and the actual simplified template
names mode)
LLVM GN Syncbot [Thu, 10 Feb 2022 22:52:25 +0000 (22:52 +0000)]
[gn build] Port
290e5722e83e
Stanislav Mekhanoshin [Thu, 10 Feb 2022 21:02:23 +0000 (13:02 -0800)]
[AMDGPU] Improve clobbering checks in the kernel argument promotion
Use same MSSA clobbering checks as in the AMDGPUAnnotateUniformValues.
Kernel argument promotion needs exactly the same information so factor
out utility function isClobberedInFunction.
Differential Revision: https://reviews.llvm.org/D119480
LLVM GN Syncbot [Thu, 10 Feb 2022 22:24:30 +0000 (22:24 +0000)]
[gn build] Port
b380a31de084
Roman Lebedev [Thu, 10 Feb 2022 18:16:19 +0000 (21:16 +0300)]
[NFC][SCEV] `createNodeForSelectOrPHIViaUMinSeq()`: use sub instead of add
For booleans, xor/add/sub are interchangeable:
https://alive2.llvm.org/ce/z/ziav3d
But for larger bitwidths, we'll need sub, so change it now.
Roman Lebedev [Thu, 10 Feb 2022 20:58:59 +0000 (23:58 +0300)]
[NFC][LSR] Harden lsr-expand-quadratic.ll against smarter SCEV
We can analyse that `select`, and after that
the test no longer does what it's supposed to.
Roman Lebedev [Thu, 10 Feb 2022 21:25:51 +0000 (00:25 +0300)]
[NFC][CodeGen][X86] Autogenerate checklines in a test to simplify further updates
Roman Lebedev [Thu, 10 Feb 2022 20:34:13 +0000 (23:34 +0300)]
[NFC][CodeGen][PPC] Autogenerate checklines in a test to simplify further updates
Roman Lebedev [Thu, 10 Feb 2022 20:33:57 +0000 (23:33 +0300)]
[NFC][LSR] Autogenerate checklines in a test to simplify further updates
Roman Lebedev [Thu, 10 Feb 2022 20:33:50 +0000 (23:33 +0300)]
[NFC][SCEV] Autogenerate checklines in a test to simplify further updates
Nikolas Klauser [Thu, 10 Feb 2022 17:08:36 +0000 (18:08 +0100)]
[libc++] Add LWG-issues from february 2022 plenary meeting
Reviewed By: ldionne, Quuxplusone, Mordante, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D119443
Yuanfang Chen [Thu, 10 Feb 2022 22:17:37 +0000 (14:17 -0800)]
Revert "[clang-cl] Support the /JMC flag"
This reverts commit
bd3a1de683f80d174ea9c97000db3ec3276bc022.
Break bots:
https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/
b8822587673277278177/overview
Ye Luo [Thu, 10 Feb 2022 21:54:13 +0000 (15:54 -0600)]
[Libomptarget][AMDGCN] add gfx90c target
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D119478
Reid Kleckner [Thu, 10 Feb 2022 21:40:28 +0000 (13:40 -0800)]
[CodeView] Avoid integer overflow while parsing long version strings
This came up on a funny vendor-provided version string that didn't have
a standard dotted quad of numbers.
Shubham Sandeep Rastogi [Wed, 9 Feb 2022 05:26:40 +0000 (21:26 -0800)]
Add support to dsymutil for dumping out new swift5 reflection sections
This change adds support for dsymutil to be able to dump out the new swift5 reflection sections called swift5_proto and swift5_protos. The test is also updated to check for this.
Differential Revision: https://reviews.llvm.org/D119310
Douglas Yung [Thu, 10 Feb 2022 21:47:04 +0000 (13:47 -0800)]
Make shtest-format.py CHECK lines more flexible
The test sometimes fails on Windows due to a warning emitted by bash about not
being able to find the /tmp directory causing this test to randomly fail. This
update makes the test more flexible to account for this possibility and should
hopefully make it more reliable.
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D118691
Shubham Sandeep Rastogi [Thu, 10 Feb 2022 20:37:59 +0000 (12:37 -0800)]
Fix the build errors when enabling -DLLVM_ENABLE_MODULES=On and change
e53e6ec6ef74
Build Failure: https://green.lab.llvm.org/green/job/lldb-cmake/41267/
Differential Revision: https://reviews.llvm.org/D119473
Aart Bik [Thu, 10 Feb 2022 19:33:38 +0000 (11:33 -0800)]
[mlir][sparse][pytaco] add SDDMM test with two different ways of defining kernel
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D119465
Teresa Johnson [Thu, 10 Feb 2022 20:41:00 +0000 (12:41 -0800)]
[ThinLTO][WPD] LICM set lookup (NFC)
Minor efficiency fix. There is no reason to perform the same set lookup
repeatedly in the inner loop as it is invariant there.
Differential Revision: https://reviews.llvm.org/D119474
Aaron Ballman [Thu, 10 Feb 2022 21:04:13 +0000 (16:04 -0500)]
Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,
void func();
becomes
void func(void);
This is the seventh batch of tests being updated (there are a
significant number of other tests left to be updated).
David Green [Thu, 10 Feb 2022 21:04:41 +0000 (21:04 +0000)]
[AArch64] Add extra fptoint_sat tests for larger than legal types. NFC
Simon Pilgrim [Thu, 10 Feb 2022 21:03:45 +0000 (21:03 +0000)]
[FileCheck] Fix initialized but never used static analyzer warning. NFC.
Remove superfluous variable initialization, the variable is assigned by both paths immediately afterward.
River Riddle [Sun, 2 Jan 2022 03:41:08 +0000 (03:41 +0000)]
[PDLL] Add support for user defined constraint and rewrite functions
These functions allow for defining pattern fragments usable within the `match` and `rewrite` sections of a pattern. The main structure of Constraints and Rewrites functions are the same, and are similar to functions in other languages; they contain a signature (i.e. name, argument list, result list) and a body:
```pdll
// Constraint that takes a value as an input, and produces a value:
Constraint Cst(arg: Value) -> Value { ... }
// Constraint that returns multiple values:
Constraint Cst() -> (result1: Value, result2: ValueRange);
```
When returning multiple results, each result can be optionally be named (the result of a Constraint/Rewrite in the case of multiple results is a tuple).
These body of a Constraint/Rewrite functions can be specified in several ways:
* Externally
In this case we are importing an external function (registered by the user outside of PDLL):
```pdll
Constraint Foo(op: Op);
Rewrite Bar();
```
* In PDLL (using PDLL constructs)
In this case, the body is defined using PDLL constructs:
```pdll
Rewrite BuildFooOp() {
// The result type of the Rewrite is inferred from the return.
return op<my_dialect.foo>;
}
// Constraints/Rewrites can also implement a lambda/expression
// body for simple one line bodies.
Rewrite BuildFooOp() => op<my_dialect.foo>;
```
* In PDLL (using a native/C++ code block)
In this case the body is specified using a C++(or potentially other language at some point) code block. When building PDLL in AOT mode this will generate a native constraint/rewrite and register it with the PDL bytecode.
```pdll
Rewrite BuildFooOp() -> Op<my_dialect.foo> [{
return rewriter.create<my_dialect::FooOp>(...);
}];
```
Differential Revision: https://reviews.llvm.org/D115836
River Riddle [Sun, 2 Jan 2022 03:40:45 +0000 (03:40 +0000)]
[PDLL] Add support for single line lambda-like patterns
This allows for defining simple patterns in a single line. The lambda
body of a Pattern expects a single operation rewrite statement:
```
Pattern => replace op<my_dialect.foo>(operands: ValueRange) with operands;
```
Differential Revision: https://reviews.llvm.org/D115835
Martin Storsjö [Mon, 7 Feb 2022 14:24:16 +0000 (16:24 +0200)]
[libcxx] Silence -Wformat-nonliteral warnings in the Windows support code
This brings the mingw build back to zero build warnings as it was
at some earlier time.
Differential Revision: https://reviews.llvm.org/D119134
Simon Pilgrim [Thu, 10 Feb 2022 20:44:19 +0000 (20:44 +0000)]
[llvm-libtool-darwin] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is dereferenced immediately, so assert the cast is correct instead of returning nullptr
Simon Pilgrim [Thu, 10 Feb 2022 20:42:14 +0000 (20:42 +0000)]
[LoopVectorize] getStepVector - reduce scope of local variable. NFC.
Nikolas Klauser [Thu, 10 Feb 2022 15:51:04 +0000 (16:51 +0100)]
[libc++] Prepare string.modifiers tests for constexpr
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D119329
Philip Reames [Thu, 10 Feb 2022 20:25:45 +0000 (12:25 -0800)]
[SCEV] Constify some uses of SCEVUnionPredicate* [NFC]
This exploits the immutability introduced in d334fec.
Huihui Zhang [Thu, 10 Feb 2022 20:00:23 +0000 (12:00 -0800)]
[NFC] Simplify pairwise store test mir to drop stack accesses.
Test simplified:
test/CodeGen/AArch64/stp-opt-with-renaming-undef-assert.mir
YASHASVI KHATAVKAR [Mon, 7 Feb 2022 15:02:22 +0000 (10:02 -0500)]
Modified SourceLevelDebugging.rst to include information about memory location exp