Commit Graph

148841 Commits

Author SHA1 Message Date
Sanjoy Das
447ca1ab6d Delete trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302479 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 23:18:36 +00:00
Sanjay Patel
c4c34cce40 [InstCombine] add tests from D32285 to show current problems; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302475 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 22:33:20 +00:00
Greg Clayton
cca9d00b74 Add const to "DWARFDie &Die" in a few functions as they can't change the DWARFDie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302471 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 21:29:17 +00:00
Eugene Zemtsov
4f230b8d83 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302470 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 21:20:53 +00:00
Adrian Prantl
28bd5d128c Make it illegal for two Functions to point to the same DISubprogram
As recently discussed on llvm-dev [1], this patch makes it illegal for
two Functions to point to the same DISubprogram and updates
FunctionCloner to also clone the debug info of a function to conform
to the new requirement. To simplify the implementation it also factors
out the creation of inlineAt locations from the Inliner into a
general-purpose utility in DILocation.

[1] http://lists.llvm.org/pipermail/llvm-dev/2017-May/112661.html
<rdar://problem/31926379>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302469 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 21:17:08 +00:00
Matthias Braun
ca58fab8c4 STLExtras: Fix enumerate() documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 21:10:58 +00:00
Greg Clayton
a086b24688 Fix typo "veify" to "verify".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 20:53:00 +00:00
Sanjay Patel
b8a453126a [InstCombine] add folds for not-of-shift-right
This is another step towards getting rid of dyn_castNotVal, 
so we can recommit:
https://reviews.llvm.org/rL300977

As the tests show, we were missing the lshr case for constants
and both ashr/lshr vector splat folds. The ashr case with constant
was being performed inefficiently in 2 steps. It's also possible
there was a latent bug in that case because we can't do that fold
if the constant is positive:
http://rise4fun.com/Alive/Bge



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302465 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 20:49:59 +00:00
Davide Italiano
29aef3c4af [PartialInlining] Capture by reference rather than by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 20:44:01 +00:00
Tim Northover
a641bd93fb ARM: use divmod libcalls on embedded MachO platforms too.
The separated libcalls are implemented in terms of __divmodsi4 and __udivmodsi4
anyway, so we should always use them if possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302462 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 20:00:14 +00:00
Reid Kleckner
550359cb2f Don't add DBG_VALUE instructions for static allocas in dbg.declare
Summary:
An llvm.dbg.declare of a static alloca is always added to the
MachineFunction dbg variable map, so these values are entirely
redundant. They survive all the way through codegen to be ignored by
DWARF emission.

Effectively revert r113967

Two bugpoint-reduced test cases from 2012 broke as a result of this
change. Despite my best efforts, I haven't been able to rewrite the test
case using dbg.value. I'm not too concerned about the lost coverage
because these were reduced from the test-suite, which we still run.

Reviewers: aprantl, dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302461 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 19:58:15 +00:00
Zachary Turner
bb0606e8de Add some useful helper methods / operators to TypeIndex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302460 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 19:46:37 +00:00
Reid Kleckner
d5e8a6baea Update instructions for using the experimental monorepo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 19:45:57 +00:00
Zachary Turner
886c6baf06 [BitVector] Make find_prev member function const.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302458 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 19:45:55 +00:00
Sanjoy Das
6bc9c98728 Add a blurb to the release notes about the WeakVH -> WeakTrackingVH transition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 19:15:06 +00:00
Zachary Turner
f019c6b219 [CodeView] Add support for random access type visitors.
Previously type visitation was done strictly sequentially, and
TypeIndexes were computed by incrementing the TypeIndex of the
last visited record.  This works fine for situations like dumping,
but not when you want to visit types in random order.  For example,
in a debug session someone might lookup a symbol by name, find that
it has TypeIndex 10,000 and then want to go straight to TypeIndex
10,000.

In order to make this work, the visitation framework needs a mode
where it can plumb TypeIndices through the callback pipeline.  This
patch adds such a mode.  In doing so, it is necessary to provide
an alternative implementation of TypeDatabase that supports random
access, so that is done as well.

Nothing actually uses these random access capabilities yet, but
this will be done in subsequent patches.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302454 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 18:38:43 +00:00
Quentin Colombet
4a1e357426 [AArch64][RegisterBankInfo] Change the default mapping of fp loads.
This fixes PR32550, in a way that does not imply running the greedy
mode at O0.

The fix consists in checking if a load is used by any floating point
instruction and if yes, we return a default mapping with FPR instead
of GPR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302453 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 18:16:31 +00:00
Quentin Colombet
3343d80c50 [AArch64][RegisterBankInfo] Fix mapping cost for GPR.
In r292478, we changed the order of the enum that is referenced by
PMI_FirstXXX. This had the side effect of changing the cost of the
mapping of all the loads, instead of just the FPRs ones.

Reinstate the higher cost for all but GPR loads.
Note: This did not have any external visible effects:
- For Fast mode, the cost would have been higher, but we don't care
  because we don't try to use alternative mappings.
- For Greedy mode, the higher cost of the GPR loads, would have
  triggered the use of the supposedly alternative mapping, that
  would be in fact the same GPR mapping but with a lower cost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302452 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 18:16:23 +00:00
Sanjay Patel
d6b71950da [InstCombine] move/add tests for not(shr (not X), Y); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302451 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 18:16:04 +00:00
Craig Topper
3f67904aa9 [ARM] Use a Changed flag to avoid making a pass's return value dependent on a compare with a Statistic object.
Statistic compile to always be 0 in release build so this compare would always return false. And in the debug builds Statistic are global variables and remember their values across pass runs. So this compare returns true anytime the pass runs after the first time it modifies something.

This was found after reviewing all usages of comparison operators on a Statistic object. We had some internal code that did a compare with a statistic that caused a mismatch in output between debug and release builds. So we did an audit out of paranoia.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302450 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 18:02:51 +00:00
Craig Topper
0f7e2baed5 [SCEV] Make setRange take ConstantRange by value instead of rvalue reference so we don't force anything on the caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302449 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 17:39:08 +00:00
Craig Topper
d81950e977 [SCEV] Don't use std::move on both inputs to APInt::operator+ or operator-. It might be confusing to the reader. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302448 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 17:39:01 +00:00
Daniel Berlin
8517c8ec97 ConstantFold: Handle gep nonnull, undef as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 17:37:33 +00:00
Daniel Berlin
30725541b4 ConstantFold: Fold getelementptr (i32, i32* null, i64 undef) to null.
Transforms/IndVarSimplify/2011-10-27-lftrnull will fail if this regresses.
Transforms/GVN/PRE/2011-06-01-NonLocalMemdepMiscompile.ll has been changed to still test what it was
trying to test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 17:37:29 +00:00
Craig Topper
d99549318e [ValueTracking] Use KnownOnes to provide a better bound on known zeros for ctlz/cttz intrinics
This patch uses KnownOnes of the input of ctlz/cttz to bound the value that can be returned from these intrinsics. This makes these intrinsics more similar to the handling for ctpop which already uses known bits to produce a similar bound.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302444 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 17:22:34 +00:00
Zvi Rackover
fc7bb1b7b3 [X86] Split test configurations. NFC.
Split test that includes reproducer for pr32967 to KNL and SKX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302442 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 16:54:25 +00:00
Sanjay Patel
e2d19343ab [InstSimplify] fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 16:35:02 +00:00
Sanjay Patel
811100c771 [InstCombine] use local variable to reduce code duplication; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302438 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 16:33:42 +00:00
Craig Topper
3f38291e28 [ValueTracking] Introduce a version of computeKnownBits that returns a KnownBits struct. Begin using it to replace internal usages of ComputeSignBit
This introduces a new interface for computeKnownBits that returns the KnownBits object instead of requiring it to be pre-constructed and passed in by reference.

This is a much more convenient interface as it doesn't require the caller to figure out the BitWidth to pre-construct the object. It's so convenient that I believe we can use this interface to remove the special ComputeSignBit flavor of computeKnownBits.

As a step towards that idea, this patch replaces all of the internal usages of ComputeSignBit with this new interface. As you can see from the patch there were a couple places where we called ComputeSignBit which really called computeKnownBits, and then called computeKnownBits again directly. I've reduced those places to only making one call to computeKnownBits. I bet there are probably external users that do it too.

A future patch will update the external users and remove the ComputeSignBit interface. I'll also working on moving more locations to the KnownBits returning interface for computeKnownBits.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302437 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 16:22:48 +00:00
Sanjay Patel
a594399826 [InstCombine/InstSimplify] add comments about code duplication; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302436 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 16:21:55 +00:00
Sanjay Patel
f3922dff07 [InstCombine] add another test for PR32949; NFC
A patch for the InstSimplify variant of this bug is up for review here:
https://reviews.llvm.org/D32954


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 15:58:57 +00:00
Zvi Rackover
592063190f InstructionSimplify: Refactor foldIdentityShuffles. NFC.
Summary:
Minor refactoring of foldIdentityShuffles() which allows the removal of a
ConstantDataVector::get() in SimplifyShuffleVectorInstruction.

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

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

Conflicts:
	lib/Analysis/InstructionSimplify.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 15:46:58 +00:00
Geoff Berry
6922382ead Fix comment typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 15:33:08 +00:00
Zvi Rackover
63feed58cf Adding reproducer for pr32967. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 14:47:32 +00:00
Simon Pilgrim
844a30564e [X86][SSE] Improve combineLogicBlendIntoPBLENDV to use general masks.
Currently combineLogicBlendIntoPBLENDV can only match ASHR to detect sign splatting of a bit mask, this patch generalises this to use computeNumSignBits instead.

This is a first step in several things we can do to improve PBLENDV support:

 * Better matching of X86ISD::ANDNP patterns.
 * Handle floating point cases.
 * Better vector and bitcast support in computeNumSignBits.
 * Recognise that PBLENDV only uses the sign bit of the mask, we should be able strip away sign splats (ASHR, PCMPGT isNeg tests etc.).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 14:16:39 +00:00
Simon Pilgrim
73e28f8b2b Normalize line endings. NFCI,
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302422 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 13:32:34 +00:00
Zvi Rackover
f4d18ab589 IR: Add a shufflevector mask commutation helper function. NFC.
Summary:
Following up on Sanjay's suggetion in D32955, move this functionality
into ShuffleVectornstruction.

Reviewers: spatel, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302420 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 12:40:18 +00:00
Simon Pilgrim
cf3a86efe4 [ARM][NEON] Add support for ISD::ABS lowering
Update NEON int_arm_neon_vabs intrinsic to use the ISD::ABS opcode directly

Added constant folding tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 10:37:34 +00:00
Martin Storsjo
b7c80c3cd2 [ARM] Clear the constant pool cache on explicit .ltorg directives
Multiple ldr pseudoinstructions with the same constant value will
reuse the same constant pool entry. However, if the constant pool
is explicitly flushed with a .ltorg directive, we should not try
to reference constants in the previous pool any longer, since they
may be out of range.

This fixes assembling hand-written assembler source which repeatedly
loads the same constant value, across a binary size larger than the
pc-relative fixup range for ldr instructions (4096 bytes). Such
assembler source already uses explicit .ltorg instructions to emit
constant pools with regular intervals. However if we try to reuse
constants emitted in earlier pools, they end up out of range.

This makes the output of the testcase match what binutils gas does
(prior to this patch, it would fail to assemble).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302416 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 10:26:24 +00:00
Simon Pilgrim
b7a513409b [AARCH64][NEON] Add support for ISD::ABS lowering
Update int_aarch64_neon_abs intrinsic to use the ISD::ABS opcode directly

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302415 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 10:25:18 +00:00
Igor Breger
13b9798e2b [GlobalISel][X86] G_GEP selection support.
Summary: [GlobalISel][X86] G_GEP selection support.

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: dberris, rovka, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302412 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 09:40:43 +00:00
Igor Breger
ca7431c78f [GlobalISel][X86] G_MUL legalizer/selector support.
Summary:
G_MUL legalizer/selector/regbank support.
Use only Tablegen-erated instruction selection.
This patch dealing with legal operations only.

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: krytarowski, rovka, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 09:03:37 +00:00
Andrew Ng
8d4aa1d832 [Lit] Fix to prevent creation of "%SystemDrive%" directory on Windows.
This patch propogates the environment variable SYSTEMDRIVE on Windows when
running the unit tests. This prevents the creation of a directory named
"%SystemDrive%" when running the unit tests from FileSystemTest that use the
function llvm::sys::fs::remove_directories which in turn uses SHFileOperationW.
It is within SHFileOperationW that this environment variable may be used and if
undefined causes the creation of a "%SystemDrive%" directory in the current
directory.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302409 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 08:55:38 +00:00
Craig Topper
c571744eac [APInt] Modify tcMultiplyPart's overflow detection to not depend on 'i' from the earlier loop. NFC
The value of 'i' is always the smaller of DstParts and SrcParts so we can just use that fact to write all the code in terms of SrcParts and DstParts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302408 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 06:34:41 +00:00
Craig Topper
df5e49783f [APInt] Use std::min instead of writing the same thing with the ternary operator. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 06:34:39 +00:00
Craig Topper
3522a09753 [APInt] Remove 'else' after 'return' in tcMultiply methods. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 06:34:36 +00:00
Dean Michael Berris
638f2cdc22 [XRay] Custom event logging intrinsic
This patch introduces an LLVM intrinsic and a target opcode for custom event
logging in XRay. Initially, its use case will be to allow users of XRay to log
some type of string ("poor man's printf"). The target opcode compiles to a noop
sled large enough to enable calling through to a runtime-determined relative
function call. At runtime, when X-Ray is enabled, the sled is replaced by
compiler-rt with a trampoline to the logic for creating the custom log entries.

Future patches will implement the compiler-rt parts and clang-side support for
emitting the IR corresponding to this intrinsic.

Reviewers: timshen, dberris

Subscribers: igorb, pelikan, rSerge, timshen, echristo, dberris, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302405 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 05:45:21 +00:00
Craig Topper
ba36bcb1c1 [SCEV] Use APInt::operator*=(uint64_t) to avoid a temporary APInt for a constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302404 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 04:55:13 +00:00
Craig Topper
b33f45017e [APInt] Take advantage of new operator*=(uint64_t) to remove a temporary APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302403 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 04:55:12 +00:00
Craig Topper
1e5158d3c8 [APInt] Add support for multiplying by a uint64_t.
This makes multiply similar to add, sub, xor, and, and or.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302402 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 04:55:09 +00:00