OSDN Git Service
Yaxun Liu [Mon, 27 Mar 2017 14:04:01 +0000 (14:04 +0000)]
[AMDGPU] Get address space mapping by target triple environment
As we introduced target triple environment amdgiz and amdgizcl, the address
space values are no longer enums. We have to decide the value by target triple.
The basic idea is to use struct AMDGPUAS to represent address space values.
For address space values which are not depend on target triple, use static
const members, so that they don't occupy extra memory space and is equivalent
to a compile time constant.
Since the struct is lightweight and cheap, it can be created on the fly at
the point of usage. Or it can be added as member to a pass and created at
the beginning of the run* function.
Differential Revision: https://reviews.llvm.org/D31284
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298846
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Thomas [Mon, 27 Mar 2017 13:52:51 +0000 (13:52 +0000)]
[InstCombine] Avoid incorrect folding of select into phi nodes when incoming element is a vector type
Summary:
We are incorrectly folding selects into phi nodes when the incoming value of a phi
node is a constant vector. This optimization is done in `FoldOpIntoPhi` when the
select condition is a phi node with constant incoming values.
Without the fix, we are miscompiling (i.e. incorrectly folding the
select into the phi node) when the vector contains non-zero
elements.
This patch fixes the miscompile and we will correctly fold based on the
select vector operand (see added test cases).
Reviewers: majnemer, sanjoy, spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31189
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298845
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 27 Mar 2017 13:43:24 +0000 (13:43 +0000)]
Correct OptionCategoryCompare() in the command line library.
Summary:
It should return <0, 0, or >0 for less-than, equal, and greater-than like
strcmp() (according to the history, it used to be implemented with
strcmp()) but it actually returned 0, or 1 for not-equal and equal.
Reviewers: qcolombet
Reviewed By: qcolombet
Subscribers: qcolombet, llvm-commits
Differential Revision: https://reviews.llvm.org/D30996
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298844
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 27 Mar 2017 13:15:13 +0000 (13:15 +0000)]
[tablegen] Use categories on options that only matter to one emitter.
Summary:
The categories are emitted in a strange order in this patch due to a bug in the
CommandLine library.
Reviewers: ab
Reviewed By: ab
Subscribers: ab, llvm-commits
Differential Revision: https://reviews.llvm.org/D30995
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298843
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 27 Mar 2017 12:56:12 +0000 (12:56 +0000)]
ADT: Add range helpers for pointer_ and pointee_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298841
91177308-0d34-0410-b5e6-
96231b3b80d8
Gadi Haber [Mon, 27 Mar 2017 12:13:37 +0000 (12:13 +0000)]
[X86][AVX2] bugzilla bug 21281 Performance regression in vector interleave in AVX2
This is a patch for an on-going bugzilla bug 21281 on the generated X86 code for a matrix transpose8x8 subroutine which requires vector interleaving. The generated code in AVX2 is currently non-optimal and requires 60 instructions as opposed to only 40 instructions generated for AVX1.
The patch includes a fix for the AVX2 case where vector unpack instructions use less operations than the vector blend operations available in AVX2.
In this case using vector unpack instructions is more efficient.
Reviewers:
zvi
delena
igorb
craig.topper
guyblank
eladcohen
m_zuckerman
aymanmus
RKSimon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298840
91177308-0d34-0410-b5e6-
96231b3b80d8
Karl-Johan Karlsson [Mon, 27 Mar 2017 07:13:44 +0000 (07:13 +0000)]
[TableGen] Make CodeGenMapTable understand the namespace field of an instruction
Do not force the backends to use target name as namespace.
Original patch by Mattias Eriksson
Reviewers: stoklund, craig.topper
Reviewed By: stoklund
Subscribers: materi, llvm-commits
Differential Revision: https://reviews.llvm.org/D31322
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298834
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 27 Mar 2017 05:47:03 +0000 (05:47 +0000)]
[IR] Implement pairs of non-const and const methods using the const version instead of the non-const version. NFCI
This removes a const_cast of the this pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298831
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 27 Mar 2017 05:46:58 +0000 (05:46 +0000)]
[IR] Share implementation for pairs of const and non-const methods using const_cast. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298830
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 27 Mar 2017 02:38:17 +0000 (02:38 +0000)]
[IR] Share implementation of pairs of const and non-const methods in BasicBlock using the const version instead of the non-const version
Summary:
During post-commit review of a previous change I made it was pointed out that const casting 'this' is technically a bad practice. This patch re-implements all of the methods in BasicBlock that do this to use the const BasicBlock version and const_cast the return value instead.
I think there are still many other classes that do similar things. I may look at more in the future.
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31377
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298827
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 26 Mar 2017 23:23:29 +0000 (23:23 +0000)]
[IR] Make Instruction::isAssociative method inline. Add LLVM_READONLY to the static version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298826
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 26 Mar 2017 21:45:04 +0000 (21:45 +0000)]
[Target] Remove some code probably copy/pasted from another backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298825
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 26 Mar 2017 21:27:21 +0000 (21:27 +0000)]
[MachineScheduler] Reference the correct header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298823
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 26 Mar 2017 20:56:25 +0000 (20:56 +0000)]
Fix typo in comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298819
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 26 Mar 2017 17:39:41 +0000 (17:39 +0000)]
Fix signed/unsigned comparison warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298813
91177308-0d34-0410-b5e6-
96231b3b80d8
Shoaib Meenai [Sun, 26 Mar 2017 17:10:11 +0000 (17:10 +0000)]
[llvm-readobj] Prefer ILT to IAT for reading COFF imports
We're seeing binutils ld produce binaries where the import address
table's NameRVA entry is actually a VA instead (i.e. it's already base
relocated), which llvm-readobj then chokes on. Both dumpbin and the
Windows loader are able to handle these binaries correctly, however, and
we can make llvm-readobj handle them correctly too by iterating the
import lookup table (which doesn't have a relocated NameRVA) rather than
the import address table.
The import lookup table and the import address table are supposed to be
identical on disk, and prior to r277298 the import lookup table would be
used by `llvm-readobj -coff-imports` anyway, so this shouldn't have any
functional change (except in the case of our malformed binaries). The
import lookup table can apparently be missing when using old Borland
linkers, so fall back to the import address table in that case.
Resolves PR31766.
Differential Revision: https://reviews.llvm.org/D31362
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298812
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Pavlov [Sun, 26 Mar 2017 16:46:53 +0000 (16:46 +0000)]
[LoopUnroll] Remap references in peeled iteration
References in cloned blocks must be remapped prior to dominator
calculation.
Differential Revision: https://reviews.llvm.org/D31281
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298811
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 26 Mar 2017 14:24:06 +0000 (14:24 +0000)]
[IR] Switch to more normal template parameter names ending in `T`
instead of `Ty`.
The `Ty` suffix is much more commonly used for LLVM `Type` variable
names, so this seemed like a particularly confusing collision.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298808
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 26 Mar 2017 13:59:17 +0000 (13:59 +0000)]
Fix signed/unsigned comparison warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298807
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 26 Mar 2017 13:17:55 +0000 (13:17 +0000)]
[X86][SSE] Add computeKnownBitsForTargetNode support for (V)PSLL/(V)PSRL instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298806
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 26 Mar 2017 12:52:28 +0000 (12:52 +0000)]
[X86][AVX512F] Fix reg class for VMOVSSZrr/VMOVSSZrrk and VMOVSDZrr/VMOVSDZrrk
Fixed -verify-machineinstrs errors in fast-isel-select-sse.ll (one of many in PR27481)
The VMOVSSZrr/VMOVSSZrrk and VMOVSDZrr/VMOVSDZrrk instructions were assuming both source registers were V128X when the second is actually supposed to be FR32X/FR64X
Differential Revision: https://reviews.llvm.org/D31200
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298805
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 26 Mar 2017 11:17:05 +0000 (11:17 +0000)]
Fix MSVC signed/unsigned comparison warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298804
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 26 Mar 2017 10:33:03 +0000 (10:33 +0000)]
Regenerate test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298803
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 26 Mar 2017 10:31:37 +0000 (10:31 +0000)]
Regenerate test
The CHECK-DAG aren't necessary and get in the way of automated checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298802
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 26 Mar 2017 10:28:39 +0000 (10:28 +0000)]
Regenerate tests to remove duplicated checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298801
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Sun, 26 Mar 2017 08:11:12 +0000 (08:11 +0000)]
[GlobalISel][X86] support G_FRAME_INDEX instruction selection.
Summary:
Support G_FRAME_INDEX instruction selection.
Reviewers: zvi, rovka, ab, qcolombet
Reviewed By: ab
Subscribers: llvm-commits, dberris, kristof.beyls, eladcohen, guyblank
Differential Revision: https://reviews.llvm.org/D30980
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298800
91177308-0d34-0410-b5e6-
96231b3b80d8
Joerg Sonnenberger [Sun, 26 Mar 2017 06:44:08 +0000 (06:44 +0000)]
Split the SimplifyCFG pass into two variants.
The first variant contains all current transformations except
transforming switches into lookup tables. The second variant
contains all current transformations.
The switch-to-lookup-table conversion results in code that is more
difficult to analyze and optimize by other passes. Most importantly,
it can inhibit Dead Code Elimination. As such it is often beneficial to
only apply this transformation very late. A common example is inlining,
which can often result in range restrictions for the switch expression.
Changes in execution time according to LNT:
SingleSource/Benchmarks/Misc/fp-convert +3.03%
MultiSource/Benchmarks/ASC_Sequoia/CrystalMk/CrystalMk -11.20%
MultiSource/Benchmarks/Olden/perimeter/perimeter -10.43%
and a couple of smaller changes. For perimeter it also results 2.6%
a smaller binary.
Differential Revision: https://reviews.llvm.org/D30333
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298799
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Wilkins [Sun, 26 Mar 2017 05:58:48 +0000 (05:58 +0000)]
Add check for BSD when setting LIB_NAMES for GNU ld
Patch by Koop Mast and Alex Arslan!
Differential Revision: https://reviews.llvm.org/D28215
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298798
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 26 Mar 2017 02:49:23 +0000 (02:49 +0000)]
[IR] Make SwitchInst::CaseIt almost a normal iterator.
This moves it to the iterator facade utilities giving it full random
access semantics, etc. It can also now be used with standard algorithms
like std::all_of and std::any_of and range adaptors like llvm::reverse.
Also make the semantics of iterating match what every other iterator
uses and forbid decrementing past the begin iterator. This was used as
a hacky way to work around iterator invalidation. However, every
instance trying to do this failed to actually avoid touching invalid
iterators despite the clear documentation that the removed and all
subsequent iterators become invalid including the end iterator. So I've
added a return of the next iterator to removeCase and rewritten the
loops that were doing this to correctly follow the iterator pattern of
either incremneting or removing and assigning fresh values to the
iterator and the end.
In one case we were trying to go backwards to make this cleaner but it
doesn't actually work. I've made that code match the code we use
everywhere else to remove cases as we iterate. This changes the order of
cases in one test output and I moved that test to CHECK-DAG so it
wouldn't care -- the order isn't semantically meaningful anyways.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298791
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 25 Mar 2017 21:22:12 +0000 (21:22 +0000)]
[X86] Pull out repeated ScalarValueSizeInBits code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298783
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 25 Mar 2017 20:43:01 +0000 (20:43 +0000)]
[X86][SSE] Combine (VSRLI (VSRAI X, Y), (NumSignBits-1)) -> (VSRLI X, (NumSignBits-1))
Part 3 of 3.
Differential Revision: https://reviews.llvm.org/D31347
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298782
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 25 Mar 2017 20:20:23 +0000 (20:20 +0000)]
Change the default attributes for llvm.prefetch to inaccessiblemem_or_argmemonly
so that we can perform some optimizations across it.
Fixes PR32365
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298781
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 25 Mar 2017 19:58:36 +0000 (19:58 +0000)]
[X86][SSE] Added ComputeNumSignBitsForTargetNode support for (V)PSRAI
Part 2 of 3.
Differential Revision: https://reviews.llvm.org/D31347
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298780
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 25 Mar 2017 19:50:14 +0000 (19:50 +0000)]
[X86][SSE] Generalised CMP+AND1 combine to ZERO/ALLBITS+MASK
Patch to generalize combinePCMPAnd1 (for handling SETCC + ZEXT cases) to work for any input that has zero/all bits set masked with an 'all low bits' mask.
Replaced the implicit assumption of shift availability with a call to SupportedVectorShiftWithImm.
Part 1 of 3.
Differential Revision: https://reviews.llvm.org/D31347
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298779
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 25 Mar 2017 16:05:33 +0000 (16:05 +0000)]
[x86] use PMOVMSK to replace memcmp libcalls for 16-byte equality
This is the payoff for D31156 - if a target has efficient comparison instructions for vector-sized equality,
we can replace memcmp calls with inline code that is both smaller and faster.
Differential Revision: https://reviews.llvm.org/D31290
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298775
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 25 Mar 2017 15:43:36 +0000 (15:43 +0000)]
[X86][SSE] Add extra computeNumSignBits test case for D31311.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298774
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 25 Mar 2017 06:52:52 +0000 (06:52 +0000)]
[InstCombine] Change the interface of SimplifyDemandedBits so that it takes the instruction and operand instead of the Use.
The first thing it did was get the User for the Use to get the instruction back. This requires looking through the Uses for the User using the waymarking walk. That's pretty fast, but its probably still better to just pass the Instruction we already had.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298772
91177308-0d34-0410-b5e6-
96231b3b80d8
Balaram Makam [Sat, 25 Mar 2017 04:02:39 +0000 (04:02 +0000)]
[AArch64] Refine Falkor Machine Model - Part1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298768
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 25 Mar 2017 02:40:02 +0000 (02:40 +0000)]
[NewGVN] Adjust NDEBUG markers.
This avoids 'used but not defined' warnings in Release builds
with GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298760
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Sat, 25 Mar 2017 02:05:44 +0000 (02:05 +0000)]
[AMDGPU] Switch data layout by triple environment amdgiz
Switch data layout by target triple environment amdgiz and amdgizcl indicating using of an address space mapping in which generic address space is 0.
amdgiz is for non-OpenCL environment where generic address space is 0.
amdgizcl is for OpenCL environment where generic address space is 0.
Differential Revision: https://reviews.llvm.org/D31211
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298758
91177308-0d34-0410-b5e6-
96231b3b80d8
Vitaly Buka [Sat, 25 Mar 2017 01:19:45 +0000 (01:19 +0000)]
[libFuzzer] Fix test on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298757
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Sat, 25 Mar 2017 01:01:11 +0000 (01:01 +0000)]
[asan] Put ctor/dtor in comdat.
When possible, put ASan ctor/dtor in comdat.
The only reason not to is global registration, which can be
TU-specific. This is not the case when there are no instrumented
globals. This is also limited to ELF targets, because MachO does
not have comdat, and COFF linkers may GC comdat constructors.
The benefit of this is a lot less __asan_init() calls: one per DSO
instead of one per TU. It's also necessary for the upcoming
gc-sections-for-globals change on Linux, where multiple references to
section start symbols trigger quadratic behaviour in gold linker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298756
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 25 Mar 2017 00:56:08 +0000 (00:56 +0000)]
[libFuzzer] read asan's dedup_token while minimizing a crash and stop minimization if another bug was found during minimization (https://github.com/google/oss-fuzz/issues/452)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298755
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sat, 25 Mar 2017 00:13:24 +0000 (00:13 +0000)]
[ARM] Fix mixup between Lo and Hi in SMLALBB formation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298752
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 24 Mar 2017 23:47:41 +0000 (23:47 +0000)]
Apply clang-format as commented in D31311. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298751
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 24 Mar 2017 23:28:42 +0000 (23:28 +0000)]
[codeview] Don't assert when the user violates the ODR
If we have an array of a user-defined aggregates for which there was an
ODR violation, then the array size will not necessarily match the number
of elements times the size of the element.
Fixes PR32383
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298750
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Fri, 24 Mar 2017 23:00:21 +0000 (23:00 +0000)]
[Outliner] Revert r298734.
When I tested r298734, I thought that red zones were enabled by default like in
X86. Since red zones are behind a flag on AArch64 the testing wasn't true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298747
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 24 Mar 2017 22:19:52 +0000 (22:19 +0000)]
[libFuzzer] be more careful when calling strlen of strcmp parameters, PR32357
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298746
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 22:12:10 +0000 (22:12 +0000)]
Revert r298711 "[InstCombine] Provide a way to calculate KnownZero/One for Add/Sub in SimplifyDemandedUseBits without recursing into ComputeKnownBits"
Tsan bot is failing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298745
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 24 Mar 2017 22:09:48 +0000 (22:09 +0000)]
[x86] add 32-bit RUN for better memcmp coverage; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298744
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 24 Mar 2017 21:09:16 +0000 (21:09 +0000)]
[libFuzzer] honor -exact_artifact_path for all intermediate files during crash minimization (https://github.com/google/oss-fuzz/issues/250)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298740
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 24 Mar 2017 21:01:16 +0000 (21:01 +0000)]
Move spill size and alignment info from MC to TargetRegisterInfo
This is another step towards implementing register classes with
parametrized register/spill sizes and value types.
This is an updated version of r298652. The difference is that MCRegister-
Class still contains register size, available as getPhysRegSize(). The
old function getSize was retained as a temporary measure to avoid build
breakage for out-of-tree targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298739
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Mar 2017 20:57:10 +0000 (20:57 +0000)]
AMDGPU: Fix annotating loops with nested loop conditions
If the branch condition for a loop was a phi which itself
was fed from a phi from a loop, it isn't safe to try
to delete the phi until after the loop is handled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298737
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 24 Mar 2017 20:52:56 +0000 (20:52 +0000)]
[MachineScheduler] Add missing machine pass dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298736
91177308-0d34-0410-b5e6-
96231b3b80d8
Ivan Krasin [Fri, 24 Mar 2017 20:49:43 +0000 (20:49 +0000)]
Revert r298620: [LV] Vectorize GEPs
Reason: breaks linking Chromium with LLD + ThinLTO (a pass crashes)
LLVM bug: https://bugs.llvm.org//show_bug.cgi?id=32413
Original change description:
[LV] Vectorize GEPs
This patch adds support for vectorizing GEPs. Previously, we only generated
vector GEPs on-demand when creating gather or scatter operations. All GEPs from
the original loop were scalarized by default, and if a pointer was to be stored
to memory, we would have to build up the pointer vector with insertelement
instructions.
With this patch, we will vectorize all GEPs that haven't already been marked
for scalarization.
The patch refines collectLoopScalars to more exactly identify the scalar GEPs.
The function now more closely resembles collectLoopUniforms. And the patch
moves vector GEP creation out of vectorizeMemoryInstruction and into the main
vectorization loop. The vector GEPs needed for gather and scatter operations
will have already been generated before vectoring the memory accesses.
Original Differential Revision: https://reviews.llvm.org/D30710
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298735
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Fri, 24 Mar 2017 20:47:59 +0000 (20:47 +0000)]
[Outliner] Remove no red zone requirment for AArch64
AArch64 doesn't require -mno-red-zone; stack fixups are sufficient here. This was
unnecessarily copied over from the X86 target.
(You can now outline with red zones! Yay!)
Removing the requirement passes all Single/MultiSource tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298734
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 24 Mar 2017 20:47:41 +0000 (20:47 +0000)]
Document how to fetch monorepo SVN revision notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298733
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Fri, 24 Mar 2017 20:42:15 +0000 (20:42 +0000)]
[asan] Delay creation of asan ctor.
Create the constructor in the module pass.
This in needed for the GC-friendly globals change, where the constructor can be
put in a comdat in some cases, but we don't know about that in the function
pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298731
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Mar 2017 20:04:18 +0000 (20:04 +0000)]
AMDGPU: Implement f16 fround
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298730
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Mar 2017 19:52:05 +0000 (19:52 +0000)]
AMDGPU: Unify divergent function exits.
StructurizeCFG can't handle cases with multiple
returns creating regions with multiple exits.
Create a copy of UnifyFunctionExitNodes that only
unifies exit nodes that skips exit nodes
with uniform branch sources.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298729
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 24 Mar 2017 19:18:29 +0000 (19:18 +0000)]
Revert r298652 on Quentin's request
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298727
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 24 Mar 2017 19:11:31 +0000 (19:11 +0000)]
Make testcase less nonsensical while still exercising the same code paths.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298726
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Mar 2017 19:04:57 +0000 (19:04 +0000)]
AMDGPU: Fold rcp/rsq of undef to undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298725
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Mar 2017 18:56:43 +0000 (18:56 +0000)]
TTI: Split IsSimple in MemIntrinsicInfo
All this did before was assert in EarlyCSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298724
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Fri, 24 Mar 2017 18:55:20 +0000 (18:55 +0000)]
[AMDGPU] Fold V_CNDMASK with identical source operands
Such instructions sometimes appear after lowering and folding.
Differential Revision: https://reviews.llvm.org/D31318
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298723
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Fri, 24 Mar 2017 18:43:15 +0000 (18:43 +0000)]
[AMDGPU] Rename Kind to ValueKind in metadata to be consistent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298722
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Fri, 24 Mar 2017 18:01:14 +0000 (18:01 +0000)]
[AMDGPU] Add AMDGPUAliasAnalysis to opt pipeline
Previously it was added only to the BE.
Differential Revision: https://reviews.llvm.org/D31323
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298721
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Fri, 24 Mar 2017 17:59:06 +0000 (17:59 +0000)]
[ThinLTO] Correct counting of functions in inliner stats
Summary: Declarations need to be filtered out when counting functions.
Reviewers: eraman
Subscribers: Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D31336
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298720
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Mar 2017 17:53:06 +0000 (17:53 +0000)]
[AMDGPU] Don't enforce constexpr, there are still old standard libraries around that don't have a constexpr std::pair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298719
91177308-0d34-0410-b5e6-
96231b3b80d8
Valery Pykhtin [Fri, 24 Mar 2017 17:49:05 +0000 (17:49 +0000)]
[AMDGPU] Remove double map lookups in SI scheduler
Patch by Axel Davy (axel.davy@normalesup.org)
Differential revision: https://reviews.llvm.org/D30382
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298718
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 24 Mar 2017 17:26:38 +0000 (17:26 +0000)]
[PDB] Split item and type records when merging type streams
Summary: MSVC does this when producing a PDB.
Reviewers: ruiu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31316
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298717
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 24 Mar 2017 17:25:47 +0000 (17:25 +0000)]
[X86][SSE] Add ashr + mask test cases.
Test cases showing cases where we're missing an opportunity to lshr a value with an extended sign to avoid loading a mask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298716
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 16:56:51 +0000 (16:56 +0000)]
[InstCombine] Provide a way to calculate KnownZero/One for Add/Sub in SimplifyDemandedUseBits without recursing into ComputeKnownBits
SimplifyDemandedUseBits for Add/Sub already recursed down LHS and RHS for simplifying bits. If that didn't provide any simplifications we fall back to calling computeKnownBits which will recurse again. Instead just take the known bits for LHS and RHS we already have and call into a new function in ValueTracking that can calculate the known bits given the LHS/RHS bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298711
91177308-0d34-0410-b5e6-
96231b3b80d8
Valery Pykhtin [Fri, 24 Mar 2017 16:45:50 +0000 (16:45 +0000)]
[AMDGPU] Fix SGPR usage count in SI scheduler
Patch by Axel Davy (axel.davy@normalesup.org)
Differential revision: https://reviews.llvm.org/D30149
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298710
91177308-0d34-0410-b5e6-
96231b3b80d8
Valery Pykhtin [Fri, 24 Mar 2017 16:37:48 +0000 (16:37 +0000)]
[AMDGPU] Add a new line after a debug message
Patch by Axel Davy (axel.davy@normalesup.org)
Differential revision: https://reviews.llvm.org/D30146
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298708
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 24 Mar 2017 16:13:18 +0000 (16:13 +0000)]
stable-merge-request.sh: Add a script for submitting merge requests via bugzilla
Summary:
This script will automatically create a new stable merge request bug in
bugzilla for the given svn revision and release number.
Reviewers: hans
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D30905
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298705
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 24 Mar 2017 16:12:31 +0000 (16:12 +0000)]
[X86][SSE] Generalised lowerTruncate by PACKSS to work with any 'zero/all bits' result, not just comparisons.
Added vector compare opcodes to X86TargetLowering::ComputeNumSignBitsForTargetNode
Covered by existing tests added for D22814.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298704
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Mar 2017 14:17:56 +0000 (14:17 +0000)]
Another instance where GCC doesn't understand implicit construction of StringLiteral.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298703
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Mar 2017 14:15:35 +0000 (14:15 +0000)]
Make GCC happy again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298702
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Mar 2017 14:11:47 +0000 (14:11 +0000)]
Don't build up std::vectors with constant sizes when an array suffices.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298701
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Fri, 24 Mar 2017 12:50:45 +0000 (12:50 +0000)]
Remove stale and unused (MC)TargetOptions comparators.
Summary:
I discovered accidentally that the operator== for TargetOptions
is stale - it is missing many fields that have been added over
the recent years. It isn't used, so remove it. Ditto for the
comparator in MCTargetOptions, which doesn't seem stale yet but is
unused.
Reviewers: echristo
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D31301
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298700
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Fri, 24 Mar 2017 07:04:31 +0000 (07:04 +0000)]
Revert "[ScalarEvolution] Re-enable Predicate implication from operations"
This reverts commit rL298690
Causes failures on clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298693
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 24 Mar 2017 06:33:51 +0000 (06:33 +0000)]
NewGVN: Small cleanup of two dominance related functions to make
them easier to understand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298692
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 24 Mar 2017 06:33:48 +0000 (06:33 +0000)]
NewGVN: Small cleanup of useless expression deletion, and don't uselessly create two expressions in symbolic store evaluation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298691
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Fri, 24 Mar 2017 06:19:00 +0000 (06:19 +0000)]
[ScalarEvolution] Re-enable Predicate implication from operations
The patch rL298481 was reverted due to crash on clang-with-lto-ubuntu build.
The reason of the crash was type mismatch between either a or b and RHS in the following situation:
LHS = sext(a +nsw b) > RHS.
This is quite rare, but still possible situation. Normally we need to cast all {a, b, RHS} to their widest type.
But we try to avoid creation of new SCEV that are not constants to avoid initiating recursive analysis that
can take a lot of time and/or cache a bad value for iterations number. To deal with this, in this patch we
reject this case and will not try to analyze it if the type of sum doesn't match with the type of RHS. In this
situation we don't need to create any non-constant SCEVs.
This patch also adds an assertion to the method IsProvedViaContext so that we could fail on it and not
go further into range analysis etc (because in some situations these analyzes succeed even when the passed
arguments have wrong types, what should not normally happen).
The patch also contains a fix for a problem with too narrow scope of the analysis caused by wrong
usage of predicates in recursive invocations.
The regression test on the said failure: test/Analysis/ScalarEvolution/implied-via-addition.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298690
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 05:38:09 +0000 (05:38 +0000)]
[ValueTracking] Use uint64_t for CarryIn in computeKnownBitsAddSub instead of a creating a temporary APInt. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298688
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 24 Mar 2017 05:30:34 +0000 (05:30 +0000)]
NewGVN: Fix PR32403 - Handling of undef in phis was not quite correct
due to LLVM's view of phi nodes. It would cause NewGVN not to fixpoint
in some interesting edge cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298687
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 03:57:24 +0000 (03:57 +0000)]
[ValueTracking] Convert more places to use setHighBits/setLowBits/setSignBit. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298683
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 02:58:02 +0000 (02:58 +0000)]
[InstCombine] Use range-based for loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298680
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 02:57:59 +0000 (02:57 +0000)]
[InstCombine] Fix 80 column violation I accidentally introduced. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298679
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Fri, 24 Mar 2017 02:21:11 +0000 (02:21 +0000)]
[CMake] Support single target builtins build on Darwin
This change allows cross-compiling compiler-rt builtins for
multiple targets as part of runtimes on Darwin. This functionality
is already supported on other platforms.
Differential Revision: https://reviews.llvm.org/D30957
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298678
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Fri, 24 Mar 2017 01:57:29 +0000 (01:57 +0000)]
[AVR] Fix build after r298178
r298178 capitalized the fields in `ArgListEntry`. All the official
targets were updated accordingly, but as an experimental target AVR
was missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298677
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 24 Mar 2017 00:51:18 +0000 (00:51 +0000)]
[libFuzzer] split two tests to get more parallelism in test runs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298673
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 24 Mar 2017 00:45:15 +0000 (00:45 +0000)]
[libFuzzer] increase kFeatureSetSize to 2^21 and make InputCorpus scale to that size. This will potentially make libFuzzer more sensitive on targets with lots of signals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298671
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 23 Mar 2017 23:48:47 +0000 (23:48 +0000)]
[libFuzzer] fix non-linux build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298666
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 23 Mar 2017 23:35:09 +0000 (23:35 +0000)]
Refactor code to reduce indentation and improve readability. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298665
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 23 Mar 2017 23:35:00 +0000 (23:35 +0000)]
Fix a bug when emitting debug info for partially constant global variables.
While fixing a malformed testcase, I discovered that the code
exercised by it was wrong, too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298664
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 23 Mar 2017 23:30:41 +0000 (23:30 +0000)]
[sancov] Don't instrument blocks with no insertion point
This prevents crashes when attempting to instrument functions containing
C++ try.
Sanitizer coverage will still fail at runtime when an exception is
thrown through a sancov instrumented function, but that seems marginally
better than what we have now. The full solution is to color the blocks
in LLVM IR and only instrument blocks that have an unambiguous color,
using the appropriate token.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298662
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Thu, 23 Mar 2017 23:28:09 +0000 (23:28 +0000)]
Fix trellis layout to avoid mis-identify triangle.
Summary:
For the following CFG:
A->B
B->C
A->C
If there is another edge B->D, then ABC should not be considered as triangle.
Reviewers: davidxl, iteratee
Reviewed By: iteratee
Subscribers: nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D31310
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298661
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Thu, 23 Mar 2017 23:26:00 +0000 (23:26 +0000)]
Set the prof weight correctly for call instructions in DeadArgumentElimination.
Summary: In DeadArgumentElimination, the call instructions will be replaced. We also need to set the prof weights so that function inlining can find the correct profile.
Reviewers: eraman
Reviewed By: eraman
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31143
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298660
91177308-0d34-0410-b5e6-
96231b3b80d8