148322 Commits

Author SHA1 Message Date
Rui Ueyama
2db23b3bbe Replace HashString algorithm with xxHash64
The previous algorithm processed one character at a time, which is very
painful on a modern CPU. Replace it with xxHash64, which both already
exists in the codebase and is fairly fast.

Patch from Scott Smith!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301487 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 22:45:04 +00:00
Eugene Zelenko
f49f90e97b [MC] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301485 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 22:31:39 +00:00
Davide Italiano
2f1bbeb63f [LibCallsShrinkWrap] Remove an unnecessary class member variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301477 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 21:28:40 +00:00
Davide Italiano
65e17c010c [LibCallsShrinkWrap] More descriptive assertion messages.
Fix a typo while I'm here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301474 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 21:21:02 +00:00
Davide Italiano
1b1163841f [LibCallsShrinkWrap] Remove some temporary cl::opt(s).
The pass has been on and working for a while.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301473 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 21:19:05 +00:00
Davide Italiano
c1543360c2 [LibCallsShrinkWrap] Teach the pass how to preserve the dominator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301471 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 21:05:40 +00:00
Daniel Berlin
988e599a02 Kill the old Simplify* APIs, leave SimplifyInstruction for the moment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 20:56:17 +00:00
Daniel Berlin
2b0666738c NewGVN: Use new SimplifyQuery based API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 20:56:14 +00:00
Daniel Berlin
5c3bf01e34 PHITransAddr: Use new SimplifyQuery based API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301465 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 20:56:13 +00:00
Daniel Berlin
516ca41d78 InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 20:56:07 +00:00
Sanjay Patel
8253e24b39 [DAGCombiner] add (sext i1 X), 1 --> zext (not i1 X)
Besides better codegen, the motivation is to be able to canonicalize this pattern 
in IR (currently we don't) knowing that the backend is prepared for that.

This may also allow removing code for special constant cases in 
DAGCombiner::foldSelectOfConstants() that was added in D30180.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 20:26:46 +00:00
Dmitry Preobrazhensky
559cd48144 [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
2017-04-26 17:55:50 +00:00
Peter Collingbourne
052412f4f5 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
2017-04-26 17:53:39 +00:00
Daniel Berlin
86c47581d6 CorrelatedValuePropagation: Rename a variable for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301435 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 17:41:46 +00:00
Craig Topper
58c7fe69d0 [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
2017-04-26 16:39:58 +00:00
Sanjoy Das
263da12ab2 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
2017-04-26 16:37:05 +00:00
Matthew Simpson
86197951a0 [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
2017-04-26 16:23:02 +00:00
Sanjoy Das
a7ff6d36af 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
2017-04-26 16:21:02 +00:00
Sanjoy Das
147a8edb1b 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
2017-04-26 16:20:59 +00:00
Sanjoy Das
d0cf26e443 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
2017-04-26 16:20:52 +00:00
Igor Breger
a620093752 [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
2017-04-26 15:59:05 +00:00
Vedant Kumar
86d385f5e5 [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
2017-04-26 15:39:53 +00:00
Dmitry Preobrazhensky
5cc9392ddb [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
2017-04-26 15:34:19 +00:00
Dylan McKay
180ce98a0d [AVR] Remove an unused local variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301413 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 14:47:27 +00:00
Sanjay Patel
c36b154061 [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
2017-04-26 14:35:54 +00:00
Haojian Wu
f2ba970438 Fix unused-variable warning caused by r301407.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301411 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 14:31:05 +00:00
Sanjay Patel
553bcb5841 [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
2017-04-26 14:05:42 +00:00
Daniel Berlin
4c814e62fc 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
2017-04-26 13:52:18 +00:00
Daniel Berlin
b7f0325d21 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
2017-04-26 13:52:16 +00:00
Daniel Berlin
c303d331b4 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
2017-04-26 13:52:13 +00:00
Ranjeet Singh
d530427b4a 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
2017-04-26 13:41:43 +00:00
Sanjay Patel
0f75548f9f [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
2017-04-26 13:27:57 +00:00
Simon Pilgrim
4886bbbe71 [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
2017-04-26 13:03:00 +00:00
Simon Pilgrim
2171b73607 [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
2017-04-26 12:23:32 +00:00
Filipe Cabecinhas
70c9b6a6d8 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
2017-04-26 12:02:41 +00:00
Sagar Thakur
8bc6721525 [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
2017-04-26 11:40:12 +00:00
Ayman Musa
78f951e836 [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
2017-04-26 11:34:09 +00:00
Simon Dardis
11a42a5bb0 [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
2017-04-26 11:10:38 +00:00
Andrew V. Tischenko
03ca81ebd4 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
2017-04-26 09:56:59 +00:00
Ayman Musa
1ebb1b7a38 [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
2017-04-26 07:08:44 +00:00
Craig Topper
4a48147c23 [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
2017-04-26 05:59:19 +00:00
Michael Liao
2238d782d6 Remove tailing whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301383 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 05:27:20 +00:00
Daniel Berlin
69cd18084e 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
2017-04-26 04:10:02 +00:00
Daniel Berlin
12b3d3d41e 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
2017-04-26 04:10:00 +00:00
Daniel Berlin
32844579d8 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
2017-04-26 04:09:56 +00:00
Dean Michael Berris
123fc0d45e [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
2017-04-26 03:49:49 +00:00
Dean Michael Berris
8577a8c0fd [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
2017-04-26 01:35:23 +00:00
Davide Italiano
9636fedac3 [AMDGPU] Garbage collect dead code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301375 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 01:00:52 +00:00
Ahmed Bougacha
3f8d08861b [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
2017-04-26 00:48:28 +00:00
Vadzim Dambrouski
ed89889572 [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
2017-04-26 00:33:59 +00:00