Stefan Gränitz [Tue, 23 Mar 2021 11:01:30 +0000 (12:01 +0100)]
Temporarily revert "[lli] Make -jit-kind=orc the default JIT engine"
This reverts commit
eaee4f269645094f03f3aaff6b365176d63ab3e8.
Nemanja Ivanovic [Tue, 23 Mar 2021 10:51:19 +0000 (05:51 -0500)]
[PowerPC] Add more missing overloads to altivec.h
Add overloads that perform subtraction on v1i128 that take and
produce vector unsigned char to avoid needing to use __int128.
The overloads are suffixed with _u128 and are needed for targets
where __int128 isn't supported (AIX).
Frederik Gossen [Tue, 23 Mar 2021 08:17:31 +0000 (09:17 +0100)]
[MLIR] Add callback builder for `shape.assuming` op
Differential Revision: https://reviews.llvm.org/D99153
David Sherwood [Mon, 8 Feb 2021 15:46:24 +0000 (15:46 +0000)]
[IR][SVE] Add new llvm.experimental.stepvector intrinsic
This patch adds a new llvm.experimental.stepvector intrinsic,
which takes no arguments and returns a linear integer sequence of
values of the form <0, 1, ...>. It is primarily intended for
scalable vectors, although it will work for fixed width vectors
too. It is intended that later patches will make use of this
new intrinsic when vectorising induction variables, currently only
supported for fixed width. I've added a new CreateStepVector
method to the IRBuilder, which will generate a call to this
intrinsic for scalable vectors and fall back on creating a
ConstantVector for fixed width.
For scalable vectors this intrinsic is lowered to a new ISD node
called STEP_VECTOR, which takes a single constant integer argument
as the step. During lowering this argument is set to a value of 1.
The reason for this additional argument at the codegen level is
because in future patches we will introduce various generic DAG
combines such as
mul step_vector(1), 2 -> step_vector(2)
add step_vector(1), step_vector(1) -> step_vector(2)
shl step_vector(1), 1 -> step_vector(2)
etc.
that encourage a canonical format for all targets. This hopefully
means all other targets supporting scalable vectors can benefit
from this too.
I've added cost model tests for both fixed width and scalable
vectors:
llvm/test/Analysis/CostModel/AArch64/neon-stepvector.ll
llvm/test/Analysis/CostModel/AArch64/sve-stepvector.ll
as well as codegen lowering tests for fixed width and scalable
vectors:
llvm/test/CodeGen/AArch64/neon-stepvector.ll
llvm/test/CodeGen/AArch64/sve-stepvector.ll
See this thread for discussion of the intrinsic:
https://lists.llvm.org/pipermail/llvm-dev/2021-January/147943.html
Vladislav Vinogradov [Thu, 18 Mar 2021 12:35:20 +0000 (15:35 +0300)]
[CMAKE] Fix cross-compilation build
Call `get_errc_messages` only if `LLVM_INCLUDE_TESTS` was set.
Reviewed By: zero9178, abhina.sreeskantharajan, jhenderson
Differential Revision: https://reviews.llvm.org/D98861
Sven van Haastregt [Tue, 23 Mar 2021 10:20:13 +0000 (10:20 +0000)]
[OpenCL] Remove mixed signedness atomic_fetch_ from opencl-c.h
The OpenCL C specification v3.0.6 s6.15.12.7.5 mentions:
For atomic_fetch and modify functions with key = or, xor, and, min
and max on atomic type atomic_intptr_t, M is intptr_t, and on
atomic type atomic_uintptr_t, M is uintptr_t.
Remove the atomic_fetch_* overloads from opencl-c.h that mix intptr_t
and uintptr_t in the same declaration.
Differential Revision: https://reviews.llvm.org/D98418
Fraser Cormack [Wed, 17 Mar 2021 09:05:55 +0000 (09:05 +0000)]
[RISCV] Optimize all-constant mask BUILD_VECTORs
This patch adds an optimization for mask-vector BUILD_VECTOR nodes whose
elements are all constants or undef. It lowers such operations by
building up the vector via a series of integer operations, in which
multiple mask elements are inserted into a vector at a time via
i8/i16/i32/i64 element types. The final result is then bitcast from that
integer vector.
We restrict this optimization in certain circumstances when optimizing
for size. If we are required to use more than one integer insert
operation, then it will likely increase code size compared with using a
load from a constant pool.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D98860
Nemanja Ivanovic [Tue, 23 Mar 2021 10:06:28 +0000 (05:06 -0500)]
[PowerPC] Add more missing overloads to altivec.h
Add overloads that perform addition on v1i128 that take and produce
vector unsigned char to avoid needing to use __int128. The overloads
are suffixed with _u128 and are needed for targets where __int128
isn't supported (AIX).
Christian Sigg [Tue, 23 Mar 2021 07:33:22 +0000 (08:33 +0100)]
[mlir] Remove deprecated methods from mlir::OpState
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D99150
Florian Hahn [Mon, 22 Mar 2021 18:23:32 +0000 (18:23 +0000)]
[VPlan] Include name when printing after
93a9d2de8f4f.
The name is included when printing in DOT mode. Also print it in non-DOT
mode after
93a9d2de8f4f.
This will become more important to distinguish different plans once
VPlans are gradually refined.
Stefan Gränitz [Tue, 23 Mar 2021 09:47:35 +0000 (10:47 +0100)]
[lli] Fix ppc64le-clang-lnt-test bot: Keep test-call.ll a MCJIT-only test
No callback manager available for powerpc64le-unknown-linux-gnu
Simon Pilgrim [Tue, 23 Mar 2021 09:40:54 +0000 (09:40 +0000)]
[X86][AVX] Narrow VPBROADCASTQ->VPBROADCASTD if we don't need the upper bits.
Helps fix cases where we've splatted smaller types to a wider vector element type without needing the upper bits.
Avoid this on AVX512 targets as that can affect broadcast folding.
Stefan Gränitz [Tue, 23 Mar 2021 09:22:06 +0000 (10:22 +0100)]
[lli] Make -jit-kind=orc the default JIT engine
MCJIT served well as the default JIT engine in lli for a long time, but the code is getting old and maintenance efforts don't seem to be in sight. In the meantime Orc became mature enough to fill that gap. The newly added greddy mode is very similar to the execution model of MCJIT. It should work as a drop-in replacement for common JIT tasks.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D98931
Roman Lebedev [Tue, 23 Mar 2021 07:50:18 +0000 (10:50 +0300)]
[lit] Reliable progress indicator and ETA
Quality of progress bar and ETA in lit has always bothered me.
For example, given `./bin/llvm-lit /repositories/llvm-project/clang/test/CodeGen* -sv`
at 1%, it says it will take 10 more minutes,
at 25%, it says it will take 1.25 more minutes,
at 50%, it says it will take 30 more seconds,
and in the end finishes with `Testing Time: 39.49s`. That's rather wildly unprecise.
Currently, it assumes that every single test will take the same amount of time to run on average.
This is is a somewhat reasonable approximation overall, but it is quite clearly imprecise,
especially in the beginning.
But, we can do better now, after D98179! We now know how long the tests took to run last time.
So we can build a better ETA predictor, by accumulating the time spent already,
the time that will be spent on the tests for which we know the previous time,
and for the test for which we don't have previous time, again use the average time
over the tests for which we know current or previous run time.
It would be better to use median, but i'm wary of the cost that may incur.
Now, on **first** run of `./bin/llvm-lit /repositories/llvm-project/clang/test/CodeGen* -sv`
at 10%, it says it will take 30 seconds,
at 25%, it says it will take 50 more seconds,
at 50%, it says it will take 27 more seconds,
and in the end finishes with `Testing Time: 41.64s`. That's pretty reasonable.
And on second run of `./bin/llvm-lit /repositories/llvm-project/clang/test/CodeGen* -sv`
at 1%, it says it will take 1 minutes,
at 25%, it says it will take 30 more seconds,
at 50%, it says it will take 19 more seconds,
and in the end finishes with `Testing Time: 39.49s`. That's amazing i think!
I think people will love this :)
Reviewed By: yln
Differential Revision: https://reviews.llvm.org/D99073
Balázs Kéri [Tue, 23 Mar 2021 08:10:22 +0000 (09:10 +0100)]
[clang][ASTImporter] Import "CapturedVLAType" in FieldDecl.
Update ASTImporter to import value of FieldDecl::getCapturedVLAType.
Reviewed By: shafik, martong
Differential Revision: https://reviews.llvm.org/D99062
Juneyoung Lee [Tue, 23 Mar 2021 04:46:19 +0000 (13:46 +0900)]
Reland "[InstCombine] Add simplification of two logical and/ors"
This relands
07c3b97e184d5bd828b8a680cdce46e73f3db9fc (D96945) which was reverted by
commit
f49354838e526671e616d16199ebdee653b9f6fa.
The two-stage compilation successfully tests passes on my machine.
Fangrui Song [Tue, 23 Mar 2021 06:05:36 +0000 (23:05 -0700)]
[SanitizerCoverage] Use External on Windows
This should fix https://reviews.llvm.org/D98903#2643589 though
it is not clear to me why ExternalWeak does not work.
Serguei Katkov [Mon, 22 Mar 2021 03:30:41 +0000 (10:30 +0700)]
[RS4GC] Fix hang on infinite loop
meetBDVState utility may sets the base pointer for the conflict state.
At this moment the base for conflict state does not have any meaning but
is used in comparison of BDV states. This comparison is used as an indicator
of progress done on iteration and RS4GC pass uses infinite loop to reach
fixed point.
As a result for added test on each iteration state for some phi nodes is updated
with other base value for conflict state and it indicates as a progress while
for conflict state there is no any progress more possible.
In reality the base value is transferred from one state to another and pass
detects the progress on these states.
The test is very fragile. The traversal order of states and operands of phi nodes
plays important role.
Reviewers: reames, dantrushin
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D99058
Serge Pavlov [Tue, 23 Mar 2021 05:46:34 +0000 (12:46 +0700)]
[TableGen] Tiny enhancement
Differential Revision: https://reviews.llvm.org/D99057
Pushpinder Singh [Tue, 9 Mar 2021 06:10:00 +0000 (06:10 +0000)]
[GlobalISel][AMDGPU] Lower G_UMULO/G_SMULO
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D93963
Max Kazantsev [Tue, 23 Mar 2021 05:13:19 +0000 (12:13 +0700)]
[NFC] Fix typo longre -> longer
Serge Pavlov [Sat, 20 Mar 2021 06:06:46 +0000 (13:06 +0700)]
[TableGen] Allow BitsInit to init integer in pseudo expansion
Differential Revision: https://reviews.llvm.org/D99057
Vitaly Buka [Tue, 23 Mar 2021 04:38:15 +0000 (21:38 -0700)]
[lsan][lsan] Use --std=c++14 to fix Windows test
Rahman Lavaee [Tue, 23 Mar 2021 04:36:32 +0000 (21:36 -0700)]
[llvm-readelf, propeller] Add fallthrough bit to basic block metadata in BB-Address-Map section.
This patch adds a fallthrough bit to basic block metadata, indicating whether the basic block can fallthrough without taking any branches. The bit will help us avoid an intel LBR bug which results in occasional duplicate entries at the beginning of the LBR stack.
This patch uses `MachineBasicBlock::canFallThrough()` to set the bit. This is not a const method because it eventually calls `TargetInstrInfo::analyzeBranch`, but it calls this function with the default `AllowModify=false`. So we can either make the argument to the `getBBAddrMapMetadata` non-const, or we can use `const_cast` when calling `canFallThrough`. I decide to go with the latter since this is purely due to legacy code, and in general we should not allow the BasicBlock to be mutable during `getBBAddrMapMetadata`.
Reviewed By: tmsriram
Differential Revision: https://reviews.llvm.org/D96918
Tony [Mon, 22 Mar 2021 22:28:11 +0000 (22:28 +0000)]
[AMDGPU] Reserve ELF code
Reserve AMD GPU ELF machine code 0x040.
Minor AMDGPUUsage format consistency change.
Reviewed By: kzhuravl
Differential Revision: https://reviews.llvm.org/D99122
Nemanja Ivanovic [Tue, 23 Mar 2021 04:08:40 +0000 (23:08 -0500)]
[PowerPC] Add more missing overloads to altivec.h
Add vec_permi as a synonym for vec_xxpermdi (but only for
doubleword vectors).
Craig Topper [Tue, 23 Mar 2021 03:30:06 +0000 (20:30 -0700)]
[RISCV] Add scheduler classes to Zfh instructions.
Reviewed By: HsiangKai
Differential Revision: https://reviews.llvm.org/D99053
Craig Topper [Tue, 23 Mar 2021 03:29:15 +0000 (20:29 -0700)]
[RISCV] Remove unused SchedWrites WriteFConv32/WriteFConv64/WriteFMov32/WriteFMov64.
It doesn't look like any instructions have ever been assigned to these classes.
Reviewed By: HsiangKai
Differential Revision: https://reviews.llvm.org/D99050
Nemanja Ivanovic [Tue, 23 Mar 2021 03:25:28 +0000 (22:25 -0500)]
[PowerPC] Add more missing overloads to altivec.h
Add vec_gbb as a synonym for vec_vgbbd but for doubleword vectors.
Nemanja Ivanovic [Tue, 23 Mar 2021 03:08:29 +0000 (22:08 -0500)]
[PowerPC] Add more missing overloads to altivec.h
Add vec_cvf as a synonym for vec_doublee/vec_floate.
Carl Ritson [Tue, 23 Mar 2021 01:56:56 +0000 (10:56 +0900)]
[AMDGPU] Only unbundle memory accesses in SIMemoryLegalizer
This restores previous behaviour and is a step toward removing
unbundling entirely.
Reviewed By: foad, rampitec
Differential Revision: https://reviews.llvm.org/D99061
Craig Topper [Tue, 23 Mar 2021 02:16:08 +0000 (19:16 -0700)]
[RISCV] Rename Zb* extension tests to use lower case 'Z' in file names.
As discussed in D99009
Philip Reames [Tue, 23 Mar 2021 02:09:07 +0000 (19:09 -0700)]
[test] precommit another test for point-in-time deref semantics
Richard Smith [Tue, 23 Mar 2021 00:45:39 +0000 (17:45 -0700)]
Improve module dumping for debugging.
* List inferred lists of imports in `#pragma clang __debug module_map`.
* Add `#pragma clang __debug modules {all,visible,building}` to dump
lists of known / visible module names or the building modules stack.
Philip Reames [Tue, 23 Mar 2021 01:56:50 +0000 (18:56 -0700)]
[tests] Expand tests for point-in-time dereferenceability
Vitaly Buka [Tue, 23 Mar 2021 01:48:14 +0000 (18:48 -0700)]
Revert "[sanitizer] Support dynamic premapped R/W range in primary allocator."
Fails on Windows https://lab.llvm.org/buildbot/#/builders/127/builds/7999
and Android https://lab.llvm.org/buildbot/#/builders/77/builds/4839
This reverts commit
bca0cf768b6021124f5e5315be333c2f45f14fca.
Zakk Chen [Tue, 23 Mar 2021 01:51:48 +0000 (18:51 -0700)]
Revert "[RISCV][NFC] Fix RVV intrinsic tests."
This reverts commit
ab082b582dd01becc0e0dbb0ff28371e0ce392a9.
Philip Reames [Tue, 23 Mar 2021 01:44:06 +0000 (18:44 -0700)]
Minor format tweak to deref analysis printer
Jonas Devlieghere [Mon, 22 Mar 2021 23:33:01 +0000 (16:33 -0700)]
[dsymutil] Fix spurious warnings for missing symbols with thinLTO
Fix spurious warnings for missing symbols with thinLTO. The latter
appends a unique suffix to avoid collisions for exported private
symbols, resulting in dsymutil complaining it couldn't find the symbol
in the object file.
rdar://
75434058
Differential revision: https://reviews.llvm.org/D99125
Philip Reames [Mon, 22 Mar 2021 21:58:33 +0000 (14:58 -0700)]
[deref] Split a test to show both global and pointwise semantics
While doing so, also split one monster test into individually named test functions.
Zakk Chen [Mon, 22 Mar 2021 15:20:48 +0000 (08:20 -0700)]
[RISCV][NFC] Fix RVV intrinsic tests.
1. Skip the temporary file
2. Test cc1 with -S to verify codegen work well. Add '-target-feature
+m' because the backend requires it to calculate the vscaled size/offset.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D99082
Nemanja Ivanovic [Tue, 23 Mar 2021 01:22:21 +0000 (20:22 -0500)]
[PowerPC] Add more missing overloads to altivec.h
Add vec_ctd which is similar to vec_ctf except the return type is
vector double rather than vector float.
River Riddle [Tue, 23 Mar 2021 01:07:09 +0000 (18:07 -0700)]
[mlir][OpAsmFormat] Add support for an "else" group on optional elements
The "else" group of an optional element is a collection of elements that get parsed/printed when the anchor of the main element group is *not* present. This is useful when there is a special syntax when an element is not present. The new syntax for an optional element is shown below:
```
optional-group: `(` elements `)` (`:` `(` else-elements `)`)? `?`
```
An example of how this might be used is shown below:
```tablegen
def FooOp : ... {
let arguments = (ins UnitAttr:$foo);
let assemblyFormat = "attr-dict (`foo_is_present` $foo^):(`foo_is_absent`)?";
}
```
would be formatted as such:
```mlir
// When the `foo` attribute is present:
foo.op foo_is_present
// When the `foo` attribute is not present:
foo.op foo_is_absent
```
Differential Revision: https://reviews.llvm.org/D99129
Sean Silva [Tue, 16 Mar 2021 20:40:35 +0000 (13:40 -0700)]
[mlir] Tune error message for assertion.
This assertion can fire in the case of different contexts as well, which
is not difficult to do from Python bindings, for example.
Gulfem Savrun Yeniceri [Tue, 23 Mar 2021 00:36:21 +0000 (00:36 +0000)]
Revert "[Passes] Add relative lookup table converter pass"
This reverts commit
78a65cd945d006ff02f9d24d9cc20a302ed93b08 which
caused buildbot failures.
Chris Lattner [Tue, 23 Mar 2021 00:36:27 +0000 (17:36 -0700)]
Rename FrozenRewritePatternList -> FrozenRewritePatternSet; NFC.
This nicely aligns the naming with RewritePatternSet. This type isn't
as widely used, but we keep a using declaration in to help with
downstream consumption of this change.
Differential Revision: https://reviews.llvm.org/D99131
Mehdi Amini [Tue, 23 Mar 2021 00:33:03 +0000 (00:33 +0000)]
Add a mechanism for Dialects to customize printing/parsing operations when they are unregistered
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D99007
Amara Emerson [Mon, 22 Mar 2021 23:52:11 +0000 (16:52 -0700)]
[darwin][driver] Pass through -global-isel LLVM flags to ld.
GlobalISel is currently not enabled when using -flto since the front-end
-mvllm flags don't get passed through. This change fixes this for Darwin
platforms. We have to do this in the driver because the code generator choice
isn't embedded into the bitcode file.
Differential Revision: https://reviews.llvm.org/D99126
Chris Lattner [Tue, 23 Mar 2021 00:19:46 +0000 (17:19 -0700)]
Tidy up some docs.
Depends on D99127.
Differential Revision: https://reviews.llvm.org/D99130
Chris Lattner [Mon, 22 Mar 2021 23:58:34 +0000 (16:58 -0700)]
[PatternMatch] Big mechanical rename OwningRewritePatternList -> RewritePatternSet and insert -> add. NFC
This doesn't change APIs, this just cleans up the many in-tree uses of these
names to use the new preferred names. We'll keep the old names around for a
couple weeks to help transitions.
Differential Revision: https://reviews.llvm.org/D99127
Juneyoung Lee [Mon, 22 Mar 2021 21:26:53 +0000 (06:26 +0900)]
Reland "[SimplifyCFG] Update FoldBranchToCommonDest to be poison-safe"
This relands commit
99108c791de0285ee726a10e8274772b18cee73c (D95026) which was
reverted by
8d5a981a135a0f0ae0a10c59b7c8093aae1c28de because the underlying
problem (https://llvm.org/pr49495) is fixed.
Mehdi Amini [Tue, 23 Mar 2021 00:18:20 +0000 (00:18 +0000)]
Revert "Revert "Revert "Revert "Revert "[lld-macho] Implement -dependency_info (partially - more opcodes needed)"""""
This reverts commit
3c21166a94ea02b946e9eea75c5e9bdfa8c43ae6.
The build is broken (clang-8 host compiler):
lld/MachO/DriverUtils.cpp:271:8: error: use of overloaded operator '<<' is ambiguous (with operand types 'llvm::raw_fd_ostream' and 'lld::macho::DependencyTracker::DepOpCode')
os << opcode;
~~ ^ ~~~~~~
Vy Nguyen [Mon, 22 Mar 2021 20:11:09 +0000 (16:11 -0400)]
Revert "Revert "Revert "Revert "[lld-macho] Implement -dependency_info (partially - more opcodes needed)""""
This reverts commit
9670d2e4af4c996098089e31b03ca138bc8d27e9.
Second attemp to reland D98559. New changes:
- inline functions removed from cpp file.
- updated tests to use CHECK-DAG instead of CHECK-NEXT
- fixed ambiguous "<<" operator by switching `char` to uint8_t
Chris Lattner [Mon, 22 Mar 2021 22:02:04 +0000 (15:02 -0700)]
[PatternRewriter] Rename OwningRewritePatternList -> RewritePatternSet and insert -> add
This maintains the old name to have minimal source impact on downstream codes, and
does not do the huge mechanical patch. I expect the huge mechanical patch to land
sometime this week, but we can keep around the old names for a couple weeks to reduce
impact on downstream projects.
Differential Revision: https://reviews.llvm.org/D99119
Gulfem Savrun Yeniceri [Mon, 22 Mar 2021 23:08:55 +0000 (23:08 +0000)]
[doc] Fix typo in rel lookup table converter pass
Add additonal hypens to match the title size that was introduced in 78a65cd.
Stephen Kelly [Wed, 17 Mar 2021 22:56:39 +0000 (22:56 +0000)]
[AST] Add introspection support for Decls
The test code has lots of interesting locations which are not yet
introspected, but those will come later:
http://ce.steveire.com/z/3T90hR
Differential Revision: https://reviews.llvm.org/D98775
Arthur O'Dwyer [Mon, 22 Mar 2021 17:12:31 +0000 (13:12 -0400)]
[libc++] Include <__config> first in all standard headers.
Mostly, *don't* include <experimental/__config> from C++17 <any>,
because that doesn't make any sense. I think it was just a cut-and-paste
typo when this header moved from experimental/.
Differential Revision: https://reviews.llvm.org/D99089
Nico Weber [Mon, 22 Mar 2021 22:38:17 +0000 (18:38 -0400)]
[gn build] fix typo in
78a65cd945d
Reid Kleckner [Mon, 22 Mar 2021 21:56:44 +0000 (14:56 -0700)]
[COFF] Only consider associated EH sections during ICF
The only known reason why ICF should not merge otherwise identical
sections with differing associated sections has to do with exception
handling tables. It's not clear what ICF should do when there are other
kinds of associated sections. In every other case when this has come up,
debug info and CF guard metadata, we have opted to make ICF ignore the
associated sections.
For comparison, ELF doesn't do anything for comdat groups. Instead,
.eh_frame is parsed to figure out if a section has an LSDA, and if so,
ICF is disabled.
Another issue is that the order of associated sections is not defined.
We have had issues in the past (crbug.com/1144476) where changing the
order of the .xdata/.pdata sections in the object file lead to large ICF
slowdowns.
To address these issues, I decided it would be best to explicitly
consider only .pdata and .xdata sections during ICF. This makes it easy
to ignore the object file order, and I think it makes the intention of
the code clearer.
I've also made the children() accessor return an empty list for
associated sections. This mostly only affects ICF and GC. This was the
behavior before I made this a linked list, so the behavior change should
be good. This had positive effects on chrome.dll: more .xdata sections
were merged that previously could not be merged because they were
associated with distinct .pdata sections.
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D98993
Martin Storsjö [Wed, 14 Oct 2020 12:13:54 +0000 (15:13 +0300)]
[libcxx] [test] Fix fs.op.proximate for windows
Simmilar to many other similar path handling tests, convert the
test reference to preferred separators, and ifdef a few test references
that use network root names.
Additionally, generalize code for trimming off the root path for
generating relative_cwd, and for skipping the root name element
in count_path_elems.
Rename one fictive path for consistency with the other test cases,
and add a bunch of more test cases for completeness.
Differential Revision: https://reviews.llvm.org/D98988
Gulfem Savrun Yeniceri [Tue, 29 Dec 2020 21:32:13 +0000 (21:32 +0000)]
[Passes] Add relative lookup table converter pass
Lookup tables generate non PIC-friendly code, which requires dynamic relocation as described in:
https://bugs.llvm.org/show_bug.cgi?id=45244
This patch adds a new pass that converts lookup tables to relative lookup tables to make them PIC-friendly.
Differential Revision: https://reviews.llvm.org/D94355
Richard Smith [Mon, 22 Mar 2021 22:06:20 +0000 (15:06 -0700)]
[docs] Clarify which part of the "refers to" rule for lifetimebound is
recursive.
Richard Smith [Mon, 22 Mar 2021 21:48:25 +0000 (14:48 -0700)]
Attempt to further improve the documentation for the [[clang::lifetimebound]] attribute.
Differential Revision: https://reviews.llvm.org/D99117
Reid Kleckner [Mon, 22 Mar 2021 21:55:38 +0000 (14:55 -0700)]
[PDB] Add missing test for
b552adf8b388a4
Peter Steinfeld [Mon, 22 Mar 2021 21:33:55 +0000 (14:33 -0700)]
[flang] Disallow erroneous procedure declarations
When writing tests for a previous problem, I ran across situations where we
were not producing error messages for declarations of specific procedures of
generic interfaces where every other compiler I tested (except nvfotran) did.
I added a check to CheckExtantExternal() and renamed it since it now checks for
erroneous extant symbols generally.
I also removed a call to this function from processing for ENTRY statements,
since it seemed unnecessary and its presence caused bogus error messages.
I also added some tests for erroneous declarations where we were not producing
error messages.
Differential Revision: https://reviews.llvm.org/D99111
Roman Lebedev [Mon, 22 Mar 2021 20:16:19 +0000 (23:16 +0300)]
[NFC][SROA] Add some more tests for speculation around PHI's
Roman Lebedev [Mon, 22 Mar 2021 17:25:14 +0000 (20:25 +0300)]
[NFC][InstCombine] Autogenerate some checklines being affected by upcoming change
Roman Lebedev [Mon, 22 Mar 2021 16:51:57 +0000 (19:51 +0300)]
[NFC][IR] Type: add getWithNewType() method
Sometimes you want to get a type with same vector element count
as the current type, but different element type,
but there's no QOL wrapper to do that. Add one.
Sanjay Patel [Mon, 22 Mar 2021 21:45:32 +0000 (17:45 -0400)]
Revert "[SimplifyCFG] use profile metadata to refine merging branch conditions"
This reverts commit
27ae17a6b0145a559c501c35ded0ab4e9dd69e8e.
There are bot failures that end with:
#4 0x00007fff7ae3c9b8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#5 0x00007fff84e504d8 (linux-vdso64.so.1+0x4d8)
#6 0x00007fff7c419a5c llvm::TargetTransformInfo::getPredictableBranchThreshold() const (/home/buildbots/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1.install/bin/../lib/libLLVMAnalysis.so.13git+0x479a5c)
...but not sure how to trigger that yet.
Matt Morehouse [Fri, 5 Mar 2021 20:53:58 +0000 (12:53 -0800)]
[sanitizer] Support dynamic premapped R/W range in primary allocator.
The main use case for this change is HWASan aliasing mode, which premaps
the alias space adjacent to the dynamic shadow. With this change, the
primary allocator can allocate from the alias space instead of a
separate region.
Reviewed By: vitalybuka, eugenis
Differential Revision: https://reviews.llvm.org/D98293
Martin Storsjö [Sat, 20 Mar 2021 21:58:26 +0000 (23:58 +0200)]
[libcxx] [test] Add XFAIL LIBCXX-WINDOWS-FIXME in 124 tests that fail in the future CI configuration
This makes no attempt yet to look into the why/what for each of them,
but makes the CI configuration useful for tracking further regressions.
After looking into each case, they can either be fixed, or converted
into UNSUPPORTED: windows or XFAIL: windows, once the cause is known
and explained.
A number of the filesystem cases can be fixed by patches that are
currently in review.
Differential Revision: https://reviews.llvm.org/D99095
Martin Storsjö [Sat, 20 Mar 2021 21:27:27 +0000 (23:27 +0200)]
[libcxx] [test] Remove a couple outdated XFAIL LIBCXX-WINDOWS-FIXME
With current versions of MSVC, these tests do succeed.
Differential Revision: https://reviews.llvm.org/D99094
Martin Storsjö [Fri, 19 Mar 2021 14:54:37 +0000 (16:54 +0200)]
[libcxx] [test] Don't leave test dirs behind in fs.op.current_path on Windows
Fix nesting of static_env and CWDGuard, restore the cwd (with
CWDGuard) before cleaning up the static_env.
Previously, every test run left 2 directories behind in the temp dir.
Differential Revision: https://reviews.llvm.org/D98954
Jonas Devlieghere [Mon, 22 Mar 2021 21:12:44 +0000 (14:12 -0700)]
Re-land "[lldb] Make the API, Shell and Unit tests independent lit test suites"
The commit got reverted because the tests were being run twice because
of the overlapping test_exec_root. Pavel has since fixed that in
8248dd91d7f042893d4a605e98d19cb1b89a44d4.
Jonas Devlieghere [Mon, 22 Mar 2021 19:49:15 +0000 (12:49 -0700)]
[lldb] config.test_exec_root is set by lit.cfg.py
Don't configure `test_exec_root` in lit.site.cfg.py. It always gets
overwritten by lit.cfg.py based on `lldb_obj_root`.
Louis Dionne [Mon, 22 Mar 2021 21:17:58 +0000 (17:17 -0400)]
[libc++] Revert "[SystemZ][z/OS] Missing wchar functions libc++"
This reverts commit
febbf68b423b14d55a14980d2ba3ec37ef1e31dc because it
added files that were not under the LLVM license.
See https://reviews.llvm.org/D98207 for details.
Nikita Popov [Mon, 22 Mar 2021 21:25:17 +0000 (22:25 +0100)]
[ValueTracking] Regenerate test checks (NFC)
Joshua Haberman [Mon, 22 Mar 2021 20:56:26 +0000 (13:56 -0700)]
[clang] Replaced some manual pointer tagging with llvm::PointerIntPair.
There is no functional change here (hence no new tests). The only change
is to replace a couple uintptr_t members with llvm::PointerIntPair<> to
clean up the code, making it more readable and less error prone.
This cleanup highlighted that the old code was effectively casting away
const. This is fixed by changing some function signatures.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D98889
Nikita Popov [Sat, 20 Mar 2021 20:01:49 +0000 (21:01 +0100)]
[InstCombine] Whitelist non-refining folds in SimplifyWithOpReplaced
This is an alternative to D98391/D98585, playing things more
conservatively. If AllowRefinement == false, then we don't use
InstSimplify methods at all, and instead explicitly implement a
small number of non-refining folds. Most cases are handled by
constant folding, and I only had to add three folds to cover
our unit tests / test-suite. While this may lose some optimization
power, I think it is safer to approach from this direction, given
how many issues this code has already caused.
Differential Revision: https://reviews.llvm.org/D99027
Raman Tenneti [Mon, 22 Mar 2021 00:42:03 +0000 (17:42 -0700)]
[libc] Introduces gmtime_r to LLVM libc, based on C99/C2X/Single Unix Sp.
gmtime and gmtime_r share the same common code. They call gmtime_internal
a static inline function. Thus added only validation tests for gmtime_r.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D99046
Nikita Popov [Sat, 20 Mar 2021 17:11:17 +0000 (18:11 +0100)]
[IR] Mark assume/annotation as InaccessibleMemOnly
These intrinsics don't need to be marked as arbitrary writing,
it's sufficient to write inaccessible memory (aka "side effect")
to preserve control dependencies. This means less special-casing
in BasicAA. This is intended as an alternative to D98925.
Differential Revision: https://reviews.llvm.org/D99022
Juneyoung Lee [Mon, 22 Mar 2021 20:55:08 +0000 (05:55 +0900)]
[SCEV] Use logical and/or matcher
This is a minor patch that updates ScalarEvolution::isImpliedCond to use logical and/or matcher.
Sanjay Patel [Mon, 22 Mar 2021 20:45:54 +0000 (16:45 -0400)]
[SimplifyCFG] use profile metadata to refine merging branch conditions
This is one step towards solving:
https://llvm.org/PR49336
In that example, we disregard the recommended usage of builtin_expect,
so an expensive (unpredictable) branch is folded into another branch
that is guarding it.
Here, we read the profile metadata to see if the 1st (predecessor)
condition is likely to cause execution to bypass the 2nd (successor)
condition before merging conditions by using logic ops.
Differential Revision: https://reviews.llvm.org/D98898
Fangrui Song [Mon, 22 Mar 2021 20:25:35 +0000 (13:25 -0700)]
[Driver] Bring back "Clean up Debian multiarch /usr/include/<triplet> madness" and restore i586-linux-gnu
This reverts commit
933d146f38c6d77a9b4fdde2b6b394f6ad9f8bf5 and
21b211a8f24f8ecfab8b380ff761a90d9cf73924
(which mis-identified the issue) but restores i586-linux-gnu which was
removed by `Gnu.cpp: remove obsoleted i386 triple detection from end-of-life distribution versions`.
Looks like i586-linux-gnu was not dead enough (used in a sysroot by Fuchsia build bot based on Debian jessie:)
but i486-linux-gnu should be very dead by now.
Yaxun (Sam) Liu [Thu, 18 Mar 2021 12:03:28 +0000 (08:03 -0400)]
[HIP] Fix ROCm detection
ROCm has changed installation path to /opt/rocm-{release}. Add detection
for that. Also support ROCM_PATH environment variable.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D98867
Sanjay Patel [Mon, 22 Mar 2021 18:37:07 +0000 (14:37 -0400)]
[SimplifyCFG] adjust test branchweights; NFC
This will check the boundary conditions of the
revised change proposed in D98898.
Sanjay Patel [Mon, 22 Mar 2021 17:46:18 +0000 (13:46 -0400)]
[TargetTransformInfo] move branch probability query from TargetLoweringInfo
This is no-functional-change intended (NFC), but needed to allow
optimizer passes to use the API. See D98898 for a proposed usage
by SimplifyCFG.
I'm simplifying the code by removing the cl::opt. That was added
back with the original commit in D19488, but I don't see any
evidence in regression tests that it was used. Target-specific
overrides can use the usual patterns to adjust as necessary.
We could also restore that cl::opt, but it was not clear to me
exactly how to do it in the convoluted TTI class structure.
Matt Morehouse [Mon, 22 Mar 2021 19:29:08 +0000 (12:29 -0700)]
[HWASan][NFC] Introduce constants for tag bits and masks.
x86_64 aliasing mode will use fewer than 8 bits for tags, so refactor
existing code to remove hard-coded 0xff and 8 values.
Reviewed By: vitalybuka, eugenis
Differential Revision: https://reviews.llvm.org/D98072
Fangrui Song [Mon, 22 Mar 2021 19:08:46 +0000 (12:08 -0700)]
[test] Bring back the improved arm and $sysroot/usr/include/i386-linux-gnu tests
21b211a8f24f8ecfab8b380ff761a90d9cf73924 was reverted temporarily to
give Fuchsia some time for migrating to a better sysroot, but the tests
can be restored separately.
Petr Hosek [Mon, 22 Mar 2021 18:55:26 +0000 (11:55 -0700)]
Revert "[Driver] Clean up Debian multiarch /usr/include/<triplet> madness"
This reverts commit
874bdc8e61662b5f39a9626b9132e0979fae556f which
broke the use of older Debian sysroots.
Petr Hosek [Mon, 22 Mar 2021 18:55:09 +0000 (11:55 -0700)]
Revert "[Driver] -m32: Add /usr/include/i386-linux-gnu for Debian"
This reverts commit
82f6e0dde29e6c6da27f64db5992eb539a57d21b which
hasn't addressed the
874bdc8e61662b5f39a9626b9132e0979fae556f issue.
Vy Nguyen [Mon, 22 Mar 2021 18:54:01 +0000 (14:54 -0400)]
Revert "Revert "Revert "[lld-macho] Implement -dependency_info (partially - more opcodes needed)"""
This reverts commit
5ad2c225f353adc92473af391775c029db23a7d9.
bots still unhappy - revertting again
Vy Nguyen [Mon, 22 Mar 2021 17:10:23 +0000 (13:10 -0400)]
Revert "Revert "[lld-macho] Implement -dependency_info (partially - more opcodes needed)""
This reverts commit
2554b95db57cfcc13864d9bbb9f4e75892067c14.
Relanding [lld-macho] Implement -dependency_info (D98559) with changes:
- inline functions removed from cpp file.
- updated tests to not check libSystem.tbd with other input files (because of possible indeterministic ordering)
Matt Arsenault [Sat, 20 Mar 2021 23:48:06 +0000 (19:48 -0400)]
GlobalISel: Add utility function to constant fold FP ops
Philip Reames [Mon, 22 Mar 2021 18:30:02 +0000 (11:30 -0700)]
Tweak a test so it actually gets autogened
Florian Hahn [Mon, 22 Mar 2021 17:05:45 +0000 (17:05 +0000)]
[VPlan] Add CHECK-LABEL to test/Transforms/LoopVectorize/vplan-printing.ll.
This patch adds CHECK-LABEL lines to
llvm/test/Transforms/LoopVectorize/vplan-printing.ll in order to make
failures slightly easier to diagnose.
Matt Arsenault [Thu, 7 Jan 2021 00:17:19 +0000 (19:17 -0500)]
GlobalISel: Handle G_BUILD_VECTOR in isKnownToBeAPowerOfTwo
serge-sans-paille [Mon, 22 Mar 2021 18:18:11 +0000 (19:18 +0100)]
[NFC] Restore original SmallString size for X86TargetMachine::getSubtargetImpl lookup
Better safe than sorry here, quoting Craig Topper:
> Clang passes a pretty lengthy feature string.
Chris Lattner [Sun, 21 Mar 2021 17:24:20 +0000 (10:24 -0700)]
[PatternMatching] Add convenience insert method to OwningRewritePatternList. NFC.
This allows adding a C function pointer as a matchAndRewrite style pattern, which
is a very common case. This adopts it in ExpandTanh to show how it reduces a level
of nesting.
We could allow C++ lambdas here, but that doesn't work as well with type inference
in the common case. Instead of:
patterns.insert(convertTanhOp);
you need to specify:
patterns.insert<math::TanhOp>(convertTanhOp);
which is boilerplate'y. Capturing state like this is very uncommon, so we choose
to require clients to define their own structs and use the non-convenience method
when they need to do so.
Differential Revision: https://reviews.llvm.org/D99039
Stefan Pintilie [Mon, 22 Mar 2021 14:53:43 +0000 (09:53 -0500)]
[LLD][PowerPC] Fix bug in PC-Relative initial exec
There is a bug when initial exec is relaxed to local exec.
In the following situation:
InitExec.c
```
extern __thread unsigned TGlobal;
unsigned getConst(unsigned*);
unsigned addVal(unsigned, unsigned*);
unsigned GetAddrT() {
return addVal(getConst(&TGlobal), &TGlobal);
}
```
Def.c
```
__thread unsigned TGlobal;
unsigned getConst(unsigned* A) {
return *A + 3;
}
unsigned addVal(unsigned A, unsigned* B) {
return A + *B;
}
```
The problem is in InitExec.c but Def.c is required if you want to link the example and see the problem.
To compile everything:
```
clang -O3 -mcpu=pwr10 -c InitExec.c
clang -O3 -mcpu=pwr10 -c Def.c
ld.lld InitExec.o Def.o -o IeToLe
```
If you objdump the problem object file:
```
$ llvm-objdump -dr --mcpu=pwr10 InitExec.o
```
you will get the following assembly:
```
0000000000000000 <GetAddrT>:
0: a6 02 08 7c mflr 0
4: f0 ff c1 fb std 30, -16(1)
8: 10 00 01 f8 std 0, 16(1)
c: d1 ff 21 f8 stdu 1, -48(1)
10: 00 00 10 04 00 00 60 e4 pld 3, 0(0), 1
0000000000000010: R_PPC64_GOT_TPREL_PCREL34 TGlobal
18: 14 6a c3 7f add 30, 3, 13
0000000000000019: R_PPC64_TLS TGlobal
1c: 78 f3 c3 7f mr 3, 30
20: 01 00 00 48 bl 0x20
0000000000000020: R_PPC64_REL24_NOTOC getConst
24: 78 f3 c4 7f mr 4, 30
28: 30 00 21 38 addi 1, 1, 48
2c: 10 00 01 e8 ld 0, 16(1)
30: f0 ff c1 eb ld 30, -16(1)
34: a6 03 08 7c mtlr 0
38: 00 00 00 48 b 0x38
0000000000000038: R_PPC64_REL24_NOTOC addVal
```
The lines of interest are:
```
10: 00 00 10 04 00 00 60 e4 pld 3, 0(0), 1
0000000000000010: R_PPC64_GOT_TPREL_PCREL34 TGlobal
18: 14 6a c3 7f add 30, 3, 13
0000000000000019: R_PPC64_TLS TGlobal
1c: 78 f3 c3 7f mr 3, 30
```
Which once linked gets turned into:
```
10010210: ff ff 03 06 00 90 6d 38 paddi 3, 13, -28672, 0
10010218: 00 00 00 60 nop
1001021c: 78 f3 c3 7f mr 3, 30
```
The problem is that register 30 is never set after the optimization.
Therefore it is not correct to relax the above instructions by replacing
the add instruction with a nop.
Instead the add instruction should be replaced with a copy (mr) instruction.
If the add uses the same resgiter as input and as ouput then it is safe to
continue to replace the add with a nop.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D95262