OSDN Git Service
Chandler Carruth [Tue, 9 Dec 2014 08:55:32 +0000 (08:55 +0000)]
Teach instcombine to canonicalize "element extraction" from a load of an
integer and "element insertion" into a store of an integer into actual
element extraction, element insertion, and vector loads and stores.
Previously various parts of LLVM (including instcombine itself) would
introduce integer loads and stores into the code as a way of opaquely
loading and storing "bits". In some cases (such as a memcpy of
std::complex<float> object) we will eventually end up using those bits
in non-integer types. In order for SROA to effectively promote the
allocas involved, it splits these "store a bag of bits" integer loads
and stores up into the constituent parts. However, for non-alloca loads
and tsores which remain, it uses integer math to recombine the values
into a large integer to load or store.
All of this would be "fine", except that it forces LLVM to go through
integer math to combine and split up values. While this makes perfect
sense for integers (and in fact is critical for bitfields to end up
lowering efficiently) it is *terrible* for non-integer types, especially
floating point types. We have a much more canonical way of representing
the act of concatenating the bits of two SSA values in LLVM: a vector
and insertelement. This patch teaching InstCombine to use this
representation.
With this patch applied, LLVM will no longer introduce integer math into
the critical path of every loop over std::complex<float> operations such
as those that make up the hot path of ... oh, most HPC code, Eigen, and
any other heavy linear algebra library.
For the record, I looked *extensively* at fixing this in other parts of
the compiler, but it just doesn't work:
- We really do want to canonicalize memcpy and other bit-motion to
integer loads and stores. SSA values are tremendously more powerful
than "copy" intrinsics. Not doing this regresses massive amounts of
LLVM's scalar optimizer.
- We really do need to split up integer loads and stores of this form in
SROA or every memcpy of a trivially copyable struct will prevent SSA
formation of the members of that struct. It essentially turns off
SROA.
- The closest alternative is to actually split the loads and stores when
partitioning with SROA, but this has all of the downsides historically
discussed of splitting up loads and stores -- the wide-store
information is fundamentally lost. We would also see performance
regressions for bitfield-heavy code and other places where the
integers aren't really intended to be split without seemingly
arbitrary logic to treat integers totally differently.
- We *can* effectively fix this in instcombine, so it isn't that hard of
a choice to make IMO.
Differential Revision: http://reviews.llvm.org/D6548
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223764
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Tue, 9 Dec 2014 08:20:06 +0000 (08:20 +0000)]
Skip declarations in the case of functions.
This is a revert of r223521 in spirit, if not in content. I am not
sure why declarations ended up in LazilyLinkGlobalValues in the first
place; that will take some more investigation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223763
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 9 Dec 2014 08:05:51 +0000 (08:05 +0000)]
Use range-based for loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223762
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Tue, 9 Dec 2014 07:06:32 +0000 (07:06 +0000)]
AVX-512: Added some comments to ERI scalar intrinsics.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223761
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 9 Dec 2014 06:50:39 +0000 (06:50 +0000)]
Fix a few instances found in SelectionDAG where we were not handling F16 at parity with F32 and F64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223760
91177308-0d34-0410-b5e6-
96231b3b80d8
Mohit K. Bhakkad [Tue, 9 Dec 2014 06:31:07 +0000 (06:31 +0000)]
test commit (spelling correction)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223758
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Tue, 9 Dec 2014 06:10:44 +0000 (06:10 +0000)]
[X86] Convert esp-relative movs of function arguments into pushes, step 1
This handles the simplest case for mov -> push conversion:
1. x86-32 calling convention, everything is passed through the stack.
2. There is no reserved call frame.
3. Only registers or immediates are pushed, no attempt to combine a mem-reg-mem sequence into a single PUSHmm.
Differential Revision: http://reviews.llvm.org/D6503
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223757
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 9 Dec 2014 05:56:09 +0000 (05:56 +0000)]
Reland r223754
The commit is identical except a reference to `GV' should have been to
`GVal'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223756
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 9 Dec 2014 05:50:11 +0000 (05:50 +0000)]
Revert "AsmParser: Reject invalid mismatch between forward ref and def"
This reverts commit r223754. I've upset the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223755
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 9 Dec 2014 05:43:56 +0000 (05:43 +0000)]
AsmParser: Reject invalid mismatch between forward ref and def
Don't assume that the forward referenced entity was of the same
global-kind as the new entity.
This fixes PR21779.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223754
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Tue, 9 Dec 2014 03:02:48 +0000 (03:02 +0000)]
Restore r223709 as it was meant to be, and enable FeatureP8Vector for P8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223751
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 9 Dec 2014 01:03:27 +0000 (01:03 +0000)]
Revert r223709, "[PowerPC]Activate FeatureVSX for the Power target", to unbreak bots.
CodeGen/PowerPC/vsx-p8.ll was failing.
'+power8-vector' is not a recognized feature for this target (ignoring feature)
llvm/test/CodeGen/PowerPC/vsx-p8.ll:33:14: error: expected string not found in input
; CHECK-REG: lxvw4x 34, 0, 3
^
<stdin>:50:2: note: scanning from here
.align 3
^
<stdin>:61:2: note: possible intended match here
lvx 3, 0, 3
^
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223729
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 9 Dec 2014 01:00:59 +0000 (01:00 +0000)]
Handle early-clobber registers in the aggressive anti-dep breaker
The aggressive anti-dep breaker, used by the PowerPC backend during post-RA
scheduling (but is available to all targets), did not handle early-clobber MI
operands (at all). When constructing the list of available registers for the
replacement of some def operand, check the using instructions, and remove
registers assigned to early-clobbered defs from the set.
Fixes PR21452.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223727
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 9 Dec 2014 00:28:24 +0000 (00:28 +0000)]
Add argument variable support to the debug info tutorial
and rearrange the prologue source location hack to immediately
after it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223725
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 9 Dec 2014 00:03:54 +0000 (00:03 +0000)]
R600/SI: Set MayStore = 0 on MUBUF loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223722
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 9 Dec 2014 00:03:51 +0000 (00:03 +0000)]
R600/SI: Move setting of the lds bit to the base MUBUF class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223721
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Dec 2014 23:55:43 +0000 (23:55 +0000)]
[Hexagon] Removing old def versions and replacing usages with versions that have encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223720
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 8 Dec 2014 23:36:48 +0000 (23:36 +0000)]
MISched: Fix moving stores across barriers
This fixes an issue with ScheduleDAGInstrs::buildSchedGraph
where stores without an underlying object would not be added
as a predecessor to the current BarrierChain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223717
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Dec 2014 23:07:59 +0000 (23:07 +0000)]
[Hexagon] Adding any8, all8, and/or/xor/andn/orn/not predicate register forms, mask, and vitpack instructions and patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223710
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Seurer [Mon, 8 Dec 2014 23:07:12 +0000 (23:07 +0000)]
[PowerPC]Activate FeatureVSX for the Power target
This change activates FeatureVSX for Power 7 and Power 8 in PPC.td.
http://reviews.llvm.org/D6570
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223709
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 8 Dec 2014 22:54:22 +0000 (22:54 +0000)]
[PowerPC] Don't use a non-allocatable register to implement the 'cc' alias
GCC accepts 'cc' as an alias for 'cr0', and we need to do the same when
processing inline asm constraints. This had previously been implemented using a
non-allocatable register, named 'cc', that was listed as an alias of 'cr0', but
the infrastructure does not seem to support this properly (neither the register
allocator nor the scheduler properly accounts for the alias). Instead, we can
just process this as a naming alias inside of the inline asm
constraint-processing code, so we'll do that instead.
There are two regression tests, one where the post-RA scheduler did the wrong
thing with the non-allocatable alias, and one where the register allocator did
the wrong thing. Fixes PR21742.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223708
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Dec 2014 22:29:06 +0000 (22:29 +0000)]
[Hexagon] Fixing broken test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223704
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Dec 2014 22:19:14 +0000 (22:19 +0000)]
[Hexagon] Adding xtype doubleword add, sub, and, or, xor and patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223702
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Dec 2014 21:56:47 +0000 (21:56 +0000)]
[Hexagon] Adding xtype doubleword comparisons. Removing unused multiclass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223701
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Dec 2014 21:19:18 +0000 (21:19 +0000)]
[Hexagon] Adding xtype parity, min, minu, max, maxu instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223693
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Dec 2014 20:33:01 +0000 (20:33 +0000)]
[Hexagon] Adding xtype halfword add/sub ll/hl/lh/hh/sat/<<16 instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223692
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 8 Dec 2014 20:30:39 +0000 (20:30 +0000)]
Make myself the code owner for llgo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223691
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 8 Dec 2014 19:55:43 +0000 (19:55 +0000)]
R600/SI: Move continue after checking s_mov_b32.
There's nothing else to bother trying to shrink these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223686
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 19:35:31 +0000 (19:35 +0000)]
ConstantFold: Zero-sized globals might land on top of another global
A zero sized array is zero sized and might share its address with
another global.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223684
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 8 Dec 2014 18:48:08 +0000 (18:48 +0000)]
Clean up the rst for the debug info tutorial
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223682
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 18:45:16 +0000 (18:45 +0000)]
Lazily link GlobalVariables and GlobalAliases.
We were already lazily linking functions, but all GlobalValues can be treated
uniformly for this.
The test updates are to ensure that a given GlobalValue is still linked in.
This fixes pr21494.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223681
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Dec 2014 18:33:49 +0000 (18:33 +0000)]
[Hexagon] Adding add/sub with saturation. Removing unused def. Cleaning up shift patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223680
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 18:30:43 +0000 (18:30 +0000)]
InstSimplify: Try to bring back the rest of r223583
This reverts r223624 with a small tweak, hopefully this will make stage3
equivalent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223679
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 8 Dec 2014 18:24:06 +0000 (18:24 +0000)]
Once more on the cmake build. nativecodegen->native on the dependencies.
Thanks to Rafael Espindola for testing assistance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223678
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 8 Dec 2014 18:20:50 +0000 (18:20 +0000)]
Attempt to fix the cmake build by requiring mcjit on the cmake
dependencies for the KS tutorials
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223677
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Mon, 8 Dec 2014 18:18:32 +0000 (18:18 +0000)]
[CompactUnwind] Fix register encoding logic
Fix a compact unwind encoding logic bug which would try to encode
more callee saved registers than it should, leading to early bail out
in the encoding logic and abusive use of DWARF frame mode unnecessarily.
Also remove no-compact-unwind.ll which was testing the wrong thing
based on this bug and move it to valid 'compact unwind' tests. Added
other few more tests too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223676
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 8 Dec 2014 18:12:28 +0000 (18:12 +0000)]
Fix KS tutorial build failure.
make all doesn't build the examples and it was uniquified since
last build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223675
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 18:05:48 +0000 (18:05 +0000)]
Don't crash when the key of a comdat is lazily linked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223673
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 8 Dec 2014 18:02:35 +0000 (18:02 +0000)]
InstrProf: An intrinsic and lowering for instrumentation based profiling
Introduce the ``llvm.instrprof_increment`` intrinsic and the
``-instrprof`` pass. These provide the infrastructure for writing
counters for profiling, as in clang's ``-fprofile-instr-generate``.
The implementation of the instrprof pass is ported directly out of the
CodeGenPGO classes in clang, and with the followup in clang that rips
that code out to use these new intrinsics this ends up being NFC.
Doing the instrumentation this way opens some doors in terms of
improving the counter performance. For example, this will make it
simple to experiment with alternate lowering strategies, and allows us
to try handling profiling specially in some optimizations if we want
to.
Finally, this drastically simplifies the frontend and puts all of the
lowering logic in one place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223672
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 8 Dec 2014 18:00:47 +0000 (18:00 +0000)]
Add Chapter 8 to the Kaleidoscope tutorial. This chapter adds
a description of how to add debug information using DWARF and
DIBuilder to the language.
Thanks to David Blaikie for his assistance with this tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223671
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 8 Dec 2014 18:00:38 +0000 (18:00 +0000)]
Fix the JIT code for the Kaleidoscope tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223670
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 8 Dec 2014 17:54:58 +0000 (17:54 +0000)]
AArch64: treat HFAs containing "half" types as blocks too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223669
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Mon, 8 Dec 2014 17:47:18 +0000 (17:47 +0000)]
[X86] Improved tablegen patters for matching TZCNT/LZCNT.
Teach ISel how to match a TZCNT/LZCNT from a conditional move if the
condition code is X86_COND_NE.
Existing tablegen patterns only allowed to match TZCNT/LZCNT from a
X86cond with condition code equal to X86_COND_E. To avoid introducing
extra rules, I added an 'ImmLeaf' definition that checks if the
condition code is COND_E or COND_NE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223668
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Dec 2014 17:33:06 +0000 (17:33 +0000)]
[Hexagon] Adding combine reg, reg with predicated forms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223667
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 17:22:06 +0000 (17:22 +0000)]
Simplify the test. NFC.
Since the main file was empty, we can just copy the content of the Input file
into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223666
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 17:02:50 +0000 (17:02 +0000)]
Simplify test. NFC.
This is just testing the largest merge mode for comdats. No need to use
hard to read names and fancy types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223665
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Dec 2014 17:01:18 +0000 (17:01 +0000)]
[Hexagon] Adding packhl instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223664
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 16:46:52 +0000 (16:46 +0000)]
Use CHECK-DAG to reduce the noise in an upcoming patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223663
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 8 Dec 2014 15:40:09 +0000 (15:40 +0000)]
[mips] Add Mips-specific CCIf's for accessing the MipsCCState. NFC.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6213
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223662
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Mon, 8 Dec 2014 14:36:51 +0000 (14:36 +0000)]
[X86] Improved lowering of packed v8i16 vector shifts by non-constant count.
Before this patch, the backend sub-optimally expanded the non-constant shift
count of a v8i16 shift into a sequence of two 'movd' plus 'movzwl'.
With this patch the backend checks if the target features sse4.1. If so, then
it lets the shuffle legalizer deal with the expansion of the shift amount.
Example:
;;
define <8 x i16> @test(<8 x i16> %A, <8 x i16> %B) {
%shamt = shufflevector <8 x i16> %B, <8 x i16> undef, <8 x i32> zeroinitializer
%shl = shl <8 x i16> %A, %shamt
ret <8 x i16> %shl
}
;;
Before (with -mattr=+avx):
vmovd %xmm1, %eax
movzwl %ax, %eax
vmovd %eax, %xmm1
vpsllw %xmm1, %xmm0, %xmm0
retq
Now:
vpxor %xmm2, %xmm2, %xmm2
vpblendw $1, %xmm1, %xmm2, %xmm1
vpsllw %xmm1, %xmm0, %xmm0
retq
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223660
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 14:25:26 +0000 (14:25 +0000)]
Move the ValueMap lookup inside linkFunctionBody. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223659
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 14:20:10 +0000 (14:20 +0000)]
Use range loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223658
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 14:05:33 +0000 (14:05 +0000)]
Use range loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223657
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 13:44:38 +0000 (13:44 +0000)]
Fix linking of prologue data.
It would crash when the function was lazy linked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223656
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 8 Dec 2014 13:43:38 +0000 (13:43 +0000)]
[CMake] Fix installation of llvm-ranlib on multiconfig builder.
Introduce install_symlink.cmake from clang/tools/driver/clang_symlink.cmake.
FIXME: Would it be generalized?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223655
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 13:35:09 +0000 (13:35 +0000)]
Simple style fixes.
* Use a range loop.
* Move simple continue checks earlier.
* clang-format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223654
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Dec 2014 13:29:33 +0000 (13:29 +0000)]
Move materialize/Dematerialize calls to linkFunctionBody. NFC.
Just less code duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223653
91177308-0d34-0410-b5e6-
96231b3b80d8
Sonam Kumari [Mon, 8 Dec 2014 09:40:43 +0000 (09:40 +0000)]
Removal Of Duplicate Test Case from shift.ll file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223648
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 8 Dec 2014 09:03:08 +0000 (09:03 +0000)]
X86 intrinsics moved form X86ISelLowering.cpp to X86IntrinsicsInfo.h
X86ISelLowering.cpp has a long switch for intrinsics. I moved a part of
this long switch to the new intrinsics table in X86IntrinsicsInfo.h.
No functional changes, just code and compile time optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223641
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 8 Dec 2014 08:33:30 +0000 (08:33 +0000)]
lit: Don't use python 2.6 features
LLVM supports python 2.5, this fixes a (somewhat) recent regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223626
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 8 Dec 2014 02:07:22 +0000 (02:07 +0000)]
Revert a part of r223583, for now. It seems causing different emission between stage2(gcc-clang) and stage3 clang. Investigating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223624
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 8 Dec 2014 00:41:39 +0000 (00:41 +0000)]
IR: Fix bitcode compatability filenames
As a fixup to r223616, follow the convention of naming the files after
the LLVM release whose bitcode they're maintaining compatability with.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223623
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 7 Dec 2014 20:32:11 +0000 (20:32 +0000)]
IR: Revert r223618 behaviour of MDNode::concatenate()
r223618 including special handling of `MDNode::intersect()`: if the
first operand is a self-reference with the same operands you're trying
to return, return it instead.
Reuse that handling in `MDNode::concatenate()` in the hopes that it
fixes a polly test that seems to rely on the old behaviour [1].
[1]: http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25167
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223619
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 7 Dec 2014 19:52:06 +0000 (19:52 +0000)]
IR: Drop uniquing for self-referencing MDNodes
It doesn't make sense to unique self-referencing nodes. Drop uniquing
for them.
Note that `MDNode::intersect()` occasionally returns self-referencing
nodes. Previously these would be returned by `MDNode::get()`. I'm not
convinced this was intended behaviour -- to me it seems it should return
a node whose only operand is the self-reference -- but I don't know much
about alias scopes so I'm preserving it for now.
This is part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223618
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 7 Dec 2014 19:02:48 +0000 (19:02 +0000)]
IR: Remove reference to ENABLE_MDNODE_UNIQUING
Apparently `MDNode` uniquing used to be optional. I suppose the
configure flag must have disappeared at some point. Change the test so
it actually tests uniquing, and remove the check for
`ENABLE_MDNODE_UNIQUING`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223617
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 7 Dec 2014 17:56:16 +0000 (17:56 +0000)]
IR: Add missing tests for function-local metadata
Add assembly and bitcode tests that I neglected to add in r223564 (IR:
Disallow complicated function-local metadata) and r223574 (IR: Disallow
function-local metadata attachments).
Found a couple of bugs:
- The error message for function-local attachments gave the wrong line
number -- it indicated the next token (typically on the next line)
instead of the token that started the attachment. Fixed.
- Metadata arguments of the form `!{i32 0, i32 %v}` (or with the
arguments reversed) fired an assertion in `ValueEnumerator` in LLVM
v3.5, so I suppose this never really worked. I suppose this was
"fixed" by r223564.
(Thanks to dblaikie for pointing out my omission.)
Part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223616
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Sun, 7 Dec 2014 17:17:43 +0000 (17:17 +0000)]
R600/SI: Disable VMEM and SMEM clauses by breaking them with S_NOP
This is only a workaround.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223615
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Sun, 7 Dec 2014 17:17:38 +0000 (17:17 +0000)]
R600/SI: Set 20-bit immediate byte offset for SMRD on VI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223614
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 7 Dec 2014 17:16:00 +0000 (17:16 +0000)]
[x86] Clean up the SSE1 test to use a slightly different pattern for
matching offsets. I don't expect this to really matter, but its what the
latest incarnation of my script for maintaining these tests happens to
produce, and so its simpler for me if everything matches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223613
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 7 Dec 2014 17:15:58 +0000 (17:15 +0000)]
[x86] Switch a constant selection test to use positive assertions and to
store to real pointers so that its clear that the right code is in fact
being generated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223612
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 7 Dec 2014 17:15:56 +0000 (17:15 +0000)]
[x86] Cleanup the combining vector shuffle tests a bit by merging
identical checks for different SSE variants into a single block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223611
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 7 Dec 2014 17:15:53 +0000 (17:15 +0000)]
[x86] Clean up the shift lowering vector shuffle tests a bit using my
script. Notably this folds all the SSE cases together into a single
FileCheck block. It also adds a vex prefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223610
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Sun, 7 Dec 2014 12:19:03 +0000 (12:19 +0000)]
R600/SI: Update instruction conversions for VI
There are 3 changes:
- Convert 32-bit S_LSHL/LSHR/ASHR to their V_*REV variants for VI
- Lower RSQ_CLAMP for VI
- Don't generate MIN/MAX_LEGACY on VI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223604
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Sun, 7 Dec 2014 12:18:57 +0000 (12:18 +0000)]
R600/SI: Add VI instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223603
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Sun, 7 Dec 2014 12:18:45 +0000 (12:18 +0000)]
R600/SI: Add SCC Defs/Uses to SOP1 and SOP2 opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223602
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 6 Dec 2014 19:22:54 +0000 (19:22 +0000)]
Turn some DenseMaps that are only used for set operations into DenseSets.
DenseSet has better memory efficiency now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223589
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 6 Dec 2014 19:22:44 +0000 (19:22 +0000)]
Make the DenseMap bucket type configurable and use a smaller bucket for DenseSet.
DenseSet used to be implemented as DenseMap<Key, char>, which usually doubled
the memory footprint of the map. Now we use a compressed set so the second
element uses no memory at all. This required some surgery on DenseMap as
all accesses to the bucket now have to go through methods; this should
have no impact on the behavior of DenseMap though. The new default bucket
type for DenseMap is a slightly extended std::pair as we expose it through
DenseMap's iterator and don't want to break any existing users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223588
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 6 Dec 2014 13:12:56 +0000 (13:12 +0000)]
Reapply "LLVMContext: Store APInt/APFloat directly into the ConstantInt/FP DenseMaps."
This reapplies r223478 with a fix for 32 bit targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223586
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 6 Dec 2014 11:58:33 +0000 (11:58 +0000)]
ConstantFold: Don't optimize comparisons with weak linkage objects
Consider:
void f() {}
void __attribute__((weak)) g() {}
bool b = &f != &g;
It's possble for g to resolve to f if --defsym=g=f is passed on to the
linker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223585
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 6 Dec 2014 10:52:32 +0000 (10:52 +0000)]
I didn't intend to commit this change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223584
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 6 Dec 2014 10:51:40 +0000 (10:51 +0000)]
InstSimplify: Optimize away useless unsigned comparisons
Code like X < Y && Y == 0 should always be folded away to false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223583
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 6 Dec 2014 05:57:06 +0000 (05:57 +0000)]
Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223580
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Sat, 6 Dec 2014 05:34:34 +0000 (05:34 +0000)]
R600/SI: Restore PrivateGlobalPrefix to the default ELF value of ".L"
This was changed in r223323.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223579
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 6 Dec 2014 03:11:46 +0000 (03:11 +0000)]
Avoid angle brackets in comment. [-Wdocumentation-html]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223576
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 6 Dec 2014 02:29:44 +0000 (02:29 +0000)]
IR: Disallow function-local metadata attachments
Metadata attachments to instructions cannot be function-local.
This is part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223574
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 6 Dec 2014 02:22:11 +0000 (02:22 +0000)]
LLVMInstrumentation requires MC since r223532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223573
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 6 Dec 2014 02:14:41 +0000 (02:14 +0000)]
Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223572
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Sat, 6 Dec 2014 02:08:16 +0000 (02:08 +0000)]
Add a proper triple to switch-jump-table.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223571
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 6 Dec 2014 02:03:49 +0000 (02:03 +0000)]
llvm/test/CodeGen/X86/switch-jump-table.ll: Add explicit triple. Local labels have a prefix "." for targeting i686-cygming.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223570
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Sat, 6 Dec 2014 01:31:07 +0000 (01:31 +0000)]
[X86] Refactor PMOV[SZ]Xrm to add missing AVX2 patterns.
Most patterns will go away once the extload legalization changes land.
Differential Revision: http://reviews.llvm.org/D6125
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223567
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Sat, 6 Dec 2014 01:28:50 +0000 (01:28 +0000)]
SelectionDAG switch lowering: Replace unreachable default with most popular case.
This can significantly reduce the size of the switch, allowing for more
efficient lowering.
I also worked with the idea of exploiting unreachable defaults by
omitting the range check for jump tables, but always ended up with a
non-neglible binary size increase. It might be worth looking into some more.
SimplifyCFG currently does this transformation, but I'm working towards changing
that so we can optimize harder based on unreachable defaults.
Differential Revision: http://reviews.llvm.org/D6510
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223566
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 6 Dec 2014 01:26:49 +0000 (01:26 +0000)]
IR: Disallow complicated function-local metadata
Disallow complex types of function-local metadata. The only valid
function-local metadata is an `MDNode` whose sole argument is a
non-metadata function-local value.
Part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223564
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Matthews [Sat, 6 Dec 2014 01:13:49 +0000 (01:13 +0000)]
Fix for xunit output to work around issue in Jenkins when tests are at the root level
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223562
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 6 Dec 2014 00:48:17 +0000 (00:48 +0000)]
Utils: Style cleanups, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223556
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 6 Dec 2014 00:48:13 +0000 (00:48 +0000)]
Utils: Avoid RAUW on metadata in CloneFunction()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223555
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 6 Dec 2014 00:45:50 +0000 (00:45 +0000)]
Canonicalize multiplies by looking at whether the operands have any constants themselves. Patch by Tim Murray!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223554
91177308-0d34-0410-b5e6-
96231b3b80d8
Neeraj Badlani [Sat, 6 Dec 2014 00:38:39 +0000 (00:38 +0000)]
[TEST-COMMIT] As per Developer Policy, Added a blank line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223553
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Sat, 6 Dec 2014 00:33:37 +0000 (00:33 +0000)]
AArch64: use explicit MVT::i64 when creating EXTRACT_SUBVECTOR nodes.
All our patterns use MVT::i64, but the ISelLowering nodes were inconsistent in
their choice.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223551
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Matthews [Sat, 6 Dec 2014 00:21:08 +0000 (00:21 +0000)]
Fix corner cases in lit xunit for paths with dots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223549
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 6 Dec 2014 00:02:31 +0000 (00:02 +0000)]
Revert "LLVMContext: Store APInt/APFloat directly into the ConstantInt/FP DenseMaps."
Somehow made DenseMap probe on forever on 32 bit machines.
This reverts commit r223478.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223546
91177308-0d34-0410-b5e6-
96231b3b80d8