OSDN Git Service

android-x86/external-llvm.git
6 years agoRevert "Don't assume a null GV is local for ELF and MachO."
Reid Kleckner [Tue, 6 Feb 2018 00:47:14 +0000 (00:47 +0000)]
Revert "Don't assume a null GV is local for ELF and MachO."

This reverts r323297.

It breaks building grub.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324301 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ThinLTO] Remove dead and dropped symbol declarations when possible
Teresa Johnson [Tue, 6 Feb 2018 00:43:39 +0000 (00:43 +0000)]
[ThinLTO] Remove dead and dropped symbol declarations when possible

Summary:
Removing the dropped symbols will prevent indirect call promotion in the
ThinLTO Backend from adding a new reference to a symbol, which can
result in linker unsats. This can happen when we compile with a sample
profile collected from one binary by used for another, which may have
profiled targets that aren't used in the new binary.

Note that until dropDeadSymbols handles variables and aliases (in
progress), we may not be able to remove the declaration and can still
have an issue.

Reviewers: grimar, davidxl

Subscribers: mehdi_amini, inglorion, llvm-commits, eraman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324299 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix regex from r324279 more better.
Paul Robinson [Tue, 6 Feb 2018 00:43:26 +0000 (00:43 +0000)]
Fix regex from r324279 more better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324298 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Auto-generate complete checks. NFC
Craig Topper [Mon, 5 Feb 2018 23:57:03 +0000 (23:57 +0000)]
[X86] Auto-generate complete checks. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324295 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Relax restrictions on what setcc condition codes can be folded with a sext...
Craig Topper [Mon, 5 Feb 2018 23:57:01 +0000 (23:57 +0000)]
[X86] Relax restrictions on what setcc condition codes can be folded with a sext when AVX512 is enabled.

We now allow all signed comparisons and not equal. The complement that needs to be added for this is no worse than the extend. And the vector output forms of pcmpeq/pcmpgt have better latency than the k-register version on SKX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324294 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoLTO: Also include dso-local bit for calls in ThinLTO cache key.
Peter Collingbourne [Mon, 5 Feb 2018 23:46:32 +0000 (23:46 +0000)]
LTO: Also include dso-local bit for calls in ThinLTO cache key.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324291 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LoopStrengthReduce, x86] don't add cost for a cmp that will be macro-fused (PR35681)
Sanjay Patel [Mon, 5 Feb 2018 23:43:05 +0000 (23:43 +0000)]
[LoopStrengthReduce, x86] don't add cost for a cmp that will be macro-fused (PR35681)

In the motivating case from PR35681 and represented by the macro-fuse-cmp test:
https://bugs.llvm.org/show_bug.cgi?id=35681
...there's a 37 -> 31 byte size win for the loop because we eliminate the big base
address offsets.

SPEC2017 on Ryzen shows no significant perf difference.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324289 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PEI] Fix failing test caused by r324283
Francis Visoiu Mistrih [Mon, 5 Feb 2018 23:06:47 +0000 (23:06 +0000)]
[PEI] Fix failing test caused by r324283

X86FrameLowering sets stack size to 0 if redzone is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324285 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PEI][NFC] Move StackSize opt-remark code next to -warn-stack code
Francis Visoiu Mistrih [Mon, 5 Feb 2018 22:46:54 +0000 (22:46 +0000)]
[PEI][NFC] Move StackSize opt-remark code next to -warn-stack code

This allows us to make sure we're always having the same sizes in both
remarks and warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324283 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix Windows bots for test from r324270.
Paul Robinson [Mon, 5 Feb 2018 22:30:00 +0000 (22:30 +0000)]
Fix Windows bots for test from r324270.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324279 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LowerMemIntrinsics] Update uses of deprecated MemIntrinsic::getAlignment API (NFC)
Daniel Neilson [Mon, 5 Feb 2018 22:23:58 +0000 (22:23 +0000)]
[LowerMemIntrinsics] Update uses of deprecated MemIntrinsic::getAlignment API (NFC)

Summary:
This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
LowerMemIntrinsics pass to cease using the old getAlignment() API of MemoryIntrinsic in
favour of getting source & dest specific alignments through the new API.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324278 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] don't try to evaluate instructions with >1 use (revert r324014)
Sanjay Patel [Mon, 5 Feb 2018 21:50:32 +0000 (21:50 +0000)]
[InstCombine] don't try to evaluate instructions with >1 use (revert r324014)

This example causes a compile-time explosion:

define i16 @foo(i16 %in) {
  %x = zext i16 %in to i32
  %a1 = mul i32 %x, %x
  %a2 = mul i32 %a1, %a1
  %a3 = mul i32 %a2, %a2
  %a4 = mul i32 %a3, %a3
  %a5 = mul i32 %a4, %a4
  %a6 = mul i32 %a5, %a5
  %a7 = mul i32 %a6, %a6
  %a8 = mul i32 %a7, %a7
  %a9 = mul i32 %a8, %a8
  %a10 = mul i32 %a9, %a9
  %a11 = mul i32 %a10, %a10
  %a12 = mul i32 %a11, %a11
  %a13 = mul i32 %a12, %a12
  %a14 = mul i32 %a13, %a13
  %a15 = mul i32 %a14, %a14
  %a16 = mul i32 %a15, %a15
  %a17 = mul i32 %a16, %a16
  %a18 = mul i32 %a17, %a17
  %a19 = mul i32 %a18, %a18
  %a20 = mul i32 %a19, %a19
  %a21 = mul i32 %a20, %a20
  %a22 = mul i32 %a21, %a21
  %a23 = mul i32 %a22, %a22
  %a24 = mul i32 %a23, %a23
  %T = trunc i32 %a24 to i16
  ret i16 %T
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324276 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SDAG] Legalize all CondCodes by inverting them and/or swapping operands
Krzysztof Parzyszek [Mon, 5 Feb 2018 21:27:16 +0000 (21:27 +0000)]
[SDAG] Legalize all CondCodes by inverting them and/or swapping operands

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324274 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SimplifyLibCalls] Update from deprecated IRBuilder API for creating memory intrinsic...
Daniel Neilson [Mon, 5 Feb 2018 21:23:22 +0000 (21:23 +0000)]
[SimplifyLibCalls] Update from deprecated IRBuilder API for creating memory intrinsics (NFC)

Summary:
This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
SimplifyLibCalls pass to cease using the old IRBuilder createMemCpy/createMemMove
single-alignment APIs in favour of the new API that allows setting source and destination
alignments independently.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, r3L24148 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324273 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF] Regularize dumping strings from line tables.
Paul Robinson [Mon, 5 Feb 2018 20:43:15 +0000 (20:43 +0000)]
[DWARF] Regularize dumping strings from line tables.

The major visible difference here is that in line-table dumps,
directory and file names are wrapped in double-quotes; previously,
directory names got single quotes and file names were not quoted at
all.

The improvement in this patch is that when a DWARF v5 line table
header has indirect strings, in a verbose dump these will all have
their section[offset] printed as well as the name itself.  This
matches the format used for dumping strings in the .debug_info
section.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324270 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add test corresponding to r324252 (PR36225); NFC
Sanjay Patel [Mon, 5 Feb 2018 19:59:52 +0000 (19:59 +0000)]
[InstCombine] add test corresponding to r324252 (PR36225); NFC

As PR36225 shows, we definitely don't want to enable the
canEvaluate* logic with phis.

There's still a question of whether we should just revert
r324014 completely because it exposes a compile-time sinkhole
(although that problem might exist independently).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324266 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd release note on change to memcpy/memmove/memset builtin signatures
Daniel Neilson [Mon, 5 Feb 2018 19:39:38 +0000 (19:39 +0000)]
Add release note on change to memcpy/memmove/memset builtin signatures

Summary:
The signatures for the builtins @llvm.memcpy, @llvm.memmove, and @llvm.memset
where changed in rL322965. The number of arguments has decreased from five to
four with the removal of the alignment argument. Alignment is now conveyed
by supplying the align parameter attribute on the destination and/or source of
the cpy/move/set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324265 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Teach DAG unfoldMemoryOperand to reconvert CMPs to tests
Nirav Dave [Mon, 5 Feb 2018 18:58:58 +0000 (18:58 +0000)]
[X86] Teach DAG unfoldMemoryOperand to reconvert CMPs to tests

Summary:
Copy MI-level cmp->test conversion to SelectionDAG-level memory unfold.
This fixes a regression from upcoming D41293 change.

Reviewers: craig.topper, RKSimon

Reviewed By: craig.topper

Subscribers: llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324261 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Artificially lower the complexity of the scalar ANDN patterns so that AND with...
Craig Topper [Mon, 5 Feb 2018 18:31:04 +0000 (18:31 +0000)]
[X86] Artificially lower the complexity of the scalar ANDN patterns so that AND with immediate will match first.

This allows the immediate to folded into the and instead of being forced to move into a register. This can sometimes result in shorter encodings since the and can sign extend an immediate.

This also allows us to match an and to a movzx after a not.

This can cause an extra move if the input to the separate NOT has an additional user which requires a copy before the NOT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324260 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add unsigned saturation subtraction canonicalizations
Sanjay Patel [Mon, 5 Feb 2018 17:53:29 +0000 (17:53 +0000)]
[InstCombine] add unsigned saturation subtraction canonicalizations

This is the instcombine part of unsigned saturation canonicalization.
Backend patches already commited:
https://reviews.llvm.org/D37510
https://reviews.llvm.org/D37534

It converts unsigned saturated subtraction patterns to forms recognized
by the backend:
(a > b) ? a - b : 0 -> ((a > b) ? a : b) - b)
(b < a) ? a - b : 0 -> ((a > b) ? a : b) - b)
(b > a) ? 0 : a - b -> ((a > b) ? a : b) - b)
(a < b) ? 0 : a - b -> ((a > b) ? a : b) - b)
((a > b) ? b - a : 0) -> - ((a > b) ? a : b) - b)
((b < a) ? b - a : 0) -> - ((a > b) ? a : b) - b)
((b > a) ? 0 : b - a) -> - ((a > b) ? a : b) - b)
((a < b) ? 0 : b - a) -> - ((a > b) ? a : b) - b)

Patch by Yulia Koval!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324255 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoLTO: Include dso-local bit in ThinLTO cache key.
Peter Collingbourne [Mon, 5 Feb 2018 17:17:51 +0000 (17:17 +0000)]
LTO: Include dso-local bit in ThinLTO cache key.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324253 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] only allow narrow/wide evaluation of values with >1 use if that user...
Sanjay Patel [Mon, 5 Feb 2018 17:16:50 +0000 (17:16 +0000)]
[InstCombine] only allow narrow/wide evaluation of values with >1 use if that user is a binop

There was a logic hole in D42739 / rL324014 because we're not accounting for select and phi
instructions that might have repeated operands. This is likely a source of an infinite loop.
I haven't manufactured a test case to prove that, but it should be safe to speculatively limit
this transform to binops while we try to create that test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324252 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Memoize instruction positions in BitTracker
Krzysztof Parzyszek [Mon, 5 Feb 2018 17:12:07 +0000 (17:12 +0000)]
[Hexagon] Memoize instruction positions in BitTracker

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324250 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Teach X86DAGToDAGISel::shrinkAndImmediate to preserve upper 32 zeroes of a...
Craig Topper [Mon, 5 Feb 2018 16:54:07 +0000 (16:54 +0000)]
[X86] Teach X86DAGToDAGISel::shrinkAndImmediate to preserve upper 32 zeroes of a 64 bit mask.

If the upper 32 bits of a 64 bit mask are all zeros, we have special isel patterns to use a 32-bit and instead of a 64-bit and by relying on the impliciting zeroing of 32 bit ops.

This patch teachs shrinkAndImmediate not to break that optimization.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324249 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r323472 "[Debug] Add dbg.value intrinsics for PHIs created during LCSSA."
Hans Wennborg [Mon, 5 Feb 2018 16:10:42 +0000 (16:10 +0000)]
Revert r323472 "[Debug] Add dbg.value intrinsics for PHIs created during LCSSA."

This broke the Chromium build; see PR36238.

> This patch is an enhancement to propagate dbg.value information when
> Phis are created on behalf of LCSSA.  I noticed a case where a value
> carried across a loop was reported as <optimized out>.
>
> Specifically this case:
>
>   int bar(int x, int y) {
>     return x + y;
>   }
>
>   int foo(int size) {
>     int val = 0;
>     for (int i = 0; i < size; ++i) {
>       val = bar(val, i);  // Both val and i are correct
>     }
>     return val; // <optimized out>
>   }
>
> In the above case, after all of the interesting computation completes
> our value is reported as "optimized out." This change will add a
> dbg.value to correct this.
>
> This patch also moves the dbg.value insertion routine from
> LoopRotation.cpp into Local.cpp, so that we can share it in both places
> (LoopRotation and LCSSA).
>
> Patch by Matt Davis!
>
> Differential Revision: https://reviews.llvm.org/D42551

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324247 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoBitTracker.h needs a full definition of MachineInstr, so include the defining file.
Benjamin Kramer [Mon, 5 Feb 2018 15:56:24 +0000 (15:56 +0000)]
BitTracker.h needs a full definition of MachineInstr, so include the defining file.

Patch by Dean Sturtevant!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324245 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Forgot about HexagonISD::VZERO in selecting const vectors
Krzysztof Parzyszek [Mon, 5 Feb 2018 15:52:54 +0000 (15:52 +0000)]
[Hexagon] Forgot about HexagonISD::VZERO in selecting const vectors

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324244 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Don't use garbage mask in HvxSelector::shuffp2
Krzysztof Parzyszek [Mon, 5 Feb 2018 15:46:41 +0000 (15:46 +0000)]
[Hexagon] Don't use garbage mask in HvxSelector::shuffp2

The function shuffp2 was breaking up a wide shuffle into a pair of
narrower ones, except that the narrower shuffle masks were actually
uninitialized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324243 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ThinLTO] Convert dead alias to declarations
Teresa Johnson [Mon, 5 Feb 2018 15:44:27 +0000 (15:44 +0000)]
[ThinLTO] Convert dead alias to declarations

Summary:
This complements the fixes in r323633 and r324075 which drop the
definitions of dead functions and variables, respectively.

Fixes PR36208.

Reviewers: grimar, rafael

Subscribers: mehdi_amini, llvm-commits, inglorion

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324242 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Use V6_vmpyih for halfword multiplication
Krzysztof Parzyszek [Mon, 5 Feb 2018 15:40:06 +0000 (15:40 +0000)]
[Hexagon] Use V6_vmpyih for halfword multiplication

Unlike V6_vmpyhv, it produces the result in the exact form that is
expected without the need for a shuffle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324241 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU][MC] Corrected dst/data size for MIMG opcodes with d16 modifier
Dmitry Preobrazhensky [Mon, 5 Feb 2018 14:18:53 +0000 (14:18 +0000)]
[AMDGPU][MC] Corrected dst/data size for MIMG opcodes with d16 modifier

See bug 36154: https://bugs.llvm.org/show_bug.cgi?id=36154

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

Reviewers: cfang, artem.tamazov, arsenm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324237 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-opt-fuzzer] Fix build after rL324225
Igor Laevsky [Mon, 5 Feb 2018 12:47:40 +0000 (12:47 +0000)]
[llvm-opt-fuzzer] Fix build after rL324225

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324232 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU][MC] Added validation of d16 and r128 modifiers of MIMG opcodes
Dmitry Preobrazhensky [Mon, 5 Feb 2018 12:45:43 +0000 (12:45 +0000)]
[AMDGPU][MC] Added validation of d16 and r128 modifiers of MIMG opcodes

See bugs 36094, 36095:
  https://bugs.llvm.org/show_bug.cgi?id=36094
  https://bugs.llvm.org/show_bug.cgi?id=36095

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

Reviewers: vpykhtin, artem.tamazov, arsenm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324231 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] Check hot loop exit edge in PPCCTRLoops
Hiroshi Inoue [Mon, 5 Feb 2018 12:25:29 +0000 (12:25 +0000)]
[PowerPC] Check hot loop exit edge in PPCCTRLoops

PPCCTRLoops transform loops using mtctr/bdnz instructions if loop trip count is known and big enough to compensate for the cost of mtctr.
But if there is a loop exit edge which is known to be frequently taken (by builtin_expect or by PGO), we should not transform the loop to avoid the cost of mtctr instruction. Here is an example of a loop with hot exit edge:

for (unsigned i = 0; i < TripCount; i++) {
  // do something
  if (__builtin_expect(check(), 1))
    break;
  // do something
}

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324229 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeGenSchedule][NFC] Always emit ProcResourceUnits.
Clement Courbet [Mon, 5 Feb 2018 12:23:51 +0000 (12:23 +0000)]
[CodeGenSchedule][NFC] Always emit ProcResourceUnits.

Summary:
Right now only the ProcResourceUnits that are directly referenced by
instructions are emitted. This change emits all of them, so that
analysis passes can use the information.
This has no functional impact. It typically adds a few entries (e.g. 4
for X86/haswell) to the generated ProcRes table.

Reviewers: gchatelet

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324228 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-opt-fuzzer] Avoid adding incorrect inputs to the fuzzer corpus
Igor Laevsky [Mon, 5 Feb 2018 11:05:47 +0000 (11:05 +0000)]
[llvm-opt-fuzzer] Avoid adding incorrect inputs to the fuzzer corpus

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324225 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix more print format specifiers in debug_rnglists dumping
James Henderson [Mon, 5 Feb 2018 10:47:13 +0000 (10:47 +0000)]
Fix more print format specifiers in debug_rnglists dumping

See also r324096.

I have made the assumption that DWARF64 is not an issue for the time
being with these fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324223 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert [SimplifyCFG] Relax restriction for folding unconditional branches
Serguei Katkov [Mon, 5 Feb 2018 09:05:43 +0000 (09:05 +0000)]
Revert [SimplifyCFG] Relax restriction for folding unconditional branches

The patch causes the failure of the test
compiler-rt/test/profile/Linux/counter_promo_nest.c

To unblock buildbot, revert the patch while investigation is in progress.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324214 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add isel patterns for selecting masked SUBV_BROADCAST with bitcasts. Remove...
Craig Topper [Mon, 5 Feb 2018 08:37:37 +0000 (08:37 +0000)]
[X86] Add isel patterns for selecting masked SUBV_BROADCAST with bitcasts. Remove combineBitcastForMaskedOp.

Add test cases for the merge masked versions to make sure we have all those covered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324210 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Add tests for PR35743
Max Kazantsev [Mon, 5 Feb 2018 08:09:49 +0000 (08:09 +0000)]
[NFC] Add tests for PR35743

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324209 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SimplifyCFG] Relax restriction for folding unconditional branches
Serguei Katkov [Mon, 5 Feb 2018 07:56:43 +0000 (07:56 +0000)]
[SimplifyCFG] Relax restriction for folding unconditional branches

The commit rL308422 introduces a restriction for folding unconditional
branches. Specifically if empty block with unconditional branch leads to
header of the loop then elimination of this basic block is prohibited.
However it seems this condition is redundantly strict.
If elimination of this basic block does not introduce more back edges
then we can eliminate this block.

The patch implements this relax of restriction.

Reviewers: efriedma, mcrosier, pacxx, hsung, davidxl
Reviewed By: pacxx
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42691

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324208 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove unused lambda. NFC
Craig Topper [Mon, 5 Feb 2018 06:56:33 +0000 (06:56 +0000)]
[X86] Remove unused lambda. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324206 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove X86ISD::SHUF128 from combineBitcastForMaskedOp. Use isel patterns instead.
Craig Topper [Mon, 5 Feb 2018 06:00:23 +0000 (06:00 +0000)]
[X86] Remove X86ISD::SHUF128 from combineBitcastForMaskedOp. Use isel patterns instead.

We always created X86ISD::SHUF128 with a 64-bit element type so we can use isel patterns to detect a bitconvert to 32-bit to handle masking.

The test changes are because we also match the bitconvert even if there is no masking. This leads to unnecessary isel pattern, but it requires more multiclass hackery in tablegen to get rid of it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324205 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-apply [SCEV] Fix isLoopEntryGuardedByCond usage
Serguei Katkov [Mon, 5 Feb 2018 05:49:47 +0000 (05:49 +0000)]
Re-apply [SCEV] Fix isLoopEntryGuardedByCond usage

ScalarEvolution::isKnownPredicate invokes isLoopEntryGuardedByCond without check
that SCEV is available at entry point of the loop. It is incorrect and fixed by patch.

To bugs additionally fixed:
assert is moved after the check whether loop is not a nullptr.
Usage of isLoopEntryGuardedByCond in ScalarEvolution::isImpliedCondOperandsViaNoOverflow
is guarded by isAvailableAtLoopEntry.

Reviewers: sanjoy, mkazantsev, anna, dorit, reames
Reviewed By: mkazantsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42417

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324204 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Auto-generate full checks. NFC
Craig Topper [Sun, 4 Feb 2018 23:48:51 +0000 (23:48 +0000)]
[X86] Auto-generate full checks. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324202 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoX86 Tests: Add shuffle that can be improved by widening elements. NFC
Zvi Rackover [Sun, 4 Feb 2018 19:31:14 +0000 (19:31 +0000)]
X86 Tests: Add shuffle that can be improved by widening elements. NFC

To be improved by D42044

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324200 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PartialInliner] Update test (NFC).
Florian Hahn [Sun, 4 Feb 2018 18:40:24 +0000 (18:40 +0000)]
[PartialInliner] Update test (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324199 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InlineFunction] Set arg attrs even if there only are VarArg attrs.
Florian Hahn [Sun, 4 Feb 2018 18:27:47 +0000 (18:27 +0000)]
[InlineFunction] Set arg attrs even if there only are VarArg attrs.

When using the partial inliner, we might have attributes for forwarded
varargs, but the CodeExtractor does not create an empty argument
attribute set for regular arguments in that case, because it does not know
of the additional arguments. So in case we have attributes for VarArgs, we
also have to make sure we create (empty) attributes for all regular arguments.

This fixes PR36210.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324197 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TableGen][AsmMatcherEmitter] Fix tied-constraint checking for InstAliases
Sander de Smalen [Sun, 4 Feb 2018 16:24:17 +0000 (16:24 +0000)]
[TableGen][AsmMatcherEmitter] Fix tied-constraint checking for InstAliases

Summary:
This is a bit of a reimplementation the work done in
https://reviews.llvm.org/D41446, since that patch only really works for
tied operands of instructions, not aliases.

Instead of checking the constraints based on the matched instruction's opcode,
this patch uses the match-info's convert function to check the operand
constraints for that specific instruction/alias.
This is based on the matched operands for the instruction, not the
resulting opcode of the MCInst.

This patch adds the following enum/table to the *GenAsmMatcher.inc file:
  enum {
    Tie0_1_1,
    Tie0_1_2,
    Tie0_1_5,
    ...
  };

  const char TiedAsmOperandTable[][3] = {
    /* Tie0_1_1 */ { 0, 1, 1 },
    /* Tie0_1_2 */ { 0, 1, 2 },
    /* Tie0_1_5 */ { 0, 1, 5 },
    ...
  };

And it is referenced directly in the ConversionTable, like this:
static const uint8_t ConversionTable[CVT_NUM_SIGNATURES][13] = {
  ...
  { CVT_95_addRegOperands, 1,
    CVT_95_addRegOperands, 2,
    CVT_Tied, Tie0_1_5,
    CVT_95_addRegOperands, 6, CVT_Done },
  ...

The Tie0_1_5 (and corresponding table) encodes that:
* Result operand 0 is the operand to copy (which is e.g. done when
  building up the operands to the MCInst in convertToMCInst())
* Asm operands 1 and 5 should be the same operands (which is checked
  in checkAsmTiedOperandConstraints()).

Reviewers: olista01, rengolin, fhahn, craig.topper, echristo, apazos, dsanders

Reviewed By: olista01

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324196 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LV] Use Demanded Bits and ValueTracking for reduction type-shrinking
Chad Rosier [Sun, 4 Feb 2018 15:42:24 +0000 (15:42 +0000)]
[LV] Use Demanded Bits and ValueTracking for reduction type-shrinking

The type-shrinking logic in reduction detection, although narrow in scope, is
also rather ad-hoc, which has led to bugs (e.g., PR35734). This patch modifies
the approach to rely on the demanded bits and value tracking analyses, if
available. We currently perform type-shrinking separately for reductions and
other instructions in the loop. Long-term, we should probably think about
computing minimal bit widths in a more complete way for the loops we want to
vectorize.

PR35734
Differential Revision: https://reviews.llvm.org/D42309

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324195 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add DAG combine to turn (bitcast (and/or/xor (bitcast X), Y)) -> (and/or/xor...
Craig Topper [Sun, 4 Feb 2018 01:43:48 +0000 (01:43 +0000)]
[X86] Add DAG combine to turn (bitcast (and/or/xor (bitcast X), Y)) -> (and/or/xor X, (bitcast Y)) when casting between GPRs and mask operations.

This reduces the number of transitions between k-registers and GPRs, reducing the number of instructions.

There's still some room for improvement to remove more transitions, but this is a good start.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324184 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove unused function argument. NFC
Craig Topper [Sun, 4 Feb 2018 01:43:44 +0000 (01:43 +0000)]
[X86] Remove unused function argument. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324183 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombiner] When folding fold (sext/zext (and/or/xor (sextload/zextload x), cst...
Craig Topper [Sat, 3 Feb 2018 23:00:31 +0000 (23:00 +0000)]
[DAGCombiner] When folding fold (sext/zext (and/or/xor (sextload/zextload x), cst)) -> (and/or/xor (sextload/zextload x), (sext/zext cst)) make sure we check the legality of the full extended load.

Summary:
If the load is already an extended load we should be using the memory VT for the legality check, not just the VT of the current extension.

I don't have a test case, just noticed it while investigating some load extension improvements.

Reviewers: RKSimon, spatel, niravd

Reviewed By: niravd

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324181 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MIPS] Regenerate vector tests with update script
Simon Pilgrim [Sat, 3 Feb 2018 22:11:22 +0000 (22:11 +0000)]
[MIPS] Regenerate vector tests with update script

Hopefully help make this a lot more maintainable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324180 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] Don't use simple VT in generic shuffle code
Simon Pilgrim [Sat, 3 Feb 2018 21:34:42 +0000 (21:34 +0000)]
[SelectionDAG] Don't use simple VT in generic shuffle code

Better to assume that any value type may be commuted, not just MVTs.

No test case right now, but discovered while investigating possible shuffle combines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324179 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Don't chain shuffles together in schedule tests
Simon Pilgrim [Sat, 3 Feb 2018 21:20:19 +0000 (21:20 +0000)]
[X86][SSE] Don't chain shuffles together in schedule tests

This is necessary to prevent the shuffles from being combined/simplified in an upcoming patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324178 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove and autoupgrade kand/kandn/kor/kxor/kxnor/knot intrinsics.
Craig Topper [Sat, 3 Feb 2018 20:18:25 +0000 (20:18 +0000)]
[X86] Remove and autoupgrade kand/kandn/kor/kxor/kxnor/knot intrinsics.

Clang already stopped using these a couple months ago.

The test cases aren't great as there is nothing forcing the operations to stay in k-registers so some of them moved back to scalar ops due to the bitcasts being moved around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324177 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRemove unneeded -debug argument from new test
David Green [Sat, 3 Feb 2018 17:33:50 +0000 (17:33 +0000)]
Remove unneeded -debug argument from new test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324176 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ORC] Rename NullResolver to NullLegacyResolver.
Lang Hames [Sat, 3 Feb 2018 16:52:48 +0000 (16:52 +0000)]
[ORC] Rename NullResolver to NullLegacyResolver.

This resolver conforms to the LegacyJITSymbolResolver interface, and will be
replaced with a null-returning resolver conforming to the newer
orc::SymbolResolver interface in the near future. This patch renames the class
to avoid a clash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324175 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Allow common type conversions to i8/i16/i32
David Green [Sat, 3 Feb 2018 16:51:03 +0000 (16:51 +0000)]
[InstCombine] Allow common type conversions to i8/i16/i32

This, in instcombine, allows conversions to i8/i16/i32 (very
common cases) even if the resulting type is not legal according
to the data layout. This can often open up extra combine
opportunities.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324174 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RISCV] Update two RISCV codegen tests after rL323991
Alex Bradbury [Sat, 3 Feb 2018 13:02:30 +0000 (13:02 +0000)]
[RISCV] Update two RISCV codegen tests after rL323991

From the discussion in D41835 it looks possible the change will be backed out,
but for now let's fix the RISCV tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324172 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix MSVC signed/unsigned comparison warning. NFCI.
Simon Pilgrim [Sat, 3 Feb 2018 12:38:56 +0000 (12:38 +0000)]
Fix MSVC signed/unsigned comparison warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324171 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix incorrect usage of std::is_assignable.
Richard Smith [Fri, 2 Feb 2018 22:29:54 +0000 (22:29 +0000)]
Fix incorrect usage of std::is_assignable.

We want to check that we can assign to an lvalue here, not a prvalue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324152 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Use getDestAlignment in SimplifyMemSet (NFC)
Daniel Neilson [Fri, 2 Feb 2018 22:03:03 +0000 (22:03 +0000)]
[InstCombine] Use getDestAlignment in SimplifyMemSet (NFC)

Summary:
Small NFC change to change the name of the function used getting and setting
the alignment of a memset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324148 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Prefer to create a ISD::SETCC over X86ISD::PCMPEQ in combineVectorSizedSetCCEqu...
Craig Topper [Fri, 2 Feb 2018 21:59:46 +0000 (21:59 +0000)]
[X86] Prefer to create a ISD::SETCC over X86ISD::PCMPEQ in combineVectorSizedSetCCEquality.

This is running pre-legalize, we should try to use target independent nodes. This will give the best opportunity for target independent optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324147 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] make sure tests are providing coverage for the stated pattern; NFC
Sanjay Patel [Fri, 2 Feb 2018 21:40:54 +0000 (21:40 +0000)]
[InstCombine] make sure tests are providing coverage for the stated pattern; NFC

Without extra instructions and uses, swapMayExposeCSEOpportunities() would change
the icmp (as seen in the check lines), so we were not actually testing patterns
that should be handled by D41480.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324143 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Pass SDLoc by const reference in a few more places in X86ISelLowering.cpp. NFC
Craig Topper [Fri, 2 Feb 2018 20:32:00 +0000 (20:32 +0000)]
[X86] Pass SDLoc by const reference in a few more places in X86ISelLowering.cpp. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324135 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add avx512 command line to ptest.ll to demonstrate that 512-bit vectors are...
Craig Topper [Fri, 2 Feb 2018 20:12:45 +0000 (20:12 +0000)]
[X86] Add avx512 command line to ptest.ll to demonstrate that 512-bit vectors are not handled by LowerVectorAllZeroTest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324130 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoPartially revert r324124 [X86] Add tests for missed opportunities to use ptest for...
Craig Topper [Fri, 2 Feb 2018 20:12:44 +0000 (20:12 +0000)]
Partially revert r324124 [X86] Add tests for missed opportunities to use ptest for all ones comparison.

Turns out I misunderstood the flag behavior of PTEST because I read the documentation for KORTEST which is different than PTEST/KTEST and made a bad assumption.

Keep the test rename though cause that's useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324129 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GISel][NFC]: Move RegisterBankInfo::getSizeInBits into TargetRegisterInfo.
Aditya Nandakumar [Fri, 2 Feb 2018 19:42:07 +0000 (19:42 +0000)]
[GISel][NFC]: Move RegisterBankInfo::getSizeInBits into TargetRegisterInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324125 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add tests for missed opportunities to use ptest for all ones comparison.
Craig Topper [Fri, 2 Feb 2018 19:34:10 +0000 (19:34 +0000)]
[X86] Add tests for missed opportunities to use ptest for all ones comparison.

Also rename the test from pr12312.ll to ptest.ll so its more recognizable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324124 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix typo
Alex Denisov [Fri, 2 Feb 2018 19:20:37 +0000 (19:20 +0000)]
Fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324123 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] simplify logic for swapMayExposeCSEOpportunities; NFCI
Sanjay Patel [Fri, 2 Feb 2018 19:08:12 +0000 (19:08 +0000)]
[InstCombine] simplify logic for swapMayExposeCSEOpportunities; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324122 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] fix typos, formatting; NFC
Sanjay Patel [Fri, 2 Feb 2018 18:39:05 +0000 (18:39 +0000)]
[InstCombine] fix typos, formatting; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324118 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64][GlobalISel] Use getRegClassForTypeOnBank() in selectCopy.
Amara Emerson [Fri, 2 Feb 2018 18:03:30 +0000 (18:03 +0000)]
[AArch64][GlobalISel] Use getRegClassForTypeOnBank() in selectCopy.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324110 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add baseline tests for unsigned saturated sub (D41480); NFC
Sanjay Patel [Fri, 2 Feb 2018 17:43:16 +0000 (17:43 +0000)]
[InstCombine] add baseline tests for unsigned saturated sub (D41480); NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324109 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove checks for FeatureAVX512 from the X86 assembly parser. Remove mcpu/mattr...
Craig Topper [Fri, 2 Feb 2018 17:02:58 +0000 (17:02 +0000)]
[X86] Remove checks for FeatureAVX512 from the X86 assembly parser. Remove mcpu/mattr from assembly test command lines.

Summary:
We should always be able to accept AVX512 registers and instructions in llvm-mc. The only subtarget mode that should be checked is 16-bit vs 32-bit vs 64-bit mode.

I've also removed all the mattr/mcpu lines from test RUN lines to be consistent with this. Most were due to AVX512, but a few were for other features.

Fixes PR36202

Reviewers: RKSimon, echristo, bkramer

Reviewed By: echristo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324106 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMake utils/UpdateTestChecks/common.py Python 2/3 compatible and fix print statements.
Fangrui Song [Fri, 2 Feb 2018 16:41:07 +0000 (16:41 +0000)]
Make utils/UpdateTestChecks/common.py Python 2/3 compatible and fix print statements.

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324104 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Switch to the new addr space mapping by default
Yaxun Liu [Fri, 2 Feb 2018 16:07:16 +0000 (16:07 +0000)]
[AMDGPU] Switch to the new addr space mapping by default

This requires corresponding clang change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324101 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd llc tests for comparison chains.
Clement Courbet [Fri, 2 Feb 2018 15:54:17 +0000 (15:54 +0000)]
Add llc tests for comparison chains.

See https://reviews.llvm.org/D42793#996098 for context.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324099 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix type sizes that were causing incorrect string formatting
James Henderson [Fri, 2 Feb 2018 15:09:31 +0000 (15:09 +0000)]
Fix type sizes that were causing incorrect string formatting

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324096 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ThinLTO] - Add comment. NFC.
George Rimar [Fri, 2 Feb 2018 15:06:09 +0000 (15:06 +0000)]
[ThinLTO] - Add comment. NFC.

Was requested during review of D42798.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324095 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Force double domain for SHUFPD stack folding tests
Simon Pilgrim [Fri, 2 Feb 2018 14:55:20 +0000 (14:55 +0000)]
[X86][SSE] Force double domain for SHUFPD stack folding tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324094 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Analysis] Support aggregate access types in TBAA
Ivan A. Kosarev [Fri, 2 Feb 2018 14:09:22 +0000 (14:09 +0000)]
[Analysis] Support aggregate access types in TBAA

This patch implements analysis for new-format TBAA access tags
with aggregate types as their final access types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324092 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd missing new files from r324077
James Henderson [Fri, 2 Feb 2018 12:45:57 +0000 (12:45 +0000)]
Add missing new files from r324077

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324078 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF v5] Add limited support for dumping .debug_rnglists
James Henderson [Fri, 2 Feb 2018 12:35:52 +0000 (12:35 +0000)]
[DWARF v5] Add limited support for dumping .debug_rnglists

This change adds support to llvm-dwarfdump for dumping DWARF5
.debug_rnglists sections in regular ELF files.

It is not complete, in that several DW_RLE_* encodings are currently
not supported, but does dump the headert and the basic ranges for
DW_RLE_start_length and DW_RLE_start_end encodings.

Obvious next steps are to add verbose dumping that dumps the raw
encodings, rather than the interpreted contents, to add -verify support
of the section (e.g. to show that the correct number of offsets are
specified), add dumping of .debug_rnglists.dwo, and to add support for
other encodings.

Reviewed by: dblaikie, JDevlieghere

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324077 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LTO] - Simplify. NFC.
George Rimar [Fri, 2 Feb 2018 12:21:26 +0000 (12:21 +0000)]
[LTO] - Simplify. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324076 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ThinLTO] - Fix for "ThinLTO inlines variables that should be discarded".
George Rimar [Fri, 2 Feb 2018 12:17:33 +0000 (12:17 +0000)]
[ThinLTO] - Fix for "ThinLTO inlines variables that should be discarded".

This fixes PR36187.

Patch teaches ThinLTO to drop non-prevailing variables,
just like we recently did for functions (in r323633).

Differential revision: https://reviews.llvm.org/D42798

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324075 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] fixed some tabs/whitespaces in test. NFC.
Sjoerd Meijer [Fri, 2 Feb 2018 11:51:06 +0000 (11:51 +0000)]
[ARM] fixed some tabs/whitespaces in test. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324074 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GlobalOpt] Include padding in debug fragments
Mikael Holmen [Fri, 2 Feb 2018 10:34:13 +0000 (10:34 +0000)]
[GlobalOpt] Include padding in debug fragments

Summary:
When creating the debug fragments for a SRA'd variable, use the types'
allocation sizes. This fixes issues where the pass would emit too small
fragments, placed at the wrong offset, for padded types.

An example of this is long double on x86. The type is represented using
x86_fp80, which is 10 bytes, but the value is aligned to 12/16 bytes.
The padding is included in the type's DW_AT_byte_size attribute;
therefore, the fragments should also include that. Newer GCC releases
(I tested 7.2.0) emit 12/16-byte pieces for long double. Earlier
releases, e.g. GCC 5.5.0, behaved as LLVM did, i.e. by emitting a
10-byte piece, followed by an empty 2/6-byte piece for the padding.

Failing to cover all `DW_AT_byte_size' bytes of a value with non-empty
pieces results in the value being printed as <optimized out> by GDB.

Patch by: David Stenberg

Reviewers: aprantl, JDevlieghere

Reviewed By: aprantl, JDevlieghere

Subscribers: llvm-commits

Tags: #debug-info

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324066 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] Consider endianness in scalarizeVectorStore().
Jonas Paulsson [Fri, 2 Feb 2018 08:48:02 +0000 (08:48 +0000)]
[SelectionDAG]  Consider endianness in scalarizeVectorStore().

When handling vectors with non byte-sized elements, reverse the order of the
elements in the built integer if the target is Big-Endian.

SystemZ tests updated.

Review: Eli Friedman, Ulrich Weigand.
https://reviews.llvm.org/D42786

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324063 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] Add an assert in getNode() for EXTRACT_VECTOR_ELT.
Jonas Paulsson [Fri, 2 Feb 2018 08:21:53 +0000 (08:21 +0000)]
[SelectionDAG]  Add an assert in getNode() for EXTRACT_VECTOR_ELT.

When getNode() is called to create an EXTRACT_VECTOR_ELT, assert that
the result VT is at least as wide as the vector element type.

Review: Eli Friedman

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324061 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SystemZ] Update test case (NFC)
Jonas Paulsson [Fri, 2 Feb 2018 07:52:02 +0000 (07:52 +0000)]
[SystemZ]  Update test case (NFC)

test/CodeGen/SystemZ/vec-trunc-to-i1.ll was marked as a temporary
FAIL when it was previously updated when it needed one more COPY.
This was however wrong, since the loop body had been reduced
significantly, and it was actually an improvement.

Review: Ulrich Weigand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324060 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RISCV] Add ELFObjectFileBase::getRISCVFeatures let llvm-objdump could get RISCV...
Shiva Chen [Fri, 2 Feb 2018 06:01:02 +0000 (06:01 +0000)]
[RISCV] Add ELFObjectFileBase::getRISCVFeatures let llvm-objdump could get RISCV target feature

llvm-objdump could get C feature by ELF::EF_RISCV_RVC e_flag,
so then we don't have to add -mattr=+c on the command line.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324058 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Legalize (v64i1 (bitcast (i64 X))) on 32-bit targets by extracting 32-bit halve...
Craig Topper [Fri, 2 Feb 2018 05:59:33 +0000 (05:59 +0000)]
[X86] Legalize (v64i1 (bitcast (i64 X))) on 32-bit targets by extracting 32-bit halves from i32, bitcasting each to v32i1, and concatenating.

This prevents the scalarization that would otherwise occur.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324057 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Legalize (i64 (bitcast (v64i1 X))) on 32-bit targets by extracting to v32i1...
Craig Topper [Fri, 2 Feb 2018 05:59:31 +0000 (05:59 +0000)]
[X86] Legalize (i64 (bitcast (v64i1 X))) on 32-bit targets by extracting to v32i1 and bitcasting to i32.

This saves a trip through memory and seems to open up other combining opportunities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324056 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RISCV] Fix c.addi and c.addi16sp immediate constraints which should be non-zero
Shiva Chen [Fri, 2 Feb 2018 02:43:23 +0000 (02:43 +0000)]
[RISCV] Fix c.addi and c.addi16sp immediate constraints which should be non-zero

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324055 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RISCV] Define getSetCCResultType for setting vector setCC type
Shiva Chen [Fri, 2 Feb 2018 02:43:18 +0000 (02:43 +0000)]
[RISCV] Define getSetCCResultType for setting vector setCC type

To avoid trigger "No default SetCC type for vectors!" Assertion

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324054 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64][GlobalISel] Fix old use of % sigil in test.
Amara Emerson [Fri, 2 Feb 2018 02:14:42 +0000 (02:14 +0000)]
[AArch64][GlobalISel] Fix old use of % sigil in test.

My rebase had missed the new $ sigil we're using.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324051 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix debug spelling in ResetMachineFunction pass.
Amara Emerson [Fri, 2 Feb 2018 01:49:59 +0000 (01:49 +0000)]
Fix debug spelling in ResetMachineFunction pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324048 91177308-0d34-0410-b5e6-96231b3b80d8