143003 Commits

Author SHA1 Message Date
Michal Gorny
1159e42199 [cmake] Canonicalize CMake booleans to 0/1 for lit interop
Canonicalize all CMake booleans to 0/1 before passing them to lit, to
ensure that the Python side handles all of them consistently
and correctly. 0/1 is a safe choice of values that trigger the same
boolean interpretation in CMake, Python and C++.

Furthermore, using them without quotes improves the chance Python will
explicitly fail when an incorrect value (such as ON/OFF, TRUE/FALSE,
YES/NO) is accidentally passed, rather than silently misinterpreting
the value.

This replaces a lot of different logics spread around lit site files,
attempting to partially reproduce the boolean logic used in CMake
and usually silently failing when an uncommon value was used instead.
In fact, some of them were never working correctly since different
values were assigned in CMake and checked in Python.

The alternative solution could be to create a common parser for CMake
booleans in lit and use it consistently throughout the site files.
However, it does not seem like the best idea to create redundant
implementation of the same logic and have to follow upstream if it ever
is extended to handle more values.

Differential Revision: https://reviews.llvm.org/D28294

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:33:48 +00:00
Michal Gorny
c56b5dc8d8 [test] Remove unused 'test_examples' config var
Remove config.test_examples from lit.site.cfg and the relevant
ENABLE_EXAMPLES definition from CMake. It is not used anywhere.

Differential Revision: https://reviews.llvm.org/D28283

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291283 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:33:39 +00:00
David Majnemer
ef654a7ee6 [InstSimplify] Optimize away urems in the presence of range metadata
We know that urem %V, C can be optimized away to %V if %V is ult C.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291282 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:23:51 +00:00
Mehdi Amini
2b72a53db9 Fix LoopLoadElimination to keep original alignment on the inital hoisted store
This is fixing a bug where Loop Vectorization is widening a load but
with a lower alignment. Hoisting the load without propagating the alignment
will allow inst-combine to later deduce a higher alignment that what the pointer
actually is.

Differential Revision: https://reviews.llvm.org/D28408

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291281 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:06:51 +00:00
Jan Vesely
0835374acb AMDGPU/R600: Don't use REGISTER_{LOAD,STORE} ISD nodes
This will make transition to SCRATCH_MEMORY easier

Differential Revision: https://reviews.llvm.org/D24746

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291279 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 21:00:46 +00:00
Simon Pilgrim
9a3bb969b8 [X86][SSE] Standardized triples in vector shift tests
Made no sense for them to be different and caused useless diffs in assembly remarks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291274 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 19:56:57 +00:00
Simon Pilgrim
3beff6a4d1 [CostModel][X86] Add AVX512 and 512-bit vector shift cost tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291269 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 19:41:26 +00:00
Matthias Braun
4bdd2c5750 AArch64CollectLOH: Rewrite as block-local analysis.
Re-apply r288561: This time with a fix where the ADDs that are part of a
3 instruction LOH would not invalidate the "LastAdrp" state. This fixes
http://llvm.org/PR31361

Previously this pass was using up to 5% compile time in some cases which
is a bit much for what it is doing. The pass featured a full blown
data-flow analysis which in the default configuration was restricted to a
single block.

This rewrites the pass under the assumption that we only ever work on a
single block. This is done in a single pass maintaining a state machine
per general purpose register to catch LOH patterns.

Differential Revision: https://reviews.llvm.org/D27329

This reverts commit 9e6cedb0a4f14364d6511597a9160305e7d34493.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291266 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 19:22:01 +00:00
Sanjay Patel
e760878a95 [InstCombine] add a vector version of a test added in r291262; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291265 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 19:14:05 +00:00
Sanjay Patel
6435c8a3b0 [InstCombine] move and add tests for icmp + shl nsw; NFC
As discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2017-January/108749.html
...we should be able to better optimize this pattern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291262 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 18:57:54 +00:00
Wolfgang Pieb
2d3796dc88 [DWARF] Null out the debug locs of (loop invariant) instructions hoisted by LICM in
order to avoid jumpy line tables. Calls are left alone because they may be inlined.

Differential Revision: https://reviews.llvm.org/D28390


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 18:38:57 +00:00
Reid Kleckner
d130989ed7 Use %z for size_t and avoid deprecated string functions
This usage of strcpy and snprintf was certainly safe, but using them
sets off various deprecation and lint warnings. Easier to just write the
belt and suspenders version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 18:22:18 +00:00
Chad Rosier
ed5adf8510 [AArch64] Reduce vector insert/extract cost for Falkor.
Differential Revision: https://reviews.llvm.org/D28403

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291254 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 18:03:26 +00:00
Simon Pilgrim
40caa97b78 [X86][SSE] Pass float domain flag to shuffle combine match functions. NFCI.
Early step towards ignoring domain above a certain shuffle depth.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291248 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 17:34:30 +00:00
Konstantin Zhuravlyov
f6f52a315e [AMDGPU] Remove extra semicolon. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291246 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 17:23:21 +00:00
Konstantin Zhuravlyov
9060577664 [AMDGPU] Do not emit .AMDGPU.config section for amdhsa
Differential Revision: https://reviews.llvm.org/D27732


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291245 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 17:02:10 +00:00
Simon Pilgrim
2634e452b0 [X86][SSE] Simplify float domain requirement in unary shuffle matching.
The AVX1-only limit is never actually required in matchUnaryVectorShuffle

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291244 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 17:00:59 +00:00
Simon Pilgrim
943d501146 [X86][AVX] Regenerate shuffle 128-bit tests.
The EVEX -> VEX fix means that AVX/AVX512 code is more likely the same now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291242 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 15:56:52 +00:00
Simon Pilgrim
567dbbefec [X86][AVX] Regenerate tzcnt tests.
The EVEX -> VEX fix means that AVX/AVX512 code is more likely the same now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291241 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 15:54:23 +00:00
Simon Pilgrim
44c1307557 Remove trailing whitespace. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291240 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 15:31:52 +00:00
Simon Pilgrim
1aeacd2364 [X86] Add X86Subtarget argument. NFCI.
All callers of getTargetVShiftNode have access to X86Subtarget already so pass it along instead of re-extracting it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291239 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 15:29:17 +00:00
Filipe Cabecinhas
a56c8a94d7 [ASan] Make ASan instrument variable-masked loads and stores
Summary: Previously we only supported constant-masked loads and stores.

Reviewers: kcc, RKSimon, pgousseau, gbedwell, vitalybuka

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D28370

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291238 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 15:24:51 +00:00
Daniel Sanders
3390413c33 [globalisel] Stop requiring -debug/-debug-only=registerbankinfo for assertions.
Summary:
I've noticed that these assertions don't trigger when the condition is false.
The problem is that the DEBUG(x) macro only executes x when the pass is
emitting debug output via the -debug and -debug-only=registerbankinfo command
line arguments.

Debug builds should always execute the assertions so use '#ifndef NDEBUG' instead.

Also removed an assertion that is only true the first time it's tested. <Target>RegisterBankInfo's constructor will re-use register banks causing them to be valid on subsequent tests. That
assertion will fail on the first test too in the near future.

Reviewers: t.p.northover, ab, rovka, qcolombet

Subscribers: dberris, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D28358

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291235 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 14:29:34 +00:00
Simon Pilgrim
e5088f5e84 [CostModel][X86] Fix 512-bit SDIV/UDIV 'big' costs.
Set the costs on the lowest target that supports the type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291229 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 11:12:53 +00:00
Simon Pilgrim
4c61c4605a [CostModel][X86] Add SDIV/UDIV cost tests for a wider range of targets
Added a test demonstrating bug in AVX512 division costs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291228 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 11:02:40 +00:00
Daniel Jasper
e8aae1b6fd Move test input to directory called Inputs.
It is a common convention that our internal test runner depends upon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 10:22:15 +00:00
Michal Gorny
7b7a32b4ff [llvm-config] Add --cmakedir to obtain CMake module location
Add a --cmakedir option to llvm-config that returns the correct path to
built/installed CMake modules (i.e. lib/cmake/llvm). This is mostly
intended as a convenience option for stand-alone builds of other LLVM
projects that frequently reconstruct LLVM_CMAKE_PATH after querying
llvm-config.

Differential Revision: https://reviews.llvm.org/D26894

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291218 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 08:23:33 +00:00
Lang Hames
5d6908ca72 [Orc][RPC] Fix an obvious locking-order bug in RawByteChannel::startSendMessage.
The lock needs to be acquired before the data is sent, not afterwards. This
think-o slipped in during the refactor in r286620, but went unnoticed as the
resulting bug only manifests in multi-threaded clients (of which there are none
in-tree).

No unit test as the bug depends on thread scheduling.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291216 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 06:22:31 +00:00
Rui Ueyama
cf9bb41b9b TarWriter: Emit PAX headers only when needed.
We use PAX headers to store long filenames (>= 100 bytes).
It is not needed to emit PAX headers if filenames fit in the
Ustar header. This patch implements that optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291215 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 05:33:45 +00:00
Craig Topper
e3ce5381d8 [AVX-512] Add EXTRACT_SUBVECTOR support to combineBitcastForMaskedOp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 05:18:48 +00:00
Craig Topper
d48b19110e [AVX-512] Add more masked vector extract test cases with and without a bitcast between the select.
The ones with the bitcast need additional work to fold the mask operation properly. This will be fixed in a future commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291213 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 05:18:44 +00:00
David Majnemer
9ec4de5ec3 [SelectionDAG] Rework lowerRangeToAssertZExt
Utilize ConstantRange to make it easier to interpret range metadata.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291211 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 02:43:28 +00:00
Rui Ueyama
fd456e365e Add a class to create a tar archive file.
In LLD, we create cpio archive files for --reproduce command.
cpio was not a bad choice because it is very easy to create, but
it was sometimes hard to use because people are not familiar with
cpio command.

I noticed that creating a tar archive isn't as hard as I thought.
So I implemented it in this patch.

Differential Revision: https://reviews.llvm.org/D28091

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 02:29:48 +00:00
Bob Wilson
9ffd2e44bf Revert "Use _Unwind_Backtrace on Apple platforms."
This reverts commit 63165f6ae3bac1623be36d4b3ce63afa1d51a30a.

After making this change, I discovered that _Unwind_Backtrace is
unable to unwind past a signal handler after an assertion failure.
I filed a bug report about that issue in rdar://29866587 but even if
we get a fix soon, it will be awhile before it get released.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291207 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 02:26:33 +00:00
Bob Wilson
80617ba8c4 Disable sigaltstack on Apple platforms
Using sigaltstack on Apple platforms is a bad idea. Darwin's backtrace()
function does not work with sigaltstack, and my change in r286851 was
supposed to solve that by using _Unwind_Backtrace instead. I tested that
_Unwind_Backtrace works for crashes but then discovered that it does not
work for assertion failures when using sigaltstack, at least on macOS.
The stack trace shows only the frames on the alternate stack.
I also saw some reports of this happening for crashes, but it fails
consistently for assertion failures. I tried various things to get it to
work but the problem seems to be in _Unwind_Backtrace itself. Disabling
sigaltstack is unfortunate since it would be nice to get backtraces for
stack overflows, but at least this gets us backtraces for the more common
cases. rdar://problem/29662459

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291206 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 02:26:30 +00:00
Peter Collingbourne
d99c988733 LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.
This change separates how type identifiers are resolved from how intrinsic
calls are lowered. All information required to lower an intrinsic call
is stored in a new TypeIdLowering data structure. The idea is that this
data structure can either be initialized using the module itself during
regular LTO, or using the module summary in ThinLTO backends.

Differential Revision: https://reviews.llvm.org/D28341

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291205 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 02:22:47 +00:00
David Blaikie
f15a3adac4 Remove unused private fields to fix the clang -Werror build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291201 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 00:48:24 +00:00
Eugene Zelenko
15a812c07c [AArch64, Lanai] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291197 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 00:30:53 +00:00
David Majnemer
5b3f19dc7f [SelectionDAG] Correctly transform range metadata to AssertZExt
We used the logBase2 of the high instead of the ceilLogBase2 resulting
in the wrong result for certain values.  For example, it resulted in an
i1 AssertZExt when the exclusive portion of the range was 3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291196 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 00:11:46 +00:00
Kostya Serebryany
71ae15e6e7 [libFuzzer] remove dead code, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291195 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 00:09:40 +00:00
Greg Clayton
d1f6d693d6 Add iterator support to DWARFDie to allow child DIE iteration.
Differential Revision: https://reviews.llvm.org/D28303



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291194 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 23:47:37 +00:00
Logan Chien
41914406a9 Code cleanup: Remove tab indents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291193 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 23:41:33 +00:00
Tim Shen
81d263bf1f [APFloatTest] Add tests for various operations
Differential Revision: https://reviews.llvm.org/D27833

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291189 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 22:57:54 +00:00
Simon Pilgrim
39e9d60ebd [CostModel][X86] Tidyup arithmetic costs code. NFCI.
Remove unnecessary braces, remove one use variables and keep LUTs to similar naming convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291187 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 22:48:02 +00:00
Kostya Serebryany
93bacfd838 [libFuzzer] improve error handling during the merge (handle various IO failures)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291182 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 22:05:47 +00:00
Geoff Berry
156afea258 [AArch64] Fold some filled/spilled subreg COPYs
Summary:
Extend AArch64 foldMemoryOperandImpl() to handle folding spills of
subreg COPYs with read-undef defs like:

  %vreg0:sub_32<def,read-undef> = COPY %WZR; GPR64:%vreg0

by widening the spilled physical source reg and generating:

  STRXui %XZR <fi#0>

as well as folding fills of similar COPYs like:

  %vreg0:sub_32<def,read-undef> = COPY %vreg1; GPR64:%vreg0, GPR32:%vreg1

by generating:

  %vreg0:sub_32<def,read-undef> = LDRWui <fi#0>

Reviewers: MatzeB, qcolombet

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D27425

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291180 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 21:51:42 +00:00
Xin Tong
111762ddd0 Fix typo. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291178 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 21:40:08 +00:00
Teresa Johnson
a4ca999339 ThinLTO: add early "dead-stripping" on the Index
Summary:
Using the linker-supplied list of "preserved" symbols, we can compute
the list of "dead" symbols, i.e. the one that are not reachable from
a "preserved" symbol transitively on the reference graph.
Right now we are using this information to mark these functions as
non-eligible for import.

The impact is two folds:
- Reduction of compile time: we don't import these functions anywhere
  or import the function these symbols are calling.
- The limited number of import/export leads to better internalization.

Patch originally by Mehdi Amini.

Reviewers: mehdi_amini, pcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23488

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 21:34:18 +00:00
Joerg Sonnenberger
44b0ebe8a3 PR 31534: When emitting both DWARF unwind tables and debug information,
do not use .cfi_sections. This requires checking if any non-declaration
function in the module needs an unwind table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 20:55:28 +00:00
Michael Kuperstein
82d65fbb46 [LICM] Allow promotion of some stores that are not guaranteed to execute.
Promotion is always legal when a store within the loop is guaranteed to execute.

However, this is not a necessary condition - for promotion to be memory model
semantics-preserving, it is enough to have a store that dominates every exit
block. This is because if the store dominates every exit block, the fact the
exit block was executed implies the original store was executed as well.

Differential Revision: https://reviews.llvm.org/D28147


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291171 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 20:42:06 +00:00