135266 Commits

Author SHA1 Message Date
Craig Topper
3305a40150 [X86] Add AVX512 load opcodes and a couple AVX load opcodes to X86InstrInfo::areLoadsFromSameBasePtr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 06:14:43 +00:00
Craig Topper
e70f2b66e1 [X86] Add more opcodes to isFrameLoadOpcode/isFrameStoreOpcode. Mainly AVX-512 related.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 06:14:39 +00:00
Craig Topper
0c4677f3cc [AVX512] Use VMOVAPSZ128rr/VMOVAPS256rr for VR128X/VR256X physreg moves when VLX is supported.
Ideally we would use VEX encoded moves instead of EVEX if the high 16 registers aren't referenced, but this a good first step.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 06:14:34 +00:00
Craig Topper
92763c0edd [X86] Fix 80-column violations. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 06:14:26 +00:00
David Majnemer
93324fe683 [GVNHoist] Change the key for VNtoInsns to a pair
While debugging GVNHoist, I found it confusing that the entries in a
VNtoInsns were not always value numbers.  They _usually_ were except for
StoreInst in which case they were a hash of two different value numbers.

This leads to two observations:
- It is more difficult to debug things when the semantic contents of
  VNtoInsns changes over time.
- Using a single value number is not much cheaper, the value of
  VNtoInsns is a SmallVector.
- It is not immediately clear what the algorithm would do if there were
  hash collisions in the StoreInst case.

Using a DenseMap of std::pair sidesteps all of this.

N.B.  The changes in the test were due their sensitivity to the
iteration order of VNtoInsns which has changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275761 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 06:11:37 +00:00
Vedant Kumar
4893e1f8d4 [llvm-cov] Attempt to fix a test failure on Windows
Don't make the test/tools/llvm-cov/demangle.test depend on the order in
which symbols are seen, or on the exact formatting llvm-cov emits after
a symbol is printed. This is an attempt to fix a Windows bot failure:

  http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/9141

I don't know what the root cause of the failure is, or why the
showTemplateInstantiations test doesn't fail in the same way on the
Windows bots. However, this measure can't hurt, and it'll at least get
me on the blamelists again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 04:49:42 +00:00
NAKAMURA Takumi
73585958d4 Revert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute""
This reverts also r275029, "Update Clang tests after adding inference for the returned argument attribute"

It broke LTO build. Seems miscompilation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 03:23:25 +00:00
David Majnemer
a6f9e21635 [GVNHoist] Sink HoistedCtr into GVNHoist
HoistedCtr cannot be a mutated global variable, that will open us up to
races between threads compiling code in parallel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 00:35:01 +00:00
David Majnemer
326770a316 [GVNHoist] Some small cleanups
No functional change is intended, just trying to clean things up a
little.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275743 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 00:34:58 +00:00
Davide Italiano
7f321092d8 [GVN] Move other PRE tests to a subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 23:55:20 +00:00
Davide Italiano
c2a1d898e3 [GVN] Move the PRE/LOADPRE test in a subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 23:48:18 +00:00
Davide Italiano
9cffe5e2cd [GVN] Use FileCheck instead of grep for tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275739 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 23:21:26 +00:00
Simon Pilgrim
998d31012c Strip trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 19:02:27 +00:00
Simon Pilgrim
08df0eb04c [X86] Add CTPOP/CTLZ/CTTZ scalar cost tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 18:29:19 +00:00
Justin Lebar
5e704c77a9 Add tests for max/minIntN(64).
Summary:
Given that we had a bug on max/minUIntN(64), these should have tests
too.

Reviewers: rnk

Subscribers: dylanmckay, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275723 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 18:19:28 +00:00
Justin Lebar
f36e8699d3 Avoid UB in maxIntN(64).
Summary:
Previously we were relying on 2's complement underflow in an int64_t.
Now we cast to a uint64_t so we explicitly get the behavior we want.

Reviewers: rnk

Subscribers: dylanmckay, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 18:19:26 +00:00
Justin Lebar
61e00f94a5 Clean up some comments in MathExtras.h.
Reviewers: rnk

Subscribers: llvm-commits, dylanmckay

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275721 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 18:19:25 +00:00
Justin Lebar
495097a50a Add assertions checking SignExtend{32,64}'s bit width.
Summary:
The bit width must be greater than zero, otherwise we shift by the
integer's width, which is UB.  Also (more obviously) the width must be
less than or equal to the integer's width, otherwise we shift by a
negative number, which is also UB.

Reviewers: rnk

Subscribers: llvm-commits, dylanmckay

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 18:19:23 +00:00
Justin Lebar
c71e1994e1 Fix isShiftedInt and isShiftedUint for widths > 32.
Summary:
Previously we were doing 1 << S.  "1" is an int, so this doesn't work
when S >= 32.

This patch also adds some static_asserts to these functions to ensure
that we don't hit UB by shifting left too much.

Reviewers: rnk

Subscribers: llvm-commits, dylanmckay

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 18:19:21 +00:00
Justin Lebar
a0a694296b Use a faster implementation of maxUIntN.
Summary:
On x86-64 with clang 3.8, before:

   mov     edx, 1
   mov     cl, dil
   shl     rdx, cl
   cmp     rdi, 64
   mov     rax, -1
   cmovne  rax, rdx
   ret

after:

  mov     ecx, 64
  sub     ecx, edi
  mov     rax, -1
  shr     rax, cl
  ret

Reviewers: rnk

Subscribers: dylanmckay, mkuper, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275718 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 18:19:19 +00:00
Justin Lebar
bac9a5d5cf Fix warnings in ImmutableSetTest and SequenceTest.
Doing "I++" inside of an EXPECT_* triggers

  warning: expression with side effects has no effect in an unevaluated context

because EXPECT_* partially expands to

  EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(i++)) == 1)>

which is an unevaluated context.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 18:10:30 +00:00
Simon Pilgrim
5bf69d80fb [X86][AVX] Added VBROADCASTF128/VBROADCASTI128 tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 17:44:18 +00:00
Simon Pilgrim
0aff5d2239 [X86] Regenerated ctlz/cttz scalar tests for 32/64-bit targets with/without LZCNT/TZCNT support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 16:15:51 +00:00
Simon Pilgrim
506afb80d9 [X86] Regenerated popcnt scalar tests for 32/64-bit targets with/without POPCNT support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275709 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 16:04:19 +00:00
Simon Pilgrim
43973299d3 [X86][SSE] lowerVectorShuffleAsPermuteAndUnpack tidyup. NFCI.
Moved unpack type determination into TryUnpack lambda.

Added missing comment describing lowerVectorShuffleAsPermuteAndUnpack call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 15:48:25 +00:00
Teresa Johnson
e2f34269f3 [ThinLTO] Perform profile-guided indirect call promotion
Summary:
To enable profile-guided indirect call promotion in ThinLTO mode, we
simply add call graph edges for each profitable target from the profile
to the summaries, then the summary-guided importing will consider the
callee for importing as usual.

Also we need to enable the indirect call promotion pass creation in the
PassManagerBuilder when PerformThinLTO=true (we are in the ThinLTO
backend), so that the newly imported functions are considered for
promotion in the backends.

The IC promotion profiles refer to callees by GUID, which required
adding GUIDs to the per-module VST in bitcode (and assigning them
valueIds similar to how they are assigned valueIds in the combined
index).

Reviewers: mehdi_amini, xur

Subscribers: mehdi_amini, davidxl, llvm-commits

Differential Revision: http://reviews.llvm.org/D21932

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 14:47:01 +00:00
Teresa Johnson
350718ee80 Address review comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 14:46:58 +00:00
Teresa Johnson
c64254e223 Refactor indirect call promotion profitability analysis (NFC)
Summary:
Refactored the profitability analysis out of the IC promotion pass and
into lib/Analysis so that it can be accessed by the summary index
builder in a follow-on patch to enable IC promotion in ThinLTO (D21932).

Reviewers: davidxl, xur

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D22182

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 14:46:54 +00:00
Guy Blank
611890892a test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 12:10:35 +00:00
Elena Demikhovsky
562b267d41 X86: Updated a test file. NFC.
This test shows subotimal code generated for AVX-512 vs PENTIUM4.
The issue will be fixed in an upcomming commit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17 07:03:13 +00:00
Dehao Chen
78ee4b6ec0 [PM] Convert IVUsers analysis to new pass manager.
Summary: Convert IVUsers analysis to new pass manager.

Reviewers: davidxl, silvas

Subscribers: junbuml, sanjoy, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 22:51:33 +00:00
Sanjay Patel
2e9433d42d [InstCombine] allow X + signbit --> X ^ signbit for vector splats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275691 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 18:29:26 +00:00
Sanjay Patel
713ceaf392 add vector test to show missing transform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275690 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 18:24:18 +00:00
Mehdi Amini
bf11cc79f2 IPRA: avoid double query to the map (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275689 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 18:20:26 +00:00
Sanjay Patel
5de5eb94ef update tests to use FileCheck, consolidate tests, fix comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 18:08:22 +00:00
Sanjay Patel
32507fc5f7 update test to use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 16:31:58 +00:00
Sanjay Patel
dbf9b41991 auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 16:27:58 +00:00
Sanjay Patel
2913e8c9be auto-ggenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275685 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 16:24:06 +00:00
Sanjay Patel
05d1283c18 [InstCombine] reassociate logic ops with constants separated by a zext
This is a partial implementation of a general fold for associative+commutative operators:
(op (cast (op X, C2)), C1) --> (cast (op X, op (C1, C2)))
(op (cast (op X, C2)), C1) --> (op (cast X), op (C1, C2))

There are 7 associative operators and 13 cast types, so this could potentially go a lot further.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 15:20:19 +00:00
Hal Finkel
4fe9cc7cb0 Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute"
This reverts commit r275042; the initial commit triggered self-hosting failures
on ARM/AArch64. James Molloy identified the problematic backend code, which has
been disabled in r275677. Trying again...

Original commit message:

Let FuncAttrs infer the 'returned' argument attribute

A function can have one argument with the 'returned' attribute, indicating that
the associated argument is always the return value of the function. Add
FuncAttrs inference logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275678 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 07:21:28 +00:00
Hal Finkel
aa47729233 Disable this-return argument forwarding on ARM/AArch64
r275042 reverted function-attribute inference for the 'returned' attribute
because the feature triggered self-hosting failures on ARM and AArch64. James
Molloy determined that the this-return argument forwarding feature, which
directly ties the returned input argument to the returned value, was the cause.
It seems likely that this forwarding code contains, or triggers, a subtle bug.
Disabling for now until we can track that down.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275677 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 07:07:29 +00:00
Yaxun Liu
384c6423e5 Re-commit [AMDGPU] Add metadata for runtime
Attempting to fix lit test failure on ppc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 05:09:21 +00:00
Craig Topper
108967b172 [AVX512] Remove CodeGenOnly VBROADCAST m_Int instructions. They can be implemented with patterns selecting existing instructions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 03:42:59 +00:00
Matthias Braun
3346c15107 llc: Add support for -run-pass none
This does not schedule any passes besides the ones necessary to
construct and print the machine function. This is useful to test .mir
file reading and printing.

Differential Revision: http://reviews.llvm.org/D22432

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275664 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 02:24:59 +00:00
Matthias Braun
4bd6d7fb73 llc: Move pass query/add code into an own function; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275663 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 02:24:15 +00:00
Matthias Braun
7e0a8cbfdc ARM/MIR: Move test from MIR to CodeGen/ARM directory
test/CodeGen/MIR/ARM/ARMLoadStoreDBG.mir is an actual test for the ARM
load store optimization pass and not a test of the mir parser/printer.

It belongs to test/CodeGen/ARM; This also updates the test to use the
new -run-pass llc syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275662 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 02:24:13 +00:00
Matthias Braun
05b523a8b1 ARM: Initialize LoadStore passes in TargetMachine
Initializing them in LLVMInitializeARMTarget() makes them visible early
enough for "llc -run-pass usage".

This required the pass to be renamed from "arm-load-store-opt" to
"arm-ldst-opt", because there already exists an arm-load-store-opt
cl::opt switch which would now clash with the passname getting added as
a switch in opt. On the bright side the pass name now matches the
DEBUG_TYPE name. Renamed "arm-prera-load-store-opt" to
"arm-repra-ldst-opt" as well for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275661 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 02:24:10 +00:00
Eric Christopher
01f8f57b81 Reword comment to be more clear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 01:55:45 +00:00
Matthias Braun
4d5c34d999 MIParser: reject subregister indexes on physregs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 01:36:18 +00:00
Richard Smith
8f1ea71020 Fix modules buildbot after r275633.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275657 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 01:05:39 +00:00