Commit Graph

110158 Commits

Author SHA1 Message Date
Chandler Carruth
06a07dadb9 [x86] Add some tests for a common unpack pattern of vector shuffle that
has a remarkably unique and efficient lowering.

While we get this some of the time already, we miss a few cases and
there wasn't a principled reason we got it. We should at least test
this. v8 already has tests for this pattern.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222607 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-22 05:44:43 +00:00
David Majnemer
fc1c5babaf InstCombine: Preserve nsw when folding X*(2^C) -> X << C
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222606 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-22 04:52:55 +00:00
David Majnemer
156d6ec86b InstCombine: Preserve nsw/nuw for ((X << C2)*C1) -> (X * (C1 << C2))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-22 04:52:52 +00:00
David Majnemer
0f8991742c InstCombine: Preserve nsw for (mul %V, -1) -> (sub 0, %V)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222604 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-22 04:52:38 +00:00
Gerolf Hoflehner
5182ad54b2 [InstCombine] Re-commit of r218721 (Optimize icmp-select-icmp sequence)
Fixes the self-host fail. Note that this commit activates dominator
analysis in the combiner by default (like the original commit did).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222590 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 23:36:44 +00:00
Joerg Sonnenberger
0b1407b5cf Fix transformation of add with pc argument to adr for non-immediate
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222587 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 22:39:34 +00:00
Kostya Serebryany
57cd7cd77a [asan] remove old experimental code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222586 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 22:34:29 +00:00
Tom Stellard
739dfb1a0e R600/SI: Add a failing test case for offset order in ds_read2 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222585 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 22:31:47 +00:00
Tom Stellard
bad4e7b748 R600/SI: Add an s_mov_b32 to patterns which use the M0RegClass
We need to use a s_mov_b32 rather than a copy, so that CSE will
eliminate redundant moves to the m0 register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222584 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 22:31:46 +00:00
Tom Stellard
573630a020 R600/SI: Emit s_mov_b32 m0, -1 before every DS instruction
This s_mov_b32 will write to a virtual register from the M0Reg
class and all the ds instructions now take an extra M0Reg explicit
argument.

This change is necessary to prevent issues with the scheduler
mixing together instructions that expect different values in the m0
registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222583 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 22:31:44 +00:00
Tom Stellard
edcd88ce1a R600/SI: Add SIFoldOperands pass
This pass attempts to fold the source operands of mov and copy
instructions into their uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222581 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 22:06:37 +00:00
Jozef Kolek
d9accc1e5f [mips][microMIPS] This patch implements functionality in MIPS delay slot
filler such as if delay slot filler have to put NOP instruction into the
delay slot of microMIPS BEQ or BNE instruction which uses the register $0,
then instead of emitting NOP this instruction is replaced by the corresponding
microMIPS compact branch instruction, i.e. BEQZC or BNEZC.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222580 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 22:04:35 +00:00
Tom Stellard
e83cdb9792 R600/SI: Mark s_mov_b32 and s_mov_b64 as rematerializable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222579 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 22:00:16 +00:00
Tom Stellard
9a85cc1705 R600/SI: Use hex notation for constant in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222578 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 22:00:13 +00:00
Colin LeMahieu
88109da602 [Hexagon] Adding sxth instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222577 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 21:54:59 +00:00
Colin LeMahieu
326816c88f [Hexagon] Adding sxtb instruction. Renaming some identically named classes that will be removed after converting referencing defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222575 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 21:35:52 +00:00
Kostya Serebryany
598c08cf1c [asan] add statistic counter to dynamic alloca instrumentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222573 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 21:25:18 +00:00
Colin LeMahieu
a3b0670792 [Hexagon] Removing SUB_rr and replacing with A2_sub.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222571 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 21:19:18 +00:00
Tim Northover
7a3eed6d22 Remove duplication of relocation names in lib/Object/ELFYAML.cpp
We can now use the ELF relocation .def files to create the mapping
of relocation numbers to names and avoid having to duplicate the
list of relocations.

Patch by Will Newton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222567 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 20:16:09 +00:00
Tim Northover
0ce0e2c149 Remove duplication of relocation names in lib/Object/ELF.cpp
We can now use the ELF relocation .def files to create the mapping
of relocation numbers to names and avoid having to duplicate the
list of relocations.

Patch by Will Newton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222566 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 20:16:07 +00:00
Tim Northover
9d5d711f65 Split ELF relocation defintions into per-architecture .def files
This should allow the list of relocations for a particular
architecture to be kept in a single header rather than duplicated
whenever we need to enumerate all the relocations.

Patch by Will Newton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222565 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 20:16:02 +00:00
Manman Ren
b179c6a5e5 Debug Info: revert r222195, r222210 and r222239.
This is no longer needed after David's fix at r222377 + r222485.
rdar://18958417


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222563 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 19:55:23 +00:00
Roman Divacky
9bd372345c Disable header duplication at -Oz in loop-rotate pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222562 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 19:53:24 +00:00
Manman Ren
ea692ff712 Debug Info: add an assertion that the context field of a global variable can not
be a DIType with identifier.

This makes sure that there is no need to use DIScopeRef for global variable's
context.

rdar://18958417


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222561 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 19:47:48 +00:00
Manman Ren
7e19efdbb3 [Objective-C] Support a new special module flag that will be put into the
objc_imageinfo struct.

rdar://17954668


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222558 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 19:24:55 +00:00
Hans Wennborg
b4401e33d5 LazyValueInfo: range'ify some for-loops. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222557 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 19:07:46 +00:00
Rafael Espindola
0b835fc95f Add params() to FunctionType. NFC.
While at it, also use makeArrayRef in elements().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222556 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 19:03:35 +00:00
Sanjay Patel
e8f6119214 Don't repeat class/function/variable names in comments. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222555 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 18:58:38 +00:00
Hans Wennborg
36c3fc5ddc LazyValueInfo: fix some typos and indentation, etc. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222554 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 18:58:23 +00:00
Rafael Espindola
633e9689bf Add and use a helper elements() to StructType. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222553 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 18:53:05 +00:00
Matthias Braun
1f69d31727 Allow multiple -debug-only args
Debug output is shown if any of the -debug-only arguments match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222547 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 18:06:09 +00:00
Sanjay Patel
d1510d968c Less space; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222546 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 18:05:59 +00:00
Rafael Espindola
093aa456a3 Fix formatting. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222545 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 18:05:55 +00:00
Sanjay Patel
28660d4b2f Add a feature flag for slow 32-byte unaligned memory accesses [x86].
This patch adds a feature flag to avoid unaligned 32-byte load/store AVX codegen
for Sandy Bridge and Ivy Bridge. There is no functionality change intended for 
those chips. Previously, the absence of AVX2 was being used as a proxy to detect
this feature. But that hindered codegen for AVX-enabled AMD chips such as btver2
that do not have the 32-byte unaligned access slowdown.

Performance measurements are included in PR21541 ( http://llvm.org/bugs/show_bug.cgi?id=21541 ).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222544 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 17:40:04 +00:00
Duncan P. N. Exon Smith
95bafa2a1f Revert "Allow FDE references outside the +/-2GB range supported by PC relative offsets for code models other than small/medium. For JIT application, memory layout is less controlled and can result in truncations otherwise."
This reverts commit r222538.

It's causing test failures for CFI, at least on Darwin:

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1189/
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/1391/

Note that the previous incremental build was on r222537, and the CFI
tests weren't failing:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1188/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222542 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 17:21:18 +00:00
Chandler Carruth
46c5a97adc [x86] Restructure the checking patterns for v16 and v32 avx2 vector
shuffle lowering to allow much better blend matching.

Specifically, with the new structure the code seems clearer to me and we
correctly can hit the cases where merging two 128-bit lanes is a clear
win and can be shuffled cheaply afterward.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222539 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 14:53:03 +00:00
Joerg Sonnenberger
28a626319e Allow FDE references outside the +/-2GB range supported by PC relative
offsets for code models other than small/medium. For JIT application,
memory layout is less controlled and can result in truncations
otherwise. 

Patch from Akos Kiss.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222538 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 14:42:43 +00:00
Chandler Carruth
0889d65fd5 [x86] Make the previous logic significantly less conservative and get
a bunch more improvements.

Non-lane-crossing is fine, the key is that lane merging only makes sense
for single-input shuffles. Not sure why I got so turned around here. The
code all works, I was just using the wrong model for it.

This only updates v4 and v8 lowering. The v16 and v32 lowering requires
restructuring the entire check sequence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222537 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 14:33:24 +00:00
Andrea Di Biagio
607099b697 [DAG] Teach how to turn a build_vector into a shuffle if some of the operands are zero.
Before this patch, the DAGCombiner only tried to convert build_vector dag nodes
into shuffles if all operands were either extract_vector_elt or undef.

This patch improves that logic and teaches the DAGCombiner how to deal with
build_vector dag nodes where one or more operands are zero. A build_vector
dag node with some zero operands is turned into a shuffle only if the resulting
shuffle mask is legal for the target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222536 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 14:32:06 +00:00
Chandler Carruth
bd357588a1 [x86] Teach the x86 vector shuffle lowering to detect mergable 128-bit
lanes.

By special casing these we can often either reduce the total number of
shuffles significantly or reduce the number of (high latency on Haswell)
AVX2 shuffles that potentially cross 128-bit lanes. Even when these
don't actually cross lanes, they have much higher latency to support
that. Doing two of them and a blend is worse than doing a single insert
across the 128-bit lanes to blend and then doing a single interleaved
shuffle.

While this seems like a narrow case, it kept cropping up on me and the
difference is *huge* as you can see in many of the test cases. I first
hit this trying to perfectly fix the interleaving shuffle patterns used
by Halide for AVX2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222533 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 13:56:05 +00:00
Chandler Carruth
a5f4576510 [x86] Remove more windows line endings that slipped into this file...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222528 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 12:33:46 +00:00
Chandler Carruth
d8d3a957d8 [x86] Add a bunch of test cases to 256-bit shuffles that exercise
merging 128-bit subvectors and also shuffling all the elements of those
subvectors. Currently we generate pretty bad code for many of these, but
I'm testing a patch that should dramatically improve this in addition to
making the shuffle lowering robust to other changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222525 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 12:17:50 +00:00
Andrea Di Biagio
04fab61b35 [DAG] Refactor the shuffle combining logic in DAGCombiner. NFC.
This patch simplifies the logic that combines a pair of shuffle nodes into
a single shuffle if there is a legal mask. Also added comments to better
describe the algorithm. No functional change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222522 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 11:33:07 +00:00
Alexey Volkov
d0d0424368 [X86] For Silvermont CPU use 16-bit division instead of 64-bit for small positive numbers
Differential Revision: http://reviews.llvm.org/D5938



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222521 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 11:19:34 +00:00
Yury Gribov
432ade7da6 [asan] Add new hidden compile-time flag asan-instrument-allocas to sanitize variable-sized dynamic allocas. Patch by Max Ostapenko.
Reviewed at http://reviews.llvm.org/D6055


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222519 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 10:29:50 +00:00
NAKAMURA Takumi
3bc8b4b38b Add LLVMScalarOpts to LLVMPowerPCCodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222516 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 09:14:45 +00:00
Hao Liu
09ad94decb DAGCombiner: Allow the DAGCombiner to combine multiple FDIVs with the same divisor info FMULs by the reciprocal.
E.g., ( a / D; b / D ) -> ( recip = 1.0 / D; a * recip; b * recip)

A hook is added to allow the target to control whether it needs to do such combine.

Reviewed in http://reviews.llvm.org/D6334


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222510 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 06:39:58 +00:00
Craig Topper
e0ed7df6b0 Remove a bunch of unnecessary typecasts to 'const TargetRegisterClass *'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222509 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 05:58:21 +00:00
Craig Topper
9130e76923 Add extra new line and remove some trailing whitespace from tablegen RegisterInfo output file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222508 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 05:58:14 +00:00
Rafael Espindola
ed46a2c2aa Fix a silly bug in StreamingMemoryObject.cpp.
The logic for detecting EOF was wrong and would fail if we ever requested
more than 16k past the last read position.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222505 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21 05:15:41 +00:00