OSDN Git Service
Craig Topper [Tue, 4 Apr 2017 05:03:02 +0000 (05:03 +0000)]
[InstCombine] Use setAllBits in place of getAllOnesValue since we know the bitwidths are the same. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299413
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Tue, 4 Apr 2017 04:47:57 +0000 (04:47 +0000)]
InstCombine: Use the InstSimplify hook for shufflevector
Summary: Start using the recently added InstSimplify hook for shuffles in the respective InstCombine visitor.
Reviewers: spatel, RKSimon, craig.topper, majnemer
Reviewed By: majnemer
Subscribers: majnemer, llvm-commits
Differential Revision: https://reviews.llvm.org/D31526
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299412
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 4 Apr 2017 00:56:34 +0000 (00:56 +0000)]
[PDB] Save one type record copy
Summary:
The TypeTableBuilder provides stable storage for type records. We don't
need to copy all of the bytes into a flat vector before adding it to the
TpiStreamBuilder.
This makes addTypeRecord take an ArrayRef<uint8_t> and a hash code to go
with it, which seems like a simplification.
Reviewers: ruiu, zturner, inglorion
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31634
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299406
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 3 Apr 2017 23:58:15 +0000 (23:58 +0000)]
[codeview] Cope with unsorted streams in type merging
Summary:
MASM can produce type streams that are not topologically sorted. It can
even produce type streams with circular references, but those are not
common in practice.
Reviewers: inglorion, ruiu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31629
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299403
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 3 Apr 2017 23:00:25 +0000 (23:00 +0000)]
[Fuzzer] Flush std::cout before aborting in CxxStringEqTest
On Windows, abort() does not appear to flush std::cout. Should fix red
sanitizer-windows bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299398
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 3 Apr 2017 22:45:46 +0000 (22:45 +0000)]
add/move codegen tests for and/or of setcc; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299396
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 3 Apr 2017 22:24:32 +0000 (22:24 +0000)]
Update stale doxygen links in ProgrammersManual.rst
Patch by Wei-Ren Chen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299395
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Mon, 3 Apr 2017 22:05:30 +0000 (22:05 +0000)]
InstSimplify: Add a hook for shufflevector
Summary:
Add a hook for simplification of shufflevector's with the following rules:
- Constant folding - NFC, as it was already being done by the default handler.
- If only one of the operands is constant, constant fold the shuffle if the
mask does not select elements from the variable operand - to show the hook is firing and affecting the test-cases.
Reviewers: RKSimon, craig.topper, spatel, sanjoy, nlopes, majnemer
Reviewed By: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31525
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299393
91177308-0d34-0410-b5e6-
96231b3b80d8
Weiming Zhao [Mon, 3 Apr 2017 21:50:04 +0000 (21:50 +0000)]
Reland r298901 with modifications (reverted in r298932)
Dont emit Mapping symbols for sections that contain only data.
Summary:
Dont emit mapping symbols for sections that contain only data.
Reviewers: rengolin, weimingz, kparzysz, t.p.northover, peter.smith
Reviewed By: t.p.northover
Patched by Shankar Easwaran <shankare@codeaurora.org>
Subscribers: alekseyshl, t.p.northover, llvm-commits
Differential Revision: https://reviews.llvm.org/D30724
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299392
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 3 Apr 2017 21:45:13 +0000 (21:45 +0000)]
AMDGPU: Remove llvm.SI.vs.load.input
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299391
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 3 Apr 2017 21:28:13 +0000 (21:28 +0000)]
DAG: Fix missing legalization for any_extend_vector_inreg operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299389
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 3 Apr 2017 21:25:20 +0000 (21:25 +0000)]
[codeview] Add support for label type records
MASM can produce these type records.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299388
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 3 Apr 2017 21:06:51 +0000 (21:06 +0000)]
[X86][SSE]] Lower BUILD_VECTOR with repeated elts as BUILD_VECTOR + VECTOR_SHUFFLE
It can be costly to transfer from the gprs to the xmm registers and can prevent loads merging.
This patch splits vXi16/vXi32/vXi64 BUILD_VECTORS that use the same operand in multiple elements into a BUILD_VECTOR with only a single insertion of each of those elements and then performs an unary shuffle to duplicate the values.
There are a couple of minor regressions this patch unearths due to some missing MOVDDUP/BROADCAST folds that I will address in a future patch.
Note: Now that vector shuffle lowering and combining is pretty good we should be reusing that instead of duplicating so much in LowerBUILD_VECTOR - this is the first of several patches to address this.
Differential Revision: https://reviews.llvm.org/D31373
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299387
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 3 Apr 2017 20:41:47 +0000 (20:41 +0000)]
[InstCombine] Remove canonicalization for (X & C1) | C2 --> (X | C2) & (C1|C2) when C1 & C2 have common bits.
It turns out that SimplifyDemandedInstructionBits will get called earlier and remove bits from C1 first. Effectively doing (X & (C1&C2)) | C2. So by the time it got to this check there could be no common bits.
I think the DAGCombiner has the same check but its check can be executed because it handles demanded bits later. I'll look at it next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299384
91177308-0d34-0410-b5e6-
96231b3b80d8
Amjad Aboud [Mon, 3 Apr 2017 20:28:45 +0000 (20:28 +0000)]
x86 interrupt calling convention: re-align stack pointer on 64-bit if an error code was pushed
The x86_64 ABI requires that the stack is 16 byte aligned on function calls. Thus, the 8-byte error code, which is pushed by the CPU for certain exceptions, leads to a misaligned stack. This results in bugs such as Bug 26413, where misaligned movaps instructions are generated.
This commit fixes the misalignment by adjusting the stack pointer in these cases. The adjustment is done at the beginning of the prologue generation by subtracting another 8 bytes from the stack pointer. These additional bytes are popped again in the function epilogue.
Fixes Bug 26413
Patch by Philipp Oppermann.
Differential Revision: https://reviews.llvm.org/D30049
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299383
91177308-0d34-0410-b5e6-
96231b3b80d8
Jun Bum Lim [Mon, 3 Apr 2017 19:20:07 +0000 (19:20 +0000)]
[CodeGenPrep] move aarch64-type-promotion to CGP
Summary:
Move the aarch64-type-promotion pass within the existing type promotion framework in CGP.
This change also support forking sexts when a new sext is required for promotion.
Note that change is based on D27853 and I am submitting this out early to provide a better idea on D27853.
Reviewers: jmolloy, mcrosier, javed.absar, qcolombet
Reviewed By: qcolombet
Subscribers: llvm-commits, aemerson, rengolin, mcrosier
Differential Revision: https://reviews.llvm.org/D28680
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299379
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 3 Apr 2017 19:18:48 +0000 (19:18 +0000)]
[DAGCombine][InstCombine] Fix inverted if condition in equivalent comments in DAGCombine and InstCombine. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299378
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel Jones [Mon, 3 Apr 2017 18:21:50 +0000 (18:21 +0000)]
Fix LLVMBuild.txt typo. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299373
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 3 Apr 2017 18:08:08 +0000 (18:08 +0000)]
AMDGPU: Remove legacy bfe intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299372
91177308-0d34-0410-b5e6-
96231b3b80d8
Graydon Hoare [Mon, 3 Apr 2017 18:04:15 +0000 (18:04 +0000)]
[Support] Make printAllJSONValues public, for custom output.
Summary:
This changes the static method TimerGroup::printAllJSONValues from private to
public, to match the static method TimerGroup::printAll. When trying to drive
the reporting machinery by hand, the existing API is _almost_ flexible enough,
but this entrypoint is required to intermix printing timers with other
non-timer output.
The underlying motive here is a Swift change to consolidate the collection of
timers, LLVM statistics and other (non-assert-dependent) counters into JSON
files, which requires a bit of manual intervention in LLVM's stat and timer
output routines. See https://github.com/apple/swift/pull/8477 for details.
Reviewers: MatzeB
Reviewed By: MatzeB
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31566
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299371
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 3 Apr 2017 17:58:48 +0000 (17:58 +0000)]
Bitcode: Remove reader support for MODULE_CODE_PURGEVALS.
Support for writing this module code was removed in r73220, which was well
before the LLVM 3.0 release, so we do not need to be able to understand it
for backwards compatibility.
Differential Revision: https://reviews.llvm.org/D31563
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299370
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 3 Apr 2017 17:49:15 +0000 (17:49 +0000)]
[InstCombine] Add test cases showing how we fail to fold vector constants into selects the way we do with scalars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299369
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Mon, 3 Apr 2017 17:41:19 +0000 (17:41 +0000)]
Revert "[DAGCombine] A shuffle of a splat is always the splat itself"
This reverts commit r299047 which is incorrect because the
simplification may result in incorrect propogation of undefs to users of
the folded shuffle.
Thanks to Andrea Di Biagio for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299368
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 3 Apr 2017 17:26:40 +0000 (17:26 +0000)]
[Hexagon] Factor out some common code in HexagonEarlyIfConv.cpp, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299367
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 3 Apr 2017 17:22:23 +0000 (17:22 +0000)]
Revert r299337 "[InstCombine] Remove redundant combine from visitAnd"
One of the tsan bots started failing at this commit. I don't see anything obviously wrong with the commit so trying this to see if it recovers.
Failing log: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/6792
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299366
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 3 Apr 2017 16:53:12 +0000 (16:53 +0000)]
[InstCombine] fix formatting for foldLogOpOfMaskedICmps and related bits; NFCI
1. Improve enum, function, and variable names.
2. Improve comments.
3. Fix variable capitalization.
4. Run clang-format.
As an existing code comment suggests, this should work with vector types / splat constants too,
so making this look right first will reduce the diffs needed for that change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299365
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 3 Apr 2017 16:34:59 +0000 (16:34 +0000)]
[APInt] Move isMask and isShiftedMask out of APIntOps and into the APInt class. Implement them without memory allocation for multiword
This moves the isMask and isShiftedMask functions to be class methods. They now use the MathExtras.h function for single word size and leading/trailing zeros/ones or countPopulation for the multiword size. The previous implementation made multiple temorary memory allocations to do the bitwise arithmetic operations to match the MathExtras.h implementation.
Differential Revision: https://reviews.llvm.org/D31565
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299362
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 3 Apr 2017 15:27:49 +0000 (15:27 +0000)]
[DAGCombiner] Check limits before accessing array element (PR32502)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299361
91177308-0d34-0410-b5e6-
96231b3b80d8
Sjoerd Meijer [Mon, 3 Apr 2017 14:50:04 +0000 (14:50 +0000)]
ARMAsmParser: clean up of isImmediate functions
- we are now using immediate AsmOperands so that the range check functions are
tablegen'ed.
- Big bonus is that error messages become much more accurate, i.e. instead of a
useless "invalid operand" error message it will not say that the immediate
operand must in range [x,y], which is why regression tests needed updating.
More tablegen operand descriptions could probably benefit from using
immediateAsmOperand, but this is a first good step to get rid of most of the
nearly identical range check functions. I will address the remaining immediate
operands in next clean ups.
Differential Revision: https://reviews.llvm.org/D31333
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299358
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 3 Apr 2017 07:08:08 +0000 (07:08 +0000)]
[InstCombine] Make foldOpWithConstantIntoOperand take a BinaryOperator instead of a generic Instruction.
It blindly assumes there are two operands so make it explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299351
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 3 Apr 2017 06:02:09 +0000 (06:02 +0000)]
[InstCombine] Remove a And transform that should be handled by SimplifyDemandedInstructionBits. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299349
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 2 Apr 2017 23:57:17 +0000 (23:57 +0000)]
Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299344
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 2 Apr 2017 23:57:10 +0000 (23:57 +0000)]
Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299343
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 2 Apr 2017 19:35:18 +0000 (19:35 +0000)]
[APInt] Make use of whichWord and maskBit to simplify some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299342
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 2 Apr 2017 19:17:22 +0000 (19:17 +0000)]
[APInt] Add a public typedef for the internal type of APInt use it instead of integerPart. Make APINT_BITS_PER_WORD and APINT_WORD_SIZE public.
This patch is one step to attempt to unify the main APInt interface and the tc functions used by APFloat.
This patch adds a WordType to APInt and uses that in all the tc functions. I've added temporary typedefs to APFloat to alias it to integerPart to keep the patch size down. I'll work on removing that in a future patch.
In future patches I hope to reuse the tc functions to implement some of the main APInt functionality.
I may remove APINT_ from BITS_PER_WORD and WORD_SIZE constants so that we don't have the repetitive APInt::APINT_ externally.
Differential Revision: https://reviews.llvm.org/D31523
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299341
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 2 Apr 2017 17:57:30 +0000 (17:57 +0000)]
[InstCombine] Make InstCombiner::OptAndOp take a BinaryOperator instead of an Instruction.
The callers have already performed the necessary cast before calling. This allows us to remove a comment that says the instruction must be a BinaryOperator and make it explicit in the argument type.
Had to add a default case to the switch because BinaryOperator::getOpcode() returns a BinaryOps enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299339
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 2 Apr 2017 17:45:41 +0000 (17:45 +0000)]
[X86][MMX] Improve support for folding fptosi from XMM to MMX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299338
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 2 Apr 2017 17:34:30 +0000 (17:34 +0000)]
[InstCombine] Remove redundant combine from visitAnd
As far as I can tell this combine is fully handled by SimplifyDemandedInstructionBits.
I was only looking at this because it is the only user of APIntOps::isShiftedMask which is itself broken. As demonstrated by r299187. I was going to fix isShiftedMask and needed to make sure we had coverage for the new cases it would expose to this combine. But looks like we can nuke it instead.
Differential Revision: https://reviews.llvm.org/D31543
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299337
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 2 Apr 2017 16:20:34 +0000 (16:20 +0000)]
[X86][MMX] Simplify tablegen patterns by always combining MOVDQ2Q from v2i64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299336
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 2 Apr 2017 15:52:28 +0000 (15:52 +0000)]
[X86][MMX] Added support for subvector extraction to MMX register
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299335
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 2 Apr 2017 15:05:18 +0000 (15:05 +0000)]
APInt.h: Prune \param(s) in \returns. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299334
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 2 Apr 2017 14:21:14 +0000 (14:21 +0000)]
Regenerate test with codegen. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299333
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 2 Apr 2017 13:59:37 +0000 (13:59 +0000)]
Regenerate test with codegen. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299332
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 2 Apr 2017 13:50:44 +0000 (13:50 +0000)]
Regenerate test. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299331
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sun, 2 Apr 2017 13:23:44 +0000 (13:23 +0000)]
NewGVN: Handle coercion of constant stores, loads, memory insts.
Summary:
Depends on D30928.
This adds support for coercion of stores and memory instructions that do not require insertion to process.
Another few tests down.
I added the relevant tests from rle.ll
Reviewers: davide
Subscribers: llvm-commits, Prazek
Differential Revision: https://reviews.llvm.org/D30929
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299330
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolai Bozhenov [Sun, 2 Apr 2017 13:14:30 +0000 (13:14 +0000)]
[BypassSlowDivision] Do not bypass division of hash-like values
Disable bypassing if one of the operands looks like a hash value. Slow
division often occurs in hashtable implementations and fast division is
never taken there because a hash value is extremely unlikely to have
enough upper bits set to zero.
A value is considered to be hash-like if it is produced by
1) XOR operation
2) Multiplication by a constant wider than the shorter type
3) PHI node with all incoming values being hash-like
Differential Revision: https://reviews.llvm.org/D28200
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299329
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 2 Apr 2017 13:10:20 +0000 (13:10 +0000)]
[X86][MMX] Add generic fptosi 4f32-4i32 test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299328
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Sun, 2 Apr 2017 10:42:21 +0000 (10:42 +0000)]
Add another interesting shufflevector test case for InstSimplify. NFC.
Test case shows opportunity to constant fold a shuffle with one variable
input vector operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299327
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 2 Apr 2017 06:59:43 +0000 (06:59 +0000)]
[X86] Use tcAdd/tcSubtract to implement the slow case of operator+=/operator-=.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299326
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 2 Apr 2017 06:59:41 +0000 (06:59 +0000)]
[APInt] Combine declaration and initialization. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299325
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 2 Apr 2017 06:59:38 +0000 (06:59 +0000)]
[APInt] Simplify some code by using operator+=(uint64_t) instead of doing a more complex assignment into a temporary APInt just to use the APInt operator+=.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299324
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 2 Apr 2017 06:59:36 +0000 (06:59 +0000)]
[APInt] Fix typo in comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299323
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sun, 2 Apr 2017 05:09:15 +0000 (05:09 +0000)]
MemorySSA: Add support for caching clobbering access in stores
Summary:
This enables us to cache the clobbering access for stores, despite the
fact that we can't rewrite the use-def chains themselves.
Early testing shows that, after this change, for larger testcases, it will be a significant net positive (memory and time) to remove the walker caching.
Reviewers: george.burgess.iv, davide
Subscribers: Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D31567
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299322
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Apr 2017 21:50:10 +0000 (21:50 +0000)]
[APInt] Use conditional operator to simplify some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299320
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Apr 2017 21:50:08 +0000 (21:50 +0000)]
[APInt] Implement flipAllBitsSlowCase with tcComplement. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299319
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Apr 2017 21:50:06 +0000 (21:50 +0000)]
[APInt] Fix indentation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299318
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Apr 2017 21:50:03 +0000 (21:50 +0000)]
[APInt] Implement AndAssignSlowCase using tcAnd. Do the same for Or and Xor. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299317
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Apr 2017 20:30:57 +0000 (20:30 +0000)]
[APInt] Allow GreatestCommonDivisor to take rvalue inputs efficiently. Use moves instead of copies in the loop.
Summary:
GreatestComonDivisor currently makes a copy of both its inputs. Then in the loop we do one move and two copies, plus any allocation the urem call does.
This patch changes it to take its inputs by value so that we can do a move of any rvalue inputs instead of copying. Then in the loop we do 3 move assignments and no copies. This way the only possible allocations we have in the loop is from the urem call.
Reviewers: dblaikie, RKSimon, hans
Reviewed By: dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31572
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299314
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 1 Apr 2017 19:47:52 +0000 (19:47 +0000)]
[WASM] Remove other comparison of unsigned expression >= 0.
This should finally fix the GCC 7 build with -Werror.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299313
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 1 Apr 2017 19:40:51 +0000 (19:40 +0000)]
[WASM] Remove a set but never used variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299312
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 1 Apr 2017 19:37:15 +0000 (19:37 +0000)]
[WASM] Remove an assertion that can never fire.
uint* is by definition always >=0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299311
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 1 Apr 2017 19:30:17 +0000 (19:30 +0000)]
[AMDGPU] Garbage collect now unused dead code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299310
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 1 Apr 2017 19:05:11 +0000 (19:05 +0000)]
[InstSimplify] add constant folding for fdiv/frem
Also, add a helper function so we don't have to repeat this code for each binop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299309
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 1 Apr 2017 18:44:03 +0000 (18:44 +0000)]
[InstSimplify] add tests for missed constant folding; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299308
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 1 Apr 2017 18:40:30 +0000 (18:40 +0000)]
fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299307
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 1 Apr 2017 15:53:12 +0000 (15:53 +0000)]
fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299305
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 1 Apr 2017 15:05:54 +0000 (15:05 +0000)]
[DAGCombiner] enable vector transforms for any/all {sign} bits set/clear
The code already allowed vector types in via "isInteger" (which might want
a more specific name), so use splat-friendly constant predicates to match
those types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299304
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 1 Apr 2017 14:32:18 +0000 (14:32 +0000)]
[PowerPC, x86] add vector tests for any/all {sign} bits set/clear; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299303
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sat, 1 Apr 2017 10:04:28 +0000 (10:04 +0000)]
MemorySSA: Update expensive checking version of def_chain_iterator for templating changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299301
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sat, 1 Apr 2017 09:44:33 +0000 (09:44 +0000)]
NewGVN: Don't try to kill off the stored value of stores when
processing the congruence class of the store.
Because we use the stored value of a store as the def, it isn't dead
just because it appears as a def when it comes from a store.
Note: I have not hit any cases with the memory code as it is where
this breaks anything, just because of what memory congruences we
actually allow. In a followup that improves memory congruence,
this bug actually breaks real stuff (but the verifier catches it).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299300
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sat, 1 Apr 2017 09:44:29 +0000 (09:44 +0000)]
NewGVN: Clean up GVNExpression memory hierarchy, restructure hash computation a bit so we don't have to redefine it for loads, stores, and calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299299
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sat, 1 Apr 2017 09:44:24 +0000 (09:44 +0000)]
NewGVN: Use def_chain iterator in singleReachablePhiPath instead of recursion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299298
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sat, 1 Apr 2017 09:44:19 +0000 (09:44 +0000)]
Move def_chain iterator to MemorySSA.h so it can be reused
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299297
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sat, 1 Apr 2017 09:44:14 +0000 (09:44 +0000)]
MemorySSA.h - make clang-format happy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299296
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sat, 1 Apr 2017 09:01:12 +0000 (09:01 +0000)]
MemorySSA: Push const correctness further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299295
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Sat, 1 Apr 2017 08:59:45 +0000 (08:59 +0000)]
MemorySSA: Kill the WalkTargetCache now that we have getBlockDefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299294
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Apr 2017 06:50:00 +0000 (06:50 +0000)]
[APInt] Implement operator! using operator==(uint64_t). NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299293
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Apr 2017 05:08:57 +0000 (05:08 +0000)]
[APInt] Remove the mul/urem/srem/udiv/sdiv functions from the APIntOps namespace. Replace the few usages with calls to the class methods. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299292
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Apr 2017 04:26:20 +0000 (04:26 +0000)]
[DAGCombiner] Fix fold (or (shuf A, V_0, MA), (shuf B, V_0, MB)) -> (shuf A, B, Mask) to explicitly ensure that only one of the inputs of each shuffle is a zero vector.
This can only happen when we have a mix of zero and undef elements and the two vectors have a different arrangement of zeros/undefs. The shuffle should eventually be constant folded to all zeros.
Fixes PR32484.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299291
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Sat, 1 Apr 2017 01:26:24 +0000 (01:26 +0000)]
Revert "Feature generic option to setup start/stop-after/before"
This reverts commit r299282.
Didn't intend to commit this :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299288
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Sat, 1 Apr 2017 01:26:21 +0000 (01:26 +0000)]
Revert "Localizer fun"
This reverts commit r299283.
Didn't intend to commit this :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299287
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Sat, 1 Apr 2017 01:26:17 +0000 (01:26 +0000)]
Revert "Instrument SDISel C++ patterns"
This reverts commit r299284.
Didn't intend to commit this :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299286
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Sat, 1 Apr 2017 01:26:14 +0000 (01:26 +0000)]
[RegBankSelect] Support REG_SEQUENCE for generic mapping
REG_SEQUENCE falls into the same category as COPY for operands mapping:
- They don't have MCInstrDesc with register constraints
- The input variable could use whatever register classes
- It is possible to have register class already assigned to the operands
In particular, given REG_SEQUENCE are always target specific because of
the subreg indices. Those indices must apply to the register class of
the definition of the REG_SEQUENCE and therefore, the target must set a
register class to that definition. As a result, the generic code can
always use that register class to derive a valid mapping for a
REG_SEQUENCE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299285
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Sat, 1 Apr 2017 01:21:32 +0000 (01:21 +0000)]
Instrument SDISel C++ patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299284
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Sat, 1 Apr 2017 01:21:28 +0000 (01:21 +0000)]
Localizer fun
WIP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299283
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Sat, 1 Apr 2017 01:21:24 +0000 (01:21 +0000)]
Feature generic option to setup start/stop-after/before
This patch refactors the code used in llc such that all the users of the
addPassesToEmitFile API have access to a homogeneous way of handling
start/stop-after/before options right out of the box.
Previously each user would have needed to duplicate this logic and set
up its own options.
NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299282
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 31 Mar 2017 23:22:19 +0000 (23:22 +0000)]
Fix a test to check assembly output instead of bitcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299279
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 31 Mar 2017 23:12:27 +0000 (23:12 +0000)]
Reduce the number of times we query the subtarget for the same information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299278
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 31 Mar 2017 23:12:24 +0000 (23:12 +0000)]
Small cleanup to remove extraneous cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299277
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Fri, 31 Mar 2017 22:36:39 +0000 (22:36 +0000)]
AMDGPU/llvm-readobj: Rename RuntimeMDNoteType -> CodeObjectMetadataNoteType to
match the new metadata. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299275
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 31 Mar 2017 22:23:42 +0000 (22:23 +0000)]
[APInt] Fix bugs in isShiftedMask to match behavior of the similar function in MathExtras.h
This removes a parameter from the routine that was responsible for a lot of the issue. It was a bit count that had to be set to the BitWidth of the APInt and would get passed to getLowBitsSet. This guaranteed the call to getLowBitsSet would create an all ones value. This was then compared to (V | (V-1)). So the only shifted masks we detected had to have the MSB set.
The one in tree user is a transform in InstCombine that never fires due to earlier transforms covering the case better. I've submitted a patch to remove it completely, but for now I've just adapted it to the new interface for isShiftedMask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299273
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Fri, 31 Mar 2017 22:14:54 +0000 (22:14 +0000)]
[AMDGPU] Fix typo in test filename. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299271
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Fri, 31 Mar 2017 22:14:14 +0000 (22:14 +0000)]
Add virtual destructor to WasmYAML::Section or avoid memory leak
Tested locally with -DLLVM_USE_SANITIZER=Address
Differential Revision: https://reviews.llvm.org/D31551
Patch by Sam Clegg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299270
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Haarman [Fri, 31 Mar 2017 21:56:30 +0000 (21:56 +0000)]
LTO: call getRealLinkageName on IRNames before feeding to getGUID
Summary: GlobalValue has two getGUID methods: an instance method and a static method. The static method takes a string, which is expected to be what GlobalValue::getRealLinkageName() would return. In LTO.cpp, we were not doing this consistently, sometimes passing an IR name instead. This change makes it so that we call getRealLinkageName() first, making the static getGUID return value consistent with the instance method. Without this change, compiling FileCheck with ThinLTO on Windows fails with numerous undefined symbol errors. With the change, it builds successfully.
Reviewers: pcc, rnk
Reviewed By: pcc
Subscribers: tejohnson, mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D31444
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299268
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 31 Mar 2017 21:35:30 +0000 (21:35 +0000)]
[InstCombine] When adding an Instruction and its Users to the worklist at the same time, make sure we put the Users in first. Then put in the instruction.
This way we ensure we immediately revisit the instruction and do any additional optimizations before visiting the users. Otherwise we might visit the users, then the instruction, then users again, then instruction again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299267
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 31 Mar 2017 21:30:50 +0000 (21:30 +0000)]
[DAGCombiner] refactor and/or-of-setcc to get rid of duplicated code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299266
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 31 Mar 2017 21:16:22 +0000 (21:16 +0000)]
Fix binary static archive that got mangled by patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299265
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 31 Mar 2017 21:10:53 +0000 (21:10 +0000)]
[llvm-ar] Extract objects to their basename in the CWD
This is helpful when extracting objects from archives produced by MSVC's
lib.exe, which users absolute paths to describe the archive members.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299264
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 31 Mar 2017 21:08:37 +0000 (21:08 +0000)]
[InstCombine] Add test case demonstrating missed opportunities for removing add/sub when the LSBs of one input are known to be 0 and MSBs of the output aren't consumed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299263
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 31 Mar 2017 21:03:59 +0000 (21:03 +0000)]
[Hexagon] Remove unused variables
Found by PVS-Studio. Fixes llvm.org/PR31676.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299262
91177308-0d34-0410-b5e6-
96231b3b80d8