Commit Graph

4897 Commits

Author SHA1 Message Date
NAKAMURA Takumi
902f128141 Relax expressions and add explicit triplets -linux and -win32.
On @foobar(double %d, double* %x),
AMD64: (%xmm0, %rdi)
Win64: (%xmm0, %rdx) (not %rcx!)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126211 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:21:17 +00:00
NAKAMURA Takumi
166b79fb24 Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126210 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:21:08 +00:00
NAKAMURA Takumi
661cae4b58 Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126209 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:21:01 +00:00
NAKAMURA Takumi
db2649995d Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126208 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:20:52 +00:00
NAKAMURA Takumi
20cee65fd1 Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126207 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:20:44 +00:00
NAKAMURA Takumi
5731b5c8ce Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126206 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:20:35 +00:00
NAKAMURA Takumi
22bc92baa4 Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126205 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:20:26 +00:00
NAKAMURA Takumi
ed2ac7c211 Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126204 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:20:18 +00:00
NAKAMURA Takumi
62627126fe Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126203 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:20:10 +00:00
NAKAMURA Takumi
64779f4b87 Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126202 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:20:02 +00:00
NAKAMURA Takumi
9839eb06bd Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126201 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:19:54 +00:00
NAKAMURA Takumi
e51a69c8fd Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126200 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:19:46 +00:00
NAKAMURA Takumi
c3bf772620 Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126199 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:19:37 +00:00
NAKAMURA Takumi
39109a3ce9 Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126198 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:19:28 +00:00
NAKAMURA Takumi
007b2b3c7e Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126197 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:19:20 +00:00
NAKAMURA Takumi
52ae4cac4e Relax expressions and add explicit triplets -linux and -win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126196 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:19:12 +00:00
NAKAMURA Takumi
ba2218ac24 test/CodeGen/X86/vec_cast.ll: Mark as XFAIL: migw,win32 for workaround of PR8311.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126195 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:19:03 +00:00
NAKAMURA Takumi
135c03094f test/CodeGen/X86/red-zone.ll: Add explicit -mtriple=x86_64-linux.
Redzone is not applicable on Win64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126194 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 07:18:55 +00:00
Evan Cheng
af05c69ba0 available_externally (hidden or not) GVs are always accessed via stubs. rdar://9027648.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126191 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 06:58:34 +00:00
Andrew Trick
fcfcdbc86a VirtRegRewriter assertion fix.
Apparently it's ok for multiple operands to "kill" the same register.
Fixes PR9237.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 06:52:56 +00:00
Cameron Zwarich
4ecc82e592 Roll out r126169 and r126170 in an attempt to fix the selfhost bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126185 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 03:24:52 +00:00
Cameron Zwarich
92efda7e91 Merge information about the number of zero, one, and sign bits of live-out registers
at phis. This enables us to eliminate a lot of pointless zexts during the DAGCombine
phase. This fixes <rdar://problem/8760114>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 00:46:27 +00:00
Eric Christopher
f8597eb0d9 Revert r125960, it's breaking darwin10 bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126163 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 23:52:19 +00:00
Devang Patel
68e6beeccc Revert r124611 - "Keep track of incoming argument's location while emitting LiveIns."
In other words, do not keep track of argument's location.  The debugger (gdb) is not prepared to see line table entries for arguments. For the debugger, "second" line table entry marks beginning of function body.
This requires some coordination with debugger to get this working. 
 - The debugger needs to be aware of prolog_end attribute attached with line table entries.
 - The compiler needs to accurately mark prolog_end in line table entries (at -O0 and at -O1+)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126155 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 23:21:26 +00:00
Richard Osborne
d83318450b Add XCore intrinsics for various instructions on ports.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126132 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 18:23:30 +00:00
NAKAMURA Takumi
d64cfe1506 Target/X86/X86FastISel: [PR6275] Fix Win32's dllimport function with fastisel.
"dllimport" function must not be GlobalVariable, but Function. It is enough to check with GlobalValue.
test/CodeGen/X86/dll-linkage.ll is updated to check llc -O0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126110 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 04:50:06 +00:00
Venkatraman Govindaraju
58269b9732 Generate correct Sparc32 ABI compliant code for functions that return a struct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126108 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 03:42:44 +00:00
Cameron Zwarich
8d7285d0e5 The signed version of our "magic number" computation for the integer approximation
of a constant had a minor typo introduced when copying it from the book, which
caused it to favor negative approximations over positive approximations in many
cases. Positive approximations require fewer operations beyond the multiplication.

In the case of division by 3, we still generate code that is a single instruction
larger than GCC's code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126097 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 00:22:02 +00:00
Nick Lewycky
eff5e69c82 Make RecursivelyDeleteDeadPHINode delete a phi node that has no users and add a
test for that. With this change, test/CodeGen/X86/codegen-dce.ll no longer finds
any instructions to DCE, so delete the test.

Also renamed J and JP to I and IP in RecursivelyDeleteDeadPHINode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126088 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 18:05:56 +00:00
Nadav Rotem
ed9b934f65 Fix 9267; Add vector zext support.
The DAGCombiner folds the zext into complex load instructions. This patch
prevents this optimization on vectors since none of the supported targets
knows how to perform load+vector_zext in one instruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126080 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 12:37:50 +00:00
Devang Patel
fe19e3f74c DIE numbers do not add any value in this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126008 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 01:28:37 +00:00
Devang Patel
a778f5c798 Do not lose debug info of an inlined function argument even if the argument is only used through GEPs.
This time with a fix that avoids using invalidated DenseMap iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125984 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:43:42 +00:00
Bill Wendling
5028249fab Reapply r114997 now that the buildbots have been updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125960 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 21:12:58 +00:00
Cameron Zwarich
1646953538 Roll out r125794 to help diagnose the llvm-gcc-i386-linux-selfhost failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:58:10 +00:00
Devang Patel
a4defc00eb Do not lose debug info of an inlined function argument even if the argument is only used through GEPs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 23:33:27 +00:00
NAKAMURA Takumi
6904f05e60 Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 generally.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. In llvm side, i686 and x64 can be treated as similar way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 12:24:17 +00:00
Eric Christopher
169e1552e7 The change for PR9190 wasn't quite right. We need to avoid making the
transformation if we can't legally create a build vector of the correct
type. Check that we can make the transformation first, and add a TODO to
refactor this code with similar cases.

Fixes: PR9223 and rdar://9000350


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125631 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-16 01:10:03 +00:00
Eric Christopher
f621e3b6d6 Add testcase for PR9190.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125630 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-16 01:08:31 +00:00
Devang Patel
d3526eab46 Ignore DBG_VALUE machine instructions while constructing instruction ranges based on location info.
Machine instruction range consisting of only DBG_VALUE MIs only contributes consecutive labels in assembly output, which is harmless, and empty scope entry in DebugInfo, which confuses debugger tools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125577 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 17:56:09 +00:00
Rafael Espindola
5d618ef7f1 Switch llvm to using comdats. For now always use groups with a single
section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125526 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 22:23:49 +00:00
Bob Wilson
56519aac04 PR9139: Specify ARM/Darwin triple for vector-DAGCombine.ll test.
The i64_buildvector test in this file relies on the alignment of i64 and
f64 types being the same, which is true for Darwin but not AAPCS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125525 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 22:12:50 +00:00
Chris Lattner
593051b4e2 fix PR9210 by implementing some type legalization logic for
vector fp conversions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125482 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 06:30:45 +00:00
Chris Lattner
0a9481f44f Enhance ComputeMaskedBits to know that aligned frameindexes
have their low bits set to zero.  This allows us to optimize
out explicit stack alignment code like in stack-align.ll:test4 when
it is redundant.

Doing this causes the code generator to start turning FI+cst into
FI|cst all over the place, which is general goodness (that is the
canonical form) except that various pieces of the code generator
don't handle OR aggressively.  Fix this by introducing a new
SelectionDAG::isBaseWithConstantOffset predicate, and using it
in places that are looking for ADD(X,CST).  The ARM backend in
particular was missing a lot of addressing mode folding opportunities
around OR.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125470 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-13 22:25:43 +00:00
Chris Lattner
915eeb4887 when legalizing extremely wide shifts, make sure that
the shift amounts are in a suitably wide type so that
we don't generate out of range constant shift amounts.

This fixes PR9028.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125458 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-13 09:10:56 +00:00
Chris Lattner
d302773885 fix visitShift to properly zero extend the shift amount if the provided operand
is narrower than the shift register.  Doing an anyext provides undefined bits in
the top part of the register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125457 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-13 09:02:52 +00:00
Venkatraman Govindaraju
cc5bd4a561 Prevent IMPLICIT_DEF/KILL to become a delay filler instruction in SPARC backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125444 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-12 19:02:33 +00:00
Nadav Rotem
609d54ee1e A fix for 9165.
The DAGCombiner created illegal BUILD_VECTOR operations.
The patch added a check that either illegal operations are
allowed or that the created operation is legal.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125435 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-12 14:40:33 +00:00
Nate Begeman
7973f350b7 Implement sdiv & udiv for <4 x i16> and <8 x i8> NEON vector types.
This avoids moving each element to the integer register file and calling __divsi3 etc. on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125402 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 20:53:29 +00:00
Daniel Dunbar
cd3e639fe7 Disable this test for now...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125361 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 02:59:08 +00:00
Evan Cheng
c143dd4f63 Fix buggy fcopysign lowering.
This
define float @foo(float %x, float %y) nounwind readnone {
entry:
  %0 = tail call float @copysignf(float %x, float %y) nounwind readnone
  ret float %0
}

Was compiled to:
    vmov     s0, r1
    bic      r0, r0, #-2147483648
    vmov     s1, r0
    vcmpe.f32    s0, #0
    vmrs         apsr_nzcv, fpscr
    it           lt
    vneglt.f32   s1, s1
    vmov         r0, s1
    bx           lr

This fails to copy the sign of -0.0f because it's lost during the float to int
conversion. Also, it's sub-optimal when the inputs are in GPR registers.

Now it uses integer and + or operations when it's profitable. And it's correct!
    lsrs    r1, r1, #31
    bfi     r0, r1, #31, #1
    bx      lr
rdar://8984306


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125357 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 02:28:55 +00:00