Commit Graph

46889 Commits

Author SHA1 Message Date
Eli Friedman
2790ba8e5a Make the fast-isel code for literal 0.0 a bit shorter/faster, since 0.0 is common. rdar://problem/9303592 .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130338 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 22:41:55 +00:00
Eli Friedman
161b887506 Remove unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130337 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 22:21:02 +00:00
Rafael Espindola
018e38c6dd Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130331 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 21:29:52 +00:00
Kevin Enderby
e23aea28f9 Fix a bug in the case that there is no add or subtract symbol and the offset
value is zero so it does not add a NULL expr operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130330 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 21:02:27 +00:00
Dan Gohman
1d7e818a38 Teach BasicAA about arm.neon.vld1 and vst1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130327 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 20:44:28 +00:00
Devang Patel
0be77dff11 Revert r130178. It turned out to be not the optimal path to emit complex location expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130326 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 20:29:27 +00:00
Evan Cheng
309db7c947 If converter was being too cute. It look for root BBs (which don't have
successors) and use inverse depth first search to traverse the BBs. However
that doesn't work when the CFG has infinite loops. Simply do a linear
traversal of all BBs work just fine.

rdar://9344645


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130324 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 19:32:43 +00:00
Dan Gohman
bddc1ca18a When analyzing functions known to only access argument pointees,
only check arguments with pointer types. Update the documentation
of IntrReadArgMem reflect this.

While here, add support for TBAA tags on intrinsic calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130317 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 18:39:03 +00:00
Andrew Trick
a2a162077c Corrects an old, old typo in a case that doesn't seem to be reached in practice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130316 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 18:17:36 +00:00
Devang Patel
7878f37cf0 Simplify cfg inserts a call to trap when unreachable code is detected. Assign DebugLoc to this new trap instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130315 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 17:59:27 +00:00
Jakob Stoklund Olesen
93e110ba34 Also add <imp-def> operands for defined and dead super-registers when rewriting.
We cannot rely on the <imp-def> operands added by LiveIntervals in all cases as
demonstrated by the test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130313 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 17:42:31 +00:00
Rafael Espindola
ed708f9c1f Factor a bit of code to MCStreamer::EmitLabel. Keep track of the last
non private symbol. This will be use for handling

foo:
  .cfi_startproc
  ...

On OS X where we have to create a foo.eh symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130305 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 15:21:19 +00:00
Duncan Sands
089a246333 Stop trying to have instcombine preserve LCSSA form: this was not
effective in avoiding recomputation of LCSSA form; the widespread
use of instsimplify (which looks through phi nodes) means it was
not preserving LCSSA form anyway; and instcombine is no longer
scheduled in the middle of the loop passes so this doesn't matter
anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130301 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 10:55:12 +00:00
Andrew Trick
104f4adeac Test case and comment for PR9633.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130294 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 05:42:17 +00:00
Eli Friedman
d5089a9794 Refactor out code to fast-isel a memcpy operation with a small constant
length.  (I'm planning to use this to implement byval.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130274 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 01:45:07 +00:00
Rafael Espindola
9266cc400e Force some values to be absolute and align based on the FDE pointers size. A small
step towards using .cfi_* on OS X.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130273 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 01:43:49 +00:00
Eli Friedman
547eb4fd56 Fix an edge case involving branches in fast-isel on x86.
rdar://problem/9303306 .



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 01:34:27 +00:00
Andrew Trick
3f95c88162 Fix for PR9633 [indvars] Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Added a type check in ScalarEvolution::computeSCEVAtScope to handle the case in which operands of an
AddRecExpr in the current scope are folded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 01:21:25 +00:00
Chris Lattner
cb5fd743a9 Enhance memdep to return clobber relation between noalias loads when
an earlier load could be widened to encompass a later load.  For example,
if we see:

  X = load i8* P, align 4
  Y = load i8* (P+3), align 1

and we have a 32-bit native integer type, we can widen the former load
to i32 which then makes the second load redundant.  GVN can't actually
do anything with this load/load relation yet, so this isn't testable, but 
it is the next step to resolving PR6627, and a fairly general class of 
"merge neighboring loads" missed optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130250 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 22:42:01 +00:00
Jakob Stoklund Olesen
9f4b893b84 Add a safe-guard against repeated splitting for some rare cases.
The number of blocks covered by a live range must be strictly decreasing when
splitting, otherwise we can't allow repeated splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130249 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 22:33:12 +00:00
Chris Lattner
d5c7f7cb5e use AA::isMustAlias to simplify some calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130248 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 21:53:34 +00:00
Chris Lattner
130131ea78 remove support for llvm.invariant.end from memdep. It is a
work-in-progress that is not progressing, and it has issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130247 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 21:50:51 +00:00
Evan Cheng
554daa67bd Be careful about scheduling nodes above previous calls. It increase usages of
more callee-saved registers and introduce copies. Only allows it if scheduling
a node above calls would end up lessen register pressure.

Call operands also has added ABI restrictions for register allocation, so be
extra careful with hoisting them above calls.

rdar://9329627


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130245 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 21:31:35 +00:00
Chris Lattner
325eeb1cd7 Transform: "icmp eq (trunc (lshr(X, cst1)), cst" to "icmp (and X, mask), cst"
when X has multiple uses.  This is useful for exposing secondary optimizations,
but the X86 backend isn't ready for this when X has a single use.  For example,
this can disable load folding.

This is inching towards resolving PR6627.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130238 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 20:18:20 +00:00
Chris Lattner
5036ce4a64 some random cleanups, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130237 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 20:02:45 +00:00
Jim Grosbach
f7da8821b4 ARM and Thumb2 support for atomic MIN/MAX/UMIN/UMAX loads.
rdar://9326019


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130234 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 19:44:18 +00:00
Rafael Espindola
fea8fea583 Print the label if we will use it in debug_frame.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130232 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 19:26:53 +00:00
Devang Patel
116da2fbe9 Refactor code. Keep dwarf register operation selection logic at one place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130231 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 19:06:18 +00:00
Jakob Stoklund Olesen
1394e6d925 Use the new TRI->getLargestLegalSuperClass hook to constrain register class inflation.
This has two effects: 1. We never inflate to a larger register class than what
the sub-target can handle. 2. Completely unconstrained virtual registers get the
largest possible register class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130229 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 18:52:36 +00:00
Jakob Stoklund Olesen
c9e5015dec Add a TRI::getLargestLegalSuperClass hook to provide an upper limit on register class inflation.
The hook will be used by the register allocator when recomputing register
classes after removing constraints.

Thumb1 code doesn't allow anything larger than tGPR, and x86 needs to ensure
that the spill size doesn't change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130228 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 18:52:33 +00:00
Devang Patel
7b5bd37241 Fix an off by one error while accessing complex address element of a DIVariable.
This worked untill now because stars are aligned (i.e. num of complex address elments are always 0 or 2+ and when it is 2+ at least two elements are access together)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130225 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 18:24:39 +00:00
Chris Lattner
9750acc079 Improve the bail-out predicate to really only kick in when phi
translation fails.  We were bailing out in some cases that would
cause us to miss GVN'ing some non-local cases away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130206 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 17:41:02 +00:00
Dan Gohman
a61e73bda5 Fast-isel support for simple inline asms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130205 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 17:18:34 +00:00
Duncan Sands
a37caf6472 Another example of a static table that wasn't marked static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 07:30:10 +00:00
Chris Lattner
bffc2b4af1 don't emit the symbol name twice for local bss and common
symbols.  For example, don't emit:
        .comm   _i,4,2                  ## @i
                                        ## @i

instead emit:
        .comm   _i,4,2                  ## @i



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130192 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 06:14:13 +00:00
Evan Cheng
b16d06f88a Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 04:57:37 +00:00
Rafael Espindola
b28d4f152e Print all the moves at a given label instead of just the first one.
Remove previous DwarfCFI hack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130187 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 03:58:56 +00:00
Nick Lewycky
1790c9cbb6 Rename everything to follow LLVM style ... I think.
Add support for switch and indirectbr edges. This works by densely numbering
all blocks which have such terminators, and then separately numbering the
possible successors. The predecessors write down a number, the successor knows
its own number (as a ConstantInt) and sends that and the pointer to the number
the predecessor wrote down to the runtime, who looks up the counter in a
per-function table.

Coverage data should now be functional, but I haven't tested it on anything
other than my 2-file synthetic test program for coverage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130186 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 03:54:16 +00:00
Rafael Espindola
d88cac0a6e No relocation produces a SLEB or ULEB, make sure they are handled in MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130181 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 02:17:58 +00:00
Chris Lattner
1f821512fc Enhance MemDep: When alias analysis returns a partial alias result,
return it as a clobber.  This allows GVN to do smart things.

Enhance GVN to be smart about the case when a small load is clobbered
by a larger overlapping load.  In this case, forward the value.  This
allows us to compile stuff like this:

int test(void *P) {
  int tmp = *(unsigned int*)P;
  return tmp+*((unsigned char*)P+1);
}

into:

_test:                                  ## @test
	movl	(%rdi), %ecx
	movzbl	%ch, %eax
	addl	%ecx, %eax
	ret

which has one load.  We already handled the case where the smaller
load was from a must-aliased base pointer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130180 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 01:21:15 +00:00
Devang Patel
0c99861836 Let dwarf writer allocate extra space in the debug location expression. This space, if requested, will be used for complex addresses of the Blocks' variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130178 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 00:12:46 +00:00
Devang Patel
9341d10f94 Rename a local variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 23:05:21 +00:00
Devang Patel
b865d46d95 Rename a method to match what it really does.
s/addVariableAddress/addFrameVariableAddress/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 23:02:17 +00:00
Devang Patel
80925f5dca Do not drop a variable's complex address if it is not based on frame base.
Observed this while reading code, so I do not have a test case handy here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:52:55 +00:00
Dan Gohman
308bec390f Fix an iterator invalidation bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130166 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:48:29 +00:00
Chris Lattner
607b8ebfb8 mark a large static table static. Pointed out by Michael Ilseman!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130160 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:14:33 +00:00
Chris Lattner
e27c3ea2bc allow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,
patch by Johannes Schaub!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130151 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 20:58:50 +00:00
Chris Lattner
ed0318eab8 add a missed bitfield instcombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130137 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 18:44:26 +00:00
Akira Hatanaka
f48eb533d5 Lower BlockAddress node when relocation-model is static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130131 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 17:10:45 +00:00
Devang Patel
06104e3743 A dbg.declare may not be in entry block, even if it is referring to an incoming argument. However, It is appropriate to emit DBG_VALUE referring to this incoming argument in entry block in MachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130129 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 16:33:52 +00:00
Chandler Carruth
a4a2a03c31 Remove some hard coded CR-LFs. Some of these were the entire files, one of
these was just one line of a file. Explicitly set the eol-style property on the
files to try and ensure this fix stays.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130125 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 07:11:23 +00:00
Duncan Sands
d03bcc1364 Fix comment typo. Noticed by Liu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130120 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 06:21:43 +00:00
Rafael Espindola
e54e785be5 Simplify the logic. Noticed by aKor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130116 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 19:55:34 +00:00
Rafael Espindola
7ed6732447 Synchronize the conditions for producing a .cfi_startproc and a .cfi_endproc.
Fixes PR9787.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130115 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 19:00:34 +00:00
Sebastian Redl
dac4b9267b Fix Target/ARM/Thumb1FrameLowering.h header guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130097 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 15:47:01 +00:00
Sebastian Redl
69ffd7ad14 Give MC/MCDisassembler/Disassembler.h a header guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130096 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 15:46:56 +00:00
Sebastian Redl
6796e4fc88 Give SplitKit.h a header guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130095 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 15:46:51 +00:00
Jay Foad
61717b3d94 Fix an assert to check exactly what it says.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130093 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 14:30:00 +00:00
Jay Foad
685501836b PR9214: Convert the DIBuilder API to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130086 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 10:11:03 +00:00
Jay Foad
ddcdcc8863 Remove unused STL header includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 19:53:52 +00:00
Jay Foad
a0f5092703 Like the coding standards say, do not use "using namespace std".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 09:06:00 +00:00
Benjamin Kramer
20115617d4 Silence an overzealous uninitialized variable warning from GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130053 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 08:21:06 +00:00
Andrew Trick
1c3af779fc Thumb2 and ARM add/subtract with carry fixes.
Fixes Thumb2 ADCS and SBCS lowering: <rdar://problem/9275821>.
t2ADCS/t2SBCS are now pseudo instructions, consistent with ARM, so the
assembly printer correctly prints the 's' suffix.

Fixes Thumb2 adde -> SBC matching to check for live/dead carry flags.

Fixes the internal ARM machine opcode mnemonic for ADCS/SBCS.
Fixes ARM SBC lowering to check for live carry (potential bug).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130048 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 03:55:32 +00:00
Andrew Trick
5adfba283d whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130046 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 03:24:11 +00:00
Owen Anderson
d74ea775af Teach FastISel to deal with instructions that have two immediate operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130033 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 23:38:06 +00:00
Devang Patel
5e06bb83f4 Let front-end tie subprogram declaration with subprogram definition directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130028 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 23:10:17 +00:00
Jakob Stoklund Olesen
200729882a Always compare the cost of region splitting with the cost of per-block splitting.
Sometimes it is better to split per block, and we missed those cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130025 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 22:47:40 +00:00
Chris Lattner
b686af053e Recommit the fix for rdar://9289512 with a couple tweaks to
fix bugs exposed by the gcc dejagnu testsuite:
1. The load may actually be used by a dead instruction, which
   would cause an assert.
2. The load may not be used by the current chain of instructions,
   and we could move it past a side-effecting instruction. Change
   how we process uses to define the problem away.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130018 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 21:59:37 +00:00
Johnny Chen
597fa65373 Disassembly of A8.6.59 LDR (literal) Encoding T1 (16-bit thumb instruction) should
print out ldr, not ldr.n.

rdar://problem/9267772


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130008 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 19:12:43 +00:00
Benjamin Kramer
e7cf062537 DAGCombine: fold "(zext x) == C" into "x == (trunc C)" if the trunc is lossless.
On x86 this allows to fold a load into the cmp, greatly reducing register pressure.
  movzbl	(%rdi), %eax
  cmpl	$47, %eax
->
  cmpb	$47, (%rdi)

This shaves 8k off gcc.o on i386. I'll leave applying the patch in README.txt to Chris :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130005 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 18:47:44 +00:00
Devang Patel
eac0c9dc77 Do not leak argument's DbgVariables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130004 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 18:09:57 +00:00
Devang Patel
0a6ea83f39 Add asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129995 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 16:44:29 +00:00
Benjamin Kramer
b20a8fc8a6 X86: Try to use a smaller encoding by transforming (X << C1) & C2 into (X & (C2 >> C1)) & C1. (Part of PR5039)
This tends to happen a lot with bitfield code generated by clang. A simple example for x86_64 is
uint64_t foo(uint64_t x) { return (x&1) << 42; }
which used to compile into bloated code:
	shlq	$42, %rdi               ## encoding: [0x48,0xc1,0xe7,0x2a]
	movabsq	$4398046511104, %rax    ## encoding: [0x48,0xb8,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00]
	andq	%rdi, %rax              ## encoding: [0x48,0x21,0xf8]
	ret                             ## encoding: [0xc3]

with this patch we can fold the immediate into the and:
	andq	$1, %rdi                ## encoding: [0x48,0x83,0xe7,0x01]
	movq	%rdi, %rax              ## encoding: [0x48,0x89,0xf8]
	shlq	$42, %rax               ## encoding: [0x48,0xc1,0xe0,0x2a]
	ret                             ## encoding: [0xc3]

It's possible to save another byte by using 'andl' instead of 'andq' but I currently see no way of doing
that without making this code even more complicated. See the TODOs in the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129990 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 15:30:40 +00:00
Eric Christopher
f4b2f933a9 Use enums for constant values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129984 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 06:34:01 +00:00
Eric Christopher
9ab1d7f9b2 Make the file format strings a little prettier for mach-o.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129980 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 04:08:58 +00:00
Eric Christopher
860d7e182a Add MachOObjectFile.cpp to cmake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 04:06:24 +00:00
Eric Christopher
ea7e13eded Hook in mach-o object files into Object interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129976 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 03:50:50 +00:00
Eric Christopher
f0c3af637a Add support for 64-bit object files to Path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129975 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 03:50:19 +00:00
Eric Christopher
6256b03674 Add an ObjectFile implementation for mach-o.
Patch by Patrick Walton!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129974 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 03:19:48 +00:00
Eric Christopher
bb498ca5c2 80-col fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129973 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 03:07:06 +00:00
Evan Cheng
db6cbe1ff1 In Thumb2 mode, lower frame indix references to:
add <rd>, sp, #<imm8>
ldr <rd>, [sp, #<imm8>]
When the offset from sp is multiple of 4 and in range of 0-1020.
This saves code size by utilizing 16-bit instructions.

rdar://9321541


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129971 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 01:42:52 +00:00
Evan Cheng
d8a1624122 Typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129970 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 01:40:20 +00:00
Chandler Carruth
add2944559 Delete the other unused variable in this function. Sorry I missed this
the first time through.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 01:29:18 +00:00
Chandler Carruth
32bd250d30 Remove an unused variable from a function. This is a likely cut-paste-o.
Silences GCC warning.

I wonder why Clang doesn't warn on this...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129968 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 01:21:06 +00:00
Bill Wendling
d3dbd5f5cd Branch folding is folding a landing pad into a regular BB.
An exception is thrown via a call to _cxa_throw, which we don't expect to
return. Therefore, the "true" part of the invoke goes to a BB that has
'unreachable' as its only instruction. This is lowered into an empty MachineBB.
The landing pad for this invoke, however, is directly after the "true" MBB.
When the empty MBB is removed, the landing pad is directly below the BB with the
invoke call. The unconditional branch is removed and then the two blocks are
merged together.

The testcase is too big for a regression test.
<rdar://problem/9305728>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129965 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 01:07:09 +00:00
Rafael Espindola
abf9af60ad Compute the size of the FDE encoding instead of hard coding it. Update
X8664_ELFTargetObjectFile::getFDEEncoding to match reality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 00:08:43 +00:00
Rafael Espindola
e8cfbd843d Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129955 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 23:39:26 +00:00
Rafael Espindola
eccbad78e0 Don't pass address spaces to EmitULEB128IntValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 23:26:40 +00:00
Devang Patel
71f3f1146f Fix DWARF description of Q registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129952 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 23:22:35 +00:00
Devang Patel
27f5acb7d4 Fix DWARF description of S registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129947 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 22:48:26 +00:00
Devang Patel
06161fcdd6 Add DW_OP_bit_piece.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129945 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 22:26:13 +00:00
Devang Patel
acc381bee9 Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129938 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 21:07:35 +00:00
Jay Foad
ec9186bcf9 PR9214: Convert Metadata API to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129932 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 19:59:31 +00:00
Matt Beaumont-Gay
ae5fbeec23 Don't recycle loop variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129928 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 19:46:23 +00:00
Jakob Stoklund Olesen
5928046306 Allow allocatable ranges from global live range splitting to be split again.
These intervals are allocatable immediately after splitting, but they may be
evicted because of later splitting. This is rare, but when it happens they
should be split again.

The remainder intervals that cannot be allocated after splitting still move
directly to spilling.

SplitEditor::finish can optionally provide a mapping from new live intervals
back to the original interval indexes returned by openIntv().

Each original interval index can map to multiple new intervals after connected
components have been separated. Dead code elimination may also add existing
intervals to the list.

The reverse mapping allows the SplitEditor client to treat the new intervals
differently depending on the split region they came from.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129925 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 18:38:15 +00:00
Rafael Espindola
1ac7fe0f4d Fix relative relocations. This is sufficient for running the rust testsuite with
MC :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129923 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 18:36:50 +00:00
Devang Patel
64d3d12f37 As per ARM docs, register Dx is described as DW_OP_regx(256+x) in DWARF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129922 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 17:51:06 +00:00
Devang Patel
2c4b4b195f Add comment in output stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129921 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 17:50:24 +00:00
Daniel Dunbar
63c21deee1 Revert r1296656, "Fix rdar://9289512 - not folding load into compare at -O0...",
which broke a couple GCC test suite tests at -O0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129914 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 16:14:46 +00:00
Justin Holewinski
326fb9d1fb PTX: Expand useable register space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129913 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 16:08:02 +00:00
Che-Liang Chiou
5efde18dd2 ptx: fix parameter ordering
This patch depends on the prior fix r129908 that changes to use std::find,
rather than std::binary_search, on unordered array.

Patch by Dan Bailey


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129909 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 10:56:58 +00:00
Che-Liang Chiou
4a17cad900 ptx: PTXMachineFunctionInfo no longer sort registers and so should not use std::binary_search
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129908 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 10:16:20 +00:00
Nick Lewycky
a4c4c0e129 In gcov profiling, give all functions an extra unified return block. This is
necessary since gcov counts transitions between blocks. It can't see if you've
run every line in a straight-line function, so we add an edge for it to notice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129905 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 03:18:00 +00:00
Nick Lewycky
17df2c3240 Fix think-o: emit all 8 bytes of the EOF marker. Also reflow a line in a
comment for 80 columns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129904 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 02:48:39 +00:00
Nick Lewycky
a61e52c9b7 Add independent controls for whether GCOV profiling should emit .gcno files or
instrument the program to emit .gcda.
TODO: we should emit slightly different .gcda files when .gcno emission is off.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129903 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 01:56:25 +00:00
Nick Lewycky
8c6d196210 Structs have elements not parameters. I'm surprised this ever compiled...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129888 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 22:52:37 +00:00
Evan Cheng
c8578948c9 Remove -use-divmod-libcall. Let targets opt in when they are available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129884 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 22:20:12 +00:00
Jakob Stoklund Olesen
3b7d917dec Add debug output for rematerializable instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129883 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 22:14:20 +00:00
Jakob Stoklund Olesen
08c5a347a0 Permit remat when a virtual register has multiple defs.
TII::isTriviallyReMaterializable() shouldn't depend on any properties of the
register being defined by the instruction. Rematerialization is going to create
a new virtual register anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129882 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 22:14:17 +00:00
Cameron Zwarich
344731c018 Fix another case of <rdar://problem/9184212> that only occurs with code
generated by llvm-gcc, since llvm-gcc uses 2 i64s for passing a 4 x float
vector on ARM rather than an i64 array like Clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129878 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 21:48:38 +00:00
Cameron Zwarich
c5c43b958c The bitcast case here is actually handled uniformly earlier in the function, so
delete it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129877 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 21:48:34 +00:00
Cameron Zwarich
5fc1282c18 Cleanup some code to better use an early return style in preparation for adding
more cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129876 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 21:48:16 +00:00
Eli Friedman
e5ff344fc0 Revert r129846; it's breaking a buildbot. See
http://google1.osuosl.org:8011/builders/llvm-x86_64-linux-checks/builds/825/steps/test.llvm.stage2/logs/st.ll



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129869 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 19:00:08 +00:00
Jakob Stoklund Olesen
6bfba2e5af Prefer cheap registers for busy live ranges.
On the x86-64 and thumb2 targets, some registers are more expensive to encode
than others in the same register class.

Add a CostPerUse field to the TableGen register description, and make it
available from TRI->getCostPerUse. This represents the cost of a REX prefix or a
32-bit instruction encoding required by choosing a high register.

Teach the greedy register allocator to prefer cheap registers for busy live
ranges (as indicated by spill weight).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129864 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 18:19:48 +00:00
Stuart Hastings
e341e8ce1a Excise unintended hunk in 129858. <rdar://problem/7662569>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129862 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 18:09:26 +00:00
Stuart Hastings
c73158730d ARM byval support. Will be enabled by another patch to the FE. <rdar://problem/7662569>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129858 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 16:47:52 +00:00
Daniel Dunbar
88c924c67e sys/Host: Change getHostTriple() to return the full Darwin version on OS X.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 15:44:33 +00:00
Justin Holewinski
e1fee48cd0 PTX: Add intrinsics to list of built-in intrinsics, which allows them to be
used by Clang.  To help Clang integration, the PTX target has been split
     into two targets: ptx32 and ptx64, depending on the desired pointer size.

- Add GCCBuiltin class to all intrinsics
- Split PTX target into ptx32 and ptx64

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129851 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 15:37:17 +00:00
Rafael Espindola
3660a847f1 Behave like gnu as when a relocation crosses sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129850 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 14:01:45 +00:00
Che-Liang Chiou
b32204cd16 ptx: add integer div and rem instruction
Patched by Dan Bailey


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129848 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 09:28:55 +00:00
Che-Liang Chiou
1e93249199 ptx: add floating-point comparison to setp
Patched by Dan Bailey


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129847 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 09:28:20 +00:00
Che-Liang Chiou
2a2dbd03a4 ptx: fix parameter ordering
Patched by Dan Bailey


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129846 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 09:27:19 +00:00
Nick Lewycky
52a83995d6 This should always be signed chars, so use int8_t. This fixes a miscompile when
llvm is built with unsigned chars where an immediate such as 0xff would be zero
extended to 64-bits, turning "cmp $0xff,%eax" into
"cmp $0xffffffffffffffff,%eax".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129845 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 03:19:42 +00:00
Rafael Espindola
4788c3e839 Remove unused arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129844 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 03:08:09 +00:00
Eric Christopher
abbbfbd672 Rewrite the expander for umulo/smulo to remember to sign extend the input
manually and pass all (now) 4 arguments to the mul libcall. Add a new
ExpandLibCall for just this (copied gratuitously from type legalization).

Fixes rdar://9292577


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129842 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 01:19:45 +00:00
Sean Callanan
863f84648f Made the MC disassembler check before accessing
MCInst operands for ARM.  This allows it to be
more tolerant of malformed MCInsts or incorrect
instruction metadata.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129840 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 00:43:34 +00:00
Daniel Dunbar
558692fd0a ADT/Triple: Renambe isOSX... methods to isMacOSX for consistency with the OS
triple component.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129838 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 00:14:25 +00:00
Johnny Chen
4aaf3465f7 Fix typo in the comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129837 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 23:58:52 +00:00
Daniel Dunbar
398a5ca9cd ADT/Triple: Drop support for -osx style triples, we are going with -macosx
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129836 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 23:55:20 +00:00
Daniel Dunbar
1af394766f ADT/Triple: Add support for Triple::MacOSX per feedback from Chris, will remove
Triple::OSX once Clang has moved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129833 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 23:34:12 +00:00
Daniel Dunbar
912225e185 ADT/Triple: Move a variety of clients to using isOSDarwin() and isOSWindows()
predicates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129816 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 21:14:45 +00:00
Daniel Dunbar
e1fe09f682 ADT/Triple: Add isOSDarwin() and isOSWindows() helper functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 21:12:05 +00:00
Daniel Dunbar
e8ba52d639 ADT/Triple: Fix Triple::getArchNameForAssembler to support OSX and iOS
enumeration values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129814 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 21:07:03 +00:00
Daniel Dunbar
2cf711f1e6 Target/X86: Eliminate uses of getDarwinVers().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129813 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 21:04:12 +00:00
Daniel Dunbar
24cfd06d03 Target/X86: Add getTargetTriple() accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129812 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 21:01:47 +00:00
Daniel Dunbar
18a0929a7a Target/PPC: Kill off DarwinVers, which is now dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129811 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:59:24 +00:00
Daniel Dunbar
14e2a90b7b Target/PPC: Eliminate a use of getDarwinVers().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129810 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:57:03 +00:00
Daniel Dunbar
869eca129b Target/PPC: Add a TargetTriple field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129809 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:54:28 +00:00
Daniel Dunbar
13fb3b5706 Target: Eliminate a use of getDarwinMajorNumber().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129803 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:44:08 +00:00
Daniel Dunbar
ebc5066b9b CodeGen: Eliminate a use of getDarwinMajorNumber().
- There is a minor semantic change here (evidenced by the test change) for
   Darwin triples that have no version component. I debated changing the default
   behavior of isOSVersionLT, but decided it made more sense for triples to be
   explicit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129802 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:32:39 +00:00
Daniel Dunbar
087d6a59ad ADT/Triple: Generalize and simplify getDarwinNumber to just be getOSVersion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:24:34 +00:00
Daniel Dunbar
0dde4c00ee ADT/Triple: Add support for more explicit "osx" and "ios" OS names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129798 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:19:27 +00:00
Stuart Hastings
567cac0c51 Delete unnecessary variable. <rdar://problem/7662569>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:09:38 +00:00
Eric Christopher
2cc4013853 Remove some duplicate op action entries and reorganize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129781 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 18:49:19 +00:00
Bob Wilson
84c5eed15b This patch combines several changes from Evan Cheng for rdar://8659675.
Making use of VFP / NEON floating point multiply-accumulate / subtraction is
difficult on current ARM implementations for a few reasons.
1. Even though a single vmla has latency that is one cycle shorter than a pair
   of vmul + vadd, a RAW hazard during the first (4? on Cortex-a8) can cause
   additional pipeline stall. So it's frequently better to single codegen
   vmul + vadd.
2. A vmla folowed by a vmul, vmadd, or vsub causes the second fp instruction to
   stall for 4 cycles. We need to schedule them apart.
3. A vmla followed vmla is a special case. Obvious issuing back to back RAW
   vmla + vmla is very bad. But this isn't ideal either:
     vmul
     vadd
     vmla
   Instead, we want to expand the second vmla:
     vmla
     vmul
     vadd
   Even with the 4 cycle vmul stall, the second sequence is still 2 cycles
   faster.

Up to now, isel simply avoid codegen'ing fp vmla / vmls. This works well enough
but it isn't the optimial solution. This patch attempts to make it possible to
use vmla / vmls in cases where it is profitable.

A. Add missing isel predicates which cause vmla to be codegen'ed.
B. Make sure the fmul in (fadd (fmul)) has a single use. We don't want to
   compute a fmul and a fmla.
C. Add additional isel checks for vmla, avoid cases where vmla is feeding into
   fp instructions (except for the #3 exceptional case).
D. Add ARM hazard recognizer to model the vmla / vmls hazards.
E. Add a special pre-regalloc case to expand vmla / vmls when it's likely the
   vmla / vmls will trigger one of the special hazards.

Enable these fp vmlx codegen changes for Cortex-A9.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129775 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 18:11:57 +00:00
Bob Wilson
cd70496ad1 Add -mcpu=cortex-a9-mp. It's cortex-a9 with MP extension. rdar://8648637.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129774 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 18:11:52 +00:00
Bob Wilson
5dde893c2b Avoid some 's' 16-bit instruction which partially update CPSR
(and add false dependency) when it isn't dependent on last CPSR defining
instruction. rdar://8928208

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129773 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 18:11:49 +00:00
Bob Wilson
f6a4d3c2f3 Avoid write-after-write issue hazards for Cortex-A9.
Add a avoidWriteAfterWrite() target hook to identify register classes that
suffer from write-after-write hazards. For those register classes, try to avoid
writing the same register in two consecutive instructions.

This is currently disabled by default.  We should not spill to avoid hazards!
The command line flag -avoid-waw-hazard can be used to enable waw avoidance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129772 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 18:11:45 +00:00
Bob Wilson
b34d837397 Some single-precision VFP instructions can execute in either the VPF or Neon
pipelines, at least on Cortex-A9.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129771 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 18:11:38 +00:00
Bob Wilson
11334dbd66 Improvements for the Cortex-A9 scheduling itineraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129770 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 18:11:36 +00:00