Max Kazantsev [Tue, 22 Sep 2020 11:44:18 +0000 (18:44 +0700)]
[SCEV] Handle `less` predicates for FoundPred = NE
Currently these predicates are ignored, yet their handling is
pretty simple. I could not find a single test where it would
actually change something, but it's only because isImpliedCondOperands
is not smart enough to prove it further on. Yet the situation when
we come there with `less` predicate is pretty common.
Differential Revision: https://reviews.llvm.org/D87890
Reviewed By: fhahn
Meera Nakrani [Tue, 22 Sep 2020 11:54:10 +0000 (11:54 +0000)]
[ARM][TTI] Prevents constants in a min(max) or max(min) pattern from being hoisted when in a loop
Changes TTI function getIntImmCostInst to take an additional Instruction parameter,
which enables us to be able to check it is part of a min(max())/max(min()) pattern that will match SSAT.
We can then mark the constant used as free to prevent it being hoisted so SSAT can still be generated.
Required minor changes in some non-ARM backends to allow for the optional parameter to be included.
Differential Revision: https://reviews.llvm.org/D87457
Raphael Isemann [Tue, 22 Sep 2020 09:16:37 +0000 (11:16 +0200)]
[lldb] Ignore certain Clang type sugar when creating the type name
Clang has some type sugar that only serves as a way to preserve the way a user
has typed a certain type in the source code. These types are currently not
unwrapped when we query the type name for a Clang type, which means that this
type sugar actually influences what formatters are picked for a certain type.
Currently if a user decides to reference a type by doing `::GlobalDecl Var = 3;`,
the type formatter for `GlobalDecl` will not be used (as the type sugar
around the type gives it the name `::GlobalDecl`. The same goes for other ways
to spell out a type such as `auto` etc.
With this patch most of this type sugar gets stripped when the full type name is
calculated. Typedefs are not getting desugared as that seems counterproductive.
I also don't desugar atomic types as that's technically not type sugar.
Reviewed By: jarin
Differential Revision: https://reviews.llvm.org/D87481
Simon Pilgrim [Tue, 22 Sep 2020 11:15:23 +0000 (12:15 +0100)]
Revert rGf835779160ec303 "[APFloat] multiplySignificand - always pass IEEEFloat as const reference. NFCI."
This reverts commit
f835779160ec30340676918915526615a07e826e while I investigate some buildbot failures
Stefan Pintilie [Fri, 18 Sep 2020 18:08:46 +0000 (13:08 -0500)]
[PowerPC] Add support for R_PPC64_GOT_TPREL_PCREL34 used in TLS Initial Exec
Add Thread Local Storage Initial Exec support to LLD.
This patch adds the computation for the relocations as well as the relaxation from Initial Exec to Local Exec.
Initial Exec:
```
pld r9, x@got@tprel@pcrel
add r9, r9, x@tls@pcrel
```
or
```
pld r9, x@got@tprel@pcrel
lbzx r10, r9, x@tls@pcrel
```
Note that @tls@pcrel is actually encoded as R_PPC64_TLS with a one byte displacement.
For the above examples relaxing Intitial Exec to Local Exec:
```
paddi r9, r9, x@tprel
nop
```
or
```
paddi r9, r13, x@tprel
lbz r10, 0(r9)
```
Reviewed By: nemanjai, MaskRay, #powerpc
Differential Revision: https://reviews.llvm.org/D86893
Simon Pilgrim [Mon, 21 Sep 2020 19:11:36 +0000 (20:11 +0100)]
[APFloat] multiplySignificand - always pass IEEEFloat as const reference. NFCI.
We do this in all other cases.
Esme-Yi [Tue, 22 Sep 2020 10:25:02 +0000 (10:25 +0000)]
[NFC][PowerPC]Add tests for multiply-by-constant.
Frederik Gossen [Tue, 22 Sep 2020 10:03:43 +0000 (10:03 +0000)]
[MLIR][Linalg] Fix assertion in dependency analysis
The assertion falsely expected ranked memrefs only. Now both, ranked and
unranked memrefs are allowed.
Differential Revision: https://reviews.llvm.org/D88080
Max Kazantsev [Tue, 22 Sep 2020 10:03:52 +0000 (17:03 +0700)]
[SCEV] Support unsigned predicates in isKnownPredicateViaNoOverflow
SCEV should be able to prove facts like `x <u x+1<nuw>`.
Differential Revision: https://reviews.llvm.org/D88015
Reviewed By: lebedev.ri
Thomas Joerg [Tue, 22 Sep 2020 10:00:29 +0000 (12:00 +0200)]
Revert "Implement a new kind of Pass: dynamic pass pipeline"
This reverts commit
385c3f43fceba227be2e4dce84a59075733541c1.
Test mlir/test/Pass:dynamic-pipeline-fail-on-parent.mlir.test fails
when run with ASAN:
ERROR: AddressSanitizer: stack-use-after-scope on address ...
Reviewed By: bkramer, pifon2a
Differential Revision: https://reviews.llvm.org/D88079
Jay Foad [Wed, 16 Sep 2020 15:44:31 +0000 (16:44 +0100)]
[AMDGPU] More codegen patterns for v2i16/v2f16 build_vector
It's simpler to do this at codegen time than to do ad-hoc constant
folding of machine instructions in SIFoldOperands.
Differential Revision: https://reviews.llvm.org/D88028
Sam Parker [Tue, 22 Sep 2020 08:22:11 +0000 (09:22 +0100)]
[ARM] Improve VPT predicate tracking
The VPTBlock has been modified to track the 'global' state of the
VPR, as well as the state for each block. Each object now just holds
a list of instructions that makeup the block, while static structures
hold the predicate information. This enables global access for
querying how both a VPT block and individual instructions are
predicated. These changes now allow us, again, to handle more
complicated cases where multiple instructions build a predicate
and/or where the same predicate in used in multiple blocks.
It doesn't, however, get us back to before the tracking was 'fixed'
as some extra logic will be required to properly handle VPT
instructions. Currently a VPT could be effectively predicated because
of it's inputs, but the existing logic will not detect that and so
will refuse to perform the transformation. This can be seen in
remat-vctp.ll test where we still don't perform the transform.
Differential Revision: https://reviews.llvm.org/D87681
Muhammad Omair Javaid [Tue, 22 Sep 2020 09:20:10 +0000 (14:20 +0500)]
Revert "Reapply Revert "RegAllocFast: Rewrite and improve""
This reverts commit
55f9f87da2c2ad791b9e62cccb1c035e037444fa.
Breaks following buildbots:
http://lab.llvm.org:8011/builders/lldb-arm-ubuntu/builds/4306
http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/9154
Eduardo Caldas [Mon, 21 Sep 2020 17:05:41 +0000 (17:05 +0000)]
[SyntaxTree][Synthesis] Fix: `deepCopy` -> `deepCopyExpandingMacros`.
There can be Macros that are tagged with `modifiable`. Thus verifying
`canModifyAllDescendants` is not sufficient to avoid macros when deep
copying.
We think the `TokenBuffer` could inform us whether a `Token` comes from
a macro. We'll look into that when we can surface this information
easily, for instance in unit tests for `ComputeReplacements`.
Differential Revision: https://reviews.llvm.org/D88034
Georgii Rymar [Fri, 18 Sep 2020 12:21:54 +0000 (15:21 +0300)]
[llvm-readobj/elf] - Stop reporting invalid extended indexes in warnings for unnamed section symbols.
We have an issue with `getFullSymbolName`: it assumes that the symbol passed is
always in the `.symtab`, what is wrong. We might calculate and report a wrong index currently.
I've added a test case revealing that.
This patch adds the "symbol index" argument to `getFullSymbolName` signature,
what fixes the issue.
Differential revision: https://reviews.llvm.org/D87899
Nicolas Vasilache [Mon, 21 Sep 2020 19:30:42 +0000 (15:30 -0400)]
[mlir][Linalg] Uniformize linalg.generic with named ops.
This revision allows representing a reduction at the level of linalg on tensors for generic ops by uniformizing with the named ops approach.
Eugene Zhulenev [Mon, 21 Sep 2020 19:28:30 +0000 (15:28 -0400)]
[MLIR] Add subf and rsqrt EDSC intrinsics
[MLIR] Add subf and rsqrt EDSC intrinsics
NOTE: Please merge it when ready.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D88039
Sam Parker [Mon, 21 Sep 2020 10:34:06 +0000 (11:34 +0100)]
[ARM] Remove MVEDomain from VLDR/STR of P0
Remove the domain from the instructions and create a shouldInspect
helper for LowOverheadLoops which queries it or a vpr operand.
Differential Revision: https://reviews.llvm.org/D87900
Sam Parker [Wed, 16 Sep 2020 13:30:47 +0000 (14:30 +0100)]
[ARM] VPT validForTailPredication
Mark all VPT instructions as valid.
Differential Revision: https://reviews.llvm.org/D87759
David Spickett [Mon, 21 Sep 2020 08:44:58 +0000 (09:44 +0100)]
[AArch64] Fix return type of Neon scalar comparison intrinsics
The following should have unsigned return types
but were signed:
vceqd_s64 vceqzd_s64 vcged_s64 vcgezd_s64
vcgtd_s64 vcgtzd_s64 vcled_s64 vclezd_s64
vcltd_s64 vcltzd_s64 vtstd_s64
See https://developer.arm.com/documentation/ihi0073/latest
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D88009
Martin Storsjö [Sun, 20 Sep 2020 20:19:12 +0000 (23:19 +0300)]
Reapply: [clang-cl] Always interpret the LIB env var as separated with semicolons
When cross compiling with clang-cl, clang splits the INCLUDE env
variable around semicolons (clang/lib/Driver/ToolChains/MSVC.cpp,
MSVCToolChain::AddClangSystemIncludeArgs) and lld splits the
LIB variable similarly (lld/COFF/Driver.cpp,
LinkerDriver::addLibSearchPaths). Therefore, the consensus for
cross compilation with clang-cl and lld-link seems to be to use
semicolons, despite path lists normally being separated by colons
on unix and EnvPathSeparator being set to that.
Therefore, handle the LIB variable similarly in Clang, when
handling lib file arguments when driving linking via Clang.
This fixes commands like "clang-cl test.c -Fetest.exe kernel32.lib" in
a cross compilation setting. Normally, most users call (lld-)link
directly, but meson happens to use this command syntax for
has_function() tests.
Reapply: Change Program.h to define procid_t as ::pid_t. When included
in lldb/unittests/Host/NativeProcessProtocolTest.cpp, it is included
after an lldb namespace containing an lldb::pid_t typedef, followed
later by a "using namespace lldb;". Previously, Program.h wasn't
included in this translation unit, but now it ends up included
transitively from Process.h.
Differential Revision: https://reviews.llvm.org/D88002
Petr Hosek [Tue, 22 Sep 2020 07:24:15 +0000 (00:24 -0700)]
Revert "[CMake] Use find_dependency in LLVMConfig.cmake"
This reverts commit
247c4fc50720ed48db2464bbe59839eedbe16794 as it
broke the runtime build.
LLVM GN Syncbot [Tue, 22 Sep 2020 06:47:54 +0000 (06:47 +0000)]
[gn build] Port
af582c9b0f3
Eduardo Caldas [Wed, 16 Sep 2020 08:03:03 +0000 (08:03 +0000)]
[SyntaxTree] Test `findFirstLeaf` and `findLastLeaf`
* Introduce `TreeTest.cpp` to unit test `Tree.h`
* Add `generateAllTreesWithShape` to generating test cases
* Add tests for `findFirstLeaf` and `findLastLeaf`
* Fix implementations of `findFirstLeaf` and `findLastLeaf` that had
been broken when empty `Tree` were present.
Differential Revision: https://reviews.llvm.org/D87779
Eduardo Caldas [Mon, 21 Sep 2020 14:45:13 +0000 (14:45 +0000)]
[SyntaxTree][Nit] Take `ArrayRef` instead of `std::vector` as argument for `createTree`
I also assured that there are no other functions unnecessarily using std::vector as argument.
Differential Revision: https://reviews.llvm.org/D88024
Petr Hosek [Tue, 22 Sep 2020 05:31:05 +0000 (22:31 -0700)]
[CMake] Use append for CMAKE_REQUIRED_* variables
This ensures that required includes and libraries such as -lm that
were added earlier aren't overwritten.
Differential Revision: https://reviews.llvm.org/D88068
Petr Hosek [Tue, 22 Sep 2020 05:37:39 +0000 (22:37 -0700)]
[CMake] Use find_dependency in LLVMConfig.cmake
This prefered over find_package as find_dependency forwards the correct
parameters for QUIET and REQUIRED to find_package.
Differential Revision: https://reviews.llvm.org/D88069
Nathan Ridge [Tue, 8 Sep 2020 00:10:45 +0000 (20:10 -0400)]
[clang] Traverse init-captures while indexing
Fixes https://github.com/clangd/clangd/issues/496
Differential Revision: https://reviews.llvm.org/D87257
Nathan Ridge [Sun, 20 Sep 2020 01:25:08 +0000 (21:25 -0400)]
[clangd] Link libclangdSupport into clangd-index-server
Fixes https://github.com/clangd/clangd/issues/534
Differential Revision: https://reviews.llvm.org/D87979
Arthur Eubanks [Tue, 1 Sep 2020 22:55:05 +0000 (15:55 -0700)]
[AlwaysInliner] Emit optimization remarks
To match the normal inliner in preparation for https://reviews.llvm.org/D86988.
Also change a FIXME to an assert.
Reviewed By: davidxl
Differential Revision: https://reviews.llvm.org/D88067
Ahmed S. Taei [Wed, 16 Sep 2020 18:11:17 +0000 (18:11 +0000)]
Reorder linalg.conv indexing_maps loop order
Change the indexing map to iterate over the (b, x0, x1, z0, z1, q, k) instead of (b, x0, x1, k, q, z0, z1) to evaluate the convolution expression:
Y[b, x0, x1, k] = sum(W[z0, z1, q, k] * X[b, x0 + z0, x1 + z1, q], z0, z1, q)
This allows llvm auto vectorize to work and has better locality resulting significant performance improvments
Differential Revision: https://reviews.llvm.org/D87781
Dominic Chen [Wed, 9 Sep 2020 01:17:05 +0000 (21:17 -0400)]
[WebAssembly][MC] Fix computation of relative symbol offset
For relative symbols, add its offset when computing relocation value.
Also, warn on unsupported absolute symbols.
Differential Revision: https://reviews.llvm.org/D87407
Serguei Katkov [Mon, 21 Sep 2020 09:49:52 +0000 (16:49 +0700)]
[LoopUnswitch] Trivial simplification: remove trivial dead condition after unswitch
Non trivial loop unswitch can keep the dead condition instruction.
CL adds trivial dead code elimination for unused condition.
Reviewers: asbirlea, aqjune, fhahn, DaniilSuchkov, reames
Reviewed By: asbirlea
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D88014
Fangrui Song [Tue, 22 Sep 2020 01:34:49 +0000 (18:34 -0700)]
[mlir] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off build after D85869
Mehdi Amini [Tue, 22 Sep 2020 00:51:27 +0000 (00:51 +0000)]
Implement a new kind of Pass: dynamic pass pipeline
Instead of performing a transformation, such pass yields a new pass pipeline
to run on the currently visited operation.
This feature can be used for example to implement a sub-pipeline that
would run only on an operation with specific attributes. Another example
would be to compute a cost model and dynamic schedule a pipeline based
on the result of this analysis.
Discussion: https://llvm.discourse.group/t/rfc-dynamic-pass-pipeline/1637
Reviewed By: silvas
Differential Revision: https://reviews.llvm.org/D86392
Fangrui Song [Tue, 22 Sep 2020 01:11:03 +0000 (18:11 -0700)]
[lldb] Delete two unneeded <regex>
Arthur Eubanks [Mon, 21 Sep 2020 23:52:07 +0000 (16:52 -0700)]
[UnifyLoopExits] Pin tests with -unify-loop-exits to legacy PM
The pass is not used in tree, so no reason to port it.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D88058
Arthur Eubanks [Wed, 16 Sep 2020 04:10:22 +0000 (21:10 -0700)]
[Delinearization][NewPM] Port delinearization to NPM
Also make tests in Analysis/Delinearization work under NPM.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D87741
Arthur Eubanks [Thu, 17 Sep 2020 20:51:01 +0000 (13:51 -0700)]
[NewPM] Pin -lazy-branch-prob and -lazy-block-freq tests to legacy PM
NPM passes just use the normal versions of these analyses instead.
Also pin any tests with -analyze to legacy PM.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D87857
Fangrui Song [Tue, 22 Sep 2020 00:41:59 +0000 (17:41 -0700)]
Include sstream after D85705
Louis Dionne [Tue, 22 Sep 2020 00:28:14 +0000 (20:28 -0400)]
[libc++] Fix copy/paste error that broke a test
Jim Ingham [Tue, 22 Sep 2020 00:26:39 +0000 (17:26 -0700)]
Fix reporting the lack of global variables in "target var".
There was a little thinko which meant when stopped in a frame with
debug information but whose CU didn't have any global variables we
report:
no debug info for frame <N>
This patch fixes that error message to say the intended:
no global variables in current compile unit
<rdar://problem/
69086361>
Fangrui Song [Tue, 22 Sep 2020 00:18:26 +0000 (17:18 -0700)]
Revert D71539 "Recommit "[SCEV] Look through single value PHIs.""
This reverts commit
11dccf8d3aa5d55210f8b886fb21926c7a8353ca.
A bootstrapped clang crashes (due to ArrayRef::front called on an empty
ArrayRef) when compiling some files. Very strangely, this only reproduces with
modules.
```
13 0x0000564d3349e968 llvm::ArrayRef<llvm::BasicBlock*>::front() const /proc/self/cwd/llvm/include/llvm/ADT/ArrayRef.h:160:7
14 0x0000564d3349e896 llvm::LoopBase<llvm::BasicBlock, llvm::Loop>::getHeader() const /proc/self/cwd/llvm/include/llvm/Analysis/LoopInfo.h:104:50
15 0x0000564d3349fd9d llvm::LoopBase<llvm::BasicBlock, llvm::Loop>::getLoopLatch() const /proc/self/cwd/llvm/include/llvm/Analysis/LoopInfoImpl.h:210:11
16 0x0000564d33593c8a llvm::ScalarEvolution::computeBackedgeTakenCount(llvm::Loop const*, bool) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:6933:15
17 0x0000564d33592ebc llvm::ScalarEvolution::getBackedgeTakenInfo(llvm::Loop const*) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:0:30
18 0x0000564d33593a54 llvm::ScalarEvolution::getBackedgeTakenCount(llvm::Loop const*, llvm::ScalarEvolution::ExitCountKind) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:6487:36
19 0x0000564d32be2402 llvm::ScalarEvolution::getConstantMaxBackedgeTakenCount(llvm::Loop const*) /proc/self/cwd/llvm/include/llvm/Analysis/ScalarEvolution.h:768:5
20 0x0000564d33590807 llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:5495:19
21 0x0000564d320abab7 llvm::ScalarEvolution::getSignedRange(llvm::SCEV const*) /proc/self/cwd/llvm/include/llvm/Analysis/ScalarEvolution.h:840:12
22 0x0000564d335a03aa llvm::ScalarEvolution::isKnownPredicateViaConstantRanges(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:9239:60
23 0x0000564d33586a80 llvm::ScalarEvolution::isKnownViaNonRecursiveReasoning(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*) /proc/self/cwd/llvm/lib/Analysis/ScalarEvolution.cpp:10284:60
```
Louis Dionne [Wed, 15 Jul 2020 15:26:20 +0000 (11:26 -0400)]
[libc++] Fix failures when running the test suite without RTTI
Louis Dionne [Mon, 21 Sep 2020 20:31:38 +0000 (16:31 -0400)]
NFC: Add whitespace-changing revisions to .git-blame-ignore-revs
Walter Erquinigo [Tue, 18 Aug 2020 00:21:52 +0000 (17:21 -0700)]
Add a "Trace" plug-in to LLDB to add process trace support in stages.
This is the first in a series of patches that will adds a new processor trace plug-in to LLDB.
The idea for this first patch to to add the plug-in interface with simple commands for the trace files that can "load" and "dump" the trace information. We can test the functionality and ensure people are happy with the way things are done and how things are organized before moving on to adding more functionality.
Processor trace information can be view in a few different ways:
- post mortem where a trace is saved off that can be viewed later in the debugger
- gathered while a process is running and allow the user to step back in time (with no variables, memory or registers) to see how each thread arrived at where it is currently stopped.
This patch attempts to start with the first solution of loading a trace file after the fact. The idea is that we will use a JSON file to load the trace information. JSON allows us to specify information about the trace like:
- plug-in name in LLDB
- path to trace file
- shared library load information so we can re-create a target and symbolicate the information in the trace
- any other info that the trace plug-in will need to be able to successfully parse the trace information
- cpu type
- version info
- ???
A new "trace" command was added at the top level of the LLDB commmands:
- "trace load"
- "trace dump"
I did this because if we load trace information we don't need to have a process and we might end up creating a new target for the trace information that will become active. If anyone has any input on where this would be better suited, please let me know. Walter Erquinigo will end up filling in the Intel PT specific plug-in so that it works and is tested once we can agree that the direction of this patch is the correct one, so please feel free to chime in with ideas on comments!
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D85705
antonio-cortes-perez [Mon, 21 Sep 2020 23:48:52 +0000 (16:48 -0700)]
[docs] Update ExtendingLLVM.rst
Updated file paths and function signatures in section
"Adding a new type".
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D88049
Krzysztof Parzyszek [Tue, 1 Sep 2020 22:31:12 +0000 (17:31 -0500)]
[EarlyCSE] Handle masked loads and stores
Extend the handling of memory intrinsics to also include non-
target-specific intrinsics, in particular masked loads and stores.
Invent "isHandledNonTargetIntrinsic" to distinguish between intrin-
sics that should be handled natively from intrinsics that can be
passed to TTI.
Add code that handles masked loads and stores and update the
testcase to reflect the results.
Differential Revision: https://reviews.llvm.org/D87340
Arthur Eubanks [Fri, 18 Sep 2020 19:27:28 +0000 (12:27 -0700)]
[NewPM] Support -disable-simplify-libcall/-disable-builtin in NPM opt
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D87932
Diego Caballero [Mon, 21 Sep 2020 22:30:02 +0000 (15:30 -0700)]
[MLIR][Affine][VectorOps] Utility to vectorize loop nest using strategy
This patch adds a utility based on SuperVectorizer to vectorize an
affine loop nest using a given vectorization strategy. This strategy allows
targeting specific loops for vectorization instead of relying of the
SuperVectorizer analysis to choose the right loops to vectorize.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D85869
Arthur Eubanks [Tue, 15 Sep 2020 20:03:05 +0000 (13:03 -0700)]
[SimplifyCFG] Override options in default constructor
SimplifyCFG's options should always be overridden by command line flags,
but they mistakenly weren't in the default constructor.
Reviewed By: ychen
Differential Revision: https://reviews.llvm.org/D87718
Evandro Menezes [Wed, 5 Aug 2020 21:51:05 +0000 (16:51 -0500)]
[RISCV] Do not mandate scheduling for CSR instructions
Scheduling information is of little value when they may disrupt the
pipeline. This patch allows omitting the scheduling information for CSR
instructions while still setting `SchedMachineModel::CompleteModel`. For
specific cases, any scheduling information added will be used by the
scheduler.
Differential revision: https://reviews.llvm.org/D85366
Kazu Hirata [Mon, 21 Sep 2020 23:23:49 +0000 (16:23 -0700)]
[llvm] Fix comment typos. NFC.
Jordan Rupprecht [Mon, 21 Sep 2020 23:19:28 +0000 (16:19 -0700)]
[lldb/test] Clean up version checking.
A few fixes while trying to figure out why tests are being skipped for arsenm:
- We check `$compiler -v`, but `-v` is `--verbose`, not `--version`. Use the long flag name.
- We check all lines matching `version ...`, but we should exit early for the first version string we see (which should be the main one). I'm not sure if this is the issue, but perhaps this is causing some users to skip some tests if another "version ..." is showing up later.
- Having `\.` in a python string is triggering pylint warnings, because it should be escaped as a regex string, e.g. `r'\.' However, `.` in a character class does not need to be escaped, as it matches only a literal `.` in that context.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D88051
Kazu Hirata [Mon, 21 Sep 2020 23:12:55 +0000 (16:12 -0700)]
Fix comment typos. NFC.
Amara Emerson [Mon, 21 Sep 2020 22:28:04 +0000 (15:28 -0700)]
[AArch64][GlobalISel] Merge selection of vector-vector G_ASHR/G_LSHR and support more cases.
The vector-immediate cases are handled elsewhere in an earlier commit.
Amara Emerson [Mon, 21 Sep 2020 22:03:29 +0000 (15:03 -0700)]
[AArch64][GlobalISel] Add a post-legalize combine for lowering vector-immediate G_ASHR/G_LSHR.
In order to select the immediate forms using the imported patterns, we need to
lower them into new G_VASHR/G_VLSHR target generic ops. Add a combine to do this
matching build_vector of constant operands.
With this, we get selection for free.
Jacques Pienaar [Mon, 21 Sep 2020 22:50:48 +0000 (15:50 -0700)]
[mlir] Add tutorial index.md pages
Sets the content for the section entry pages Hugo side.
Differential Revision: https://reviews.llvm.org/D87969
Amara Emerson [Mon, 21 Sep 2020 18:17:53 +0000 (11:17 -0700)]
[AArch64][GlobalISel] Make <4 x s16> G_ASHR and G_LSHR legal.
Selection support for these is coming up.
Richard Smith [Mon, 21 Sep 2020 21:52:06 +0000 (14:52 -0700)]
Don't build a StringLiteral expression with reference type when
performing list-initialization of a char array reference from a braced
string literal of a smaller size.
Mircea Trofin [Mon, 21 Sep 2020 21:27:23 +0000 (14:27 -0700)]
[NFC][regalloc] Use reverse iterator ranges for improved readability
Differential Revision: https://reviews.llvm.org/D88047
shafik [Mon, 21 Sep 2020 21:55:33 +0000 (14:55 -0700)]
[ASTImporter] Modifying ImportDeclContext(...) to ensure that we also handle the case when the FieldDecl is an ArrayType whose ElementType is a RecordDecl
When we fixed ImportDeclContext(...) in D71378 to make sure we complete each
FieldDecl of a RecordDecl when we are importing the definition we missed the
case where a FeildDecl was an ArrayType whose ElementType is a record.
This fix was motivated by a codegen crash during LLDB expression parsing. Since
we were not importing the definition we were crashing during layout which
required all the records be defined.
Differential Revision: https://reviews.llvm.org/D86660
Martin Storsjö [Mon, 21 Sep 2020 21:10:07 +0000 (00:10 +0300)]
Revert "[clang-cl] Always interpret the LIB env var as separated with semicolons"
This reverts commit
4d85444b317a00a3e15da63cdb693d272c99a0cc.
This commit broke building lldb's NativeProcessProtocolTest.cpp,
with errors like these:
In file included from include/llvm/Support/Process.h:32:0,
from tools/lldb/unittests/Host/NativeProcessProtocolTest.cpp:12:
include/llvm/Support/Program.h:39:11: error: reference to ‘pid_t’ is ambiguous
typedef pid_t procid_t;
/usr/include/sched.h:38:17: note: candidates are: typedef __pid_t pid_t
typedef __pid_t pid_t;
tools/lldb/include/lldb/lldb-types.h:85:18: note: typedef uint64_t lldb::pid_t
typedef uint64_t pid_t;
Krzysztof Parzyszek [Tue, 1 Sep 2020 22:31:12 +0000 (17:31 -0500)]
[EarlyCSE] Small refactoring changes, NFC
1. Store intrinsic ID in ParseMemoryInst instead of a boolean flag
"IsTargetMemInst". This will make it easier to add support for
target-independent intrinsics.
2. Extract the complex multiline conditions from EarlyCSE::processNode
into a new function "getMatchingValue".
Differential Revision: https://reviews.llvm.org/D87691
Baptiste Saleil [Mon, 21 Sep 2020 21:03:34 +0000 (16:03 -0500)]
[PowerPC] Remove unnecessary patterns and types
These patterns and type uses were added by mistake by commit
1372e23c7d4b25fd23689842246e66f70c949b46
Pengxuan Zheng [Mon, 21 Sep 2020 20:43:42 +0000 (13:43 -0700)]
[Hexagon] Make HexagonVLCR compatibile with New PM
The patch modifies HexagonVectorLoopCarriedReuse pass to make it compatible with both Legacy Pass Manager through HexagonVectorLoopCarriedReuseLegacyPass and with New Pass Manager through HexagonVectorLoopCarriedReusePass.
Reviewed By: pzheng
Differential Revision: https://reviews.llvm.org/D86955
Martin Storsjö [Thu, 10 Sep 2020 10:33:00 +0000 (13:33 +0300)]
[CodeGen] [WinException] Only produce handler data at the end of the function if needed
If we are going to write handler data (that is written as variable
length data following after the unwind info in .xdata), we need to
emit the handler data immediately, but for cases where no such
info is going to be written, skip emitting it right away. (Unwind
info for all remaining functions that hasn't gotten it emitted
directly is emitted at the end.)
This does slightly change the ordering of sections (triggering a
bunch of updates to DebugInfo/COFF tests), but the change should be
benign.
This also matches GCC's assembly output, which doesn't output
.seh_handlerdata unless it actually is needed.
For ARM64, the unwind info can be packed into the runtime function
entry itself (leaving no data in the .xdata section at all), but
that can only be done if there's no follow-on data in the .xdata
section. If emission of the unwind info is triggered via
EmitWinEHHandlerData (or the .seh_handlerdata directive), which
implicitly switches to the .xdata section, there's a chance of the
caller wanting to pass further data there, so the packed format
can't be used in that case.
Differential Revision: https://reviews.llvm.org/D87448
Martin Storsjö [Sun, 20 Sep 2020 20:19:12 +0000 (23:19 +0300)]
[clang-cl] Always interpret the LIB env var as separated with semicolons
When cross compiling with clang-cl, clang splits the INCLUDE env
variable around semicolons (clang/lib/Driver/ToolChains/MSVC.cpp,
MSVCToolChain::AddClangSystemIncludeArgs) and lld splits the
LIB variable similarly (lld/COFF/Driver.cpp,
LinkerDriver::addLibSearchPaths). Therefore, the consensus for
cross compilation with clang-cl and lld-link seems to be to use
semicolons, despite path lists normally being separated by colons
on unix and EnvPathSeparator being set to that.
Therefore, handle the LIB variable similarly in Clang, when
handling lib file arguments when driving linking via Clang.
This fixes commands like "clang-cl test.c -Fetest.exe kernel32.lib" in
a cross compilation setting. Normally, most users call (lld-)link
directly, but meson happens to use this command syntax for
has_function() tests.
Differential Revision: https://reviews.llvm.org/D88002
Martin Storsjö [Tue, 15 Sep 2020 09:35:07 +0000 (12:35 +0300)]
[clang] [MinGW] Add an implicit .exe suffix even when crosscompiling
GCC 8 changed behaviour wrt this, and made it consistent for cross
compilation cases. While it's a change, it's a more sensible behaviour
going forward.
Differential Revision: https://reviews.llvm.org/D88005
Chris Hamilton [Mon, 21 Sep 2020 20:37:39 +0000 (15:37 -0500)]
[Analyzer] GNU named variadic macros in Plister
Added support for GNU named variadic macros in
macro expansion for plist generation.
Fix for https://bugs.llvm.org/show_bug.cgi?id=44493
Reviewed By: Szelethus
Differential Revision: https://reviews.llvm.org/D87942
Sanjay Patel [Mon, 21 Sep 2020 20:04:31 +0000 (16:04 -0400)]
[SLP] use std::distance/find to reduce code; NFC
We were already using this code pattern right after
the loop, so this makes it consistent.
Matt Arsenault [Fri, 18 Sep 2020 20:04:36 +0000 (16:04 -0400)]
AMDGPU: Don't add frame register to frame pseudos
We no longer treat the frame register like a function argument, so the
problem this avoided is no longer relevant.
Stephen Neuendorffer [Mon, 21 Sep 2020 19:53:58 +0000 (12:53 -0700)]
[mlir] Add missing space in debug message
Matt Arsenault [Mon, 21 Sep 2020 12:45:06 +0000 (08:45 -0400)]
Reapply Revert "RegAllocFast: Rewrite and improve"
This reverts commit
dbd53a1f0c939a55e7719c39d08179468f9ad3dc.
Needed lldb test updates
Zequan Wu [Wed, 2 Sep 2020 21:50:32 +0000 (14:50 -0700)]
[Coverage] Add empty line regions to SkippedRegions
Differential Revision: https://reviews.llvm.org/D84988
Sanjay Patel [Mon, 21 Sep 2020 19:33:08 +0000 (15:33 -0400)]
[InstCombine] use unary shuffle creator to reduce code duplication; NFC
Sanjay Patel [Mon, 21 Sep 2020 18:01:52 +0000 (14:01 -0400)]
[LoopVectorize] use unary shuffle creator to reduce code duplication; NFC
Louis Dionne [Mon, 21 Sep 2020 19:27:40 +0000 (15:27 -0400)]
[libc++] Verify base substitutions earlier in the testing format
This allows diagnosing missing substitution issues even when doing
availability feature detection in the DSL.
Arthur Eubanks [Fri, 18 Sep 2020 19:55:00 +0000 (12:55 -0700)]
[DIE] Remove DeadInstEliminationPass
This pass is like DeadCodeEliminationPass, but only does one pass
through a function instead of iterating on users of eliminated
instructions.
DeadCodeEliminationPass should be used in all cases.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D87933
Roman Lebedev [Mon, 21 Sep 2020 19:09:59 +0000 (22:09 +0300)]
[NFC][SCEV] Cleanup lowering of @llvm.uadd.sat, (-1 - V) is just ~V
Fangrui Song [Mon, 21 Sep 2020 19:08:41 +0000 (12:08 -0700)]
[ELF][test] Delete large temporary files and make some temporary files smaller with two text segments
Large files are cumbersome on some filesystems and can more easily trigger ENOSPC.
Some tests use two text sections with output section addresses to test branch ranges.
Use two text segments to prevent LLD from filling the gap and unnecessarily increasing the output size.
With this change, there is no test/ELF temporary file larger than 100MiB.
Reviewed By: psmith
Differential Revision: https://reviews.llvm.org/D88037
Stanislav Mekhanoshin [Mon, 21 Sep 2020 18:52:28 +0000 (11:52 -0700)]
[AMDGPU] Fixed typo in intrinsic comment. NFC.
Reid Kleckner [Fri, 18 Sep 2020 18:22:15 +0000 (11:22 -0700)]
[MS] On x86_32, pass overaligned, non-copyable arguments indirectly
This updates the C++ ABI argument classification code to use the logic
from D72114, fixing an ABI incompatibility with MSVC.
Part of PR44395.
Differential Revision: https://reviews.llvm.org/D87923
jerryyin [Mon, 21 Sep 2020 18:22:56 +0000 (11:22 -0700)]
[AMDGPU] Adding mutex to guard lld::elf::link interface use
check-mlir target run tests simultaneously with multiple threads. This caused multiple threads to invoke the `lld::elf::link()` interface at the same time. Since the interface does not have a thread-safe implementation, add a metex to prevent multi-threaded access.
I discovered this by looking the the failure stack trace. lld/ELF/symbolTable.cpp, SymbolTable::insert() hit into an assert with related to Epoch Trackers. The root cause is to due to there is no protection around the symMap (update) which is implemented in non-thread safe data structure: denseMap.
Differential Revision: https://reviews.llvm.org/D88038
Arthur Eubanks [Mon, 21 Sep 2020 18:02:37 +0000 (11:02 -0700)]
[ObjCARC] Initialize return value
Mistakenly removed initialization of `Changed` in https://reviews.llvm.org/D87806.
David Tenty [Fri, 28 Aug 2020 18:38:59 +0000 (14:38 -0400)]
[AIX][Clang][Driver] Add handling of shared option
Reviewed By: jasonliu
Differential Revision: https://reviews.llvm.org/D87914
Sanjay Patel [Mon, 21 Sep 2020 17:45:56 +0000 (13:45 -0400)]
[SLP] use unary shuffle creator to reduce code duplication; NFC
Sanjay Patel [Mon, 21 Sep 2020 17:27:40 +0000 (13:27 -0400)]
[IRBuilder][VectorCombine] make and use a convenience function for unary shuffle; NFC
This reduces code duplication for common construct.
Follow-ups can use this in SLP, LoopVectorizer, and other passes.
Ye Luo [Mon, 21 Sep 2020 17:42:54 +0000 (13:42 -0400)]
[OpenMP] Protect unrecogonized CUDA error code
If an error code can not be recognized by cuGetErrorString, errStr remains null and causes crashing at DP() printing.
Protect this case.
Reviewed By: jhuber6, tianshilei1992
Differential Revision: https://reviews.llvm.org/D87980
Roman Lebedev [Mon, 21 Sep 2020 16:42:55 +0000 (19:42 +0300)]
[SCEV] Recognize @llvm.uadd.sat as `%y + umin(%x, (-1 - %y))`
----------------------------------------
define i32 @src(i32 %x, i32 %y) {
%0:
%r = uadd_sat i32 %x, %y
ret i32 %r
}
=>
define i32 @tgt(i32 %x, i32 %y) {
%0:
%t0 = sub nsw nuw i32
4294967295, %y
%t1 = umin i32 %x, %t0
%r = add nuw i32 %t1, %y
ret i32 %r
}
Transformation seems to be correct!
The alternative, naive, lowering could be the following,
although i don't think it's better,
thought it will likely be needed for sadd/ssub/*shl:
----------------------------------------
define i32 @src(i32 %x, i32 %y) {
%0:
%r = uadd_sat i32 %x, %y
ret i32 %r
}
=>
define i32 @tgt(i32 %x, i32 %y) {
%0:
%t0 = zext i32 %x to i33
%t1 = zext i32 %y to i33
%t2 = add nuw i33 %t0, %t1
%t3 = zext i32
4294967295 to i33
%t4 = umin i33 %t2, %t3
%r = trunc i33 %t4 to i32
ret i32 %r
}
Transformation seems to be correct!
Roman Lebedev [Mon, 21 Sep 2020 15:05:47 +0000 (18:05 +0300)]
[SCEV] Recognize @llvm.usub.sat as `%x - (umin %x, %y)`
----------------------------------------
define i32 @src(i32 %x, i32 %y) {
%0:
%r = usub_sat i32 %x, %y
ret i32 %r
}
=>
define i32 @tgt(i32 %x, i32 %y) {
%0:
%t0 = umin i32 %x, %y
%r = sub nuw i32 %x, %t0
ret i32 %r
}
Transformation seems to be correct!
Roman Lebedev [Mon, 21 Sep 2020 14:58:31 +0000 (17:58 +0300)]
[NFC][SCEV] Add tests for @llvm.*.sat intrinsics
Roman Lebedev [Mon, 21 Sep 2020 14:16:08 +0000 (17:16 +0300)]
[SCEV] Recognize @llvm.abs as smax(x, -x)
As per alive2 (ignoring undef):
----------------------------------------
define i32 @src(i32 %x, i1 %y) {
%0:
%r = abs i32 %x, 0
ret i32 %r
}
=>
define i32 @tgt(i32 %x, i1 %y) {
%0:
%neg_x = mul i32 %x,
4294967295
%r = smax i32 %x, %neg_x
ret i32 %r
}
Transformation seems to be correct!
----------------------------------------
define i32 @src(i32 %x, i1 %y) {
%0:
%r = abs i32 %x, 1
ret i32 %r
}
=>
define i32 @tgt(i32 %x, i1 %y) {
%0:
%neg_x = mul nsw i32 %x,
4294967295
%r = smax i32 %x, %neg_x
ret i32 %r
}
Transformation seems to be correct!
Roman Lebedev [Mon, 21 Sep 2020 14:01:11 +0000 (17:01 +0300)]
[NFC][SCEV] Add tests for @llvm.abs intrinsic
Simon Pilgrim [Mon, 21 Sep 2020 17:24:08 +0000 (18:24 +0100)]
[SLP] Use for-range loops across ValueLists. NFCI.
Also rename some existing loops that used a 'j' iterator to consistently use 'V'.
Dave Lee [Mon, 21 Sep 2020 17:22:51 +0000 (10:22 -0700)]
[cmake] Centralize LLVM_ENABLE_WARNINGS option
Configure default value of `LLVM_ENABLE_WARNINGS` in `HandleLLVMOptions.cmake`.
`LLVM_ENABLE_WARNINGS` is documented as ON by default, but `HandleLLVMOptions` assumes the default has been set somewhere else. If it has not been explicitly set, then `HandleLLVMOptions` implicitly uses OFF as a default.
This removes the various `option()` declarations in favor of a single declaration in `HandleLLVMOptions`. This will prevent the unwanted use of `-w` that is mentioned in a couple of the comments.
Reviewed By: DavidTruby, #libunwind, JDevlieghere, compnerd
Differential Revision: https://reviews.llvm.org/D87243
Dave Lee [Wed, 16 Sep 2020 23:40:48 +0000 (16:40 -0700)]
[lldb/Commands] Fix outdated `breakpoint command add` help string
Update the some examples in the help string for `breakpoint command add`.
Python breakpoint commands have different output than what's shown in the help string.
Notes:
* Removed an example containing an inner function, as it seems more about a Python technique than about `command script add`
* Updated `print x` to `print(x)` to be python 2/3 agnostic
Differential Revision: https://reviews.llvm.org/D87807
Sriraman Tallam [Mon, 21 Sep 2020 16:53:09 +0000 (09:53 -0700)]
The wrong placement of add pass with optimizations led to -funique-internal-linkage-names being disabled.
Fixed the placement of the MPM.addpass for UniqueInternalLinkageNames to make
it work correctly with -O2 and new pass manager. Updated the tests to
explicitly check O0 and O2.
Previously, the addPass was placed before BackendUtil.cpp#L1373 which is wrong
as MPM gets assigned at this point and any additions to the pass vector before
this is wrong. This change just moves it after MPM is assigned and places it at
a point where O0 and O0+ can share it.
Differential Revision: https://reviews.llvm.org/D87921
Sanjay Patel [Mon, 21 Sep 2020 16:54:07 +0000 (12:54 -0400)]
[SLP] simplify interface for gather(); NFC
The implementation of gather() should be reduced too,
but this change by itself makes things a little clearer:
we don't try to gather to a different type or
number-of-values than whatever is passed in as the value
list itself.
Simon Pilgrim [Mon, 21 Sep 2020 16:38:23 +0000 (17:38 +0100)]
ImplicitNullChecks.cpp - use auto const& iterators in for-range loops to avoid copies. NFCI.