OSDN Git Service
Dmitry Preobrazhensky [Wed, 26 Apr 2017 17:55:50 +0000 (17:55 +0000)]
[AMDGPU][MC] Added arg checks for vmcnt, expcnt, lgkmcnt helpers
Summary of changes:
- corrected vmcnt, expcnt, lgkmcnt helpers to checks their argument for truncation;
- added saturated versions of these helpers.
See bug 32711 for details: https://bugs.llvm.org//show_bug.cgi?id=32711
Reviewers: artem.tamazov, vpykhtin
Differential Revision: https://reviews.llvm.org/D32546
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301439
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 26 Apr 2017 17:53:39 +0000 (17:53 +0000)]
LTO: Mark undefined module asm symbols as used.
Marking them as used causes them to be considered visible outside of LTO. This
prevents the symbols from being internalized or discarded, either by GlobalDCE
or by summary-based dead stripping in ThinLTO.
This change makes it unnecessary to add these symbols to llvm.compiler.used
in the backend, as the symbols are kept alive by virtue of being external,
so remove the backend code that handles that.
Fixes PR32798.
Differential Revision: https://reviews.llvm.org/D32544
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301438
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Wed, 26 Apr 2017 17:41:46 +0000 (17:41 +0000)]
CorrelatedValuePropagation: Rename a variable for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301435
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 26 Apr 2017 16:39:58 +0000 (16:39 +0000)]
[ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits
This patch introduces a new KnownBits struct that wraps the two APInt used by computeKnownBits. This allows us to treat them as more of a unit.
Initially I've just altered the signatures of computeKnownBits and InstCombine's simplifyDemandedBits to pass a KnownBits reference instead of two separate APInt references. I'll do similar to the SelectionDAG version of computeKnownBits/simplifyDemandedBits as a separate patch.
I've added a constructor that allows initializing both APInts to the same bit width with a starting value of 0. This reduces the repeated pattern of initializing both APInts. Once place default constructed the APInts so I added a default constructor for those cases.
Going forward I would like to add more methods that will work on the pairs. For example trunc, zext, and sext occur on both APInts together in several places. We should probably add a clear method that can be used to clear both pieces. Maybe a method to check for conflicting information. A method to return (Zero|One) so we don't write it out everywhere. Maybe a method for (Zero|One).isAllOnesValue() to determine if all bits are known. I'm sure there are many other methods we can come up with.
Differential Revision: https://reviews.llvm.org/D32376
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301432
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 26 Apr 2017 16:37:05 +0000 (16:37 +0000)]
Reverts commit r301424, r301425 and r301426
Commits were:
"Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts"
"Add a new WeakVH value handle; NFC"
"Rename WeakVH to WeakTrackingVH; NFC"
The changes assumed pointers are 8 byte aligned on all architectures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301429
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Wed, 26 Apr 2017 16:23:02 +0000 (16:23 +0000)]
[LV] Handle external uses of floating-point induction variables
Reference: https://bugs.llvm.org/show_bug.cgi?id=32758
Differential Revision: https://reviews.llvm.org/D32445
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301428
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 26 Apr 2017 16:21:02 +0000 (16:21 +0000)]
Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts
Summary:
In cases where an instruction (a call site, say) is RAUW'ed with some
other value (this is possible via the `returned` attribute, amongst
other things), we want the slot in UnknownInsts to point to the
original Instruction we wanted to track, not the value it got replaced
by.
Fixes PR32587.
Reviewers: davide
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D32268
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301426
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 26 Apr 2017 16:20:59 +0000 (16:20 +0000)]
Add a new WeakVH value handle; NFC
Summary:
WeakVH nulls itself out if the value it was tracking gets deleted, but
it does not track RAUW.
Reviewers: dblaikie, davide
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D32267
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301425
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Wed, 26 Apr 2017 16:20:52 +0000 (16:20 +0000)]
Rename WeakVH to WeakTrackingVH; NFC
Summary:
I plan to use WeakVH to mean "nulls itself out on deletion, but does
not track RAUW" in a subsequent commit.
Reviewers: dblaikie, davide
Reviewed By: davide
Subscribers: arsenm, mehdi_amini, mcrosier, mzolotukhin, jfb, llvm-commits, nhaehnle
Differential Revision: https://reviews.llvm.org/D32266
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301424
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Wed, 26 Apr 2017 15:59:05 +0000 (15:59 +0000)]
[globalisel][tablegen] Fix vector element size
Summary: Fix vector element size.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: rovka, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D32537
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301421
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Wed, 26 Apr 2017 15:39:53 +0000 (15:39 +0000)]
[sampleprof] Drop test dependency on the string hash func (NFC)
The SampleProfWriter emits function information in an order determined
by the string hash function. The situation is a bit brittle, because
changing the hash function can break the tests.
Instead of sorting the function samples to get a relaible ordering (that
might be too expensive), make the tests not depend on a particular
ordering of function samples.
Differential Revision: https://reviews.llvm.org/D32516
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301419
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Preobrazhensky [Wed, 26 Apr 2017 15:34:19 +0000 (15:34 +0000)]
[AMDGPU][MC] Added check for truncation of SOPK imm operand
See bug 30827: https://bugs.llvm.org//show_bug.cgi?id=30827
Reviewers: artem.tamazov, vpykhtin
Differential Revision: https://reviews.llvm.org/D32535
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301418
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Wed, 26 Apr 2017 14:47:27 +0000 (14:47 +0000)]
[AVR] Remove an unused local variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301413
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 26 Apr 2017 14:35:54 +0000 (14:35 +0000)]
[x86] change tests to use sext, not zext; NFC
These are intended to exercise D31944, so we need sexts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301412
91177308-0d34-0410-b5e6-
96231b3b80d8
Haojian Wu [Wed, 26 Apr 2017 14:31:05 +0000 (14:31 +0000)]
Fix unused-variable warning caused by r301407.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301411
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 26 Apr 2017 14:05:42 +0000 (14:05 +0000)]
[TargetLowering] fix isConstTrueVal to account for build vector truncation
Build vectors have magical truncation powers, so we have things like this:
v4i1 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>
v4i16 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>
If we don't truncate the splat node returned by getConstantSplatNode(), then we won't find
truth when ZeroOrNegativeOneBooleanContent is the rule.
Differential Revision: https://reviews.llvm.org/D32505
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301408
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Wed, 26 Apr 2017 13:52:18 +0000 (13:52 +0000)]
Convert LoopRotation to use SimplifyQuery version of SimplifyInstruction. Add AssumptionCache, DominatorTree, TLI if available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301407
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Wed, 26 Apr 2017 13:52:16 +0000 (13:52 +0000)]
Convert SimplifyInstructions to use the SimplifyQuery version of SimplifyInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301406
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Wed, 26 Apr 2017 13:52:13 +0000 (13:52 +0000)]
Convert CVP to use SimplifyQuery version of SimplifyInstruction. Add AssumptionCache, DominatorTree, TLI if available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301405
91177308-0d34-0410-b5e6-
96231b3b80d8
Ranjeet Singh [Wed, 26 Apr 2017 13:41:43 +0000 (13:41 +0000)]
Fix signed multiplication with overflow fallback.
For targets that don't have ISD::MULHS or ISD::SMUL_LOHI for the type
and the double width type is illegal, then the two operands are
sign extended to twice their size then multiplied to check for overflow.
The extended upper halves were mismatched causing an incorrect result.
This fixes the mismatch.
A test was added for ARM V6-M where the bug was detected.
Patch by James Duley.
Differential Revision: https://reviews.llvm.org/D31807
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301404
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 26 Apr 2017 13:27:57 +0000 (13:27 +0000)]
[DAG] add FIXME comments for splat detection; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301403
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 26 Apr 2017 13:03:00 +0000 (13:03 +0000)]
[X86] Added pointer math zext test case (PR22970)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301401
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 26 Apr 2017 12:23:32 +0000 (12:23 +0000)]
[X86][SSE] Add test case for repeated vector insertions of the same element (PR15298)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301396
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Wed, 26 Apr 2017 12:02:41 +0000 (12:02 +0000)]
Simplify the CFG after loop pass cleanup.
Summary:
Otherwise we might end up with some empty basic blocks or
single-entry-single-exit basic blocks.
This fixes PR32085
Reviewers: chandlerc, danielcdh
Subscribers: mehdi_amini, RKSimon, llvm-commits
Differential Revision: https://reviews.llvm.org/D30468
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301395
91177308-0d34-0410-b5e6-
96231b3b80d8
Sagar Thakur [Wed, 26 Apr 2017 11:40:12 +0000 (11:40 +0000)]
[mips] Fix test mips64fpldst.ll with machine verifier enabled
Removed micro mips register classes for gp initialization because gp initialization uses pure mips64 instruction. Even when compiling for micro mips, gp initialization can be done with pure mips64 instructions.
Reviewed by Simon Dardis
Differential: D32286
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301394
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Wed, 26 Apr 2017 11:34:09 +0000 (11:34 +0000)]
[X86] Add missing mayLoad/mayStore attributes to some X86 instructions (Continue)
Complete the patch committed in rL300190.
Differential Revision: https://reviews.llvm.org/D32287
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301393
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Wed, 26 Apr 2017 11:10:38 +0000 (11:10 +0000)]
[mips] Rework a portion of MipsCC interface. (NFC)
r299766 contained a "conditional move or jump depends on uninitialized value"
fault, identified by valgrind. This occurred as MipsFastISel::finishCall(..)
used CCState over MipsCCState. The latter is required for the TableGen'd calling
convention logic due to reliance on pre-analyzing type information to lower call
results/returns of vectors correctly.
This change modifies the MipsCC AnalyzeCallResult to be useful with both the
SelectionDAG and FastISel lowering logic.
Reviewers: slthakur
Differential Revision: https://reviews.llvm.org/D32004
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301392
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew V. Tischenko [Wed, 26 Apr 2017 09:56:59 +0000 (09:56 +0000)]
PR31007 and PR27884 will be closed: a possibility to compile constants like 0bH is now supported in MS asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301390
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Wed, 26 Apr 2017 07:08:44 +0000 (07:08 +0000)]
[X86][SSE2] Fix asm string for movq (Move Quadword) instruction.
Replace "mov{d|q}" with "movq".
Differential Revision: https://reviews.llvm.org/D32220
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301386
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 26 Apr 2017 05:59:19 +0000 (05:59 +0000)]
[InstCombine] Add test cases for opportunities to improve knownbits handling for cttz and ctlz intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301385
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Wed, 26 Apr 2017 05:27:20 +0000 (05:27 +0000)]
Remove tailing whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301383
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Wed, 26 Apr 2017 04:10:02 +0000 (04:10 +0000)]
InstructionSimplify: Use braced initializer list for SimplifyQuery creation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301381
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Wed, 26 Apr 2017 04:10:00 +0000 (04:10 +0000)]
InstructionSimplify: Have SimplifyFPBinOp pass FastMathFlags by value, like we do everywhere else
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301380
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Wed, 26 Apr 2017 04:09:56 +0000 (04:09 +0000)]
InstructionSimplify: End our long national nightmare of ever-growing Simplify* arguments.
Summary:
Expose the internal query structure, start using it.
Note: This is the most minimal change possible i could create. I have
trivial followups, like fixing the one use of const FastMathFlags &,
the renaming of CtxI to be consistent, etc.
This should be NFC.
Reviewers: majnemer, davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32448
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301379
91177308-0d34-0410-b5e6-
96231b3b80d8
Dean Michael Berris [Wed, 26 Apr 2017 03:49:49 +0000 (03:49 +0000)]
[XRay][tools] Remove wayward semicolon (NFC)
Follow-up to D29320.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301378
91177308-0d34-0410-b5e6-
96231b3b80d8
Dean Michael Berris [Wed, 26 Apr 2017 01:35:23 +0000 (01:35 +0000)]
[XRay][tools] Fixup definition for stat division.
Copy-pasta error.
Follow-up to D29320.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301376
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 26 Apr 2017 01:00:52 +0000 (01:00 +0000)]
[AMDGPU] Garbage collect dead code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301375
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Wed, 26 Apr 2017 00:48:28 +0000 (00:48 +0000)]
[Support] Avoid UB in sys::fs::perms::operator~. NFC.
This was exposed in r297945 and r301220: the intermediate complement
is a 32-bit value, and casting it to 'perms' invokes UB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301373
91177308-0d34-0410-b5e6-
96231b3b80d8
Vadzim Dambrouski [Wed, 26 Apr 2017 00:33:59 +0000 (00:33 +0000)]
[MSP430] Fix PR32769: Select8 and Select16 need to have SR in Uses.
If Select pseudo instruction doesn't have use SR, then
CMP instructions are being marked as dead and later can be
removed by MachineCSE pass. This leads to incorrect code
generation.
Differential Revision: https://reviews.llvm.org/D32473
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301372
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Wed, 26 Apr 2017 00:16:10 +0000 (00:16 +0000)]
[gcov] Sort file info before printing it
The order in which GCOV file info is printed depends on the string hash
function. This makes some GCOV tests brittle, because the tests must be
updated whenever the hash function changes.
Sort the filenames before printing out the file info to solve the
problem. This should be relatively cheap.
Differential Revision: https://reviews.llvm.org/D32512
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301371
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Wed, 26 Apr 2017 00:02:39 +0000 (00:02 +0000)]
revert debugging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301370
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Wed, 26 Apr 2017 00:02:31 +0000 (00:02 +0000)]
[WebAssembly] Allow for signed relocation addends
Summary:
Addends are used as offsets to addresses of globals
and can be both positive and negative. This change
prints libObject in line with the spec and the MC
layer.
Subscribers: jfb, dschuff
Differential Revision: https://reviews.llvm.org/D32507
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301369
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Tue, 25 Apr 2017 23:58:20 +0000 (23:58 +0000)]
[AVR] Do not kill the dest register for a pseudo instruction
It caused the register to later be dead, which would trigger a verifier
error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301368
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 25 Apr 2017 23:40:57 +0000 (23:40 +0000)]
AMDGPU: Shift down reserved SP register like scratch wave offset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301367
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 25 Apr 2017 23:33:28 +0000 (23:33 +0000)]
[DAG] fix formatting of isConstantSplat(); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301366
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 25 Apr 2017 21:17:38 +0000 (21:17 +0000)]
AMDGPU: Clean up VOP3NoMods pattern
There is no need to copy the operands or inspect the sources.
Also remove some unnecessary clamp/omod usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301363
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 25 Apr 2017 20:56:14 +0000 (20:56 +0000)]
[x86] add more tests for potential change in bool math folding; NFC
Also, use AVX2 to show a potential difference for 256-bit vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301362
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Tue, 25 Apr 2017 20:38:26 +0000 (20:38 +0000)]
AMDGPU: Fix ValueKind code object metadata for images
Differential Revision: https://reviews.llvm.org/D32504
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301360
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 25 Apr 2017 20:30:08 +0000 (20:30 +0000)]
[x86] regenerate checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301359
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 25 Apr 2017 20:22:29 +0000 (20:22 +0000)]
[llvm-pdbdump] Allow sorting / filtering by immediate padding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301358
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 25 Apr 2017 20:22:02 +0000 (20:22 +0000)]
[llvm-pdbdump] Dump File / Line Info to YAML.
We were already parsing and dumping this to the human readable
format, but not to the YAML format. This does so, in preparation
for reading it in and reconstructing the line information from
YAML.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301357
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 25 Apr 2017 20:21:35 +0000 (20:21 +0000)]
[StringExtras] Add a fromHex to complement toHex.
We already have a function toHex that will convert a string like
"\xFF\xFF" to the string "FFFF", but we do not have one that goes
the other way - i.e. to convert a textual string representing a
sequence of hexadecimal characters into the corresponding actual
bytes. This patch adds such a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301356
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 25 Apr 2017 19:44:25 +0000 (19:44 +0000)]
SimplifyLibCalls: Fix crash on memset(notmalloc())
rdar://
31520787
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301352
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 25 Apr 2017 19:40:53 +0000 (19:40 +0000)]
Fix an assertion when skipping stack values in DWARF2 mode.
The fix consists of resetting LocationKind when addMachineRegExpression fails.
rdar://problem/
31803010
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301351
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Tue, 25 Apr 2017 18:56:33 +0000 (18:56 +0000)]
[llvm-objdump] Don't attempt to print lines beyond the end of file
This may trigger a segfault in llvm-objdump when the line number stored
in debug infromation points beyond the end of file; lines in LineBuffer
are stored in std::vector which is allocated in chunks, so even if the
debug info points beyond the end of the file, this doesn't necessarily
trigger the segfault unless the line number points beyond the allocated
space.
Differential Revision: https://reviews.llvm.org/D32466
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301347
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Tue, 25 Apr 2017 18:56:14 +0000 (18:56 +0000)]
[Hexagon] Only increment debug counters if debug option is present
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301346
91177308-0d34-0410-b5e6-
96231b3b80d8
Gil Rapaport [Tue, 25 Apr 2017 18:14:24 +0000 (18:14 +0000)]
[LV] Make LIT test insensitive to basic block numbering
This patch is part of D28975's breakdown.
induction.ll encodes the specific (and rather arbitrary) numbers given to
predicated basic blocks by the unique naming mechanism, which makes it
sensitive to changes in LV's instruction generation order. This patch replaces
those specific numbers with a numeric pattern.
Differential Revision: https://reviews.llvm.org/D32404
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301345
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Tue, 25 Apr 2017 18:00:08 +0000 (18:00 +0000)]
Skip bitcasts while looking for GEP in LoadStoreVectorizer
Differential Revisison: https://reviews.llvm.org/D32101
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301343
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 25 Apr 2017 18:00:04 +0000 (18:00 +0000)]
[X86][AVX2] Add shuffle test for PR27320 showing current codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301342
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 17:54:12 +0000 (17:54 +0000)]
[InstCombine] Remove redundant code from SimplifyUsingDistributiveLaws
The code I've removed here exists in ExpandBinOp in InstSimplify which we call into before SimplifyUsingDistributiveLaws. The code in InstSimplify looks to have been copied from here.
I verified this code doesn't fire on any lit tests. Not that that proves its definitely dead.
Differential Revision: https://reviews.llvm.org/D32472
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301341
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 17:46:30 +0000 (17:46 +0000)]
[APInt] Use isSubsetOf, intersects, and bit counting methods to reduce temporary APInts
This patch uses various APInt methods to reduce temporary APInt creation.
This should be all of the unrelated cleanups that got buried in D32376(creating a KnownBits struct) as well as some pointed out by Simon during the review of that. Plus a few improvements to use counting instead of masking.
I've left out any places where we do something like (KnownZero & KnownOne) != 0 as I plan to add a helper method to KnownBits to ask that question and didn't want to thrash that code an additional time.
Differential Revision: https://reviews.llvm.org/D32495
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301338
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 17:40:58 +0000 (17:40 +0000)]
[InstCombine] Fix CHECK-LABEL in two tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301337
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 25 Apr 2017 17:22:34 +0000 (17:22 +0000)]
[X86][SSE] Add tests for PR14657 showing current codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301334
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 25 Apr 2017 17:22:09 +0000 (17:22 +0000)]
Print complete DIExpressions in the assembler output DEBUG_VALUE comments.
The previous code was complex, incorrect, and couldn't print everything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301333
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Tue, 25 Apr 2017 17:13:23 +0000 (17:13 +0000)]
[WebAssembly] Fix relocation count in wasm binaries with call_indirect
Subscribers: jfb, dschuff
Differential Revision: https://reviews.llvm.org/D32459
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301331
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Tue, 25 Apr 2017 17:11:56 +0000 (17:11 +0000)]
[WebAssembly] Read global index in init expression as LEB
Subscribers: jfb, dschuff
Differential Revision: https://reviews.llvm.org/D32462
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301330
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 17:01:32 +0000 (17:01 +0000)]
[InstSimplify] Handle (~A & ~B) | (~A ^ B) -> ~A ^ B
The code Sanjay Patel moved over from InstCombine doesn't work properly if the 'and' has both inputs as nots because we used a commuted op matcher on the 'and' first. But this will bind to the first 'not' on 'and' when there could be two 'not's. InstCombine could rely on DeMorgan to ensure the 'and' wouldn't have two 'not's eventually, but InstSimplify can't rely on that.
This patch matches the xor first then checks for the ands and allows a not of either operand of the xor.
Differential Revision: https://reviews.llvm.org/D32458
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301329
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 25 Apr 2017 16:54:45 +0000 (16:54 +0000)]
[PM] Run IndirectCallPromotion only when PGO is enabled.
Differential Revision: https://reviews.llvm.org/D32465
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301327
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 16:48:19 +0000 (16:48 +0000)]
[InstCombine] Remove superfluous curly braces around a single line if body. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301326
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 16:48:14 +0000 (16:48 +0000)]
[ValueTracking] Use APInt::operator|=(uint64_t) instead of creating a temporary APInt. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301325
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 16:48:09 +0000 (16:48 +0000)]
[ValueTracking] Use APInt instead of auto. NFC
This is a pre-commit for a patch I'm working on to turn KnownZero/One into a struct. Once I do that the type here will be less obvious.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301324
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 16:48:03 +0000 (16:48 +0000)]
[ValueTracking] Use BitWidth local variable instead of re-reading it from KnownZero. NFC
This is a pre-commit for a patch that I'm working on to merge KnownZero/KnownOne into a KnownBits struct which would have had to touch this line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301323
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 25 Apr 2017 16:41:28 +0000 (16:41 +0000)]
[SelectionDAG] Added getBuildVector(ArrayRef<SDUse>) helper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301322
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 25 Apr 2017 16:16:03 +0000 (16:16 +0000)]
[DAGCombiner] Refactor to make it easy to add support for vectors in a future patch. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301320
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Ng [Tue, 25 Apr 2017 15:39:57 +0000 (15:39 +0000)]
Resubmit r301309: [DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler.
This patch reapplies r301309 with the fix to the MIR test to fix the assertion
triggered by r301309. Had trimmed a little bit too much from the MIR!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301317
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 15:19:04 +0000 (15:19 +0000)]
[InstCombine] Add missing commute handling to (A | B) & (B ^ (~A)) -> (A & B)
The matching here wasn't able to handle all the possible commutes. It always assumed the not would be on the left of the xor, but that's not guaranteed.
Differential Revision: https://reviews.llvm.org/D32474
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301316
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 25 Apr 2017 15:10:47 +0000 (15:10 +0000)]
[SelectionDAG] Use getBuildVector helper where possible. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301314
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Tue, 25 Apr 2017 15:09:04 +0000 (15:09 +0000)]
[AVR] Support the LDWRdPtr instruction with the same Src+Dst register
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301313
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Ng [Tue, 25 Apr 2017 14:36:01 +0000 (14:36 +0000)]
Revert "[DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler."
This reverts commit r301309 which is causing buildbot assertion failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301312
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Tue, 25 Apr 2017 14:27:27 +0000 (14:27 +0000)]
Bring back the ability opt out of padding zero-byte functions by not providing a nop instruction.
Summary: No test case since I'm not aware of an in-tree target that needs this.
Reviewers: hans
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32398
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301311
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Ng [Tue, 25 Apr 2017 13:39:49 +0000 (13:39 +0000)]
[DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler.
This patch fixes a bug with the updating of DBG_VALUE's in
BreakAntiDependencies. Previously, it would only attempt to update the first
DBG_VALUE following the instruction whose register is being changed,
potentially leaving DBG_VALUE's referring to the wrong register. Now the code
will update all DBG_VALUE's that immediately follow the instruction.
This issue was detected as a result of an optimized codegen difference with
"-g" where an X86 byte/word fixup was not performed due to a DBG_VALUE
referencing the wrong register.
Differential Revision: https://reviews.llvm.org/D31755
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301309
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 25 Apr 2017 13:39:07 +0000 (13:39 +0000)]
[SelectionDAG] Pull out repeated getValueType calls. NFCI.
Noticed in D32391.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301308
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 25 Apr 2017 12:40:45 +0000 (12:40 +0000)]
[DAGCombiner] Add vector support for (srl (trunc (srl x, c1)), c2) combine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301305
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Ng [Tue, 25 Apr 2017 12:36:14 +0000 (12:36 +0000)]
[SimplifyLibCalls] Fix infinite loop with fast-math optimization.
One of the fast-math optimizations is to replace calls to standard double
functions with their float equivalents, e.g. exp -> expf. However, this can
cause infinite loops for the following:
float expf(float val) { return (float) exp((double) val); }
A similar inline declaration exists in the MinGW-w64 math.h header file which
when compiled with -O2/3 and fast-math generates infinite loops.
So this fix checks that the calling function to the standard double function
that is being replaced does not match the float equivalent.
Differential Revision: https://reviews.llvm.org/D31806
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301304
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 25 Apr 2017 12:29:07 +0000 (12:29 +0000)]
[SelectionDAG] Recognise splat vector isKnownToBeAPowerOfTwo one/sign bit shift cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301303
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 25 Apr 2017 10:47:35 +0000 (10:47 +0000)]
[DAGCombiner] Use SDValue::getConstantOperandVal helper where possible. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301300
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 25 Apr 2017 06:53:25 +0000 (06:53 +0000)]
[IVUsers] Don't bail out of normalizing non-affine add recs
Summary:
In a previous change I changed SCEV's normalization / denormalization
to work with non-affine add recs. So the bailout in IVUsers can be
removed.
Reviewers: atrick, efriedma
Reviewed By: atrick
Subscribers: davide, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D32105
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301298
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 06:47:49 +0000 (06:47 +0000)]
[InstCombine] Add test cases for missing commute handling in ((A ^ C) ^ B) & (B ^ A) -> (B ^ A) & ~C
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301297
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 06:22:17 +0000 (06:22 +0000)]
[InstCombine] Add test cases showing failures to handle commuted patterns after tricking the operand complexity sorting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301296
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 25 Apr 2017 06:02:11 +0000 (06:02 +0000)]
[InstCombine] Use commutable matchers to reduce some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301294
91177308-0d34-0410-b5e6-
96231b3b80d8
Gil Rapaport [Tue, 25 Apr 2017 05:57:22 +0000 (05:57 +0000)]
[LV] Remove redundant basic block split
This patch is part of D28975's breakdown.
Genreating the control-flow to guard predicated instructions modified to
only use SplitBlockAndInsertIfThen() for producing the if-then construct.
Differential Revision: https://reviews.llvm.org/D32224
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301293
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Guelton [Tue, 25 Apr 2017 05:45:37 +0000 (05:45 +0000)]
Update doc of the variadic version of getOrInsertFunction
It no longer needs a null terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301292
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Tue, 25 Apr 2017 04:51:19 +0000 (04:51 +0000)]
[CodeExtractor]: Fixup use refs of the old phi.
Differential Revision: http://reviews.llvm.org/D32468
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301291
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 25 Apr 2017 04:06:35 +0000 (04:06 +0000)]
[ObjCARC] Do not sink an objc_retain past a clang.arc.use.
We need to do this to prevent a miscompile which sinks an objc_retain
past an objc_release that releases the object objc_retain retains. This
happens because the top-down and bottom-up traversals each determines
the insert point for retain or release individually without knowing
where the other instruction is moved.
For example, when the following IR is fed to the ARC optimizer, the
top-down traversal decides to insert objc_retain right before
objc_release and the bottom-up traversal decides to insert objc_release
right after clang.arc.use.
(IR before ARC optimizer)
%11 = call i8* @objc_retain(i8* %10)
call void (...) @clang.arc.use(%0* %5)
call void @llvm.dbg.value(...)
call void @objc_release(i8* %6)
This reverses the order of objc_release and objc_retain, which causes
the object to be destructed prematurely.
(IR after ARC optimizer)
call void (...) @clang.arc.use(%0* %5)
call void @objc_release(i8* %6)
call void @llvm.dbg.value(...)
%11 = call i8* @objc_retain(i8* %10)
rdar://problem/
30530580
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301289
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 25 Apr 2017 03:48:47 +0000 (03:48 +0000)]
[SimplifyLibCalls] Remove a cl::opt that's been `true` for a long time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301288
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 25 Apr 2017 00:09:19 +0000 (00:09 +0000)]
Teach SCEV normalization to de/normalize non-affine add recs
Summary:
Before this change, SCEV Normalization would incorrectly normalize
non-affine add recurrences. To work around this there was (still is)
a check in place to make sure we only tried to normalize affine add
recurrences.
We recently found a bug in aforementioned check to bail out of
normalizing non-affine add recurrences. However, instead of fixing
the bailout, I have decided to teach SCEV normalization to work
correctly with non-affine add recurrences, making the bailout
unnecessary (I'll remove it in a subsequent change).
I've also added some unit tests (which would have failed before this
change).
Reviewers: atrick, sunfish, efriedma
Reviewed By: atrick
Subscribers: mcrosier, mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32104
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301281
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 24 Apr 2017 23:42:41 +0000 (23:42 +0000)]
InferAddressSpaces: Use reference arguments instead of pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301276
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Mon, 24 Apr 2017 23:21:38 +0000 (23:21 +0000)]
[Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301275
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 24 Apr 2017 23:02:57 +0000 (23:02 +0000)]
InferAddressSpaces: Remove redundant assert
This is just asserting all the operations are handled in the
switch, which the unreachable already handles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301270
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 24 Apr 2017 22:42:34 +0000 (22:42 +0000)]
[ARM, x86] add more vector tests for bool math; NFC
I'm proposing a fold for increment-of-sexted-bool in:
https://reviews.llvm.org/D31944
...so we need to know what happens in more cases like these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301269
91177308-0d34-0410-b5e6-
96231b3b80d8