oota-llvm.git
10 years ago[X86][FastISel] During X86 fastisel, the address of indirect call was resolved
Quentin Colombet [Mon, 14 Oct 2013 22:32:09 +0000 (22:32 +0000)]
[X86][FastISel] During X86 fastisel, the address of indirect call was resolved
through bitcast, ptrtoint, and inttoptr instructions. This is valid
only if the related instructions are in that same basic block, otherwise
we may reference variables that were not live accross basic blocks
resulting in undefined virtual registers.

The bug was exposed when both SDISel and FastISel were used within the same
function, i.e., one basic block is issued with FastISel and another with SDISel,
as demonstrated with the testcase.

<rdar://problem/15192473>

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

10 years agoFix the ExecutionDepsFix pass to handle AVX instructions.
Andrew Trick [Mon, 14 Oct 2013 22:19:03 +0000 (22:19 +0000)]
Fix the ExecutionDepsFix pass to handle AVX instructions.

This pass is needed to break false dependencies. Without it, unlucky
register assignment can result in wild (5x) swings in
performance. This pass was trying to handle AVX but not getting it
right. AVX doesn't have partial register defs, it has unused register
reads in which the high bits of a source operand are copied into the
unused bits of the dest.

Fixing this requires conservative liveness analysis. This is awkard
because the pass already has its own pseudo-liveness. However, proper
liveness is expensive, and we would like to use a generic utility to
compute it. The fix only invokes liveness on-demand. It is rare to
detect a case that needs undef-read dependence breaking, but when it
happens, it can be needed many times within a very large block.

I think the existing heuristic which uses a register window of 16 is
too conservative for loop-carried false dependencies. If the loop is a
reduction. The out-of-order engine may be able to execute several loop
iterations in parallel. However, I'll leave this tuning exercise for
next time.

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

10 years agoLiveRegUnits: Use *MBB for consistency and convenience.
Andrew Trick [Mon, 14 Oct 2013 22:18:59 +0000 (22:18 +0000)]
LiveRegUnits: Use *MBB for consistency and convenience.

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

10 years agowhitespace
Andrew Trick [Mon, 14 Oct 2013 22:18:56 +0000 (22:18 +0000)]
whitespace

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

10 years agoFix a typo, in a comment, in a test.
Nick Lewycky [Mon, 14 Oct 2013 22:02:53 +0000 (22:02 +0000)]
Fix a typo, in a comment, in a test.

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

10 years agoRevert part of a fix from 2010, changes since then:
Eric Christopher [Mon, 14 Oct 2013 21:52:26 +0000 (21:52 +0000)]
Revert part of a fix from 2010, changes since then:

a) x86-64 TLS has been documented
b) the code path should use movq for the correct relocation
   to be generated.

I've also added a fixme for the test case that we should improve
the code generated, it should look something like is documented
in the tls abi document.

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

10 years agoReformat this routine slightly.
Eric Christopher [Mon, 14 Oct 2013 21:52:23 +0000 (21:52 +0000)]
Reformat this routine slightly.

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

10 years agoRemove some extraneous whitespace.
Eric Christopher [Mon, 14 Oct 2013 21:52:18 +0000 (21:52 +0000)]
Remove some extraneous whitespace.

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

10 years agoLiveRegUnits::removeRegsInMask safety.
Andrew Trick [Mon, 14 Oct 2013 20:45:19 +0000 (20:45 +0000)]
LiveRegUnits::removeRegsInMask safety.

Clobbering is exclusive not inclusive on register units.
For liveness, we need to consider all the preserved registers.
e.g. A regmask that clobbers YMM0 may preserve XMM0.
Units are only clobbered when all super-registers are clobbered.

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

10 years agoUse a SparseSet in LiveRegUnits.
Andrew Trick [Mon, 14 Oct 2013 20:45:17 +0000 (20:45 +0000)]
Use a SparseSet in LiveRegUnits.

Some clients may add block live ins and may track liveness over a
large scope. This guarantees an efficient implementation in all cases
with no memory allocation/deallocation, independent of the number of
target registers. It could be slightly less convenient but is fine in
the expected case.

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

10 years agoMove LiveRegUnits implementation into .cpp. Comment and format.
Andrew Trick [Mon, 14 Oct 2013 20:45:14 +0000 (20:45 +0000)]
Move LiveRegUnits implementation into .cpp. Comment and format.

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

10 years agoRemove extra indentation in LiveRegUnits.
Andrew Trick [Mon, 14 Oct 2013 20:45:11 +0000 (20:45 +0000)]
Remove extra indentation in LiveRegUnits.

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

10 years agoConvert LiveRegUnits methods to the current convention (it's new code).
Andrew Trick [Mon, 14 Oct 2013 20:45:09 +0000 (20:45 +0000)]
Convert LiveRegUnits methods to the current convention (it's new code).

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

10 years agoDebug Info: static member DIE creation.
Manman Ren [Mon, 14 Oct 2013 20:33:57 +0000 (20:33 +0000)]
Debug Info: static member DIE creation.

Clean up creation of static member DIEs. We can create static member DIEs from
two places, so we call getOrCreateStaticMemberDIE from the two places.

getOrCreateStaticMemberDIE will get or create the context DIE first, then it
will check if the DIE already exists, if not, we create the static member DIE
and add it to the context.

Creation of static member DIEs are handled in a similar way as subprogram DIEs.

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

10 years agoFix indenting.
David Blaikie [Mon, 14 Oct 2013 20:15:04 +0000 (20:15 +0000)]
Fix indenting.

That wasn't confusing /at all/...

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

10 years agovs2013 msbuild integration: add missing .target files, fix typo in CMakeLists
Hans Wennborg [Mon, 14 Oct 2013 18:16:37 +0000 (18:16 +0000)]
vs2013 msbuild integration: add missing .target files, fix typo in CMakeLists

This should fix PR17568.

Patch by Josh Samuel!

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

10 years agoMachineSink: Fix and tweak critical-edge breaking heuristic.
Will Dietz [Mon, 14 Oct 2013 16:57:17 +0000 (16:57 +0000)]
MachineSink: Fix and tweak critical-edge breaking heuristic.

Per original comment, the intention of this loop
is to go ahead and break the critical edge
(in order to sink this instruction) if there's
reason to believe doing so might "unblock" the
sinking of additional instructions that define
registers used by this one.  The idea is that if
we have a few instructions to sink "together"
breaking the edge might be worthwhile.

This commit makes a few small changes
to help better realize this goal:

First, modify the loop to ignore registers
defined by this instruction.  We don't
sink definitions of physical registers,
and sinking an SSA definition isn't
going to unblock an upstream instruction.

Second, ignore uses of physical registers.
Instructions that define physical registers are
rejected for sinking, and so moving this one
won't enable moving any defining instructions.
As an added bonus, while virtual register
use-def chains are generally small due
to SSA goodness, iteration over the uses
and definitions (used by hasOneNonDBGUse)
for physical registers like EFLAGS
can be rather expensive in practice.
(This is the original reason for looking at this)

Finally, to keep things simple continue
to only consider this trick for registers that
have a single use (via hasOneNonDBGUse),
but to avoid spuriously breaking critical edges
only do so if the definition resides
in the same MBB and therefore this one directly
blocks it from being sunk as well.
If sinking them together is meant to be,
let the iterative nature of this pass
sink the definition into this block first.

Update tests to accomodate this change,
add new testcase where sinking avoids pipeline stalls.

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

10 years agoRemove utils/profile.pl.
Rafael Espindola [Mon, 14 Oct 2013 16:48:32 +0000 (16:48 +0000)]
Remove utils/profile.pl.

It uses now removed opt options.

Patch by Alastair Murray!

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

10 years agoRemove lib/Transforms/Instrumentation/ProfilingUtils.*
Rafael Espindola [Mon, 14 Oct 2013 16:46:46 +0000 (16:46 +0000)]
Remove lib/Transforms/Instrumentation/ProfilingUtils.*

They were leftover from the old profiling support.

Patch by Alastair Murray.

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

10 years agoRemove the now unused strong phi elimination pass.
Rafael Espindola [Mon, 14 Oct 2013 16:39:04 +0000 (16:39 +0000)]
Remove the now unused strong phi elimination pass.

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

10 years agoBasic blocks typically have few predecessors. Use a SmallDenseMap to
Chris Lattner [Mon, 14 Oct 2013 16:05:55 +0000 (16:05 +0000)]
Basic blocks typically have few predecessors.  Use a SmallDenseMap to
avoid a heap allocation when this is the case.

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

10 years ago[msan] Instrument x86.*_cvt* intrinsics.
Evgeniy Stepanov [Mon, 14 Oct 2013 15:16:25 +0000 (15:16 +0000)]
[msan] Instrument x86.*_cvt* intrinsics.

Currently MSan checks that arguments of *cvt* intrinsics are fully initialized.
That's too much to ask: some of them only operate on lower half, or even
quarter, of the input register.

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

10 years ago[AArch64] Add support for NEON scalar integer compare instructions.
Chad Rosier [Mon, 14 Oct 2013 14:37:20 +0000 (14:37 +0000)]
[AArch64] Add support for NEON scalar integer compare instructions.

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

10 years agoAdd Cortex-A57 support
Bernard Ogden [Mon, 14 Oct 2013 13:17:07 +0000 (13:17 +0000)]
Add Cortex-A57 support

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

10 years agoAdd subtarget feature support for Cortex-A53
Bernard Ogden [Mon, 14 Oct 2013 13:16:57 +0000 (13:16 +0000)]
Add subtarget feature support for Cortex-A53

Some previous implicit defaults have changed, for example FP and NEON
are now on by default.

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

10 years ago[mips][msa] Direct Object Emission support for BIT instructions.
Matheus Almeida [Mon, 14 Oct 2013 13:07:39 +0000 (13:07 +0000)]
[mips][msa] Direct Object Emission support for BIT instructions.

List of instructions:
bclri.{b,h,w,d}
binsli.{b,h,w,d}
binsri.{b,h,w,d}
bnegi.{b,h,w,d}
bseti.{b,h,w,d}
sat_s.{b,h,w,d}
sat_u.{b,h,w,d}
slli.{b,h,w,d}
srai.{b,h,w,d}
srari.{b,h,w,d}
srli.{b,h,w,d}
srlri.{b,h,w,d}

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

10 years ago[mips][msa] Direct Object Emission support for VEC instructions.
Matheus Almeida [Mon, 14 Oct 2013 12:57:18 +0000 (12:57 +0000)]
[mips][msa] Direct Object Emission support for VEC instructions.

List of instructions:
and.v, bmnz.v, bmz.v, bsel.v, nor.v, or.v, xor.v.

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

10 years ago[mips][msa] Direct Object Emission of INSVE.{b,h,w,d}.
Matheus Almeida [Mon, 14 Oct 2013 12:38:17 +0000 (12:38 +0000)]
[mips][msa] Direct Object Emission of INSVE.{b,h,w,d}.

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

10 years ago[mips][msa] Direct Object Emission for the majority of the ELM instructions.
Matheus Almeida [Mon, 14 Oct 2013 12:22:43 +0000 (12:22 +0000)]
[mips][msa] Direct Object Emission for the majority of the ELM instructions.

List of instructions:
copy_s.{b,h,w}
copy_u.{b,h,w}
sldi.{b,h,w,d}
splati.{b,h,w,d}

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

10 years ago[mips][msa] Direct Object Emission of INSERT.{B,H,W} instruction.
Matheus Almeida [Mon, 14 Oct 2013 11:49:30 +0000 (11:49 +0000)]
[mips][msa] Direct Object Emission of INSERT.{B,H,W} instruction.

INSERT is the first type of MSA instruction that requires a change to the way
MSA registers are parsed. This happens because MSA registers may be suffixed by
an index in the form of an immediate or a general purpose register. The changes
to parseMSARegs reflect that requirement.

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

10 years ago[msan] Fix handling of scalar select of vectors.
Evgeniy Stepanov [Mon, 14 Oct 2013 09:52:09 +0000 (09:52 +0000)]
[msan] Fix handling of scalar select of vectors.

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

10 years agoFixed a bug in dynamic allocation memory on stack.
Elena Demikhovsky [Mon, 14 Oct 2013 07:26:51 +0000 (07:26 +0000)]
Fixed a bug in dynamic allocation memory on stack.
The alignment of allocated space was wrong, see Bugzila 17345.

Done by Zvi Rackover <zvi.rackover@intel.com>.

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

10 years agoCreate classes to reduce the size of the tablegen entries for the CRC32 instructions.
Craig Topper [Mon, 14 Oct 2013 05:19:58 +0000 (05:19 +0000)]
Create classes to reduce the size of the tablegen entries for the CRC32 instructions.

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

10 years agoAllow pinsrw/pinsrb/pextrb/pextrw/movmskps/movmskpd/pmovmskb/extractps instructions...
Craig Topper [Mon, 14 Oct 2013 04:55:01 +0000 (04:55 +0000)]
Allow pinsrw/pinsrb/pextrb/pextrw/movmskps/movmskpd/pmovmskb/extractps instructions to parse either GR32 or GR64 without resorting to duplicating instructions.

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

10 years agoAdd disassembler support for SSE4.1 register/register form of PEXTRW. There is a...
Craig Topper [Mon, 14 Oct 2013 01:42:32 +0000 (01:42 +0000)]
Add disassembler support for SSE4.1 register/register form of PEXTRW. There is a shorter encoding that was part of SSE2, but a memory form was added in SSE4.1. This is the register form of that encoding.

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

10 years agoMark MOVMSKPS/MOVMSKPD/VPINSRWrr64i as AsmParserOnly to remove them from the disassem...
Craig Topper [Mon, 14 Oct 2013 01:21:22 +0000 (01:21 +0000)]
Mark MOVMSKPS/MOVMSKPD/VPINSRWrr64i as AsmParserOnly to remove them from the disassembler tables. Add PINSRWrr64i to complement the AVX version.

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

10 years agoWindows: Fix a typo in an assert
David Majnemer [Mon, 14 Oct 2013 01:17:32 +0000 (01:17 +0000)]
Windows: Fix a typo in an assert

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

10 years agoDon't use 64-bit versions of MOVMSKPD in CodeGen. The instructions only produce a...
Craig Topper [Mon, 14 Oct 2013 00:24:33 +0000 (00:24 +0000)]
Don't use 64-bit versions of MOVMSKPD in CodeGen. The instructions only produce a 1-bit result so we can just use SUBREG_TO_REG to extend the 32-bit versions.

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

10 years agoWindows: Don't bother with pinning Kernel32.dll
David Majnemer [Mon, 14 Oct 2013 00:06:58 +0000 (00:06 +0000)]
Windows: Don't bother with pinning Kernel32.dll

We don't delay load it so it shouldn't be going anywhere.

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

10 years agoMC: Don't assume incoming StringRef's are null terminated.
Will Dietz [Sun, 13 Oct 2013 22:09:26 +0000 (22:09 +0000)]
MC: Don't assume incoming StringRef's are null terminated.

This can happen when processing command line arguments, which
are often stored as std::string's and later turned into
StringRef's via std::string::data().  Unfortunately this
is not guaranteed to return a null-terminated string
until C++11, causing breakage on platforms that don't do this.

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

10 years agoR600: improve dump of S_WAITCNT
Vincent Lejeune [Sun, 13 Oct 2013 17:56:28 +0000 (17:56 +0000)]
R600: improve dump of S_WAITCNT

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

10 years agoR600/SI: Add SinkingPass before ISel
Vincent Lejeune [Sun, 13 Oct 2013 17:56:21 +0000 (17:56 +0000)]
R600/SI: Add SinkingPass before ISel

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

10 years agoR600/SI: Support byval arguments
Vincent Lejeune [Sun, 13 Oct 2013 17:56:16 +0000 (17:56 +0000)]
R600/SI: Support byval arguments

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

10 years agoR600: Use masked read sel for texture instructions
Vincent Lejeune [Sun, 13 Oct 2013 17:56:10 +0000 (17:56 +0000)]
R600: Use masked read sel for texture instructions

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

10 years agoR600: fix swizzle export
Vincent Lejeune [Sun, 13 Oct 2013 17:56:04 +0000 (17:56 +0000)]
R600: fix swizzle export

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

10 years agoR600: Clear the VPM bit of export instructions.
Vincent Lejeune [Sun, 13 Oct 2013 17:55:57 +0000 (17:55 +0000)]
R600: Clear the VPM bit of export instructions.

It makes apparently no change it to set this bit or not but the
docs recommand to left it cleared.

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

10 years agoWindows: Use GetModuleHandleEx instead of LoadLibrary
David Majnemer [Sun, 13 Oct 2013 10:34:21 +0000 (10:34 +0000)]
Windows: Use GetModuleHandleEx instead of LoadLibrary

We were using an anti-pattern of:
 - LoadLibrary
 - GetProcAddress
 - FreeLibrary

This is problematic because of several reasons:
 - We are holding on to pointers into a library we just unloaded.
 - Calling LoadLibrary results in an increase in the reference count of
   the library in question and any libraries that it depends on and
   so-on and so-forth.  This is none too quick.

Instead, use GetModuleHandleEx with GET_MODULE_HANDLE_EX_FLAG_PIN.  This
is done because because we didn't bring the reference for the library
into existence and therefor shouldn't count on it being around later.

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

10 years agoTargetLowering: Don't index into empty string.
Will Dietz [Sun, 13 Oct 2013 03:08:49 +0000 (03:08 +0000)]
TargetLowering: Don't index into empty string.

(This is triggered by current lit tests)

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

10 years agoyaml2coff/elf: Touchup for compatibility.
Will Dietz [Sat, 12 Oct 2013 21:29:16 +0000 (21:29 +0000)]
yaml2coff/elf: Touchup for compatibility.

* std::string::append(int, int) can be ambiguous.
* std::vector<>::data() is a C++11 feature, use ArrayRef abstraction.

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

10 years agoSLPVectorizer: Sort PHINodes based on their opcode
Arnold Schwaighofer [Sat, 12 Oct 2013 18:56:27 +0000 (18:56 +0000)]
SLPVectorizer: Sort PHINodes based on their opcode

Before this patch we relied on the order of phi nodes when we looked for phi
nodes of the same type. This could prevent vectorization of cases where there
was a phi node of a second type in between phi nodes of some type.

This is important for vectorization of an internal graphics kernel. On the test
suite + external on x86_64 (and on a run on armv7s) it showed no impact on
either performance or compile time.

radar://15024459

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

10 years agoLoopVectorize: Add missing INITIALIZE_PASS_DEPENDENCY macros
Tobias Grosser [Sat, 12 Oct 2013 18:29:15 +0000 (18:29 +0000)]
LoopVectorize: Add missing INITIALIZE_PASS_DEPENDENCY macros

Contributed-by: Peter Zotov <whitequark@whitequark.org>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192536 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoForce a CPU on test so it doesn't depend on microarchitectural scheduling decisions.
Benjamin Kramer [Sat, 12 Oct 2013 11:17:12 +0000 (11:17 +0000)]
Force a CPU on test so it doesn't depend on microarchitectural scheduling decisions.

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

10 years agoUpdate so that it uses the `-V' command line option and supports Python 3.x.
Bill Wendling [Sat, 12 Oct 2013 08:42:59 +0000 (08:42 +0000)]
Update so that it uses the `-V' command line option and supports Python 3.x.

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

10 years agoRemove more filters from the disassembler. Mark some AVX512 instructions as CodeGenOnly.
Craig Topper [Sat, 12 Oct 2013 05:41:08 +0000 (05:41 +0000)]
Remove more filters from the disassembler. Mark some AVX512 instructions as CodeGenOnly.

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

10 years agoR600: Store disassembly in a special ELF section when feature +DumpCode is enabled.
Tom Stellard [Sat, 12 Oct 2013 05:02:51 +0000 (05:02 +0000)]
R600: Store disassembly in a special ELF section when feature +DumpCode is enabled.

Patch by: Jay Cornwall

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192523 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMark some more instructions as CodeGenOnly. Remove filters from the disassembler.
Craig Topper [Sat, 12 Oct 2013 04:46:18 +0000 (04:46 +0000)]
Mark some more instructions as CodeGenOnly. Remove filters from the disassembler.

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

10 years agoFor Mips16, start to consolidate all forms of 32 bit literal loading so that
Reed Kotler [Sat, 12 Oct 2013 02:19:08 +0000 (02:19 +0000)]
For Mips16, start to consolidate all forms of 32 bit literal loading so that
they can be better handled and optimized in the Mips16 constant island code.

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

10 years agoAdd missing #include's to cctype when using isdigit/alpha/etc.
Will Dietz [Sat, 12 Oct 2013 00:55:57 +0000 (00:55 +0000)]
Add missing #include's to cctype when using isdigit/alpha/etc.

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

10 years agoDebug Info: remove form from function addDIEEntry.
Manman Ren [Fri, 11 Oct 2013 23:58:05 +0000 (23:58 +0000)]
Debug Info: remove form from function addDIEEntry.

The form must be a reference form in addDIEEntry. Which reference form to
use will be decided by the callee.

No functionality change.

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

10 years agoFixing problems in lli's RemoteMemoryManager.
Andrew Kaylor [Fri, 11 Oct 2013 22:47:10 +0000 (22:47 +0000)]
Fixing problems in lli's RemoteMemoryManager.

This fixes a problem from a previous check-in where a return value was omitted.

Previously the remote/stubs-remote.ll and remote/stubs-sm-pic.ll tests were reporting passes, but they should have been failing.  Those tests attempt to link against an external symbol and remote symbol resolution is not supported.  The old RemoteMemoryManager implementation resulted in local symbols being used for resolution and the child process crashed but the test didn't notice.  With this check-in remote symbol resolution fails, and so the test (correctly) fails.

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

10 years agoAdding multiple object support to MCJIT EH frame handling
Andrew Kaylor [Fri, 11 Oct 2013 21:25:48 +0000 (21:25 +0000)]
Adding multiple object support to MCJIT EH frame handling

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

10 years agoR600: Add scalar i32 add test
Matt Arsenault [Fri, 11 Oct 2013 21:03:41 +0000 (21:03 +0000)]
R600: Add scalar i32 add test

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

10 years agoUse CHECK-LABEL
Matt Arsenault [Fri, 11 Oct 2013 21:03:39 +0000 (21:03 +0000)]
Use CHECK-LABEL

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

10 years agoFix typo
Matt Arsenault [Fri, 11 Oct 2013 21:03:36 +0000 (21:03 +0000)]
Fix typo

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

10 years agofConversion: Attempt #2 at fixing the MSVC build.
Benjamin Kramer [Fri, 11 Oct 2013 19:49:09 +0000 (19:49 +0000)]
fConversion: Attempt #2 at fixing the MSVC build.

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

10 years agoIfConversion: Try to unbreak the MSVC build.
Benjamin Kramer [Fri, 11 Oct 2013 19:39:48 +0000 (19:39 +0000)]
IfConversion: Try to unbreak the MSVC build.

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

10 years agoMips: Disassemble sign-extended 64 bit immediates properly.
Benjamin Kramer [Fri, 11 Oct 2013 19:05:08 +0000 (19:05 +0000)]
Mips: Disassemble sign-extended 64 bit immediates properly.

This doesn't change the meaning of the output, but makes look right. PR17539.

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

10 years agoRemove kill flags after if conversion if necessary
Matthias Braun [Fri, 11 Oct 2013 19:04:37 +0000 (19:04 +0000)]
Remove kill flags after if conversion if necessary

When if converting something like:
true:
   ... = R0<kill>

false:
   ... = R0<kill>

then the instructions of the true block must not have a <kill> flag
anymore, as the instruction of the false block follow and do still read
the R0 value.
Specifically this patch determines the set of register live-in in the
false block (possibly after simulating the liveness changes of the
duplicated instructions). Each of these live-in registers mustn't be
killed.

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

10 years agoIntroduce ad hoc liveness tracking utility: LiveRegUnits
Matthias Braun [Fri, 11 Oct 2013 19:04:35 +0000 (19:04 +0000)]
Introduce ad hoc liveness tracking utility: LiveRegUnits

Contains a set of live register (units) and code to move forward and
backward in the schedule while updating the live set.

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

10 years ago[DAGCombiner] Load slicing test case: attempt to really fix the buildbots (used sse4...
Quentin Colombet [Fri, 11 Oct 2013 18:54:49 +0000 (18:54 +0000)]
[DAGCombiner] Load slicing test case: attempt to really fix the buildbots (used sse4.2 instead of avx!).

<rdar://problem/14477220>

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

10 years agoAdd warning about CHECK-DAG with variable definition
Renato Golin [Fri, 11 Oct 2013 18:50:22 +0000 (18:50 +0000)]
Add warning about CHECK-DAG with variable definition

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

10 years agoDebug Info Testing Case: check for the name of a structure.
Manman Ren [Fri, 11 Oct 2013 18:50:00 +0000 (18:50 +0000)]
Debug Info Testing Case: check for the name of a structure.

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

10 years agoReally fix CHECK-LABEL and CHECK-DAG interaction. This actually just restores the...
Stephen Lin [Fri, 11 Oct 2013 18:38:36 +0000 (18:38 +0000)]
Really fix CHECK-LABEL and CHECK-DAG interaction. This actually just restores the initial implementation that was in r186162 but got lost in some subsequent refactoring. More explicit variable names and comments are present now to hopefully prevent repeat regression, as well as another test.

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

10 years ago[DAGCombiner] Reapply load slicing (192471) with a test that explicitly set sse4...
Quentin Colombet [Fri, 11 Oct 2013 18:29:42 +0000 (18:29 +0000)]
[DAGCombiner] Reapply load slicing (192471) with a test that explicitly set sse4.2 support.
This should fix the buildbots.

Original commit message:
[DAGCombiner] Slice a big load in two loads when the element are next to each
other in memory and the target has paired load and performs post-isel loads
combining.

E.g., this optimization will transform something like this:
a = load i64* addr
b = trunc i64 a to i32
c = lshr i64 a, 32
d = trunc i64 c to i32

into:
b = load i32* addr1
d = load i32* addr2
Where addr1 = addr2 +/- sizeof(i32), if the target supports paired load and
performs post-isel loads combining.

One should overload TargetLowering::hasPairedLoad to provide this information.
The default is false.

<rdar://problem/14477220>

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

10 years ago[DAGCombiner] Revert load slicing (r192471), until I figure out why it fails on ubuntu.
Quentin Colombet [Fri, 11 Oct 2013 18:17:17 +0000 (18:17 +0000)]
[DAGCombiner] Revert load slicing (r192471), until I figure out why it fails on ubuntu.

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

10 years agoRevert "Tests: Be less dependent on a specific schedule/regalloc"
Matthias Braun [Fri, 11 Oct 2013 18:09:19 +0000 (18:09 +0000)]
Revert "Tests: Be less dependent on a specific schedule/regalloc"

This reverts r192454

Apparently FileCheck isn't as smart as I though and does not enforce a
topological order between variable defs+uses.

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

10 years ago[DAGCombiner] Slice a big load in two loads when the element are next to each
Quentin Colombet [Fri, 11 Oct 2013 18:01:14 +0000 (18:01 +0000)]
[DAGCombiner] Slice a big load in two loads when the element are next to each
other in memory and the target has paired load and performs post-isel loads
combining.

E.g., this optimization will transform something like this:
 a = load i64* addr
 b = trunc i64 a to i32
 c = lshr i64 a, 32
 d = trunc i64 c to i32

into:
 b = load i32* addr1
 d = load i32* addr2
Where addr1 = addr2 +/- sizeof(i32), if the target supports paired load and
performs post-isel loads combining.

One should overload TargetLowering::hasPairedLoad to provide this information.
The default is false.

<rdar://problem/14477220>

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

10 years agoFix handling of CHECK-DAG inside of CHECK-LABEL.
Rafael Espindola [Fri, 11 Oct 2013 16:48:02 +0000 (16:48 +0000)]
Fix handling of CHECK-DAG inside of CHECK-LABEL.

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

10 years agoBetter info when debugging vectorizer
Renato Golin [Fri, 11 Oct 2013 16:14:39 +0000 (16:14 +0000)]
Better info when debugging vectorizer

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

10 years ago[ARM] Fix FP ABI attributes with no VFP enabled.
Amara Emerson [Fri, 11 Oct 2013 16:03:43 +0000 (16:03 +0000)]
[ARM] Fix FP ABI attributes with no VFP enabled.

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

10 years agofix typo in comment
Matthias Braun [Fri, 11 Oct 2013 15:40:14 +0000 (15:40 +0000)]
fix typo in comment

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

10 years agoTests: Be less dependent on a specific schedule/regalloc
Matthias Braun [Fri, 11 Oct 2013 15:40:12 +0000 (15:40 +0000)]
Tests: Be less dependent on a specific schedule/regalloc

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

10 years agoThis reverts 192447 because of compiler warning generated on darwin build.
Matheus Almeida [Fri, 11 Oct 2013 13:58:32 +0000 (13:58 +0000)]
This reverts 192447 because of compiler warning generated on darwin build.

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

10 years agoThis reverts r192449 because of compiler warning generated on darwin build.
Matheus Almeida [Fri, 11 Oct 2013 13:56:12 +0000 (13:56 +0000)]
This reverts r192449 because of compiler warning generated on darwin build.

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

10 years ago[mips][msa] Direct Object Emission for the majority of the ELM instructions.
Matheus Almeida [Fri, 11 Oct 2013 13:39:49 +0000 (13:39 +0000)]
[mips][msa] Direct Object Emission for the majority of the ELM instructions.

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

10 years ago[mips][msa] Direct Object Emission of INSERT.{B,H,W} instruction.
Matheus Almeida [Fri, 11 Oct 2013 13:29:36 +0000 (13:29 +0000)]
[mips][msa] Direct Object Emission of INSERT.{B,H,W} instruction.

INSERT is the first type of MSA instruction that requires a change to the way MSA registers are parsed.
This happens because MSA registers may be suffixed by an index in the form of an immediate or a
 general purpose register. The changes to parseMSARegs reflect that requirement.

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

10 years ago[mips][msa] Improves robustness of the test by enhancing pattern matching.
Matheus Almeida [Fri, 11 Oct 2013 13:18:01 +0000 (13:18 +0000)]
[mips][msa] Improves robustness of the test by enhancing pattern matching.

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

10 years ago[NVPTX] Switch from StrongPHIElimination to PHIElimination in NVPTXTargetMachine...
Justin Holewinski [Fri, 11 Oct 2013 12:39:39 +0000 (12:39 +0000)]
[NVPTX] Switch from StrongPHIElimination to PHIElimination in NVPTXTargetMachine, and add some missing optimization passes to addOptimizedRegAlloc

Fixes PR17529

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

10 years agoMake AsmPrinter::emitImplicitDef a virtual method so targets can emit custom comments...
Justin Holewinski [Fri, 11 Oct 2013 12:39:36 +0000 (12:39 +0000)]
Make AsmPrinter::emitImplicitDef a virtual method so targets can emit custom comments for implicit defs

For NVPTX, this fixes a crash where the emitImplicitDef implementation was expecting physical registers,
while NVPTX uses virtual registers (with a couple of exceptions).  Now, the implicit def comment will be
emitted as a true PTX register name. Other targets can use this to customize the output of implicit def
comments.

Fixes PR17519

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

10 years ago[ARM] Add a test case for disabled neon/fpu features.
Amara Emerson [Fri, 11 Oct 2013 11:07:00 +0000 (11:07 +0000)]
[ARM] Add a test case for disabled neon/fpu features.

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

10 years ago[mips][msa] Added support for matching maddv.[bhwd], and msubv.[bhwd] from normal...
Daniel Sanders [Fri, 11 Oct 2013 10:50:42 +0000 (10:50 +0000)]
[mips][msa] Added support for matching maddv.[bhwd], and msubv.[bhwd] from normal IR (i.e. not intrinsics)

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

10 years ago[mips][msa] Added support for matching fmsub.[wd] from normal IR (i.e. not intrinsics)
Daniel Sanders [Fri, 11 Oct 2013 10:27:32 +0000 (10:27 +0000)]
[mips][msa] Added support for matching fmsub.[wd] from normal IR (i.e. not intrinsics)

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

10 years agoXCore target fix bug in emitArrayBound() causing segmentation fault
Robert Lytton [Fri, 11 Oct 2013 10:27:13 +0000 (10:27 +0000)]
XCore target fix bug in emitArrayBound() causing segmentation fault

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

10 years agoXCore target does not emit '.hidden' or '.protected' attributes
Robert Lytton [Fri, 11 Oct 2013 10:27:00 +0000 (10:27 +0000)]
XCore target does not emit '.hidden' or '.protected' attributes

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

10 years agoXCore target: fix bug in XCoreLowerThreadLocal.cpp
Robert Lytton [Fri, 11 Oct 2013 10:26:48 +0000 (10:26 +0000)]
XCore target: fix bug in XCoreLowerThreadLocal.cpp

When a ConstantExpr which uses a thread local is part of a PHI node
instruction, the insruction that replaces the ConstantExpr must
be inserted in the predecessor block, in front of the terminator instruction.
If the predecessor block has multiple successors, the edge is first split.

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

10 years agoXCore target: add XCoreTargetLowering::isZExtFree()
Robert Lytton [Fri, 11 Oct 2013 10:26:29 +0000 (10:26 +0000)]
XCore target: add XCoreTargetLowering::isZExtFree()

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

10 years ago[mips][msa] Added support for matching fmadd.[wd] from normal IR (i.e. not intrinsics)
Daniel Sanders [Fri, 11 Oct 2013 10:14:25 +0000 (10:14 +0000)]
[mips][msa] Added support for matching fmadd.[wd] from normal IR (i.e. not intrinsics)

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

10 years ago[mips][msa] Added support for matching ffint_[us].[wd], and ftrunc_[us].[wd] from...
Daniel Sanders [Fri, 11 Oct 2013 10:00:06 +0000 (10:00 +0000)]
[mips][msa] Added support for matching ffint_[us].[wd], and ftrunc_[us].[wd] from normal IR (i.e. not intrinsics)

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

10 years agoRemove another unnecessary filter from the disassembler.
Craig Topper [Fri, 11 Oct 2013 06:59:57 +0000 (06:59 +0000)]
Remove another unnecessary filter from the disassembler.

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

10 years agoLiveRangeCalc.h: Update a description corresponding to r192396. [-Wdocumentation]
NAKAMURA Takumi [Fri, 11 Oct 2013 04:52:03 +0000 (04:52 +0000)]
LiveRangeCalc.h: Update a description corresponding to r192396. [-Wdocumentation]

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