Commit Graph

64128 Commits

Author SHA1 Message Date
Benjamin Kramer
4ba1b3074b MCELF: Fix a thinko of mine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 18:12:04 +00:00
Bob Wilson
3b7bbfd36c Fix comment typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112202 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 18:08:11 +00:00
Devang Patel
767b5b6227 Fix prototypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112200 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 17:47:45 +00:00
Owen Anderson
62efd3b385 Make JumpThreading smart enough to properly thread StrSwitch when it's compiled with clang++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112198 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 17:40:24 +00:00
Benjamin Kramer
63d37b9322 MCELF: Compensate for the addend on i386. Patch by Roman Divacky, with some cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112197 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 17:23:02 +00:00
Jim Grosbach
9f134b5713 Restrict the register to tGPR to make sure the str instruction will be
encodable as a 16-bit wide instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 17:02:47 +00:00
Dan Gohman
4b7dff9a79 Revert r112176; it broke test/CodeGen/Thumb2/thumb2-cmn.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 15:50:25 +00:00
Dan Gohman
6cb8c23db1 Reapply r112091 and r111922, support for metadata linking, with a
fix: add a flag to MapValue and friends which indicates whether
any module-level mappings are being made. In the common case of
inlining, no module-level mappings are needed, so MapValue doesn't
need to examine non-function-local metadata, which can be very
expensive in the case of a large module with really deep metadata
(e.g. a large C++ program compiled with -g).

This flag is a little awkward; perhaps eventually it can be moved
into the ClonedCodeInfo class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 15:41:53 +00:00
Benjamin Kramer
837bccd052 StringRef::compare_numeric also differed from StringRef::compare for characters > 127.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 15:25:35 +00:00
Benjamin Kramer
0043e35b82 Do unsigned char comparisons in StringRef::compare_lower to be more consistent with compare in corner cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112185 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 14:21:08 +00:00
Bill Wendling
01b1e1c958 There seems to be a (potential) hardware bug with the CMN instruction and
comparison with 0. These two pieces of code should give identical results:

  rsbs r1, r1, 0
  cmp  r0, r1
  mov  r0, #0
  it   ls
  mov  r0, #1

and:

  cmn  r0, r1
  mov  r0, #0
  it   ls
  mov  r0, #1

However, the CMN gives the *opposite* result when r1 is 0. This is because the
carry flag is set in the CMP case but not in the CMN case. In short, the CMP
instruction doesn't perform a truncate of the (logical) NOT of 0 plus the value
of r0 and the carry bit (because the "carry bit" parameter to AddWithCarry is
defined as 1 in this case, the carry flag will always be set when r0 >= 0). The
CMN instruction doesn't perform a NOT of 0 so there is never a "carry" when this
AddWithCarry is performed (because the "carry bit" parameter to AddWithCarry is
defined as 0).

The AddWithCarry in the CMP case seems to be relying upon the identity:

  ~x + 1 = -x

However when x is 0 and unsigned, this doesn't hold:

   x = 0
  ~x = 0xFFFF FFFF
  ~x + 1 = 0x1 0000 0000
  (-x = 0) != (0x1 0000 0000 = ~x + 1)

Therefore, we should disable *all* versions of CMN, especially when comparing
against zero, until we can limit when the CMN instruction is used (when we know
that the RHS is not 0) or when we have a hardware fix for this.

(See the ARM docs for the "AddWithCarry" pseudo-code.)

This is related to <rdar://problem/7569620>.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 09:07:33 +00:00
Chris Lattner
341fa09a3c Add a hackaround for PR7993 which is causing failures on x86 builders that lack sse2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 06:57:07 +00:00
Chris Lattner
4bbdb4c78c I think enough general codegen bugs are fixed to allow this to work
on random hosts, lets see!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 05:52:42 +00:00
Chris Lattner
8306968c14 implement SplitVecOp_CONCAT_VECTORS, fixing the included testcase with SSE1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 05:51:22 +00:00
Bob Wilson
70e48b23a3 Use pseudo instructions for VST1d64Q.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 05:33:30 +00:00
Chris Lattner
8de3bdb16a Make sure this forces the x86 targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 05:25:05 +00:00
Chris Lattner
97a2a56f43 fix sse1 only codegen in x86-64 mode, which is something we
apparently try to support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112168 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 05:24:29 +00:00
Daniel Dunbar
076137c424 Revert r111922, "MapValue support for MDNodes. This is similar to r109117,
except ...", it is causing *massive* performance regressions when building Clang
with itself (-O3 -g).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 03:48:11 +00:00
Daniel Dunbar
fd406f1ee2 Revert r112091, "Remap metadata attached to instructions when remapping
individual ...", which depends on r111922, which I am reverting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 03:48:08 +00:00
Chris Lattner
6dabd9dba0 zap dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 02:57:35 +00:00
Oscar Fuentes
4d2d099e27 Updated CMake library dependencies. Removed unnecessary component name
from llvm-link/CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 02:29:53 +00:00
John McCall
4672f0f61c SmallVector's growth policies don't like starting from zero capacity.
I think there are good reasons to change this, but in the interests
of short-term stability, make SmallVector<...,0> reserve non-zero
capacity in its constructors.  This means that SmallVector<...,0>
uses more memory than SmallVector<...,1> and should really only be
used (unless/until this workaround is removed) by clients that
care about using SmallVector with an incomplete type.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 02:11:48 +00:00
Chris Lattner
f88c23597a remove dead proto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 01:14:37 +00:00
Chris Lattner
2a36545176 zap dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 01:13:54 +00:00
Bruno Cardoso Lopes
e943c15621 Fix PR7748 without using microsoft extensions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 01:02:53 +00:00
Jim Grosbach
ae47c6d69e Enable pre-RA virtual frame base register allocation. rdar://8277890
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112127 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 00:58:06 +00:00
Dan Gohman
b4e3cda118 Rewrite ExtractGV, removing a bunch of stuff that didn't fully work,
and was over-complicated, and replacing it with a simple implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 00:22:55 +00:00
Bob Wilson
2ac124c561 Revert svn 107892 (with changes to work with trunk). It caused a crash if
a VLD result was not used (Radar 8355607).  It should also fix pr7988, but
I haven't verified that yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 00:13:36 +00:00
Chris Lattner
c87a6d4fb0 temporarily disable this, which started failing on the llvm-i686-linux
builder.  I will investigate tonight.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 23:43:14 +00:00
Dan Gohman
44f95335dd Convert llvm-extract to use lazy loading. This makes it substantially
faster on large modules.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 23:33:07 +00:00
Chris Lattner
1a68958d3d we should pattern match the SSE complex arithmetic ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 23:31:42 +00:00
Bob Wilson
709d59255a Start converting NEON load/stores to use pseudo instructions, beginning here
with the VST4 instructions.  Until after register allocation, we want to
represent sets of adjacent registers by a single super-register.  These
VST4 pseudo instructions have a single QQ or QQQQ source register operand.
They get expanded to the real VST4 instructions with 4 separate D register
operands.  Once this conversion is complete, we'll be able to remove the
NEONPreAllocPass and avoid some fragile and hacky code elsewhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 23:27:42 +00:00
John McCall
5b5f7260a0 Provide an explicit specialization of SmallVector at N=0 which does
not require its type argument to be complete if no members are
actually used.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 23:11:24 +00:00
Chris Lattner
cd11e9db35 add a specialization for the MVT form of getTypeAction, since it is
trivial.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 23:05:45 +00:00
Chris Lattner
aafe626c7f remove some llvmcontext arguments that are now dead post-refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 23:00:45 +00:00
Chris Lattner
e6f7c267df Change handling of illegal vector types to widen when possible instead of
expanding: e.g. <2 x float> -> <4 x float> instead of -> 2 floats.  This
affects two places in the code: handling cross block values and handling
function return and arguments.  Since vectors are already widened by 
legalizetypes, this gives us much better code and unblocks x86-64 abi
and SPU abi work.

For example, this (which is a silly example of a cross-block value):
define <4 x float> @test2(<4 x float> %A) nounwind {
 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
 %C = fadd <2 x float> %B, %B
  br label %BB
BB:
 %D = fadd <2 x float> %C, %C
 %E = shufflevector <2 x float> %D, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
 ret <4 x float> %E
}

Now compiles into:

_test2:                                 ## @test2
## BB#0:
 addps %xmm0, %xmm0
 addps %xmm0, %xmm0
 ret

previously it compiled into:

_test2:                                 ## @test2
## BB#0:
 addps %xmm0, %xmm0
 pshufd $1, %xmm0, %xmm1
                                        ## kill: XMM0<def> XMM0<kill> XMM0<def>
 insertps $0, %xmm0, %xmm0
 insertps $16, %xmm1, %xmm0
 addps %xmm0, %xmm0
 ret

This implements rdar://8230384



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 22:49:25 +00:00
Chris Lattner
e6e0018d3e tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 22:45:53 +00:00
Dan Gohman
ce934260dc Remap metadata attached to instructions when remapping individual
instructions, not when remapping modules.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 21:36:50 +00:00
Bruno Cardoso Lopes
3e60a232c1 Revert this for now, PUNPCKLDQ dont operate on v4f32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 21:26:37 +00:00
Daniel Dunbar
3d6e4c3111 X86: Fix misencode of RI64mi8. This fixes OpenSSL / x86_64-apple-darwin10 / clang -O3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 21:11:02 +00:00
Devang Patel
ab43add695 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:41:24 +00:00
Devang Patel
78a06e50b7 Remove dead argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:39:26 +00:00
Jim Grosbach
c52b3cced8 Add some statistics for PEI register scavenging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:34:28 +00:00
Dan Gohman
064ff3e435 Add a FIXME comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:23:38 +00:00
Dan Gohman
698138384e Fix the bitcode reader to clear out function-specific state
from MDValueList between each function, now that the bitcode
writer is reusing the index space for function-local metadata.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:22:53 +00:00
Dan Gohman
56e2a57744 Fix a bug found by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:20:21 +00:00
Dan Gohman
6b9cb84f8c Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:17:19 +00:00
Benjamin Kramer
7b83c26051 MCELF: Use precomputed symbol indices, patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:09:43 +00:00
Eric Christopher
2177a04e24 Fix header define to reflect the name of the file.
Patch by Adam Treat!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 19:28:39 +00:00
Michael J. Spencer
bf252bef67 MC: Fix inconsistant naming in COFF object writer. Patch by Cameron Esfahani.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112076 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 19:27:27 +00:00