Kadir Cetinkaya [Fri, 29 May 2020 10:35:16 +0000 (12:35 +0200)]
[clangd] Preserve extra args in PreambleTests::IncludeParsing to fix windows build bots
Georgii Rymar [Tue, 19 May 2020 14:29:45 +0000 (17:29 +0300)]
[llvm-readelf] - --elf-hash-histogram: do not crash when the .gnu.hash goes past the EOF.
llvm-readelf might crash when the .gnu.hash table goes past the EOF.
This patch splits and updates the code of a helper function `checkGNUHashTable`,
which is similar to `checkHashTable` and fixes the issue.
Differential revision: https://reviews.llvm.org/D80215
Kadir Cetinkaya [Thu, 14 May 2020 10:23:21 +0000 (12:23 +0200)]
[clangd] Add buildPreamble to TestTU
Summary: Depends on D77644.
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79930
Kadir Cetinkaya [Thu, 2 Apr 2020 08:53:45 +0000 (10:53 +0200)]
[clangd] Handle additional includes while parsing ASTs
Summary:
Enables building ASTs with stale preambles by handling additional preamble
includes. Sets the correct location information for those imaginary includes so
that features like gotodef/documentlink keeps functioning propoerly.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77644
Benjamin Kramer [Fri, 29 May 2020 10:18:25 +0000 (12:18 +0200)]
Unbreak the build of mlir-cuda-runner
Louis Dionne [Fri, 15 May 2020 19:58:19 +0000 (15:58 -0400)]
[libc++] Fix the LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT setting
When the __config_site header is generated, but LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT
wasn't specified, _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT would be defined
to 0, which was the NonUnique RTTI comparison implementation. The intent
was to use the Unique RTTI comparison implementation in that case, which
caused https://llvm.org/PR45549.
Instead, use a proper "switch" to select the RTTI comparison implementation.
Note that 0 can't be used as a value, because that is treated the same
by CMake as a variable that is just not defined.
Differential Revision: https://reviews.llvm.org/D80037
Georgii Rymar [Wed, 27 May 2020 14:56:25 +0000 (17:56 +0300)]
[llvm-readobj][test] - unwind.test: add comments, document the current behavior.
Here I've added comments, added testing for llvm-readelf and documented
the behavior that we already have.
It was discussed in the D80380 thread that we want to improve the
"p_memsz does not match p_filesz for GNU_EH_FRAME" message reported
(and probably convert error to a warning). This patch is a preparation
for that.
Differential revision: https://reviews.llvm.org/D80635
Emre Kultursay [Fri, 29 May 2020 09:18:26 +0000 (11:18 +0200)]
Do not list adb devices when a device id is given
Summary:
On Android, this method gets called twice: first when establishing
a host-server connection, then when attaching to a process id.
Each call takes several seconds to finish (especially slower on Windows)
and eliminating the call for the typical case improves latency significantly.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D79586
Pavel Labath [Mon, 25 May 2020 12:37:04 +0000 (14:37 +0200)]
[lldb] Make "inline" tests more configurable
Summary:
This patch adds two new arguments to the MakeInlineTest function. The
main motivation is a follow-up patch I'm preparing, but they seem
generally useful.
The first argument allows the user to specify the "build dictionary".
With this argument one can avoid the need to provide a custom Makefile
if all he needs is to override a couple of make variables. This hooks in
neatly into the existing dictionary support for non-inline tests.
The second argument specifies the name of the test. This could be used
to provide better names to the generated test classes, but it's mainly
useful in conjuction with the first argument: now that we can specify a
custom build dictionary, it may sometimes make sense to run the same
test twice with different build configurations. To achieve that, we need
to give the two tests different names, and this argument achieves that.
The usage of the arguments is demonstrated via TestBasicEntryValues.py.
Reviewers: vsk, JDevlieghere
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D80518
Raphael Isemann [Fri, 29 May 2020 09:19:14 +0000 (11:19 +0200)]
[lldb][NFC] Remove a std::string->C string->StringRef conversion in ClangUserExpression
Vitaly Buka [Fri, 29 May 2020 08:02:36 +0000 (01:02 -0700)]
Avoid O_CLOEXEC to allow building on older Linux (RHEL5)
Summary:
See https://github.com/google/sanitizers/issues/1253.
Small patch to enable compilation on (ancient) Red Hat Enterprise Linux 5.
Reviewers: kcc, vitalybuka
Reviewed By: vitalybuka
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D80648
Ehsan Toosi [Wed, 20 May 2020 16:23:43 +0000 (18:23 +0200)]
[MLIR][BufferPlacement] Support functions that return Memref typed results
Buffer placement can now operates on functions that return buffers. These
buffers escape from the deallocation phase of buffer placement.
Differential Revision: https://reviews.llvm.org/D80696
Jay Foad [Fri, 29 May 2020 08:42:00 +0000 (09:42 +0100)]
[AMDGPU] Better use of llvm::numbers
Tweak a few constant expressions involving numbers::pi etc to avoid
rounding errors. NFCI though it's possible some of these will now be
more accurate in the last bit.
Jay Foad [Fri, 29 May 2020 08:34:29 +0000 (09:34 +0100)]
[AMDGPU] Use numbers::pi instead of M_PI. NFC.
Kazushi (Jam) Marukawa [Fri, 29 May 2020 08:50:06 +0000 (10:50 +0200)]
[VE] Implements minimum MC layer for VE (4/4)
Summary:
This patch includes following items.
- Adds AsmParser and minimum AsmBackend/ELFObjectWriter/MCCodeEmitter to
support only LEA instruction in order to reduce the size of this patch.
- Adds regression test of MC layer for a LEA instruction.
- Relocations are not supported this time to reduce the size of this patch.
Differential Revision: https://reviews.llvm.org/D79546
Sjoerd Meijer [Fri, 29 May 2020 08:05:41 +0000 (09:05 +0100)]
[TTI] New target hook emitGetActiveLaneMask
This is split off from D79100 and adds a new target hook emitGetActiveLaneMask
that can be queried to check if the intrinsic @llvm.get.active.lane.mask() is
supported by the backend and if it should be emitted for a given loop.
See also commit rG7fb8a40e5220 and its commit message for more details/context
on this new intrinsic.
Differential Revision: https://reviews.llvm.org/D80597
Haojian Wu [Tue, 19 May 2020 16:05:15 +0000 (18:05 +0200)]
[AST][RecoveryExpr] Make DeduceAutoType fail if the auto is deduced from recovery exprs.
Summary:
With recovery-ast, we will get an undeduced `auto` return type for
"auto foo()->undef()" function declaration, the function decl still keeps
valid, it is dangerous, and breaks assumptions in clang, and leads crashes.
This patch invalidates these functions, if we deduce autos from the
return rexpression, which is similar to auto VarDecl.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80221
Sjoerd Meijer [Fri, 29 May 2020 07:27:22 +0000 (08:27 +0100)]
New intrinsic @llvm.get.active.lane.mask()
This is split off from D79100 and:
- adds a intrinsic description/definition for @llvm.get.active.lane.mask(), and
- describe its semantics in LangRef.
As described (in more detail) in its LangRef section, it is semantically
equivalent to an icmp with the vector induction variable and the back-edge
taken count, and generates a mask of active/inactive vector lanes.
It will have several use cases. First, it will be used by the
ExpandVectorPredication pass for the VP intrinsics, to expand VP intrinsics for
scalable vectors on targets that do not support the `%evl` parameter, see
D78203.
Also, this is part of, and essential for our ARM MVE tail-predication story:
- this intrinsic will be emitted by the LoopVectorizer in D79100, when
the scalar epilogue is tail-folded into the vector body. This new intrinsic
will generate the predicate for the masked loads/stores, and it takes the
back-edge taken count as an argument. The back-edge taken count represents the
number of elements processed by the loop, which we need to setup MVE
tail-predication.
- Emitting the intrinsic is controlled by a new TTI hook, see D80597.
- We pick up this new intrinsic in an ARM MVETailPredication backend pass, see
D79175, and convert it to a MVE target specific intrinsic/instruction to
create a tail-predicated loop.
Differential Revision: https://reviews.llvm.org/D80596
davidak [Thu, 28 May 2020 20:33:14 +0000 (22:33 +0200)]
libclc: update website url
old link is dead
Sylvestre Ledru [Fri, 29 May 2020 07:13:08 +0000 (09:13 +0200)]
[CMake] Pass CLANG_VENDOR variables into later stages
We are already passing CLANG_VERSION_* & PACKAGE_VENDOR
David Sherwood [Tue, 26 May 2020 15:07:46 +0000 (16:07 +0100)]
[SVE] Remove getNumElements() warnings in InstCombiner::visitBitCast
Whilst trying to compile this test to assembly:
CodeGen/aarch64-sve-intrinsics/acle_sve_reinterpret.c
I discovered some warnings were firing in InstCombiner::visitBitCast
due to calls to getNumElements() for scalable vector types. These
calls only really made sense for fixed width vectors so I have fixed
up the code appropriately.
Differential Revision: https://reviews.llvm.org/D80559
David Sherwood [Wed, 27 May 2020 14:21:48 +0000 (15:21 +0100)]
[SVE] Fix warnings in SelectInst::areInvalidOperands
We should be comparing the element counts rather than the
numbers of elements.
Differential Revision: https://reviews.llvm.org/D80634
David Sherwood [Wed, 6 May 2020 16:14:15 +0000 (17:14 +0100)]
[CodeGen] Add support for extracting elements of scalable vectors
I have tried to ensure that SelectionDAG and DAGCombiner do
sensible things for scalable vectors, and added support for a
limited number of simple folds. Codegen support for the vector
extract patterns have also been added to the AArch64 backend.
New vector extract tests have been added here:
CodeGen/AArch64/sve-extract-element.ll
and I have also added new folds using inserts and extracts here:
CodeGen/AArch64/sve-insert-element.ll
Differential Revision: https://reviews.llvm.org/D80208
Siva Chandra Reddy [Tue, 12 May 2020 23:01:28 +0000 (16:01 -0700)]
[libc] Add implementation of call_once from threads.h.
Reviewers: abrachet, maskray
Differential Revision: https://reviews.llvm.org/D79828
Craig Topper [Fri, 29 May 2020 06:39:54 +0000 (23:39 -0700)]
[X86] Remove MMX isel patterns containing (x86mmx (scalar_to_vector (i32))).
I don't think we can make such a node. I don't think
x86_mmx is considered a vector for the check in getNode.
Amara Emerson [Fri, 22 May 2020 21:21:50 +0000 (14:21 -0700)]
[AArch64][GlobalISel] Enable extending loads combines post-legalization.
During legalization we can end up with extends of loads, which in the case of
zexts causes us to not hit tablegen imported patterns.
The caveat here is that we don't want anyext load forming, since some variants
are illegal. This change also prevents the combine from creating any illegal
loads.
Differential Revision: https://reviews.llvm.org/D80458
LLVM GN Syncbot [Fri, 29 May 2020 03:47:15 +0000 (03:47 +0000)]
[gn build] Port
a6deaeec370
Lang Hames [Fri, 29 May 2020 00:55:49 +0000 (17:55 -0700)]
[ORC] Add debugging output for LLJIT construction.
This can be handy for checking whether the LLJIT instance you're constructing
matches your expectations.
Lang Hames [Thu, 28 May 2020 16:02:58 +0000 (09:02 -0700)]
[JITLink] Improve llvm-jitlink regression testing support for ELF.
This patch adds a jitlink pass, 'registerELFGraphInfo', that records section
and symbol information about each LinkGraph in the llvm-jitlink session object.
This allows symbols and sections to be referred to by name in llvm-jitlink
regression tests. This will enable a testcase to be written for
https://reviews.llvm.org/D80613.
Lang Hames [Thu, 28 May 2020 16:40:46 +0000 (09:40 -0700)]
[JITLink] Fix 80-column rule violation.
Whitney Tsang [Fri, 29 May 2020 03:02:27 +0000 (03:02 +0000)]
[LoopUnroll] Fix not-rotated.ll by adding back a limitation was unintentionally
removed in https://reviews.llvm.org/D80477
Philip Reames [Fri, 29 May 2020 03:03:20 +0000 (20:03 -0700)]
[Tests] Migrate more statepoint lowering tests to use operand bundles
Only 2 tests left after this. They just happen to be the most annoying.
Xing GUO [Fri, 29 May 2020 02:51:37 +0000 (10:51 +0800)]
[ObjectYAML][DWARF] Add DWARF entry in ELFYAML.
This patch adds a new DWARF entry in ELF YAML file.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D80203
Heejin Ahn [Mon, 25 May 2020 08:35:35 +0000 (01:35 -0700)]
[WebAssembly] Fix a bug in finding matching EH pad
Summary:
`getMatchingEHPad()` in LateEHPrepare is a function to find the nearest
EH pad that dominates the given instruction. This intends to be
lightweight so it does not use full WebAssemblyException scope analysis
or dominator analysis. It simply does backward BFS to its predecessors
and stops at the first EH pad each search path encounters. All search
should end up at the same EH pad, and if not, it returns null.
But it didn't take into account that when there are inner scopes within
the current scope, some path in BFS can hit an inner EH pad first. For
example, in the given diagram, `Inst` belongs to the outer scope and
`getMathingEHPad()` should return 'EHPad 1', but some search path can go
into the inner scope and end up with 'EHPad 2'. The search will return
null because different paths end up with different EH pads.
```
--- EHPad 1 ---
| - EHPad 2 - |
| | | |
| ----------- |
| Inst |
---------------
```
So far this was OK because we haven't tested a case in which a given
instruction is far from its EH pad. Also, this bug does not happen when
the inner EH scope is a cleanup scope, because a cleanup scope ends with
a `cleanupret` whose successor is an EH pad, so the search encounters
that EH pad first before going into the child scope. But this can happen
when the child scope is a catch scope that ends with `catchret`. So this
patch, when doing backward BFS, does not search predecessors that ends
with `catchret`. Because `catchret`s are replaced with `br`s during this
pass, this records BBs that have `catchret`s in the beginning, before
doing any other transformations.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80571
Heejin Ahn [Mon, 25 May 2020 08:34:43 +0000 (01:34 -0700)]
[WebAssembly] Fix a bug in removing unnecessary branches
Summary:
One of the things `removeUnnecessaryInstrs()` in CFGStackify does is to
remove an unnecessary unconditinal branch before an EH pad. When there
is an unconditional branch right before a catch instruction and it
branches to the end of `end_try` marker, we don't need the branch,
because it there is no exception, the control flow transfers to
that point anyway.
```
bb0:
try
...
br bb2 <- Not necessary
bb1:
catch
...
bb2:
end
```
This applies when we have a conditional branch followed by an
unconditional one, in which case we should only remove the unconditional
branch. For example:
```
bb0:
try
...
br_if someplace_else
br bb2 <- Not necessary
bb1:
catch
...
bb2:
end
```
But `TargetInstrInfo::removeBranch` we used removed all existing
branches when there are multiple ones. This patch fixes it by only
deleting the last (= unconditional) branch manually.
Also fixes some `preds` comments in the test file.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80572
Fangrui Song [Fri, 29 May 2020 02:16:29 +0000 (19:16 -0700)]
[llvm-xray][test] Fix unsupported-elf32.txt after D80185
Whitney Tsang [Fri, 29 May 2020 01:11:50 +0000 (01:11 +0000)]
[LoopUnroll] Support loops with exiting block that is neither header nor
latch.
Summary: Remove the limitation in LoopUnrollPass that exiting block must
be either header or latch.
Reviewer: dmgreen, jdoerfert, Meinersbur, kbarton, bmahjour, etiotto,
fhahn, efriedma
Reviewed By: etiotto, fhahn, efriedma
Subscribers: efriedma, lkail, xbolva00, hiraditya, zzheng, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D80477
Tony [Wed, 27 May 2020 03:44:10 +0000 (23:44 -0400)]
[AMDGPU] DWARF Proposal For Heterogeneous Debugging
- Add introduction to DWARF Proposal For Heterogeneous Debugging.
Differential Revision: https://reviews.llvm.org/D70523
Valery N Dmitriev [Thu, 28 May 2020 15:54:04 +0000 (08:54 -0700)]
[NFC][SLP] Add test case exposing SLP cost model bug.
The bug is related to aggregate build cost model adjustment
that adds a bias to cost triggering vectorization of actually
unprofitable to vectorize tree.
Differential Revision: https://reviews.llvm.org/D80682
Matt Arsenault [Sat, 23 May 2020 22:28:12 +0000 (18:28 -0400)]
GlobalISel: Work on improving stock set of legality predicates
I get confused by a lot of the predicate names here, since I would
assume they apply to vectors as well. Rename to reflect they only
apply to scalars.
Also add a few predicates AMDGPU uses that should be generally useful.
Also add any() to complement all. I've wanted to use this a few times
but then worked around it not being there.
Craig Topper [Fri, 29 May 2020 00:00:56 +0000 (17:00 -0700)]
[X86] Fix a nullptr dereference in X86Subtarget::classifyLocalReference when compiling with -mcmodel=medium -fpic and using a constant pool
LowerConstantPool passes a nullptr into classifyLocalReference. The medium code model handling for PIC will try to deference it using isa. This patch switches to isa_and_nonnull.
Differential Revision: https://reviews.llvm.org/D80763
Arthur Eubanks [Thu, 28 May 2020 06:12:36 +0000 (23:12 -0700)]
Run Coverage pass before other *San passes under new pass manager, round 2
Summary:
This was attempted once before in https://reviews.llvm.org/D79698, but
was reverted due to the coverage pass running in the wrong part of the
pipeline. This commit puts it in the same place as the other sanitizers.
This changes PassBuilder.OptimizerLastEPCallbacks to work on a
ModulePassManager instead of a FunctionPassManager. That is because
SanitizerCoverage cannot (easily) be split into a module pass and a
function pass like some of the other sanitizers since in its current
implementation it conditionally inserts module constructors based on
whether or not it successfully modified functions.
This fixes compiler-rt/test/msan/coverage-levels.cpp under the new pass
manager (last check-msan test).
Currently sanitizers + LTO don't work together under the new pass
manager, so I removed tests that checked that this combination works for
sancov.
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D80692
Sam Clegg [Thu, 21 May 2020 04:35:18 +0000 (21:35 -0700)]
[lld][WebAssembly] Convert some lld tests to assembly
When we originally wrote these tests we didn't have a stable and
fleshed out assembly format. Now we do so we should prefer that
over llvm ir for lld tests to avoid including more part of llvm
than necessary in order to run the test.
This change converts just 30 out of about 130 test files. More to
come when I have some more time.
Differential Revision: https://reviews.llvm.org/D80361
Jonas Devlieghere [Thu, 28 May 2020 23:03:57 +0000 (16:03 -0700)]
[lldb/CMake] Set both the BUILD and INSTALL RPATH on macOS
This is necessary when building the framework.
Vitaly Buka [Thu, 28 May 2020 22:47:35 +0000 (15:47 -0700)]
Dan Liew [Thu, 28 May 2020 22:57:44 +0000 (15:57 -0700)]
Disable `duplicate_os_log_reports.cpp` test.
It's not passing on macOS green dragon bots. To get them green just
disable for now.
rdar://problem/
62141527
Craig Topper [Thu, 28 May 2020 22:40:06 +0000 (15:40 -0700)]
[X86] Add test case to show fast-isel incorrectly emitting a 64-bit movabsq instruction in 32-bit mode when using constant pools with -code-model=large. NFC
-code-model=large isn't supposed to mean anything to 32-bit mode.
But nothing prevents passing it so we shouldn't generate bad code
if someone does.
Ian Levesque [Tue, 19 May 2020 05:38:14 +0000 (01:38 -0400)]
[xray] Add llvm-xray extract support for 32 bit ARM
Summary:
XRay works on 32-bit ARM but extract didn't support it.
See also another previous attempt in D77858.
Reviewers: MaskRay, dberris, johnislarry
Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80185
Ian Levesque [Thu, 28 May 2020 22:25:49 +0000 (18:25 -0400)]
clang-format xray InstrumentationMap.cpp
Vitaly Buka [Thu, 28 May 2020 22:36:17 +0000 (15:36 -0700)]
[NFC,StackSafety] Add test flag
Richard Smith [Thu, 28 May 2020 22:02:18 +0000 (15:02 -0700)]
Fix handling of default arguments in __attribute__((enable_if)).
We didn't properly build default argument expressions previously -- we
failed to build the wrapper CXXDefaultArgExpr node, which meant that
std::source_location misbehaved, and we didn't perform default argument
instantiation when necessary, which meant that dependent default
arguments in function templates didn't work at all.
Marius Brehler [Thu, 28 May 2020 22:31:28 +0000 (00:31 +0200)]
[mlir] Add test to check if standalone dialect is registered
Summary: Add a test to check if the standalone dialect is registered within standalone-opt. Similar to the mlir-opt commandline.mlir test.
Reviewers: Kayjukh, stephenneuendorffer
Reviewed By: Kayjukh
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, jurahul, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80764
Eric Christopher [Thu, 28 May 2020 21:54:49 +0000 (14:54 -0700)]
unsigned -> Register for readability.
Philip Reames [Thu, 28 May 2020 22:16:36 +0000 (15:16 -0700)]
[Tests] Update a few more statepoint tests
Starting to work through the hard ones now, progress likely to slow drammatically.
Craig Topper [Thu, 28 May 2020 22:10:29 +0000 (15:10 -0700)]
[X86] Fix a comment reference to registers R8L..R15L to use R8B..R15B like everywhere else. NFC
A new Intel SDM was released today that also fixes this issue in
some documentation.
Siva Chandra Reddy [Thu, 28 May 2020 21:57:36 +0000 (14:57 -0700)]
[libc][NFC][Obvious] Fix few header guards in src/threads.
Nicolas Vasilache [Thu, 28 May 2020 21:55:21 +0000 (17:55 -0400)]
[mlir][Vector] Fix vector.transfer alignment calculation
https://reviews.llvm.org/D79246 introduces alignment propagation for vector transfer operations. Unfortunately, the alignment calculation is incorrect and can result in crashes.
This revision fixes the calculation by using the natural alignment of the memref elemental type, instead of the resulting vector type.
If more alignment is desired, it can be done in 2 ways:
1. use a proper vector.type_cast to transform a memref<axbxcxdxf32> into a memref<axbxvector<cxdxf32>> giving a natural alignment of vector<cxdxf32>
2. add an alignment attribute to vector transfer operations and propagate it.
With this change the alignment in the relevant tests goes down from 128 to 4.
Lastly, a few minor cleanups are performed and the custom `isMinorIdentityMap` is deprecated.
Differential Revision: https://reviews.llvm.org/D80734
Siva Chandra Reddy [Thu, 28 May 2020 21:52:39 +0000 (14:52 -0700)]
[libc][NFC][Obvious] Remove line break from a CMake message.
The line break was giving an impression of something going wrong.
Christopher Tetreault [Thu, 28 May 2020 21:24:13 +0000 (14:24 -0700)]
[SVE] Eliminate calls to default-false VectorType::get() from mlir
Reviewers: efriedma, ftynse, c-rhodes, david-arm, rriddle
Reviewed By: ftynse
Subscribers: tschuett, rkruppe, psnobl, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80340
Arthur Eubanks [Thu, 28 May 2020 21:38:05 +0000 (14:38 -0700)]
Revert "Run Coverage pass before other *San passes under new pass manager, round 2"
This reverts commit
922fa2fce38b0bd97921b91ff1cdc57f18d3569c.
Philip Reames [Thu, 28 May 2020 21:34:47 +0000 (14:34 -0700)]
[Tests] Remove deopt operands from SafepointIRVerfier tests
This linter has nothing to do with deopt, and the operands had clearly been copied blindly from another source. Rather than migrate to deopt operand bundle, let's just simplify the tests.
Philip Reames [Thu, 28 May 2020 21:17:00 +0000 (14:17 -0700)]
[Tests] Switch a few statepoint tests to using operand bundles
We've started (D80598) the process of migrating away from the inline operand lists in statepoints to using explicit operand bundles. Update a few tests to reflect the new preference. More to come, these were simply the ones outside any obvious grouping.
Evgenii Stepanov [Thu, 28 May 2020 21:30:19 +0000 (14:30 -0700)]
[scudo] Fix deadlock in ScudoWrappersCTest.DisableForkEnable test.
pthread_cond_wait needs a loop around it to handle spurious wake ups,
as well as the case when signal runs before wait.
Vitaly Buka [Thu, 28 May 2020 21:25:44 +0000 (14:25 -0700)]
[NFC,StackSafety] clang-tidy warning fixes
Arthur Eubanks [Thu, 28 May 2020 06:12:36 +0000 (23:12 -0700)]
Run Coverage pass before other *San passes under new pass manager, round 2
Summary:
This was attempted once before in https://reviews.llvm.org/D79698, but
was reverted due to the coverage pass running in the wrong part of the
pipeline. This commit puts it in the same place as the other sanitizers.
This changes PassBuilder.OptimizerLastEPCallbacks to work on a
ModulePassManager instead of a FunctionPassManager. That is because
SanitizerCoverage cannot (easily) be split into a module pass and a
function pass like some of the other sanitizers since in its current
implementation it conditionally inserts module constructors based on
whether or not it successfully modified functions.
This fixes compiler-rt/test/msan/coverage-levels.cpp under the new pass
manager (last check-msan test).
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D80692
Christopher Tetreault [Thu, 28 May 2020 21:13:05 +0000 (14:13 -0700)]
[SVE] Eliminate calls to default-false VectorType::get() from Analysis
Reviewers: efriedma, fpetrogalli, kmclaughlin, sunfish
Reviewed By: fpetrogalli
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80324
Marius Brehler [Thu, 28 May 2020 19:34:44 +0000 (12:34 -0700)]
[mlir] Extend standalone example by standalone-translate
Extend the standalone by standalone-translate, based on mlir-translate.
Differential Revision: https://reviews.llvm.org/D80737
Stephen Neuendorffer [Thu, 28 May 2020 20:50:32 +0000 (13:50 -0700)]
[MLIR] Fix build when NVPTX is not enabled
In this case, neither target is selected, but there is still a dependence
on the MC library (through the TargetOptions.h include)
David Green [Thu, 28 May 2020 16:49:01 +0000 (17:49 +0100)]
[ARM] More tests for MVE LSR and float issues. NFC
Vedant Kumar [Wed, 27 May 2020 20:22:10 +0000 (13:22 -0700)]
[LiveDebugValues] Add cutoffs to avoid pathological behavior
Summary:
We received a report of LiveDebugValues consuming 25GB+ of RAM when
compiling code generated by Unity's IL2CPP scripting backend.
There's an initial 5GB spike due to repeatedly copying cached lists of
MachineBasicBlocks within the UserValueScopes members of VarLocs.
But the larger scaling issue arises due to the fact that prior to range
extension, there are 81K basic blocks and 156K DBG_VALUEs: given enough
memory, LiveDebugValues would insert 101 million MIs (I counted this by
incrementing a counter inside of VarLoc::BuildDbgValue).
It seems like LiveDebugValues would have to be rearchitected to support
this kind of input (we'd need some new represntation for DBG_VALUEs that
get inserted into ~every block via flushPendingLocs). OTOH, large globs
of auto-generated code are typically not debugged interactively.
So: add cutoffs to disable range extension when the input is too big. I
chose the cutoffs experimentally, erring on the conservative side. When
compiling a large collection of Apple software, range extension never
got disabled.
rdar://
63418929
Reviewers: aprantl, friss, jmorse, Orlando
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80662
Vedant Kumar [Wed, 27 May 2020 22:44:10 +0000 (15:44 -0700)]
[MachineVerifier] Verify that a DBG_VALUE has a debug location
Summary:
Verify that each DBG_VALUE has a debug location. This is required by
LiveDebugValues, and perhaps by other late passes.
There's an exception for tests: lots of tests use a two-operand form of
DBG_VALUE for convenience. There's no reason to prevent that.
This is an extension of D80665, but there's no dependency.
Reviewers: aprantl, jmorse, davide, chrisjackson
Subscribers: hiraditya, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80670
Vedant Kumar [Wed, 27 May 2020 20:13:13 +0000 (13:13 -0700)]
[MachineLICM] Assert that locations from debug insts are not lost
Summary:
Assert that MachineLICM does not move a debug instruction and then drop
its debug location. Later passes require each debug instruction to have
a location.
Testing: check-llvm, clang stage2 RelWithDebInfo build (x86_64)
Reviewers: aprantl, davide, chrisjackson, jmorse
Subscribers: hiraditya, asbirlea, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80665
Philip Reames [Thu, 28 May 2020 20:49:41 +0000 (13:49 -0700)]
[Statepoints] Sink routines for grabbing projections to GCStatepointInst [NFC]
Mechanical movement, nothing more.
Philip Reames [Thu, 28 May 2020 20:34:12 +0000 (13:34 -0700)]
[Statepoint] Sink actual_args and gc_args to GCStatepointInst [NFC]
These are the two operand sets which are expected to survive more than another week or so. Instead of bothering to update the deopt and gc-transition operands, we'll just wait until those are removed and delete the code.
For those following along, this is likely to be the last (major) change in this sequence for about a week. I want to wait until all of this has been merged downstream to ensure I haven't introduced any bugs (and migrate some downstream code to the new interfaces). Once that's done, we should be able to delete Statepoint/ImmutableStatepoint without too much work.
Philip Reames [Thu, 28 May 2020 19:31:49 +0000 (12:31 -0700)]
[Statepoint] Use iterate_range.empty [NFC]
Nemanja Ivanovic [Thu, 28 May 2020 20:48:05 +0000 (15:48 -0500)]
[Clang] Enable KF and KC mode for [_Complex] __float128
The headers provided with recent GNU toolchains for PPC have code that includes
typedefs such as:
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__)))
This patch allows clang to compile programs that contain
#include <math.h>
with -mfloat128 which it currently fails to compile.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=46068
Differential revision: https://reviews.llvm.org/D80374
Greg Clayton [Thu, 28 May 2020 20:29:48 +0000 (13:29 -0700)]
[lldb-vscode] Make it possible to run vsce package
Summary:
Running `vsce package` to package lldb-vscode as an installable .vsix file errors with:
```
ERROR Invalid publisher name 'llvm.org'. Expected the identifier of a publisher, not its human-friendly name.
```
This patch fixes the publisher name and bumps a required dependency so that `vsce package` succeeds.
Reviewers: clayborg
Reviewed By: clayborg
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D80569
Vitaly Buka [Thu, 28 May 2020 08:07:31 +0000 (01:07 -0700)]
[StackSafety] Lazy calculations
We are going to convert this into pure analysis, so
processing will be delayed up to the first safety request.
Vitaly Buka [Thu, 28 May 2020 20:01:02 +0000 (13:01 -0700)]
[NFC,StackSafety] Move internal offset calculation
Vitaly Buka [Thu, 28 May 2020 05:21:39 +0000 (22:21 -0700)]
[StackSafety] Don't run datafow on allocas
We need to process only parameters. Allocas access can be calculated
afterwards.
Also don't create fake function for aliases and just resolve them on
initialization.
Vitaly Buka [Thu, 28 May 2020 03:35:06 +0000 (20:35 -0700)]
[StackSafety] Remove SetMetadata parameter
Jonas Devlieghere [Thu, 28 May 2020 20:06:44 +0000 (13:06 -0700)]
[Docs] Correct description of lldbinit behavior
Jim pointed out that "every time somebody has touched the documentation
on startup files they have stated that we source the application one and
then the global one, even though in actual fact we’ve never done that."
Indeed, when we read the application specific .lldbinit file, the global
one is not read. This patch updates the man page to reflect that.
Vy Nguyen [Thu, 28 May 2020 04:33:13 +0000 (00:33 -0400)]
add isAtPosition narrowing matcher for parmVarDecl
Differential Revision: https://reviews.llvm.org/D80603
Eduardo Caldas [Thu, 28 May 2020 16:28:36 +0000 (18:28 +0200)]
Improve test infrastructure in SyntaxTree
Summary:
* Test if the code sourcing the SyntaxTree compiles
* Output compiler errors and warnings to err
* Fix tests with code that did not compile
Reviewers: gribozavr2
Reviewed By: gribozavr2
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80731
Arthur Eubanks [Thu, 28 May 2020 17:27:52 +0000 (10:27 -0700)]
Add tests for preallocated + musttail
Summary:
Follow-up to https://reviews.llvm.org/D80581.
Turns out the codegen part already worked, so only needed to add tests.
I manually verified that in these tests the generated code for inalloca
and preallocated were identical.
Reviewers: efriedma, hans
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80742
aartbik [Thu, 28 May 2020 18:04:02 +0000 (11:04 -0700)]
[llvm] [MatrixIntrinsics] Add row-major support for llvm.matrix.transpose
Summary:
Only column-major was supported so far. This adds row-major support as well.
Note that we probably also want very efficient SIMD implementations for the
various target platforms.
Bug:
https://bugs.llvm.org/show_bug.cgi?id=46085
Reviewers: nicolasvasilache, reidtatge, bkramer, fhahn, ftynse, andydavis1, craig.topper, dcaballe, mehdi_amini, anemet
Reviewed By: fhahn
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80673
Whitney Tsang [Thu, 28 May 2020 19:08:07 +0000 (19:08 +0000)]
Revert "[LoopUnroll] Support loops with exiting block that is neither header nor"
This reverts commit
281058226587d8c70172ff0fb1e55d58876da229.
Revert until
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/7334
is resolved.
Sjoerd Meijer [Thu, 28 May 2020 18:49:12 +0000 (19:49 +0100)]
[AArch64] Add native CPU detection for Neoverse N1
Map the CPU ID value 0xd0c to "neoverse-n1".
Patch by James Greenhalgh.
Differential Revision: https://reviews.llvm.org/D80736
Stanislav Mekhanoshin [Thu, 28 May 2020 18:36:36 +0000 (11:36 -0700)]
AMDGPU/GlobalISel: precommit extractelement test. NFC.
Philip Reames [Thu, 28 May 2020 18:28:58 +0000 (11:28 -0700)]
[Statepoint] Convert a few more isStatepoint calls to idiomatic isa/cast
I'd apparently only grepped in the lib directories and missed a few used in the Statepoint header itself. Beyond simple mechanical cleanup, changed the type of one routine to reflect the fact it also returns a statepoint.
Matt Arsenault [Mon, 18 May 2020 15:32:46 +0000 (11:32 -0400)]
AMDGPU: Handle rewriting ptrmask for more address spaces
If this mask only clears bits in the low 32-bit half of a flat
pointer, these bits are always preserved in the result address
space. If the high bits are modified, they may need to be preserved
for some kind of user pointer tagging.
Louis Dionne [Thu, 28 May 2020 18:28:09 +0000 (14:28 -0400)]
[libc++] NFC: Remove outdated numbering in <bit> synopsis
Whitney Tsang [Thu, 28 May 2020 18:23:56 +0000 (18:23 +0000)]
[LoopUnroll] Support loops with exiting block that is neither header nor
latch.
Summary: Remove the limitation in LoopUnrollPass that exiting block must
be either header or latch.
Reviewer: dmgreen, jdoerfert, Meinersbur, kbarton, bmahjour, etiotto,
fhahn, efriedma
Reviewed By: etiotto, fhahn, efriedma
Subscribers: efriedma, lkail, xbolva00, hiraditya, zzheng, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D80477
Matt Arsenault [Wed, 6 May 2020 20:43:33 +0000 (16:43 -0400)]
AMDGPU: Add intrinsic for s_setreg
This will be more useful with fenv access implemented.
Anthony Steinhauser [Thu, 28 May 2020 18:19:20 +0000 (11:19 -0700)]
[libc] Fixing the build command for benchmarks.
Building libc without clang fails with:
CMake Error at /home/asteinhauser/llvm-project/libc/CMakeLists.txt:49 (message):
'clang' and 'clang-tools-extra' are required in LLVM_ENABLE_PROJECTS to
lint llvm-libc. The linting step performs important checks to help prevent
the introduction of subtle bugs, but it may increase build times.
Reviewers: sivachandra
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D80495
Tobias Hieta [Thu, 28 May 2020 18:04:38 +0000 (21:04 +0300)]
[clang] Avoid linking libdl unless needed
Differential Revision: https://reviews.llvm.org/D80492
MaheshRavishankar [Thu, 28 May 2020 17:19:47 +0000 (10:19 -0700)]
[mlir][Linalg] Add pass to remove unit-extent dims from tensor
operands of Generic ops.
Unit-extent dimensions are typically used for achieving broadcasting
behavior. The pattern added (along with canonicalization patterns
added previously) removes the use of unit-extent dimensions, and
instead uses a more canonical representation of the computation. This
new pattern is not added as a canonicalization for now since it
entails adding additional reshape operations. A pass is added to
exercise these patterns, along with an API entry to populate a
patterns list with these patterns.
Differential Revision: https://reviews.llvm.org/D79766
Alex Zinenko [Thu, 28 May 2020 16:57:39 +0000 (18:57 +0200)]
[mlir][GPU] Link relevant LLVM components in GPUCommon instead of test
D80142 restructured MLIR-to-GPU-binary conversion to support multiple
targets. It also modified cmake files to link relevant LLVM components
in test/lib, which broke shared-library builds, and likely made the
conversions unusable outside mlir-opt (or other tools that link in test
library targets). Link these components to GPUCommon instead.
Differential Revision: https://reviews.llvm.org/D80739
Philip Reames [Thu, 28 May 2020 17:45:07 +0000 (10:45 -0700)]
[Statepoint] Sink logic about actual callee into GCStatepointInst
Sinking logic around actual callee from Statepoint to GCStatepointInst. While doing so, adjust naming to be consistent about refering to "actual" callee and follow precedent on naming from CallBase otherwise.
Use the result to simplify one consumer. This is mostly just to ensure the new code is exercised, but is also a helpful cleanup on it's own.
Jonas Devlieghere [Thu, 28 May 2020 17:39:45 +0000 (10:39 -0700)]
[lldb/Reproducers] Add top-level-target check-lldb-reproducers
This adds a new target `check-lldb-reproducers` that replaces the old
`check-lldb-repro`. The latter would only run the shell tests, while
`check-lldb-reproducers` includes the API tests as well. The new target
will be used on GreenDragon.
It's still possible to run just the shell tests with reproducers,
although now that requires crafting the lit invocation yourself. The
parameters haven't changed and are the shame for the API and shell
tests:
--param lldb-run-with-repro=capture
--param lldb-run-with-repro=replay
This patch also updates the reproducer documentation.