Commit Graph

74898 Commits

Author SHA1 Message Date
Mohit K. Bhakkad
b284d4ae31 test commit (spelling correction)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223758 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09 06:31:07 +00:00
Michael Kuperstein
77c1b73211 [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
2014-12-09 06:10:44 +00:00
David Majnemer
2959baffd2 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
2014-12-09 05:56:09 +00:00
David Majnemer
ebddbe8ba6 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
2014-12-09 05:50:11 +00:00
David Majnemer
82258b45e4 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
2014-12-09 05:43:56 +00:00
Bill Schmidt
13dd854d8c 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
2014-12-09 03:02:48 +00:00
NAKAMURA Takumi
3d6e1eeeb2 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
2014-12-09 01:03:27 +00:00
Hal Finkel
014b06e7b2 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
2014-12-09 01:00:59 +00:00
Tom Stellard
9c276c7ab6 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
2014-12-09 00:03:54 +00:00
Tom Stellard
781a7ae1ac 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
2014-12-09 00:03:51 +00:00
Colin LeMahieu
a3b01e5189 [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
2014-12-08 23:55:43 +00:00
Tom Stellard
653ef32216 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
2014-12-08 23:36:48 +00:00
Colin LeMahieu
73ed2dcdac [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
2014-12-08 23:07:59 +00:00
Bill Seurer
ac6e0c82ed [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
2014-12-08 23:07:12 +00:00
Hal Finkel
b849e04d2b [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
2014-12-08 22:54:22 +00:00
Colin LeMahieu
27fbb34173 [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
2014-12-08 22:19:14 +00:00
Colin LeMahieu
9804956609 [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
2014-12-08 21:56:47 +00:00
Colin LeMahieu
7b9be18636 [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
2014-12-08 21:19:18 +00:00
Colin LeMahieu
a321bd4f19 [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
2014-12-08 20:33:01 +00:00
Matt Arsenault
dbd00bf51a 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
2014-12-08 19:55:43 +00:00
David Majnemer
8eef439528 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
2014-12-08 19:35:31 +00:00
Rafael Espindola
7fd7effa37 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
2014-12-08 18:45:16 +00:00
Colin LeMahieu
4772502317 [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
2014-12-08 18:33:49 +00:00
David Majnemer
fca9c7b21c 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
2014-12-08 18:30:43 +00:00
Bruno Cardoso Lopes
43edafcc07 [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
2014-12-08 18:18:32 +00:00
Rafael Espindola
dcc44c64c1 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
2014-12-08 18:05:48 +00:00
Justin Bogner
70b0751080 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
2014-12-08 18:02:35 +00:00
Tim Northover
811474b929 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
2014-12-08 17:54:58 +00:00
Andrea Di Biagio
eafdf26d89 [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
2014-12-08 17:47:18 +00:00
Colin LeMahieu
cf2daa3671 [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
2014-12-08 17:33:06 +00:00
Colin LeMahieu
5c7adadf6d [Hexagon] Adding packhl instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223664 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 17:01:18 +00:00
Daniel Sanders
b856112d87 [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
2014-12-08 15:40:09 +00:00
Andrea Di Biagio
ae16ff1c42 [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
2014-12-08 14:36:51 +00:00
Rafael Espindola
968f0454b8 Move the ValueMap lookup inside linkFunctionBody. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223659 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 14:25:26 +00:00
Rafael Espindola
eaa2992eb2 Use range loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223658 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 14:20:10 +00:00
Rafael Espindola
e305256ca2 Use range loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223657 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 14:05:33 +00:00
Rafael Espindola
7779b87b25 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
2014-12-08 13:44:38 +00:00
Rafael Espindola
254e67955f 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
2014-12-08 13:35:09 +00:00
Rafael Espindola
95d1d167d0 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
2014-12-08 13:29:33 +00:00
Elena Demikhovsky
c4fbd3fd62 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
2014-12-08 09:03:08 +00:00
NAKAMURA Takumi
e4a5390406 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
2014-12-08 02:07:22 +00:00
Duncan P. N. Exon Smith
8ecb7e2243 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
2014-12-07 20:32:11 +00:00
Duncan P. N. Exon Smith
7280d8ccce 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
2014-12-07 19:52:06 +00:00
Duncan P. N. Exon Smith
a77df65a84 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
2014-12-07 17:56:16 +00:00
Marek Olsak
6b9ae406ac 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
2014-12-07 17:17:43 +00:00
Marek Olsak
eca8933d58 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
2014-12-07 17:17:38 +00:00
Marek Olsak
ac1f24a06a 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
2014-12-07 12:19:03 +00:00
Marek Olsak
7eeb607497 R600/SI: Add VI instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223603 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-07 12:18:57 +00:00
Marek Olsak
9ecb1217e4 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
2014-12-07 12:18:45 +00:00
Benjamin Kramer
2991725fe2 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
2014-12-06 19:22:54 +00:00
Benjamin Kramer
2cd5836249 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
2014-12-06 19:22:44 +00:00
Benjamin Kramer
51df2c2a10 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
2014-12-06 13:12:56 +00:00
David Majnemer
278bbacd27 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
2014-12-06 11:58:33 +00:00
David Majnemer
d34c5a921f 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
2014-12-06 10:52:32 +00:00
David Majnemer
620e8763ec 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
2014-12-06 10:51:40 +00:00
NAKAMURA Takumi
c589098319 Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223580 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 05:57:06 +00:00
Tom Stellard
1ba81462d0 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
2014-12-06 05:34:34 +00:00
Duncan P. N. Exon Smith
09ba28c27c 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
2014-12-06 02:29:44 +00:00
NAKAMURA Takumi
e1d7711d2f LLVMInstrumentation requires MC since r223532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223573 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 02:22:11 +00:00
Ahmed Bougacha
3b9ac8c7c3 [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
2014-12-06 01:31:07 +00:00
Hans Wennborg
a421ac689f 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
2014-12-06 01:28:50 +00:00
Duncan P. N. Exon Smith
30596886ed 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
2014-12-06 01:26:49 +00:00
Duncan P. N. Exon Smith
e70779ec53 Utils: Style cleanups, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223556 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 00:48:17 +00:00
Duncan P. N. Exon Smith
fe10a1117a Utils: Avoid RAUW on metadata in CloneFunction()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223555 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-06 00:48:13 +00:00
Nick Lewycky
8a51f8e8ce 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
2014-12-06 00:45:50 +00:00
Tim Northover
4e54b5db81 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
2014-12-06 00:33:37 +00:00
Benjamin Kramer
d46a8180c0 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
2014-12-06 00:02:31 +00:00
Ahmed Bougacha
f5e810be25 [X86] Cleanup FCOPYSIGN lowering. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223542 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 23:11:36 +00:00
Kuba Brecka
0a12d8211e Recommit of r223513 and r223514.
Reviewed at http://reviews.llvm.org/D6488



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223532 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 22:19:18 +00:00
Colin LeMahieu
d2f12fd27a [Hexagon] Relocating logical instructions and templates later in the td file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223523 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 21:51:12 +00:00
Colin LeMahieu
ec51bc6f3a [Hexagon] Adding sub/and/or reg, imm forms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223522 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 21:38:29 +00:00
Rafael Espindola
9423af6b70 Remove dead code. We are only lazy about functions with bodies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223521 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 21:36:06 +00:00
Kuba Brecka
05c096b953 Reverting r223513 and r223514.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223520 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 21:32:46 +00:00
Sanjay Patel
ab4ad4f98e Optimize merging of scalar loads for 32-byte vectors [X86, AVX]
Fix the poor codegen seen in PR21710 ( http://llvm.org/bugs/show_bug.cgi?id=21710 ).
Before we crack 32-byte build vectors into smaller chunks (and then subsequently
glue them back together), we should look for the easy case where we can just load
all elements in a single op.

An example of the codegen change is:

From:

vmovss  16(%rdi), %xmm1
vmovups (%rdi), %xmm0
vinsertps       $16, 20(%rdi), %xmm1, %xmm1
vinsertps       $32, 24(%rdi), %xmm1, %xmm1
vinsertps       $48, 28(%rdi), %xmm1, %xmm1
vinsertf128     $1, %xmm1, %ymm0, %ymm0
retq

To:

vmovups (%rdi), %ymm0
retq

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223518 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 21:28:14 +00:00
Peter Collingbourne
93712874d8 [DFSAN][MIPS][LLVM] Defining ShadowPtrMask variable for MIPS64
Patch by Kumar Sukhani!

corresponding compiler-rt patch: http://reviews.llvm.org/D6437
clang patch: http://reviews.llvm.org/D6147

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223516 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 21:22:32 +00:00
Colin LeMahieu
5db47f1376 [Hexagon] Updating mux_ir/ri/ii/rr with encoding bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223515 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 21:09:27 +00:00
Kuba Brecka
86af53ecf0 AddressSanitizer - Don't instrument globals from cstring_literals sections. (llvm part)
Reviewed at http://reviews.llvm.org/D6488



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223513 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 21:04:43 +00:00
Rafael Espindola
f117c8ae03 Simplify the loop linking function bodies. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223512 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 21:04:36 +00:00
Jan Wen Voung
a44126f432 Use 32-bit ebp for NaCl64 in a limited case: llvm.frameaddress.
Summary:
Follow up to [x32] "Use ebp/esp as frame and stack pointer":
http://reviews.llvm.org/D4617

In that earlier patch, NaCl64 was made to always use rbp.
That's needed for most cases because rbp should hold a full
64-bit address within the NaCl sandbox so that load/stores
off of rbp don't require sandbox adjustment (zeroing the top
32-bits, then filling those by adding r15).

However, llvm.frameaddress returns a pointer and pointers
are 32-bit for NaCl64. In this case, use ebp instead, which
will make the register copy type check. A similar mechanism
may be needed for llvm.eh.return, but is not added in this change.

Test Plan: test/CodeGen/X86/frameaddr.ll

Reviewers: dschuff, nadav

Subscribers: jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223510 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 20:55:53 +00:00
Bill Seurer
dfa6293b55 [PowerPC]Add VSX loads/stores to fastisel for PPC target
This patch adds VSX floating point loads and stores to fastisel.

Along with the change to tablegen (D6220), VSX instructions are now fully supported in fastisel.

http://reviews.llvm.org/D6274


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223507 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 20:15:56 +00:00
Colin LeMahieu
4fda99f866 [Hexagon] Adding tfrih/l instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223506 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 20:07:19 +00:00
Andrea Di Biagio
6a9a49d7ab [X86] Improved lowering of packed vector shifts to vpsllq/vpsrlq.
SSE2/AVX non-constant packed shift instructions only use the lower 64-bit of
the shift count. 

This patch teaches function 'getTargetVShiftNode' how to deal with shifts
where the shift count node is of type MVT::i64.

Before this patch, function 'getTargetVShiftNode' only knew how to deal with
shift count nodes of type MVT::i32. This forced the backend to wrongly
truncate the shift count to MVT::i32, and then zero-extend it back to MVT::i64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223505 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 20:02:22 +00:00
Colin LeMahieu
189606dbfe [Hexagon] Adding add reg, imm form with encoding bits and test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223504 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 19:51:23 +00:00
Rafael Espindola
98821ee350 Remove unused arguments. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223503 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 19:35:07 +00:00
Eric Christopher
7a76d76e0c These two calls were grabbing the same register info. Unify them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223502 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 19:23:55 +00:00
Duncan P. N. Exon Smith
1a283409bc BFI: Saturate when combining edges to a successor
When a loop gets bundled up, its outgoing edges are quite large, and can
just barely overflow 64-bits.  If one successor has multiple incoming
edges -- and that successor is getting all the incoming mass --
combining just its edges can overflow.  Handle that by saturating rather
than asserting.

This fixes PR21622.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223500 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 19:13:42 +00:00
Colin LeMahieu
78ec9010c5 [Hexagon] Adding DoubleRegs decoder. Moving C2_mux and A2_nop. Adding combine imm-imm form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223494 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 18:24:06 +00:00
Adrian Prantl
33ada85735 Fix a bug when pretty-printing DW_OP_deref.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223493 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 18:19:38 +00:00
Ahmed Bougacha
bf6e012f8e [CodeGenPrepare] Use variables for reused values. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223491 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 18:04:40 +00:00
Colin LeMahieu
fba13406e2 [Hexagon] [NFC] Rearranging patterns and mux instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223488 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 17:58:06 +00:00
Colin LeMahieu
639b824b52 [Hexagon] [NFC] Rearranging def order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223487 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 17:55:51 +00:00
Rafael Espindola
24ba29981c Refactor duplicated code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223486 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 17:53:15 +00:00
Colin LeMahieu
0785bdf107 [Hexagon] Adding combine reg-reg forms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223485 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 17:38:36 +00:00
Colin LeMahieu
4c58675d35 [Hexagon] Marking several instructions as isCodeGenOnly=0 and adding direct disassembly tests for many instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223482 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 17:27:39 +00:00
Benjamin Kramer
472e9cc4bc LLVMContext: Store APInt/APFloat directly into the ConstantInt/FP DenseMaps.
Required some APInt massaging to get proper empty/tombstone values. Apart
from making the code a bit simpler this also reduces the bucket size of
the ConstantInt map from 32 to 24 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223478 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 17:03:01 +00:00
Rafael Espindola
dd6794f01d Small cleanup on how we clear constant variables. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223474 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 16:05:19 +00:00
Rafael Espindola
46cbde27ce Use an early return. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223470 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 15:42:30 +00:00
Evgeniy Stepanov
c4c08aab64 [msan] Avoid extra origin address realignment.
Do not realign origin address if the corresponding application
address is at least 4-byte-aligned.

Saves 2.5% code size in track-origins mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223464 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 14:34:03 +00:00
Andrea Di Biagio
54529ed1c4 [X86] Avoid introducing extra shuffles when lowering packed vector shifts.
When lowering a vector shift node, the backend checks if the shift count is a
shuffle with a splat mask. If so, then it introduces an extra dag node to
extract the splat value from the shuffle. The splat value is then used
to generate a shift count of a target specific shift.

However, if we know that the shift count is a splat shuffle, we can use the
splat index 'I' to extract the I-th element from the first shuffle operand.
The advantage is that the splat shuffle may become dead since we no longer
use it.

Example:

;;
define <4 x i32> @example(<4 x i32> %a, <4 x i32> %b) {
  %c = shufflevector <4 x i32> %b, <4 x i32> undef, <4 x i32> zeroinitializer
  %shl = shl <4 x i32> %a, %c
  ret <4 x i32> %shl
}
;;

Before this patch, llc generated the following code (-mattr=+avx):
  vpshufd $0, %xmm1, %xmm1   # xmm1 = xmm1[0,0,0,0]
  vpxor  %xmm2, %xmm2
  vpblendw $3, %xmm1, %xmm2, %xmm1 # xmm1 = xmm1[0,1],xmm2[2,3,4,5,6,7]
  vpslld %xmm1, %xmm0, %xmm0
  retq

With this patch, the redundant splat operation is removed from the code.
  vpxor  %xmm2, %xmm2
  vpblendw $3, %xmm1, %xmm2, %xmm1 # xmm1 = xmm1[0,1],xmm2[2,3,4,5,6,7]
  vpslld %xmm1, %xmm0, %xmm0
  retq


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223461 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 12:13:30 +00:00
Charlie Turner
1610d6e878 Add missing FP build attribute tests.
The test file test/CodeGen/ARM/build-attributes.ll was missing several
floating-point build attribute tests. The intention of this commit is that for
each CPU / architecture currently tested, there are now tests that make sure
the following attributes are sufficiently checked,

  * Tag_ABI_FP_rounding
  * Tag_ABI_FP_denormal
  * Tag_ABI_FP_exceptions
  * Tag_ABI_FP_user_exceptions
  * Tag_ABI_FP_number_model

Also in this commit, the -unsafe-fp-math flag has been augmented with the full
suite of flags Clang sends to LLVM when you pass -ffast-math to Clang. That is,
`-unsafe-fp-math' has been changed to `-enable-unsafe-fp-math -disable-fp-elim
-enable-no-infs-fp-math -enable-no-nans-fp-math -fp-contract=fast'

Change-Id: I35d766076bcbbf09021021c0a534bf8bf9a32dfc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223454 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05 08:22:47 +00:00