oota-llvm.git
9 years agoR600/SI: Add new helper isSGPRClassID
Matt Arsenault [Wed, 24 Sep 2014 02:17:12 +0000 (02:17 +0000)]
R600/SI: Add new helper isSGPRClassID

Move these into header since they are trivial

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

9 years agoR600/SI: Fix hardcoded and wrong operand numbers.
Matt Arsenault [Wed, 24 Sep 2014 02:17:09 +0000 (02:17 +0000)]
R600/SI: Fix hardcoded and wrong operand numbers.

Also fix leftover debug printing

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

9 years agoR600/SI: Enable named operand table for SALU instructions
Matt Arsenault [Wed, 24 Sep 2014 02:17:06 +0000 (02:17 +0000)]
R600/SI: Enable named operand table for SALU instructions

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

9 years ago[x86] Start refactoring the comment printing logic in the MC lowering of
Chandler Carruth [Wed, 24 Sep 2014 02:16:12 +0000 (02:16 +0000)]
[x86] Start refactoring the comment printing logic in the MC lowering of
vector shuffles.

This is just the beginning by hoisting it into its own function and
making use of early exit to dramatically simplify the flow of the
function. I'm going to be incrementally refactoring this until it is
a bit less magical how this applies to other instructions, and I can
teach it how to dig a shuffle mask out of a register. Then I plan to
hook it up to VPERMD so we get our mask comments for it.

No functionality changed yet.

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

9 years agoR600/SI: Fix weird CHECK-DAG usage
Matt Arsenault [Wed, 24 Sep 2014 02:14:26 +0000 (02:14 +0000)]
R600/SI: Fix weird CHECK-DAG usage

This prevents these from failing in a future commit.

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

9 years agoR600/SI: Enable selecting SALU inside branches
Tom Stellard [Wed, 24 Sep 2014 01:33:28 +0000 (01:33 +0000)]
R600/SI: Enable selecting SALU inside branches

We can do this now that the FixSGPRLiveRanges pass is working.

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

9 years agoR600/SI: Move PHIs that define SGPRs to the VALU in most cases
Tom Stellard [Wed, 24 Sep 2014 01:33:26 +0000 (01:33 +0000)]
R600/SI: Move PHIs that define SGPRs to the VALU in most cases

This fixes a bug that is uncovered by a future commit and will
be tested by the test/CodeGen/R600/sgpr-control-flow.ll test case.

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

9 years agoR600/SI: Fix the FixSGPRLiveRanges pass
Tom Stellard [Wed, 24 Sep 2014 01:33:24 +0000 (01:33 +0000)]
R600/SI: Fix the FixSGPRLiveRanges pass

The previous implementation was extending the live range of SGPRs
by modifying the live intervals directly.  This was causing a lot
of machine verification errors when the machine scheduler was enabled.

The new implementation adds pseudo instructions with implicit uses to
extend the live ranges of SGPRs, which works much better.

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

9 years agoR600/SI: Mark EXEC_LO and EXEC_HI as reserved
Tom Stellard [Wed, 24 Sep 2014 01:33:23 +0000 (01:33 +0000)]
R600/SI: Mark EXEC_LO and EXEC_HI as reserved

These registers can be allocated and used like other 32-bit registers,
but it seems like a likely source for bugs.

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

9 years agoR600/SI: Fix SIRegisterInfo::getPhysRegSubReg()
Tom Stellard [Wed, 24 Sep 2014 01:33:22 +0000 (01:33 +0000)]
R600/SI: Fix SIRegisterInfo::getPhysRegSubReg()

Correctly handle special registers: EXEC, EXEC_LO, EXEC_HI, VCC_LO,
VCC_HI, and M0.  The previous implementation would assertion fail
when passed these registers.

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

9 years agoR600/SI: Implement VGPR register spilling for compute at -O0 v3
Tom Stellard [Wed, 24 Sep 2014 01:33:17 +0000 (01:33 +0000)]
R600/SI: Implement VGPR register spilling for compute at -O0 v3

VGPRs are spilled to LDS.  This still needs more testing, but
we need to at least enable it at -O0, because the fast register
allocator spills all registers that are live at the end of blocks
and without this some future commits will break the
flat-address-space.ll test.

v2: Only calculate thread id once

v3: Move insertion of spill instructions to
    SIRegisterInfo::eliminateFrameIndex()

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

9 years ago[x86] Teach the new vector shuffle lowering to lower v8i32 shuffles with
Chandler Carruth [Wed, 24 Sep 2014 01:24:44 +0000 (01:24 +0000)]
[x86] Teach the new vector shuffle lowering to lower v8i32 shuffles with
the native AVX2 instructions.

Note that the test case is really frustrating here because VPERMD
requires the mask to be in the register input and we don't produce
a comment looking through that to the constant pool. I'm going to
attempt to improve this in a subsequent commit, but not sure if I will
succeed.

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

9 years ago[x86] Fix a really terrible bug in the repeated 128-bin-lane shuffle
Chandler Carruth [Wed, 24 Sep 2014 01:03:57 +0000 (01:03 +0000)]
[x86] Fix a really terrible bug in the repeated 128-bin-lane shuffle
detection. It was incorrectly handling undef lanes by actually treating
an undef lane in the first 128-bit lane as a *numeric* shuffle value.

Fortunately, this almost always DTRT and disabled detecting repeated
patterns. But not always. =/ This patch introduces a much more
principled approach and fixes the miscompiles I spotted by inspection
previously.

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

9 years agoFix swift-atomics testcase
Robin Morisset [Tue, 23 Sep 2014 23:18:01 +0000 (23:18 +0000)]
Fix swift-atomics testcase

This testcase was not testing what it meant: because there were only two checks for
dmb {{ish}} in the second function, it could have missed a bug where one of the three
required dmb {{ish}} became dmb {{ishst}}. As I was fixing it, I also added
CHECK-LABELs to make it a bit less brittle.

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

9 years ago[x86] Teach the new vector shuffle lowering to lower v4i64 vector
Chandler Carruth [Tue, 23 Sep 2014 22:39:02 +0000 (22:39 +0000)]
[x86] Teach the new vector shuffle lowering to lower v4i64 vector
shuffles using the AVX2 instructions. This is the first step of cutting
in real AVX2 support.

Note that I have spotted at least one bug in the test cases already, but
I suspect it was already present and just is getting surfaced. Will
investigate next.

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

9 years agoGlobalOpt: Preserve comdats of unoptimized initializers
Reid Kleckner [Tue, 23 Sep 2014 22:33:01 +0000 (22:33 +0000)]
GlobalOpt: Preserve comdats of unoptimized initializers

Rather than slurping in and splatting out the whole ctor list, preserve
the existing array entries without trying to understand them.  Only
remove the entries that we know we can optimize away.  This way we don't
need to wire through priority and comdats or anything else we might add.

Fixes a linker issue where the .init_array or .ctors entry would point
to discarded initialization code if the comdat group from the TU with
the faulty global_ctors entry was dropped.

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

9 years agoAArch64: allow constant expressions for shifted reg literals
Jim Grosbach [Tue, 23 Sep 2014 22:16:02 +0000 (22:16 +0000)]
AArch64: allow constant expressions for shifted reg literals

e.g., add w1, w2, w3, lsl #(2 - 1)

This sort of thing comes up in pre-processed assembly playing macro games.
Still validate that it's an assembly time constant. The early exit error check
was just a bit overzealous and disallowed a left paren.

rdar://18430542

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

9 years ago[x86] Teach the rest of the 'target shuffle' machinery about blends and
Chandler Carruth [Tue, 23 Sep 2014 22:14:14 +0000 (22:14 +0000)]
[x86] Teach the rest of the 'target shuffle' machinery about blends and
add VPBLENDD to the InstPrinter's comment generation so we get nice
comments everywhere.

Now that we have the nice comments, I can see the bug introduced by
a silly typo in the commit that enabled VPBLENDD, and have fixed it. Yay
tests that are easy to inspect.

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

9 years agoR600/SI: Clean up checks for legality of immediate operands
Tom Stellard [Tue, 23 Sep 2014 21:26:25 +0000 (21:26 +0000)]
R600/SI: Clean up checks for legality of immediate operands

There are new register classes VCSrc_* which represent operands that
can take an SGPR, VGPR or inline constant.  The VSrc_* class is now used
to represent operands that can take an SGPR, VGPR, or a 32-bit
immediate.

This allows us to have more accurate checks for legality of
immediates, since before we had no way to distinguish between operands
that supported any 32-bit immediate and operands which could only
support inline constants.

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

9 years ago[X86] Make wide loads be managed by AtomicExpand
Robin Morisset [Tue, 23 Sep 2014 20:59:25 +0000 (20:59 +0000)]
[X86] Make wide loads be managed by AtomicExpand

Summary:
AtomicExpand already had logic for expanding wide loads and stores on LL/SC
architectures, and for expanding wide stores on CmpXchg architectures, but
not for wide loads on CmpXchg architectures. This patch fills this hole,
and makes use of this new feature in the X86 backend.

Only one functionnal change: we now lose the SynchScope attribute.
It is regrettable, but I have another patch that I will submit soon that will
solve this for all of AtomicExpand (it seemed better to split it apart as it
is a different concern).

Test Plan: make check-all (lots of tests for this functionality already exist)

Reviewers: jfb

Subscribers: llvm-commits

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

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

9 years ago[Power] Use AtomicExpandPass for fence insertion, and use lwsync where appropriate
Robin Morisset [Tue, 23 Sep 2014 20:46:49 +0000 (20:46 +0000)]
[Power] Use AtomicExpandPass for fence insertion, and use lwsync where appropriate

Summary:
This patch makes use of AtomicExpandPass in Power for inserting fences around
atomic as part of an effort to remove fence insertion from SelectionDAGBuilder.
As a big bonus, it lets us use sync 1 (lightweight sync, often used by the mnemonic
lwsync) instead of sync 0 (heavyweight sync) in many cases.

I also added a test, as there was no test for the barriers emitted by the Power
backend for atomic loads and stores.

Test Plan: new test + make check-all

Reviewers: jfb

Subscribers: llvm-commits

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

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

9 years agoAdd AtomicExpandPass::bracketInstWithFences, and use it whenever getInsertFencesForAt...
Robin Morisset [Tue, 23 Sep 2014 20:31:14 +0000 (20:31 +0000)]
Add AtomicExpandPass::bracketInstWithFences, and use it whenever getInsertFencesForAtomic would trigger in SelectionDAGBuilder

Summary:
The goal is to eventually remove all the code related to getInsertFencesForAtomic
in SelectionDAGBuilder as it is wrong (designed for ARM, not really portable, works
mostly by accident because the backends are overly conservative), and repeats the
same logic that goes in emitLeading/TrailingFence.

In this patch, I make AtomicExpandPass insert the fences as it knows better
where to put them. Because this requires getting the fences and not just
passing an IRBuilder around, I had to change the return type of
emitLeading/TrailingFence.
This code only triggers on ARM for now. Because it is earlier in the pipeline
than SelectionDAGBuilder, it triggers and lowers atomic accesses to atomic so
SelectionDAGBuilder does not add barriers anymore on ARM.

If this patch is accepted I plan to implement emitLeading/TrailingFence for all
backends that setInsertFencesForAtomic(true), which will allow both making them
less conservative and simplifying SelectionDAGBuilder once they are all using
this interface.

This should not cause any functionnal change so the existing tests are used
and not modified.

Test Plan: make check-all, benefits from existing tests of atomics on ARM

Reviewers: jfb, t.p.northover

Subscribers: aemerson, llvm-commits

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

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

9 years ago[MCJIT] Fix some more RuntimeDyld debugging output format specifiers.
Lang Hames [Tue, 23 Sep 2014 19:20:57 +0000 (19:20 +0000)]
[MCJIT] Fix some more RuntimeDyld debugging output format specifiers.

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

9 years ago[MCJIT] Remove PPCRelocations.h - it's no longer used.
Lang Hames [Tue, 23 Sep 2014 19:17:48 +0000 (19:17 +0000)]
[MCJIT] Remove PPCRelocations.h - it's no longer used.

This was overlooked in r218320, which removed the relocation headers for other
targets. Thanks to Ulrich Weigand for catching it.

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

9 years agoJust add a fixme about a possibly faster implementation of some atomic loads on some...
Robin Morisset [Tue, 23 Sep 2014 18:33:21 +0000 (18:33 +0000)]
Just add a fixme about a possibly faster implementation of some atomic loads on some ARM processors

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

9 years agoFix typo
Matt Arsenault [Tue, 23 Sep 2014 18:30:57 +0000 (18:30 +0000)]
Fix typo

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

9 years ago[x86] Teach the new shuffle lowering's blend functionality to use AVX2's
Chandler Carruth [Tue, 23 Sep 2014 18:16:12 +0000 (18:16 +0000)]
[x86] Teach the new shuffle lowering's blend functionality to use AVX2's
VPBLENDD where appropriate even on 128-bit vectors.

According to Agner's tables, this instruction is significantly higher
throughput (can execute on any port) on Haswell chips so we should
aggressively try to form it when available.

Sadly, this loses our delightful shuffle comments. I'll add those back
for VPBLENDD next.

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

9 years ago[MCJIT] Nuke MachineRelocation and MachineCodeEmitter. Now that the old JIT is
Lang Hames [Tue, 23 Sep 2014 18:08:47 +0000 (18:08 +0000)]
[MCJIT] Nuke MachineRelocation and MachineCodeEmitter. Now that the old JIT is
gone they're no longer needed.

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

9 years ago[docs] Fixed a typo in Atomics.rst
Jingyue Wu [Tue, 23 Sep 2014 17:35:28 +0000 (17:35 +0000)]
[docs] Fixed a typo in Atomics.rst

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

9 years ago[MCJIT] Remove a few more references to JITMemoryManager that survived r218316.
Lang Hames [Tue, 23 Sep 2014 17:10:24 +0000 (17:10 +0000)]
[MCJIT] Remove a few more references to JITMemoryManager that survived r218316.

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

9 years ago[MCJIT] Remove #include of JITMemoryManager that accidentally survived r218316.
Lang Hames [Tue, 23 Sep 2014 17:02:24 +0000 (17:02 +0000)]
[MCJIT] Remove #include of JITMemoryManager that accidentally survived r218316.

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

9 years ago[MCJIT] Delete the JTIMemoryManager and associated APIs.
Lang Hames [Tue, 23 Sep 2014 16:56:02 +0000 (16:56 +0000)]
[MCJIT] Delete the JTIMemoryManager and associated APIs.

This patch removes the old JIT memory manager (which does not provide any
useful functionality now that the old JIT is gone), and migrates the few
remaining clients over to SectionMemoryManager.

http://llvm.org/PR20848

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

9 years agoUse SDValue bool operator to reduce code. No functional change.
Sanjay Patel [Tue, 23 Sep 2014 16:24:20 +0000 (16:24 +0000)]
Use SDValue bool operator to reduce code. No functional change.

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

9 years agoFix segfault in AArch64 backend with -g and -mbig-endian
Oliver Stannard [Tue, 23 Sep 2014 15:38:11 +0000 (15:38 +0000)]
Fix segfault in AArch64 backend with -g and -mbig-endian

Fix a null pointer dereference when trying to swap the endianness of
fixups in the .eh_frame section in the AArch64 backend.

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

9 years agoRework r218304, "ExecutionEngineTests: Call llvm_shutdown() on exit for ManagedStatic...
NAKAMURA Takumi [Tue, 23 Sep 2014 14:41:02 +0000 (14:41 +0000)]
Rework r218304, "ExecutionEngineTests: Call llvm_shutdown() on exit for ManagedStatic introduced in r218151."

r218304 caused crash on msvc builder.

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

9 years agovalgrind/x86_64-pc-linux-gnu.supp: We don't care if sed leaks.
NAKAMURA Takumi [Tue, 23 Sep 2014 14:19:09 +0000 (14:19 +0000)]
valgrind/x86_64-pc-linux-gnu.supp: We don't care if sed leaks.

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

9 years agoFix a small typo in the test comment
Timur Iskhodzhanov [Tue, 23 Sep 2014 14:07:12 +0000 (14:07 +0000)]
Fix a small typo in the test comment

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

9 years agoLoop instead of individual def's for each GPR.
Sid Manning [Tue, 23 Sep 2014 13:55:50 +0000 (13:55 +0000)]
Loop instead of individual def's for each GPR.

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

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

9 years agoExecutionEngineTests: Call llvm_shutdown() on exit for ManagedStatic introduced in...
NAKAMURA Takumi [Tue, 23 Sep 2014 13:49:51 +0000 (13:49 +0000)]
ExecutionEngineTests: Call llvm_shutdown() on exit for ManagedStatic introduced in r218151.

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

9 years agoRebuild the inputs for the codeview-linetables.test with VS2013
Timur Iskhodzhanov [Tue, 23 Sep 2014 13:49:51 +0000 (13:49 +0000)]
Rebuild the inputs for the codeview-linetables.test with VS2013
Also provide reproducible instructions

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

9 years agoDo not destroy external linkage when deleting function body
Petar Jovanovic [Tue, 23 Sep 2014 12:54:19 +0000 (12:54 +0000)]
Do not destroy external linkage when deleting function body

The function deleteBody() converts the linkage to external and thus destroys
original linkage type value. Lack of correct linkage type causes wrong
relocations to be emitted later.
Calling dropAllReferences() instead of deleteBody() will fix the issue.

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

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

9 years ago[x86] Teach the vector comment parsing and printing to correctly handle
Chandler Carruth [Tue, 23 Sep 2014 11:15:19 +0000 (11:15 +0000)]
[x86] Teach the vector comment parsing and printing to correctly handle
undef in the shuffle mask. This shows up when we're printing comments
during lowering and we still have an IR-level constant hanging around
that models undef.

A nice consequence of this is *much* prettier test cases where the undef
lanes actually show up as undef rather than as a particular set of
values. This also allows us to print shuffle comments in cases that use
undef such as the recently added variable VPERMILPS lowering. Now those
test cases have nice shuffle comments attached with their details.

The shuffle lowering for PSHUFB has been augmented to use undef, and the
shuffle combining has been augmented to comprehend it.

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

9 years ago[x86] Teach the AVX1 path of the new vector shuffle lowering one more
Chandler Carruth [Tue, 23 Sep 2014 10:08:29 +0000 (10:08 +0000)]
[x86] Teach the AVX1 path of the new vector shuffle lowering one more
trick that I missed.

VPERMILPS has a non-immediate memory operand mode that allows it to do
asymetric shuffles in the two 128-bit lanes. Use this rather than two
shuffles and a blend.

However, it turns out the variable shuffle path to VPERMILPS (and
VPERMILPD, although that one offers no functional differenc from the
immediate operand other than variability) wasn't even plumbed through
codegen. Do such plumbing so that we can reasonably emit
a variable-masked VPERMILP instruction. Also plumb basic comment parsing
and printing through so that the tests are reasonable.

There are still a few tests which don't show the shuffle pattern. These
are tests with undef lanes. I'll teach the shuffle decoding and printing
to handle undef mask entries in a follow-up. I've looked at the masks
and they seem reasonable.

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

9 years agoEnsure bitcode encoding stays stable.
Michael Kuperstein [Tue, 23 Sep 2014 08:48:01 +0000 (08:48 +0000)]
Ensure bitcode encoding stays stable.
This includes constants, attributes, and some additional instructions not covered by previous tests.

Work was done by lama.saba@intel.com.

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

9 years ago[ADT/IntrusiveRefCntPtr] Give friend access to IntrusiveRefCntPtr<X> so the relevant...
Argyrios Kyrtzidis [Tue, 23 Sep 2014 06:06:43 +0000 (06:06 +0000)]
[ADT/IntrusiveRefCntPtr] Give friend access to IntrusiveRefCntPtr<X> so the relevant move constructor can access 'Obj'.

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

9 years agoWindows/DynamicLibrary.inc: Remove 'extern "C"' in ELM_Callback.
NAKAMURA Takumi [Tue, 23 Sep 2014 01:09:46 +0000 (01:09 +0000)]
Windows/DynamicLibrary.inc: Remove 'extern "C"' in ELM_Callback.

'extern "C" static' is not accepted by g++-4.7. Rather to tweak, I just removed 'extern "C"', since it doesn't affect the ABI.

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

9 years agotighten up checks
Sanjay Patel [Mon, 22 Sep 2014 22:46:44 +0000 (22:46 +0000)]
tighten up checks

We manage to generate all of the matching instructions (and a lot more) via
the reciprocal optimization function - even if we completely remove the square
root optimization. With CHECK_NEXT, we assure that we're executing the
expected square root optimization paths and not generating extra insts.

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

9 years agoConverting terminalHasColors mutex to a global ManagedStatic to avoid the static...
Chris Bieneman [Mon, 22 Sep 2014 22:39:20 +0000 (22:39 +0000)]
Converting terminalHasColors mutex to a global ManagedStatic to avoid the static destructor.

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

9 years ago[x86] Rename X86ISD::VPERMILP to X86ISD::VPERMILPI (and the same for the
Chandler Carruth [Mon, 22 Sep 2014 22:29:42 +0000 (22:29 +0000)]
[x86] Rename X86ISD::VPERMILP to X86ISD::VPERMILPI (and the same for the
td pattern). Currently we only model the immediate operand variation of
VPERMILPS and VPERMILPD, we should make that clear in the pseudos used.
Will be adding support for the variable mask variant in my next commit.

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

9 years agoFix a "typo" from my previous commit.
Kaelyn Takata [Mon, 22 Sep 2014 22:17:59 +0000 (22:17 +0000)]
Fix a "typo" from my previous commit.

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

9 years agoSilence unused variable warnings in the new stub functions that occur
Kaelyn Takata [Mon, 22 Sep 2014 22:14:13 +0000 (22:14 +0000)]
Silence unused variable warnings in the new stub functions that occur
when assertions are disabled.

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

9 years agoremove unnecessary labels; NFC
Sanjay Patel [Mon, 22 Sep 2014 21:52:53 +0000 (21:52 +0000)]
remove unnecessary labels; NFC

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

9 years ago[x86] Stub out the integer lowering of 256-bit vectors with AVX2
Chandler Carruth [Mon, 22 Sep 2014 21:45:57 +0000 (21:45 +0000)]
[x86] Stub out the integer lowering of 256-bit vectors with AVX2
support. No interesting functionality yet, but this will let me
implement one vector type at a time.

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

9 years agoIn this callback ModuleName includes the file path.
Yaron Keren [Mon, 22 Sep 2014 21:40:15 +0000 (21:40 +0000)]
In this callback ModuleName includes the file path.
Comparing ModuleName to the file names listed will
always fail.

I wonder how this code ever worked and what its
purpose was. Why exclude the msvc runtime DLLs
but not exclude all Windows system DLLs?

Anyhow, it does not function as intended.

clang-formatted as well.

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

9 years ago[FastISel][AArch64] Also allow folding of sign-/zero-extend and shift-left for boolea...
Juergen Ributzka [Mon, 22 Sep 2014 21:08:53 +0000 (21:08 +0000)]
[FastISel][AArch64] Also allow folding of sign-/zero-extend and shift-left for booleans (i1).

Shift-left immediate with sign-/zero-extensions also works for boolean values.
Update the assert and the test cases to reflect that fact.

This should fix a bug found by Chad.

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

9 years agoms-inline-asm: Fix parsing label names inside bracket expressions
Ehsan Akhgari [Mon, 22 Sep 2014 20:40:36 +0000 (20:40 +0000)]
ms-inline-asm: Fix parsing label names inside bracket expressions

Summary:
This fixes a couple of issues.  One is ensuring that AOK_Label rewrite
rules have a lower priority than AOK_Skip rules, as AOK_Skip needs to
be able to skip the brackets properly.  The other part of the fix ensures
that we don't overwrite Identifier when looking up the identifier, and
that we use the locally available information to generate the AOK_Label
rewrite in ParseIntelIdentifier.  Doing that in CreateMemForInlineAsm
would be problematic since the Start location there may point to the
beginning of a bracket expression, and not necessarily the beginning of
an identifier.

This also means that we don't need to carry around the InternlName field,
which helps simplify the code.

Test Plan: This will be tested on the clang side.

Reviewers: rnk

Subscribers: llvm-commits

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

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

9 years agoMC: ReadOnlyWithRel section kinds should map to rdata in COFF
David Majnemer [Mon, 22 Sep 2014 20:39:23 +0000 (20:39 +0000)]
MC: ReadOnlyWithRel section kinds should map to rdata in COFF

Don't consider ReadOnlyWithRel as a writable section in COFF, they
really belong in .rdata.

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

9 years ago[x86] Introduce tests covering the gamut of 256-bit vector shuffling.
Chandler Carruth [Mon, 22 Sep 2014 20:25:08 +0000 (20:25 +0000)]
[x86] Introduce tests covering the gamut of 256-bit vector shuffling.

These are just test cases, no actual code yet. This establishes the
baseline fallback strategy we're starting from on AVX2 and the expected
lowering we use on AVX1.

Also, these test cases are very much generated. I've manually crafted
the specific pattern set that I'm hoping will be useful at exercising
the lowering code, but I've not (and could not) manually verify *all* of
these. I've spot checked and they seem legit to me.

As with the rest of vector shuffling, at a certain point the only really
useful way to check the correctness of this stuff is through fuzz
testing.

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

9 years agoMake MCAsmParserSemaCallback::LookupInlineAsmLabel a pure virtual function
Ehsan Akhgari [Mon, 22 Sep 2014 19:49:07 +0000 (19:49 +0000)]
Make MCAsmParserSemaCallback::LookupInlineAsmLabel a pure virtual function

Summary:
r218229 made this function return a dummy nullptr in order to avoid
API breakage between clang/llvm.

Reviewers: rnk

Subscribers: llvm-commits

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

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

9 years agoUse broadcasts to optimize overall size when loading constant splat vectors (x86...
Sanjay Patel [Mon, 22 Sep 2014 18:54:01 +0000 (18:54 +0000)]
Use broadcasts to optimize overall size when loading constant splat vectors (x86-64 with AVX or AVX2).

We generate broadcast instructions on CPUs with AVX2 to load some constant splat vectors.
This patch should preserve all existing behavior with regular optimization levels,
but also use splats whenever possible when optimizing for *size* on any CPU with AVX or AVX2.

The tradeoff is up to 5 extra instruction bytes for the broadcast instruction to save
at least 8 bytes (up to 31 bytes) of constant pool data.

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

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

9 years agoFix test case commited in r218242 to appease buildbot.
Akira Hatanaka [Mon, 22 Sep 2014 18:07:20 +0000 (18:07 +0000)]
Fix test case commited in r218242 to appease buildbot.

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

9 years agoRevert "R600/SI: Add support for global atomic add"
Tom Stellard [Mon, 22 Sep 2014 16:44:04 +0000 (16:44 +0000)]
Revert "R600/SI: Add support for global atomic add"

This reverts commit r218254.

The global_atomics.ll test fails with asserts disabled.  For some reason,
the compiler fails to produce the atomic no return variants.

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

9 years agoFix a test introduced in r218246 to work also on Windows.
Frederic Riss [Mon, 22 Sep 2014 16:17:32 +0000 (16:17 +0000)]
Fix a test introduced in r218246 to work also on Windows.

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

9 years agoR600/SI: Add support for global atomic add
Tom Stellard [Mon, 22 Sep 2014 15:35:35 +0000 (15:35 +0000)]
R600/SI: Add support for global atomic add

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

9 years agoR600/SI: Remove modifier operands from V_CNDMASK_B32_e64
Tom Stellard [Mon, 22 Sep 2014 15:35:34 +0000 (15:35 +0000)]
R600/SI: Remove modifier operands from V_CNDMASK_B32_e64

Modifiers don't work for this instruction.

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

9 years agoR600: Don't set BypassSlowDiv for 64-bit division
Tom Stellard [Mon, 22 Sep 2014 15:35:32 +0000 (15:35 +0000)]
R600: Don't set BypassSlowDiv for 64-bit division

BypassSlowDiv is used by codegen prepare to insert a run-time
check to see if the operands to a 64-bit division are really 32-bit
values and if they are it will do 32-bit division instead.

This is not useful for R600, which has predicated control flow since
both the 32-bit and 64-bit paths will be executed in most cases.  It
also increases code size which can lead to more instruction cache
misses.

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

9 years agoR600/SI: Use ISD::MUL instead of ISD::UMULO when lowering division
Tom Stellard [Mon, 22 Sep 2014 15:35:30 +0000 (15:35 +0000)]
R600/SI: Use ISD::MUL instead of ISD::UMULO when lowering division

ISD::MUL and ISD:UMULO are the same except that UMULO sets an overflow
bit.  Since we aren't using the overflow bit, we should use ISD::MUL.

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

9 years agoR600/SI: Add enums for some hard-coded values
Tom Stellard [Mon, 22 Sep 2014 15:35:29 +0000 (15:35 +0000)]
R600/SI: Add enums for some hard-coded values

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

9 years ago[x32] Fix segmented stacks support
Pavel Chupin [Mon, 22 Sep 2014 13:11:35 +0000 (13:11 +0000)]
[x32] Fix segmented stacks support

Summary:
Update segmented-stacks*.ll tests with x32 target case and make
corresponding changes to make them pass.

Test Plan: tests updated with x32 target

Reviewers: nadav, rafael, dschuff

Subscribers: llvm-commits, zinovy.nis

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

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

9 years ago[dwarfdump] Dump full filenames as DW_AT_(decl|call)_file attribute values
Frederic Riss [Mon, 22 Sep 2014 12:36:04 +0000 (12:36 +0000)]
[dwarfdump] Dump full filenames as DW_AT_(decl|call)_file attribute values

Reviewers: dblaikie samsonov

Subscribers: llvm-commits

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

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

9 years agoAllow DWARFDebugInfoEntryMinimal::getSubroutineName to resolve cross-unit references.
Frederic Riss [Mon, 22 Sep 2014 12:35:53 +0000 (12:35 +0000)]
Allow DWARFDebugInfoEntryMinimal::getSubroutineName to resolve cross-unit references.

Summary: getSubroutineName is currently only used by llvm-symbolizer, thus add a binary test containing a cross-cu inlining example.

Reviewers: samsonov, dblaikie

Subscribers: llvm-commits

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

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

9 years agoFix assert when decoding PSHUFB mask
Robert Lougher [Mon, 22 Sep 2014 11:54:38 +0000 (11:54 +0000)]
Fix assert when decoding PSHUFB mask

The PSHUFB mask decode routine used to assert if the mask index was out of
range (<0 or greater than the size of the vector).  The problem is, we can
legitimately have a PSHUFB with a large index using intrinsics.  The
instruction only uses the least significant 4 bits.  This change removes the
assert and masks the index to match the instruction behaviour.

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

9 years agoDowngrade DWARF2 section limit error to a warning
Oliver Stannard [Mon, 22 Sep 2014 10:45:16 +0000 (10:45 +0000)]
Downgrade DWARF2 section limit error to a warning

We currently emit an error when trying to assemble a file with more
than one section using DWARF2 debug info. This should be a warning
instead, as the resulting file will still be usable, but with a
degraded debug illusion.

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

9 years agoUpdate comment on AtomicRMWInst::Nand
Hal Finkel [Mon, 22 Sep 2014 06:47:10 +0000 (06:47 +0000)]
Update comment on AtomicRMWInst::Nand

As of July 2014, all backends have been updated to implement
AtomicRMWInst::Nand as ~(x & y) (and not as x & ~y, as some did previously).
This was added to the release notes in r212635 (and the LangRef had been
changed), but it seems that we forgot to update the header-file description.

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

9 years ago[x86] Move the AVX v4i64 test cases down to group them together.
Chandler Carruth [Mon, 22 Sep 2014 03:05:23 +0000 (03:05 +0000)]
[x86] Move the AVX v4i64 test cases down to group them together.

Increasingly I don't want to mix the integer and floating point tests,
especially with AVX where they are handled quite differently.

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

9 years agoAdd two thresholds lvi-overdefined-BB-threshold and lvi-overdefined-threshold
Jiangning Liu [Mon, 22 Sep 2014 02:23:05 +0000 (02:23 +0000)]
Add two thresholds lvi-overdefined-BB-threshold and lvi-overdefined-threshold
for LVI algorithm. For a specific value to be lowered, when the number of basic
blocks being checked for overdefined lattice value is larger than
lvi-overdefined-BB-threshold, or the times of encountering overdefined value
for a single basic block is larger than lvi-overdefined-threshold, the LVI
algorithm will stop further lowering the lattice value.

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

9 years agoms-inline-asm: Add a sema callback for looking up label names
Ehsan Akhgari [Mon, 22 Sep 2014 02:21:35 +0000 (02:21 +0000)]
ms-inline-asm: Add a sema callback for looking up label names

The implementation of the callback in clang's Sema will return an
internal name for labels.

Test Plan: Will be tested in clang.

Reviewers: rnk

Subscribers: llvm-commits

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

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

9 years ago[x86] Back out a bad choice about lowering v4i64 and pave the way for
Chandler Carruth [Mon, 22 Sep 2014 00:32:15 +0000 (00:32 +0000)]
[x86] Back out a bad choice about lowering v4i64 and pave the way for
a more sane approach to AVX2 support.

Fundamentally, there is no useful way to lower integer vectors in AVX.
None. We always end up with a VINSERTF128 in the end, so we might as
well eagerly switch to the floating point domain and do everything
there. This cleans up lots of weird and unlikely to be correct
differences between integer and floating point shuffles when we only
have AVX1.

The other nice consequence is that by doing things this way we will make
it much easier to write the integer lowering routines as we won't need
to duplicate the logic to check for AVX vs. AVX2 in each one -- if we
actually try to lower a 256-bit vector as an integer vector, we have
AVX2 and can rely on it. I think this will make the code much simpler
and more comprehensible.

Currently, I've disabled *all* support for AVX2 so that we always fall
back to AVX. This keeps everything working rather than asserting. That
will go away with the subsequent series of patches that provide
a baseline AVX2 implementation.

Please note, I'm going to implement AVX2 *without access to hardware*.
That means I cannot correctness test this path. I will be relying on
those with access to AVX2 hardware to do correctness testing and fix
bugs here, but as a courtesy I'm trying to sketch out the framework for
the new-style vector shuffle lowering in the context of the AVX2 ISA.

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

9 years ago[x86] Teach the new vector shuffle lowering how to cleverly lower single
Chandler Carruth [Sun, 21 Sep 2014 23:46:13 +0000 (23:46 +0000)]
[x86] Teach the new vector shuffle lowering how to cleverly lower single
input v8f32 shuffles which are not 128-bit lane crossing but have
different shuffle patterns in the low and high lanes. This removes most
of the extract/insert traffic that was unnecessary and is particularly
good at lowering cases where only one of the two lanes is shuffled at
all.

I've also added a collection of test cases with undef lanes because this
lowering is somewhat more sensitive to undef lanes than others.

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

9 years ago[x86] Add a bunch of test cases where we have different shuffle patterns
Chandler Carruth [Sun, 21 Sep 2014 23:32:42 +0000 (23:32 +0000)]
[x86] Add a bunch of test cases where we have different shuffle patterns
in the high and low 128-bit lanes of a v8f32 vector.

No functionality change yet, but wanted to set up the baseline for my
next patch which will make these quite a bit better. =]

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

9 years agoFix typo
Matt Arsenault [Sun, 21 Sep 2014 17:27:32 +0000 (17:27 +0000)]
Fix typo

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

9 years agoUse llvm_unreachable instead of assert(!)
Matt Arsenault [Sun, 21 Sep 2014 17:27:31 +0000 (17:27 +0000)]
Use llvm_unreachable instead of assert(!)

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

9 years agoR600/SI: Don't use strings for single characters
Matt Arsenault [Sun, 21 Sep 2014 17:27:28 +0000 (17:27 +0000)]
R600/SI: Don't use strings for single characters

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

9 years agoRemove redundant if test.
Lang Hames [Sun, 21 Sep 2014 17:21:56 +0000 (17:21 +0000)]
Remove redundant if test.

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

9 years agoRefactor reciprocal square root estimate into target-independent function; NFC.
Sanjay Patel [Sun, 21 Sep 2014 15:19:15 +0000 (15:19 +0000)]
Refactor reciprocal square root estimate into target-independent function; NFC.

This is purely a plumbing patch. No functional changes intended.

The ultimate goal is to allow targets other than PowerPC (certainly X86 and Aarch64) to turn this:

z = y / sqrt(x)

into:

z = y * rsqrte(x)

using whatever HW magic they can use. See http://llvm.org/bugs/show_bug.cgi?id=20900 .

The first step is to add a target hook for RSQRTE, take the already target-independent code selfishly hoarded by PPC, and put it into DAGCombiner.

Next steps:

    The code in DAGCombiner::BuildRSQRTE() should be refactored further; tests that exercise that logic need to be added.
    Logic in PPCTargetLowering::BuildRSQRTE() should be hoisted into DAGCombiner.
    X86 and AArch64 overrides for TargetLowering.BuildRSQRTE() should be added.

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

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

9 years agomop up: "Don’t duplicate function or class name at the beginning of the comment."
Sanjay Patel [Sun, 21 Sep 2014 14:48:16 +0000 (14:48 +0000)]
mop up: "Don’t duplicate function or class name at the beginning of the comment."

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

9 years ago[x86] With the stronger canonicalization of shuffles added in r218216,
Chandler Carruth [Sun, 21 Sep 2014 13:37:51 +0000 (13:37 +0000)]
[x86] With the stronger canonicalization of shuffles added in r218216,
the new vector shuffle lowering no longer needs to check both symmetric
forms of UNPCK patterns for v4f64.

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

9 years ago[x86] Teach the new vector shuffle lowering to re-use the SHUFPS
Chandler Carruth [Sun, 21 Sep 2014 13:35:14 +0000 (13:35 +0000)]
[x86] Teach the new vector shuffle lowering to re-use the SHUFPS
lowering when it can use a symmetric SHUFPS across both 128-bit lanes.

This required making the SHUFPS lowering tolerant of other vector types,
and adjusting our canonicalization to canonicalize harder.

This is the last of the clever uses of symmetry I've thought of for
v8f32. The rest of the tricks I'm aware of here are to work around
assymetry in the mask.

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

9 years ago[x86] Refactor the logic to form SHUFPS instruction patterns to lower
Chandler Carruth [Sun, 21 Sep 2014 13:03:00 +0000 (13:03 +0000)]
[x86] Refactor the logic to form SHUFPS instruction patterns to lower
a generic vector shuffle mask into a helper that isn't specific to the
other things that influence which choice is made or the specific types
used with the instruction.

No functionality changed.

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

9 years ago[x86] Teach the new vector shuffle lowering the basics about insertion
Chandler Carruth [Sun, 21 Sep 2014 12:49:46 +0000 (12:49 +0000)]
[x86] Teach the new vector shuffle lowering the basics about insertion
of a single element into a zero vector for v4f64 and v4i64 in AVX.
Ironically, there is less to see here because xor+blend is so crazy fast
that we can't really beat that to zero the high 128-bit lane.

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

9 years ago[x86] Teach the new vector shuffle lowering how to lower to UNPCKLPS and
Chandler Carruth [Sun, 21 Sep 2014 12:20:44 +0000 (12:20 +0000)]
[x86] Teach the new vector shuffle lowering how to lower to UNPCKLPS and
UNPCKHPS with AVX vectors by recognizing those patterns when they are
repeated for both 128-bit lanes.

With this, we now generate the exact same (really nice) code for
Quentin's avx_test_case.ll which was the most significant regression
reported for the new shuffle lowering. In fact, I'm out of specific test
cases for AVX lowering, the rest were AVX2 I think. However, there are
a bunch of pretty obvious remaining things to improve with AVX...

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

9 years ago[x86] Add test cases for UNPCK instructions with v8f32 AVX vectors in
Chandler Carruth [Sun, 21 Sep 2014 12:13:11 +0000 (12:13 +0000)]
[x86] Add test cases for UNPCK instructions with v8f32 AVX vectors in
preparation for enhancing their support in the new vector shuffle
lowering.

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

9 years ago[x86] Begin teaching the new vector shuffle lowering among the most
Chandler Carruth [Sun, 21 Sep 2014 12:01:19 +0000 (12:01 +0000)]
[x86] Begin teaching the new vector shuffle lowering among the most
important bits of cleverness: to detect and lower repeated shuffle
patterns between the two 128-bit lanes with a single instruction.

This patch just teaches it how to lower single-input shuffles that fit
this model using VPERMILPS. =] There is more that needs to happen here.

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

9 years ago[x86] Regenerate this test case now that I've improved my script for
Chandler Carruth [Sun, 21 Sep 2014 11:51:33 +0000 (11:51 +0000)]
[x86] Regenerate this test case now that I've improved my script for
generating the test cases to format things more consistently and
actually catch all the operand sequences that should be elided in favor
of the asm comments. No actual changes here.

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

9 years ago[x86] Explicitly lower to a blend early if it is trivial to do so for
Chandler Carruth [Sun, 21 Sep 2014 11:40:39 +0000 (11:40 +0000)]
[x86] Explicitly lower to a blend early if it is trivial to do so for
v8f32 shuffles in the new vector shuffle lowering code.

This is very cheap to do and makes it much more clear that anything more
expensive but overlapping with this lowering should be selected
afterward (for example using AVX2's VPERMPS). However, no functionality
changed here as without this code we would fall through to create no-op
shuffles of each input and a blend. =]

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

9 years ago[x86] Teach the new vector shuffle lowering of v4f64 to prefer a direct
Chandler Carruth [Sun, 21 Sep 2014 11:17:55 +0000 (11:17 +0000)]
[x86] Teach the new vector shuffle lowering of v4f64 to prefer a direct
VBLENDPD over using VSHUFPD. While the 256-bit variant of VBLENDPD slows
down to the same speed as VSHUFPD on Sandy Bridge CPUs, it has twice the
reciprocal throughput on Ivy Bridge CPUs much like it does everywhere
for 128-bits. There isn't a downside, so just eagerly use this
instruction when it suffices.

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

9 years ago[x86] Add some more comprehensive tests for v4f64 blending.
Chandler Carruth [Sun, 21 Sep 2014 11:12:19 +0000 (11:12 +0000)]
[x86] Add some more comprehensive tests for v4f64 blending.

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

9 years ago[x86] Re-generate a bunch of the v4f64 test cases with my new script.
Chandler Carruth [Sun, 21 Sep 2014 11:07:41 +0000 (11:07 +0000)]
[x86] Re-generate a bunch of the v4f64 test cases with my new script.

This expands the integer cases to cover the fact that AVX2 moves their
lane-crossing shuffles into the integer domain. It also adds proper
support for AVX2 run lines and the "ALL" group when it doesn't matter.

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

9 years ago[x86] Switch the blend implementation to use a MVT switch rather than
Chandler Carruth [Sun, 21 Sep 2014 10:36:12 +0000 (10:36 +0000)]
[x86] Switch the blend implementation to use a MVT switch rather than
awkward conditions. The readability improvement of this will be even
more important as I generalize it to handle more types.

No functionality changed.

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

9 years ago[x86] Remove some essentially lying comments from the v4f64 path of the
Chandler Carruth [Sun, 21 Sep 2014 10:27:14 +0000 (10:27 +0000)]
[x86] Remove some essentially lying comments from the v4f64 path of the
new vector shuffle lowering.

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