OSDN Git Service

android-x86/external-llvm.git
7 years ago[X86][InstCombine] Teach InstCombineCalls to simplify demanded elements for scalar...
Craig Topper [Sun, 11 Dec 2016 07:42:06 +0000 (07:42 +0000)]
[X86][InstCombine] Teach InstCombineCalls to simplify demanded elements for scalar FMA intrinsics.

These intrinsics don't read the upper bits of their second and third inputs so we can try to simplify them.

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

7 years ago[AVX-512][InstCombine] Teach InstCombineCalls how to simplify demanded for scalar...
Craig Topper [Sun, 11 Dec 2016 07:42:04 +0000 (07:42 +0000)]
[AVX-512][InstCombine] Teach InstCombineCalls how to simplify demanded for scalar cmp intrinsics with masking and rounding.

These intrinsics don't read the upper elements of their first and second input. These are slightly different the the SSE version which does use the upper bits of its first element as passthru bits since the result goes to an XMM register. For AVX-512 the result goes to a mask register instead.

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

7 years ago[AVX-512][InstCombine] Teach InstCombineCalls how to simplify demanded elements for...
Craig Topper [Sun, 11 Dec 2016 07:42:01 +0000 (07:42 +0000)]
[AVX-512][InstCombine] Teach InstCombineCalls how to simplify demanded elements for scalar add,div,mul,sub,max,min intrinsics with masking and rounding.

These intrinsics don't read the upper bits of their second input. And the third input is the passthru for masking and that only uses the lower element as well.

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

7 years ago[AVR] Add calling convention CodeGen tests
Dylan McKay [Sun, 11 Dec 2016 07:09:45 +0000 (07:09 +0000)]
[AVR] Add calling convention CodeGen tests

This adds CodeGen tests for the AVR C calling convention.

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

7 years ago[libFuzzer] don't depend on time in a test
Kostya Serebryany [Sun, 11 Dec 2016 06:28:09 +0000 (06:28 +0000)]
[libFuzzer] don't depend on time in a test

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

7 years ago[AVR] Add a test to validate a simple 'blinking led' program
Dylan McKay [Sun, 11 Dec 2016 04:59:39 +0000 (04:59 +0000)]
[AVR] Add a test to validate a simple 'blinking led' program

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

7 years ago[AVX-512][InstCombine] Add 512-bit vpermilvar intrinsics to InstCombineCalls to match...
Craig Topper [Sun, 11 Dec 2016 01:59:36 +0000 (01:59 +0000)]
[AVX-512][InstCombine] Add 512-bit vpermilvar intrinsics to InstCombineCalls to match 128 and 256-bit.

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

7 years ago[X86] Fix a comment to say 'an FMA' instead of 'a FMA'. NFC
Craig Topper [Sun, 11 Dec 2016 01:28:08 +0000 (01:28 +0000)]
[X86] Fix a comment to say 'an FMA' instead of 'a FMA'. NFC

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

7 years ago[X86] Remove masking from 512-bit VPERMIL intrinsics in preparation for being able...
Craig Topper [Sun, 11 Dec 2016 01:26:44 +0000 (01:26 +0000)]
[X86] Remove masking from 512-bit VPERMIL intrinsics in preparation for being able to constant fold them in InstCombineCalls like we do for 128/256-bit.

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

7 years ago[AVR] Fix a signed vs unsigned compiler warning
Dylan McKay [Sun, 11 Dec 2016 00:24:13 +0000 (00:24 +0000)]
[AVR] Fix a signed vs unsigned compiler warning

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

7 years ago[X86][InstCombine] Teach InstCombineCalls to turn pshufb intrinsic into a shufflevect...
Craig Topper [Sun, 11 Dec 2016 00:23:50 +0000 (00:23 +0000)]
[X86][InstCombine] Teach InstCombineCalls to turn pshufb intrinsic into a shufflevector if the indices are constant.

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

7 years ago[AVR] Remove incorrect comment
Dylan McKay [Sat, 10 Dec 2016 23:50:30 +0000 (23:50 +0000)]
[AVR] Remove incorrect comment

This should've been removed in r289323.

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

7 years ago[X86] Remove masking from 512-bit PSHUFB intrinsics in preparation for being able...
Craig Topper [Sat, 10 Dec 2016 23:09:43 +0000 (23:09 +0000)]
[X86] Remove masking from 512-bit PSHUFB intrinsics in preparation for being able to constant fold it in InstCombineCalls like we do for 128/256-bit.

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

7 years ago[InstCombine] add helper for shift-by-shift folds; NFCI
Sanjay Patel [Sat, 10 Dec 2016 22:16:29 +0000 (22:16 +0000)]
[InstCombine] add helper for shift-by-shift folds; NFCI

These are currently limited to integer types, but we should
be able to extend to splat vectors and possibly general vectors.

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

7 years ago[X86][SSE] Add tests for sign extended vXi64 multiplication
Simon Pilgrim [Sat, 10 Dec 2016 22:02:36 +0000 (22:02 +0000)]
[X86][SSE] Add tests for sign extended vXi64 multiplication

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

7 years ago[X86][SSE] Ensure UNPCK inputs are a consistent value type in LowerHorizontalByteSum
Simon Pilgrim [Sat, 10 Dec 2016 21:16:45 +0000 (21:16 +0000)]
[X86][SSE] Ensure UNPCK inputs are a consistent value type in LowerHorizontalByteSum

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

7 years ago[AVX-512] Remove 128/256 masked vpermil instrinsics and autoupgrade to a select aroun...
Craig Topper [Sat, 10 Dec 2016 21:15:52 +0000 (21:15 +0000)]
[AVX-512] Remove 128/256 masked vpermil instrinsics and autoupgrade to a select around the unmasked avx1 intrinsics.

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

7 years ago[X86][IR] Move the autoupgrading of store intrinsics out of the main nested if/else...
Craig Topper [Sat, 10 Dec 2016 21:15:48 +0000 (21:15 +0000)]
[X86][IR] Move the autoupgrading of store intrinsics out of the main nested if/else chain. This should buy a little more time against the MSVC limit mentioned in PR31034.

The handlers for stores all return at the end of their block so they can be picked off early.

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

7 years agoAMDGPU: Fix asan errors when folding operands
Matt Arsenault [Sat, 10 Dec 2016 19:58:00 +0000 (19:58 +0000)]
AMDGPU: Fix asan errors when folding operands

This was failing when trying to fold immediates into operand 1 of a
phi, which only has one statically known operand.

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

7 years ago[X86][SSE] Move ZeroVector creation into the shuffle pattern case where its actually...
Simon Pilgrim [Sat, 10 Dec 2016 19:49:55 +0000 (19:49 +0000)]
[X86][SSE] Move ZeroVector creation into the shuffle pattern case where its actually used.

Also fix the ZeroVector's type - I've no idea how this hasn't caused problems........

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

7 years ago[AVX-512] Add support for lowering (v2i64 (fp_to_sint (v2f32))) to vcvttps2uqq when...
Craig Topper [Sat, 10 Dec 2016 19:35:39 +0000 (19:35 +0000)]
[AVX-512] Add support for lowering (v2i64 (fp_to_sint (v2f32))) to vcvttps2uqq when AVX512DQ and AVX512VL are available.

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

7 years ago[X86] Clarify indentation. NFC
Craig Topper [Sat, 10 Dec 2016 19:35:36 +0000 (19:35 +0000)]
[X86] Clarify indentation. NFC

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

7 years ago[X86] Combine LowerFP_TO_SINT and LowerFP_TO_UINT. They only differ by a single boole...
Craig Topper [Sat, 10 Dec 2016 19:35:33 +0000 (19:35 +0000)]
[X86] Combine LowerFP_TO_SINT and LowerFP_TO_UINT. They only differ by a single boolean flag passed to a helper function. Just check the opcode and create the flag.

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

7 years ago[InstSimplify] improve function name; NFC
Sanjay Patel [Sat, 10 Dec 2016 17:40:47 +0000 (17:40 +0000)]
[InstSimplify] improve function name; NFC

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

7 years ago[mips] Eliminate else-after-return. NFC
Simon Atanasyan [Sat, 10 Dec 2016 17:30:09 +0000 (17:30 +0000)]
[mips] Eliminate else-after-return. NFC

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

7 years ago[SelectionDAG] Add ability for computeKnownBits to peek through bitcasts from 'large...
Simon Pilgrim [Sat, 10 Dec 2016 17:00:00 +0000 (17:00 +0000)]
[SelectionDAG] Add ability for computeKnownBits to peek through bitcasts from 'large element' scalar/vector to 'small element' vector.

Extension to D27129 which already supported bitcasts from 'small element' vector to 'large element' scalar/vector types.

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

7 years ago[X86][XOP] Add permil2ps buildvector combine test
Simon Pilgrim [Sat, 10 Dec 2016 13:45:08 +0000 (13:45 +0000)]
[X86][XOP] Add permil2ps buildvector combine test

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

7 years ago[AVR] Add a stub README file
Dylan McKay [Sat, 10 Dec 2016 12:08:19 +0000 (12:08 +0000)]
[AVR] Add a stub README file

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

7 years ago[AVR] Fix and clean up the inline assembly tests
Dylan McKay [Sat, 10 Dec 2016 11:49:07 +0000 (11:49 +0000)]
[AVR] Fix and clean up the inline assembly tests

There was a bug where we would hit an assertion if 'Q' was used as a
constraint.

I also removed hardcoded register names to prefer regexes so the tests
don't break when the register allocator changes.

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

7 years ago[AVR] Explicitly set the target in all CodeGen tests
Dylan McKay [Sat, 10 Dec 2016 11:23:16 +0000 (11:23 +0000)]
[AVR] Explicitly set the target in all CodeGen tests

This seems to have caused failures on the buildbot.

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

7 years ago[AVR] Fix an inline asm assertion which would always trigger
Dylan McKay [Sat, 10 Dec 2016 11:18:37 +0000 (11:18 +0000)]
[AVR] Fix an inline asm assertion which would always trigger

It looks like some time in the past, constraint codes were changed from
chars being passed around to enums.

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

7 years ago[AVR] Use the register scavenger when expanding 'LDDW' instructions
Dylan McKay [Sat, 10 Dec 2016 10:51:55 +0000 (10:51 +0000)]
[AVR] Use the register scavenger when expanding 'LDDW' instructions

Summary: This gets rid of the hardcoded 'r0' that was used previously.

Reviewers: asl

Subscribers: llvm-commits

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

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

7 years ago[AVR] Support stores to undefined pointers
Dylan McKay [Sat, 10 Dec 2016 10:16:13 +0000 (10:16 +0000)]
[AVR] Support stores to undefined pointers

This would previously trigger an assertion error in AVRISelDAGToDAG.

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

7 years ago[PM] Further broaden this test's regex as both the CGSCC and Function
Chandler Carruth [Sat, 10 Dec 2016 07:59:59 +0000 (07:59 +0000)]
[PM] Further broaden this test's regex as both the CGSCC and Function
inner AM proxies are now being rendered differently.

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

7 years ago[PM] Try to support the new spelling of one of the proxy names that are
Chandler Carruth [Sat, 10 Dec 2016 07:46:51 +0000 (07:46 +0000)]
[PM] Try to support the new spelling of one of the proxy names that are
showing up on the build bots.

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

7 years ago[PM] Support invalidation of inner analysis managers from a pass over the outer IR...
Chandler Carruth [Sat, 10 Dec 2016 06:34:44 +0000 (06:34 +0000)]
[PM] Support invalidation of inner analysis managers from a pass over the outer IR unit.

Summary:
This never really got implemented, and was very hard to test before
a lot of the refactoring changes to make things more robust. But now we
can test it thoroughly and cleanly, especially at the CGSCC level.

The core idea is that when an inner analysis manager proxy receives the
invalidation event for the outer IR unit, it needs to walk the inner IR
units and propagate it to the inner analysis manager for each of those
units. For example, each function in the SCC needs to get an
invalidation event when the SCC gets one.

The function / module interaction is somewhat boring here. This really
becomes interesting in the face of analysis-backed IR units. This patch
effectively handles all of the CGSCC layer's needs -- both invalidating
SCC analysis and invalidating function analysis when an SCC gets
invalidated.

However, this second aspect doesn't really handle the
LoopAnalysisManager well at this point. That one will need some change
of design in order to fully integrate, because unlike the call graph,
the entire function behind a LoopAnalysis's results can vanish out from
under us, and we won't even have a cached API to access. I'd like to try
to separate solving the loop problems into a subsequent patch though in
order to keep this more focused so I've adapted them to the API and
updated the tests that immediately fail, but I've not added the level of
testing and validation at that layer that I have at the CGSCC layer.

An important aspect of this change is that the proxy for the
FunctionAnalysisManager at the SCC pass layer doesn't work like the
other proxies for an inner IR unit as it doesn't directly manage the
FunctionAnalysisManager and invalidation or clearing of it. This would
create an ever worsening problem of dual ownership of this
responsibility, split between the module-level FAM proxy and this
SCC-level FAM proxy. Instead, this patch changes the SCC-level FAM proxy
to work in terms of the module-level proxy and defer to it to handle
much of the updates. It only does SCC-specific invalidation. This will
become more important in subsequent patches that support more complex
invalidaiton scenarios.

Reviewers: jlebar

Subscribers: mehdi_amini, mcrosier, mzolotukhin, llvm-commits

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

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

7 years ago[X86] Use X86ISD::CVTTP2SI and X86ISD::CVTTP2UI for lowering 128-bit cvttps2qq and...
Craig Topper [Sat, 10 Dec 2016 06:02:48 +0000 (06:02 +0000)]
[X86] Use X86ISD::CVTTP2SI and X86ISD::CVTTP2UI for lowering 128-bit cvttps2qq and cvttps2uqq intrinsics since there is a mismatch between number of input and output elements.

Ideally ISD::FP_TO_SINT and ISD::FP_TO_UINT would only be used for cases with the same number of input and output elements.

Similar things have already been done for other convert intrinsics.

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

7 years ago[AVR] Fix a bunch of incorrect assertion messages
Dylan McKay [Sat, 10 Dec 2016 05:48:48 +0000 (05:48 +0000)]
[AVR] Fix a bunch of incorrect assertion messages

These should've been checking whether the immediate is a 6-bit unsigned
integer.

If the immediate was '63', this would cause an assertion error which
shouldn't have occurred.

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

7 years ago[libFuzzer] test cleanup (3)
Kostya Serebryany [Sat, 10 Dec 2016 02:48:42 +0000 (02:48 +0000)]
[libFuzzer] test cleanup (3)

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

7 years ago[libFuzzer] test cleanup (2)
Kostya Serebryany [Sat, 10 Dec 2016 02:47:00 +0000 (02:47 +0000)]
[libFuzzer] test cleanup (2)

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

7 years ago[libFuzzer] test cleanup
Kostya Serebryany [Sat, 10 Dec 2016 02:45:56 +0000 (02:45 +0000)]
[libFuzzer] test cleanup

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

7 years ago[libFuzzer] switch all libFuzzer tests to use -fsanitize-coverage=trace-pc-guard...
Kostya Serebryany [Sat, 10 Dec 2016 02:26:23 +0000 (02:26 +0000)]
[libFuzzer] switch all libFuzzer tests to use -fsanitize-coverage=trace-pc-guard. Support for the previosly used instrumentation will be removed in the following changes

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

7 years ago[libFuzzer] use __sanitizer_get_module_and_offset_for_pc to get the module name while...
Kostya Serebryany [Sat, 10 Dec 2016 01:19:35 +0000 (01:19 +0000)]
[libFuzzer] use __sanitizer_get_module_and_offset_for_pc to get the module name while printing the coverage

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

7 years agoAMDGPU: Fix AMDGPUPromoteAlloca breaking addrspacecasts
Matt Arsenault [Sat, 10 Dec 2016 00:52:50 +0000 (00:52 +0000)]
AMDGPU: Fix AMDGPUPromoteAlloca breaking addrspacecasts

The users of the addrspacecast were having their types incorrectly
changed, producing invalid bitcasts between address spaces.

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

7 years agoAMDGPU: Fix handling of 16-bit immediates
Matt Arsenault [Sat, 10 Dec 2016 00:39:12 +0000 (00:39 +0000)]
AMDGPU: Fix handling of 16-bit immediates

Since 32-bit instructions with 32-bit input immediate behavior
are used to materialize 16-bit constants in 32-bit registers
for 16-bit instructions, determining the legality based
on the size is incorrect. Change operands to have the size
specified in the type.

Also adds a workaround for a disassembler bug that
produces an immediate MCOperand for an operand that
is supposed to be OPERAND_REGISTER.

The assembler appears to accept out of bounds immediates and
truncates them, but this seems to be an issue for 32-bit
already.

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

7 years agoAMDGPU: Fix vintrp disassembly
Matt Arsenault [Sat, 10 Dec 2016 00:29:55 +0000 (00:29 +0000)]
AMDGPU: Fix vintrp disassembly

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

7 years agoAMDGPU: Change vintrp printing to better match sc
Matt Arsenault [Sat, 10 Dec 2016 00:23:12 +0000 (00:23 +0000)]
AMDGPU: Change vintrp printing to better match sc

Some of the immediates need to be printed differently
eventually.

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

7 years agoBigger-hammer REQUIRES to fix Windows bot.
Paul Robinson [Fri, 9 Dec 2016 23:08:17 +0000 (23:08 +0000)]
Bigger-hammer REQUIRES to fix Windows bot.

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

7 years ago[AMDGPU, PowerPC, TableGen] Fix some Clang-tidy modernize and Include What You Use...
Eugene Zelenko [Fri, 9 Dec 2016 22:06:55 +0000 (22:06 +0000)]
[AMDGPU, PowerPC, TableGen] 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@289282 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSpeculative REQUIRES to fix Windows bot.
Paul Robinson [Fri, 9 Dec 2016 21:59:00 +0000 (21:59 +0000)]
Speculative REQUIRES to fix Windows bot.

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

7 years ago[X86] Regenerate test
Simon Pilgrim [Fri, 9 Dec 2016 21:53:12 +0000 (21:53 +0000)]
[X86] Regenerate test

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

7 years agoAMDGPU: Cleanup checks in sext_inreg test
Matt Arsenault [Fri, 9 Dec 2016 21:10:41 +0000 (21:10 +0000)]
AMDGPU: Cleanup checks in sext_inreg test

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

7 years agoFix LLVM's use of DW_OP_bit_piece in DWARF expressions.
Adrian Prantl [Fri, 9 Dec 2016 20:43:40 +0000 (20:43 +0000)]
Fix LLVM's use of DW_OP_bit_piece in DWARF expressions.

LLVM's use of DW_OP_bit_piece is incorrect and a based on a
misunderstanding of the wording in the DWARF specification. The offset
argument of DW_OP_bit_piece refers to the offset into the location
that is on the top of the DWARF expression stack, and not an offset
into the source variable. This has since also been clarified in the
DWARF specification.

This patch fixes all uses of DW_OP_bit_piece to emit the correct
offset and simplifies the DwarfExpression class to semi-automaticaly
emit empty DW_OP_pieces to adjust the offset of the source variable,
thus simplifying the code using DwarfExpression.

While this is an incompatible bugfix, in practice I don't expect this
to be much of a problem since LLVM's old interpretation and the
correct interpretation of DW_OP_bit_piece differ only when there are
gaps in the fragmented locations of the described variables or if
individual fragments are smaller than a byte. LLDB at least won't
interpret locations with gaps in them because is has no way to present
undefined bits in a variable, and there is a high probability that an
old-form expression will be malformed when interpreted correctly,
because the DW_OP_bit_piece offset will be outside of the location at
the top of the stack.

As a nice side-effect, this patch enables us to use a more efficient
encoding for subregisters: In order to express a sub-register at a
non-zero offset we now use a DW_OP_bit_piece instead of shifting the
value into place manually.

This patch also adds missing test coverage for code paths that weren't
exercised before.

<rdar://problem/29335809>
Differential Revision: https://reviews.llvm.org/D27550

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

7 years agoAdd README describing the intention of test/CodeGen/MIR
Matthias Braun [Fri, 9 Dec 2016 20:16:12 +0000 (20:16 +0000)]
Add README describing the intention of test/CodeGen/MIR

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

7 years agoAMDGPU/SI: Remove XNACK feature from CI
Marek Olsak [Fri, 9 Dec 2016 19:49:58 +0000 (19:49 +0000)]
AMDGPU/SI: Remove XNACK feature from CI

Summary: CI doesn't have XNACK.

Reviewers: tstellarAMD

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

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

7 years agoAMDGPU/SI: Don't reserve XNACK when it's disabled
Marek Olsak [Fri, 9 Dec 2016 19:49:54 +0000 (19:49 +0000)]
AMDGPU/SI: Don't reserve XNACK when it's disabled

Summary:
This frees 2 additional scalar registers.

These are results from all of my 3 patches combined:

  Polaris:
    Spilled SGPRs: 2231 -> 1517 (-32.00 %)

  Tonga:
    Spilled SGPRs: 3829 -> 2608 (-31.89 %)
    Spilled VGPRs: 100 -> 84 (-16.00 %)

  Tonga even spills SGPRs via VGPRs to scratch. That's a compute shader
  limited to 64 VGPRs.

Reviewers: tstellarAMD

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

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

7 years agoAMDGPU/SI: Don't reserve FLAT_SCR on non-HSA targets & without stack objects
Marek Olsak [Fri, 9 Dec 2016 19:49:48 +0000 (19:49 +0000)]
AMDGPU/SI: Don't reserve FLAT_SCR on non-HSA targets & without stack objects

Summary: This frees 2 scalar registers.

Reviewers: tstellarAMD

Subscribers: qcolombet, arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

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

7 years agoAMDGPU/SI: Allow using SGPRs 96-101 on VI
Marek Olsak [Fri, 9 Dec 2016 19:49:40 +0000 (19:49 +0000)]
AMDGPU/SI: Allow using SGPRs 96-101 on VI

Summary:
There is no point in setting SGPRS=104, because VI allocates SGPRs
in multiples of 16, so 104 -> 112. That enables us to use all 102 SGPRs
for general purposes.

Reviewers: tstellarAMD

Subscribers: qcolombet, arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

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

7 years agoRemove /Zc:sizedDealloc- from the MSVC build
Reid Kleckner [Fri, 9 Dec 2016 19:20:28 +0000 (19:20 +0000)]
Remove /Zc:sizedDealloc- from the MSVC build

According to the connect bug
(https://connect.microsoft.com/VisualStudio/feedback/details/1351894),
this was only necessary with pre-release versions of MSVC 2015.

Fixes PR23513

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

7 years ago[DWARF] Suppress .loc directives from CFI instructions
Paul Robinson [Fri, 9 Dec 2016 19:15:32 +0000 (19:15 +0000)]
[DWARF] Suppress .loc directives from CFI instructions

Like DBG_VALUE, these emit nothing to the .text section, and sometimes
have no source location specified.  Just ignore them.

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

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

7 years agoMove .mir tests to appropriate directories
Matthias Braun [Fri, 9 Dec 2016 19:08:15 +0000 (19:08 +0000)]
Move .mir tests to appropriate directories

test/CodeGen/MIR should contain tests that intent to test the MIR
printing or parsing. Tests that test something else should be in
test/CodeGen/TargetName even when they are written in .mir.

As a rule of thumb, only tests using "llc -run-pass none" should be in
test/CodeGen/MIR.

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

7 years agoAMDGPU: Fix isTypeDesirableForOp for i16
Matt Arsenault [Fri, 9 Dec 2016 17:57:43 +0000 (17:57 +0000)]
AMDGPU: Fix isTypeDesirableForOp for i16

This should do nothing for targets without i16.

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

7 years ago[SelectionDAG] Add knownbits support for EXTRACT_VECTOR_ELT opcodes (REAPPLIED)
Simon Pilgrim [Fri, 9 Dec 2016 17:53:11 +0000 (17:53 +0000)]
[SelectionDAG] Add knownbits support for EXTRACT_VECTOR_ELT opcodes (REAPPLIED)

Reapplied with fix for PR31323 - X86 SSE2 vXi16 multiplies for illegal types were creating CONCAT_VECTORS nodes with vector inputs that might not total the number of elements in the result type.

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

7 years agoAMDGPU: Fix i128 mul
Matt Arsenault [Fri, 9 Dec 2016 17:49:14 +0000 (17:49 +0000)]
AMDGPU: Fix i128 mul

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

7 years agoAMDGPU: Allow TBA, TMA, TTMP* registers with SMEM instructions
Matt Arsenault [Fri, 9 Dec 2016 17:49:11 +0000 (17:49 +0000)]
AMDGPU: Allow TBA, TMA, TTMP* registers with SMEM instructions

Fixes assembler regressions.

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

7 years agoAMDGPU: Clean up instruction bits
Matt Arsenault [Fri, 9 Dec 2016 17:49:08 +0000 (17:49 +0000)]
AMDGPU: Clean up instruction bits

Sort the instruction bits by type and make sure there is one
for each format.

Also cleanup namespaces.

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

7 years ago[PPC] Add intrinsics for vector extract word and vector insert word.
Sean Fertile [Fri, 9 Dec 2016 17:21:42 +0000 (17:21 +0000)]
[PPC] Add intrinsics for vector extract word and vector insert word.

Revision: https://reviews.llvm.org/D26547

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

7 years agoRevert "In visitSTORE, always use FindBetterChain, rather than only when UseAA is...
Nirav Dave [Fri, 9 Dec 2016 17:18:24 +0000 (17:18 +0000)]
Revert "In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled."

This reverts commit r289221 which appears to be triggering an assertion

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

7 years agoIn visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.
Nirav Dave [Fri, 9 Dec 2016 16:15:12 +0000 (16:15 +0000)]
In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.

Retrying after fixing overly aggressive load-store forwarding optimization.

Simplify Consecutive Merge Store Candidate Search

Now that address aliasing is much less conservative, push through
simplified store merging search which only checks for parallel stores
through the chain subgraph. This is cleaner as the separation of
non-interfering loads/stores from the store-merging logic.

Whem merging stores, search up the chain through a single load, and
finds all possible stores by looking down from through a load and a
TokenFactor to all stores visited. This improves the quality of the
output SelectionDAG and generally the output CodeGen (with some
exceptions).

Additional Minor Changes:

   1. Finishes removing unused AliasLoad code
   2. Unifies the the chain aggregation in the merged stores across
      code paths
   3. Re-add the Store node to the worklist after calling
      SimplifyDemandedBits.
   4. Increase GatherAllAliasesMaxDepth from 6 to 18. That number is
      arbitrary, but seemed sufficient to not cause regressions in
      tests.

This finishes the change Matt Arsenault started in r246307 and
jyknight's original patch.

Many tests required some changes as memory operations are now
reorderable. Some tests relying on the order were changed to use
volatile memory operations

Noteworthy tests:

    CodeGen/AArch64/argument-blocks.ll -
      It's not entirely clear what the test_varargs_stackalign test is
      supposed to be asserting, but the new code looks right.

    CodeGen/AArch64/arm64-memset-inline.lli -
    CodeGen/AArch64/arm64-stur.ll -
    CodeGen/ARM/memset-inline.ll -

      The backend now generates *worse* code due to store merging
      succeeding, as we do do a 16-byte constant-zero store efficiently.

    CodeGen/AArch64/merge-store.ll -
      Improved, but there still seems to be an extraneous vector insert
      from an element to itself?

    CodeGen/PowerPC/ppc64-align-long-double.ll -
      Worse code emitted in this case, due to the improved store->load
      forwarding.

    CodeGen/X86/dag-merge-fast-accesses.ll -
    CodeGen/X86/MergeConsecutiveStores.ll -
    CodeGen/X86/stores-merging.ll -
    CodeGen/Mips/load-store-left-right.ll -
      Restored correct merging of non-aligned stores

    CodeGen/AMDGPU/promote-alloca-stored-pointer-value.ll -
      Improved. Correctly merges buffer_store_dword calls

    CodeGen/AMDGPU/si-triv-disjoint-mem-access.ll -
      Improved. Sidesteps loading a stored value and
      merges two stores

    CodeGen/X86/pr18023.ll -
      This test has been removed, as it was asserting incorrect
      behavior. Non-volatile stores *CAN* be moved past volatile loads,
      and now are.

    CodeGen/X86/vector-idiv.ll -
    CodeGen/X86/vector-lzcnt-128.ll -
      It's basically impossible to tell what these tests are actually
      testing. But, looks like the code got better due to the memory
      operations being recognized as non-aliasing.

    CodeGen/X86/win32-eh.ll -
      Both loads of the securitycookie are now merged.

Reviewers: arsenm, hfinkel, tstellarAMD, jyknight, nhaehnle

Subscribers: wdng, nhaehnle, nemanjai, arsenm, weimingz, niravd, RKSimon, aemerson, qcolombet, dsanders, resistor, tstellarAMD, t.p.northover, spatel

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

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

7 years agoUse SelectionDAG.getSplatBuildVector helper. NFCI.
Simon Pilgrim [Fri, 9 Dec 2016 16:01:50 +0000 (16:01 +0000)]
Use SelectionDAG.getSplatBuildVector helper. NFCI.

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

7 years agoAMDGPU/SI: Don't mark VINTRP instructions as mayLoad
Tom Stellard [Fri, 9 Dec 2016 15:57:15 +0000 (15:57 +0000)]
AMDGPU/SI: Don't mark VINTRP instructions as mayLoad

Summary:
These instructions technically do read from memory, but the memory
is considered to be out of bounds for normal load/store instructions.

shader-db stats:

SGPRS: 1416075 -> 1413323 (-0.19 %)
VGPRS: 867413 -> 863935 (-0.40 %)
Spilled SGPRs: 1409 -> 1354 (-3.90 %)
Spilled VGPRs: 63 -> 63 (0.00 %)
Private memory VGPRs: 880 -> 880 (0.00 %)
Scratch size: 2648 -> 2632 (-0.60 %) dwords per thread
Code Size: 37889052 -> 37897340 (0.02 %) bytes
LDS: 2147 -> 2147 (0.00 %) blocks
Max Waves: 279243 -> 280369 (0.40 %)
Wait states: 0 -> 0 (0.00 %)

Reviewers: nhaehnle, mareko, arsenm

Subscribers: kzhuravl, wdng, yaxunl, tony-tye

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

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

7 years ago[SelectionDAG] Use SelectionDAG.getBuildVector helper. NFCI.
Simon Pilgrim [Fri, 9 Dec 2016 15:23:41 +0000 (15:23 +0000)]
[SelectionDAG] Use SelectionDAG.getBuildVector helper. NFCI.

Makes interception of BUILD_VECTOR creation easier for debugging.

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

7 years ago[SCEVExpander] Remove \brief, reflow comments; NFC
Sanjoy Das [Fri, 9 Dec 2016 14:42:14 +0000 (14:42 +0000)]
[SCEVExpander] Remove \brief, reflow comments; NFC

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

7 years ago[SCEVExpander] Use llvm data structures; NFC
Sanjoy Das [Fri, 9 Dec 2016 14:42:11 +0000 (14:42 +0000)]
[SCEVExpander] Use llvm data structures; NFC

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

7 years ago[SelectionDAG] Add additional checks to CONCAT_VECTORS creation
Simon Pilgrim [Fri, 9 Dec 2016 14:27:52 +0000 (14:27 +0000)]
[SelectionDAG] Add additional checks to CONCAT_VECTORS creation

Part of the work for PR31323 - add extra asserts checking that the input vectors are of consistent type and result in the correct number of vector elements.

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

7 years agoPlug another leak in the DWARF unittests, DIEInlineStrings are never destroyed.
Benjamin Kramer [Fri, 9 Dec 2016 13:33:41 +0000 (13:33 +0000)]
Plug another leak in the DWARF unittests, DIEInlineStrings are never destroyed.

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

7 years agoFix memory leak in unit test.
Benjamin Kramer [Fri, 9 Dec 2016 13:12:30 +0000 (13:12 +0000)]
Fix memory leak in unit test.

The StringPool entries are destroyed with the allocator, the string pool
itself is not.

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

7 years agollvm/test/Object/archive-thin-create.test: Make sure that %t is empty to stabilize...
NAKAMURA Takumi [Fri, 9 Dec 2016 11:44:57 +0000 (11:44 +0000)]
llvm/test/Object/archive-thin-create.test: Make sure that %t is empty to stabilize the test.

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

7 years ago[AVR] Remove a set of redundant tests
Dylan McKay [Fri, 9 Dec 2016 11:22:26 +0000 (11:22 +0000)]
[AVR] Remove a set of redundant tests

This fixes the build.

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

7 years ago[SelectionDAG] Add partial BITCAST support to computeKnownBits
Simon Pilgrim [Fri, 9 Dec 2016 10:13:45 +0000 (10:13 +0000)]
[SelectionDAG] Add partial BITCAST support to computeKnownBits

Adds support for bitcasting a little endian 'small element' vector to 'large element' scalar/vector (e.g. v16i8 to v4i32 or v2i32 to i64), which is required for PR30845. We extract the knownbits for each 'small element' part and concatenate the results together.

We can add support for big endian and 'large element' scalar/vector to 'small element' vector bitcasting once we have test cases for them.

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

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

7 years agoUpdate Doxygen comment in StringSaver (NFC)
Malcolm Parsons [Fri, 9 Dec 2016 09:33:33 +0000 (09:33 +0000)]
Update Doxygen comment in StringSaver (NFC)

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

7 years agoRevert "[SelectionDAG] Add knownbits support for EXTRACT_VECTOR_ELT opcodes"
Daniel Jasper [Fri, 9 Dec 2016 09:04:51 +0000 (09:04 +0000)]
Revert "[SelectionDAG] Add knownbits support for EXTRACT_VECTOR_ELT opcodes"

This reverts commit r288916 as it is currently causing a crasher in
Halide. Reproducer on llvm.org/PR31323. While it might be that halide is
generating invalid IR, llc shouldn't crash.

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

7 years ago[X86] Modify patterns from memory form of RCP/RSQRT/SQRT intrinsics to only allow...
Craig Topper [Fri, 9 Dec 2016 07:57:21 +0000 (07:57 +0000)]
[X86] Modify patterns from memory form of RCP/RSQRT/SQRT intrinsics to only allow (scalar_to_vector (loadf32/load64)) instead of anything that sse_load_f32/f64 can match.

sse_load_f32/f64 can also match loads that are zero extended to vectors. We shouldn't match that because we wouldn't be able to get the instruction to zero the upper bits like the intrinsic semantics would require for such a case.

There is a test case that does depend on this behavior.

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

7 years ago[AVR] Use a more appropriate integer type for wide IN/OUT instructions
Dylan McKay [Fri, 9 Dec 2016 07:49:14 +0000 (07:49 +0000)]
[AVR] Use a more appropriate integer type for wide IN/OUT instructions

We could previously select an integer which would hit an assertion error
in pseudo expansion.

The new type will also generate the appropriate fixups if needed, which
wasn't done beforehand.

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

7 years ago[AVR] Add tests for a large number of pseudo instructions
Dylan McKay [Fri, 9 Dec 2016 07:49:04 +0000 (07:49 +0000)]
[AVR] Add tests for a large number of pseudo instructions

This adds MIR tests for 24 pseudo instructions.

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

7 years ago[AVX-512] Correctly preserve the passthru semantics of the FMA scalar intrinsics
Craig Topper [Fri, 9 Dec 2016 06:42:28 +0000 (06:42 +0000)]
[AVX-512] Correctly preserve the passthru semantics of the FMA scalar intrinsics

Summary:
Scalar intrinsics have specific semantics about the which input's upper bits are passed through to the output. The same input is also supposed to be the input we use for the lower element when the mask bit is 0 in a masked operation. We aren't currently keeping these semantics with instruction selection.

This patch corrects this by introducing new scalar FMA ISD nodes that indicate whether operand 1(one of the multiply inputs) or operand 3(the additon/subtraction input) should pass thru its upper bits.

We use this information to select 213/132 form for the operand 1 version and the 231 form for the operand 3 version.

We also use this information to suppress combining FNEG operations on the passthru input since semantically the passthru bits aren't negated. This is stronger than the earlier check added for a user being SELECTS so we can remove that.

This fixes PR30913.

Reviewers: delena, zvi, v_klochkov

Subscribers: llvm-commits

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

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

7 years agoAMDGPU: Select i16 instructions to VOP3 forms
Matt Arsenault [Fri, 9 Dec 2016 06:19:12 +0000 (06:19 +0000)]
AMDGPU: Select i16 instructions to VOP3 forms

These were selecting directly to the VOP2 form instead
of VOP3 like the i32 instructions. Fixes regressions in
future commits where an immediate isn't folded because it was
initially used for the second operand.

Because uniform 16-bit operations are promoted to i32, it's
difficult to get a simple testcase where this matters. Fold
failures in SIFoldOperands here tend to be hidden by commute
and fold in SIShrinkInstructions.

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

7 years agoRe-commit r289184, "Support: Use a 64-bit seek in raw_fd_ostream::seek()." with a...
Peter Collingbourne [Fri, 9 Dec 2016 05:20:43 +0000 (05:20 +0000)]
Re-commit r289184, "Support: Use a 64-bit seek in raw_fd_ostream::seek()." with a configure-time check for lseek64.

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

7 years ago[X86] Add masked versions of VPERMT2* and VPERMI2* to load folding tables.
Craig Topper [Fri, 9 Dec 2016 05:20:11 +0000 (05:20 +0000)]
[X86] Add masked versions of VPERMT2* and VPERMI2* to load folding tables.

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

7 years agoRevert r289184, we need more configury for Darwin and *BSD.
Peter Collingbourne [Fri, 9 Dec 2016 05:04:30 +0000 (05:04 +0000)]
Revert r289184, we need more configury for Darwin and *BSD.

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

7 years agoSupport: Use a 64-bit seek in raw_fd_ostream::seek().
Peter Collingbourne [Fri, 9 Dec 2016 04:57:19 +0000 (04:57 +0000)]
Support: Use a 64-bit seek in raw_fd_ostream::seek().

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

7 years ago[SCCP] Make the test added in r289175 more meaningful.
Davide Italiano [Fri, 9 Dec 2016 03:49:20 +0000 (03:49 +0000)]
[SCCP] Make the test added in r289175 more meaningful.

Add a comment while here.

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

7 years ago[SCCP] Teach the pass about `mul %x 0` even if %x is overdefined.
Davide Italiano [Fri, 9 Dec 2016 03:08:42 +0000 (03:08 +0000)]
[SCCP] Teach the pass about `mul %x 0` even if %x is overdefined.

The motivating example is:

extern int patatino;
int goo() {
    int x = 0;
    for (int i = 0; i < 1000000; ++i) {
        x *= patatino;
    }
    return x;
}

Currently SCCP will not realize that this function returns always zero,
therefore will try to unroll and vectorize the loop at -O3 producing an
awful lot of (useless) code. With this change, it will just produce:

0000000000000000 <g>:
   xor    %eax,%eax
   retq

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

7 years ago[AVX-512] Add vpermilps/pd to load folding tables.
Craig Topper [Fri, 9 Dec 2016 02:18:11 +0000 (02:18 +0000)]
[AVX-512] Add vpermilps/pd to load folding tables.

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

7 years ago[AVX-512] Move some floating point stack folding test cases out of the integer test.
Craig Topper [Fri, 9 Dec 2016 02:18:07 +0000 (02:18 +0000)]
[AVX-512] Move some floating point stack folding test cases out of the integer test.

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

7 years ago[Analysis] Fix typo in comment. NFC
Craig Topper [Fri, 9 Dec 2016 02:18:04 +0000 (02:18 +0000)]
[Analysis] Fix typo in comment. NFC

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

7 years ago[libFuzzer] implement crash-resistant merge (https://github.com/google/sanitizers...
Kostya Serebryany [Fri, 9 Dec 2016 01:17:24 +0000 (01:17 +0000)]
[libFuzzer] implement crash-resistant merge (https://github.com/google/sanitizers/issues/722). This is a first experimental variant that needs some more testing, thus not yet adding a lit test (but there are unit tests).

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

7 years agoWholeProgramDevirt: Teach the pass to handle structs of arrays.
Peter Collingbourne [Fri, 9 Dec 2016 01:10:11 +0000 (01:10 +0000)]
WholeProgramDevirt: Teach the pass to handle structs of arrays.

This will become necessary in some cases once D22296 lands.

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

7 years ago[LCG] Minor cleanup to the LCG walk over a function, NFC.
Chandler Carruth [Fri, 9 Dec 2016 00:46:44 +0000 (00:46 +0000)]
[LCG] Minor cleanup to the LCG walk over a function, NFC.

This just hoists the check for declarations up a layer which allows
various sets used in the walk to be smaller. Also moves the relevant
comments to match, and catches a few other cleanups in this code.

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

7 years agoMake WholeProgramDevirt understand ConstStruct vtables.
Peter Collingbourne [Fri, 9 Dec 2016 00:33:27 +0000 (00:33 +0000)]
Make WholeProgramDevirt understand ConstStruct vtables.

Based on a patch by LemonBoy!

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

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