Commit Graph

47213 Commits

Author SHA1 Message Date
David Chisnall
b2a00dca1b Second pass at allowing plugins to modify default passes. This time without bonus inter-library dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131556 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 19:00:41 +00:00
Evan Cheng
b936e3006f Revise r131553. Just use the type of the input node and forgo the bitcast. rdar://9449159.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131555 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 18:59:17 +00:00
Evan Cheng
d48fda46f5 Fix an ARMTargetLowering::LowerSELECT bug: legalized result must have same type as input. Sorry test cases only trigger when dag combine is disabled. rdar://9449178
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131553 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 18:47:27 +00:00
Devang Patel
d3372b85e6 Use IRBuilder while simplifying terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131552 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 18:43:31 +00:00
Devang Patel
a23812cfbd Use IRBuilder while simplifying unconditional branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131551 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 18:28:48 +00:00
Devang Patel
f60364de44 Use IRBuilder while folding two entry PHINode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131548 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 18:16:44 +00:00
Eli Friedman
976e7e1cc8 Switch more inst insertion in instcombine to IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131547 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 18:10:28 +00:00
Devang Patel
3e410c6607 Set up IRBuilder for use during simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131545 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 18:01:27 +00:00
Eli Friedman
1eca76a611 Switch more inst insertion in instcombine to IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131544 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 17:58:37 +00:00
Matt Beaumont-Gay
f88ad9aeee fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131543 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 17:37:10 +00:00
Eli Friedman
e87ca454ba Switch inst insertion in instcombine transform to IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131542 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 17:31:55 +00:00
Devang Patel
62fb3556ea Use IRBuiler while constant folding terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131541 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 17:26:46 +00:00
Stuart Hastings
d116611e0a Fix inelegant initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131538 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 15:54:26 +00:00
Justin Holewinski
657d1bed23 PTX: add flag to disable mad/fma selection
Patch by Dan Bailey

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131537 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 15:42:23 +00:00
Duncan Sands
d6dde76090 Revert commit 131534 since it seems to have broken several buildbots.
Original log entry:
Refactor getActionType and getTypeToTransformTo ; place all of the 'decision'
code in one place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131536 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 14:57:56 +00:00
Nadav Rotem
fe3f5d7538 Refactor getActionType and getTypeToTransformTo ; place all of the 'decision'
code in one place.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131534 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 12:26:38 +00:00
Duncan Sands
7016ec1a45 Now that SrcBits and DestBits always represent the primitive size, rather
than either the primitive size or the element primitive size (in the case
of vectors), simplify the vector logic.  No functionality change.  There
is some distracting churn in the patch because I lined up comments better
while there - sorry about that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131533 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 10:59:25 +00:00
Duncan Sands
bb1695e333 Tighten up checking of the validity of casts. (1) The IR parser would
happily accept things like "sext <2 x i32> to <999 x i64>".  It would
also accept "sext <2 x i32> to i64", though the verifier would catch
that later.  Fixed by having castIsValid check that vector lengths match
except when doing a bitcast.  (2) When creating a cast instruction, check
that the cast is valid (this was already done when creating constexpr
casts).  While there, replace getScalarSizeInBits (used to allow more
vector casts) with getPrimitiveSizeInBits in getCastOpcode and isCastable
since vector to vector casts are now handled explicitly by passing to the
element types; i.e. this bit should result in no functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131532 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 09:21:57 +00:00
Duncan Sands
117feba971 Teach getCastOpcode about element-by-element vector casts. For example, "trunc"
can be used to turn a <4 x i64> into a <4 x i32> but getCastOpcode would assert
if you passed these types to it.  Note that this strictly extends the previous
functionality: if getCastOpcode previously accepted two vector types (i.e. didn't
assert) then it still will and returns the same opcode (BitCast).  That's because
before it would only accept vectors with the same bitwidth, and the new code only
touches vectors with the same length.  However if two vectors have both the same
bitwidth and the same length then their element types have the same bitwidth, so
the new logic will return BitCast as before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131530 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 07:13:41 +00:00
Tanya Lattner
2a8eb722c7 In r131488 I misunderstood how VREV works. It splits the vector in half and splits each half. Therefore, the real problem was that we were using a VREV64 for a 4xi16, when we should have been using a VREV32.
Updated test case and reverted change to the PerfectShuffle Table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131529 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 06:42:21 +00:00
Charles Davis
0e30f02f44 Implement the Win64 EH directive methods for the assembly language streamer.
GAS has no such directives (not even mingw-w64 GAS has them), so I took
creative license with their names in assembly. I prefixed them all with
"w64_" to avoid namespace collisions, for example. If I discover that GAS
has taken a different approach, I'll change ours to match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131525 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 04:58:05 +00:00
Jakob Stoklund Olesen
54f0d1e021 Eliminate dead dead code elimination code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131524 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 04:51:15 +00:00
Jakob Stoklund Olesen
c6b9ebdd64 Also use shrinkToUses after AdjustCopiesBackFrom().
The 'last use' may not be in the same basic block, and we still want a correct
live range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131523 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 04:51:12 +00:00
Charles Davis
9c77398d1c While thinking about how to know where the functions' boundaries are for
the purposes of the Win64 EH tables, I realized we had no way to tell where
the function ends. (MASM bounds functions with PROC and ENDP keywords.)
Add a directive to delimit the end of the function, and rename the 'frame'
directive to more accurately reflect its duality with the new directive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131522 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 04:47:22 +00:00
Jakob Stoklund Olesen
fc2fcb4165 Properly shrink live ranges after deleting dead copies. Clean up after all joined copies.
LiveInterval::shrinkToUses recomputes the live range from scratch instead of
removing snippets. This should avoid the problem with dangling live ranges.

Leave physreg identity copies alone. They can be created when joining a virtreg
with a physreg. They don't affect register allocation, and they will be removed
by the rewriter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131521 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 04:18:19 +00:00
Cameron Zwarich
141ec63962 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131519 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 02:29:50 +00:00
Cameron Zwarich
7d336c0c68 Fix more of PR8825 by correctly using rGPR registers when lowering atomic
compare-and-swap intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131518 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 02:20:07 +00:00
Eli Friedman
ef819d0ed8 Start trying to make InstCombine preserve more debug info. The idea here is to set the debug location on the IRBuilder, which will be then right location in most cases. This should magically give many transformations debug locations, and fixing places which are missing a debug location will usually just means changing the code creating it to use the IRBuilder.
As an example, the change to InstCombineCalls catches a common case where a call to a bitcast of a function is rewritten.

Chris, does this approach look reasonable?



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131516 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 01:28:27 +00:00
Eli Friedman
3e22cb9ec3 Use ReplaceInstUsesWith instead of replaceAllUsesWith where appropriate in instcombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131512 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 00:32:01 +00:00
Devang Patel
d80e8ed2fa Preseve line numbers while simplifying CFG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131508 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 23:29:05 +00:00
Cameron Zwarich
d6ffcd88ba Actually, the address operand of the Thumb2 LDREX / STREX instructions *can*
take r13, so we can just make it a GPR. This fixes PR8825.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131507 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 23:26:20 +00:00
Cameron Zwarich
3c60ff4f3d Correct a minor problem with the Thumb2 LDREX and STREX instruction encodings. They
were marked as taking a tGPR when in reality they take an rGPR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131506 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 23:11:12 +00:00
Bill Wendling
f5c95b889f Conditionalize the format of the GCOV files by target type. Darwin uses the 4.2
format.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131503 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 23:05:13 +00:00
Eli Friedman
9c4dae6b0b Make fast-isel miss counting in -stats and -fast-isel-verbose take terminators into account; since there are many fewer isel misses with recent changes, misses caused by terminators are more significant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131502 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 23:02:10 +00:00
Dan Gohman
1b32896bd2 Misc. code cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131497 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 22:22:52 +00:00
Dan Gohman
71dc7c9d89 Misc. code cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131495 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 22:20:36 +00:00
Stuart Hastings
ca1ef48585 X86 pmovsx/pmovzx ignore the upper half of their inputs.
rdar://problem/6945110


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131493 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 22:13:31 +00:00
Tanya Lattner
c81c9709ef vrev is incorrectly defined in the perfect shuffle table. The ordering is backwards (should be 0x3210 versus 0x1032) which exposed a bug when doing a shuffle on a 4xi16. I've attached a test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131488 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 20:48:40 +00:00
Devang Patel
de98568bf8 Preserve line number information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131482 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 20:00:02 +00:00
Devang Patel
d9b4996637 Set debug loc for new load instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131481 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 19:43:38 +00:00
Devang Patel
c9ea771cb8 Preserve line number information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131480 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 19:43:06 +00:00
Mon P Wang
fee22869ca Enable autodetect of popcnt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131476 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 18:33:37 +00:00
Eli Friedman
19515b4e52 Add x86 fast-isel for calls returning first-class aggregates. rdar://9435872.
This is r131438 with a couple small fixes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131474 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 18:29:03 +00:00
Eli Friedman
b8e0d3412c Clean up the mess created by r131467+r131469.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131471 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 18:02:22 +00:00
Stuart Hastings
6db2c2fe21 Revert 131467 due to buildbot complaint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131469 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 16:59:46 +00:00
Stuart Hastings
504421e327 Fix an obscure issue in X86_64 parameter passing: if a tiny byval is
passed as the fifth parameter, insure it's passed correctly (in R9).
rdar://problem/6920088


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131467 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 16:45:55 +00:00
Jakob Stoklund Olesen
6e3b3e2122 Tweak cross-class coalescing to be more aggressive when the target class is small.
The greedy register allocator has live range splitting and register class
inflation, so it can actually fully undo this join, including restoring the
original register classes.

We still don't want to do this for long live ranges, mostly because of the high
register pressure of there are many constrained live ranges overlapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131466 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 16:38:37 +00:00
Rafael Espindola
ab078f0232 Don't include information about the build into the information returned by
getHostTriple. This fixes a 32 bit clang running on a 64 bit ubuntu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131463 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 15:26:34 +00:00
Nadav Rotem
86694297ff Fix a bug in PerformEXTRACT_VECTOR_ELTCombine. The code created an ADD SDNode
with two different types, in cases where the index and the ptr had different
types.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131461 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 08:31:57 +00:00
Eric Christopher
6abb7bae10 Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131459 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 08:16:14 +00:00
Eric Christopher
c324f72ab7 Support XOR and AND optimization with no return value.
Finishes off rdar://8470697


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131458 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 08:10:18 +00:00
Eric Christopher
811c2b7110 Couple less magic numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131457 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 07:50:41 +00:00
Eric Christopher
8102bf003e Make this code a little less magic number laden.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131456 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 07:47:55 +00:00
Chris Lattner
5d4718b1c7 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131455 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 07:22:33 +00:00
Eli Friedman
c93943b6fe Back out r131444 and r131438; they're breaking nightly tests. I'll look into
it more tomorrow.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131451 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 02:36:59 +00:00
Eli Friedman
cdc9a20561 Add x86 fast-isel for calls returning first-class aggregates. rdar://9435872.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131438 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 00:13:47 +00:00
Owen Anderson
e1edb17bc3 @llvm.lifetime.begin acts as a load, not @llvm.lifetime.end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131437 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 00:05:49 +00:00
Jakob Stoklund Olesen
f5497fb1b4 Teach LiveInterval::isZeroLength about null SlotIndexes.
When instructions are deleted, they leave tombstone SlotIndex entries.
The isZeroLength method should ignore these null indexes.

This causes RABasic to sometimes spill a callee-saved register in the
abi-isel.ll test, so don't run that test with -regalloc=basic.  Prioritizing
register allocation according to spill weight can cause more registers to be
used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131436 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 23:50:05 +00:00
Jim Grosbach
0c72076190 Kill some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131431 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 22:24:07 +00:00
Dan Gohman
975716af1b Delete unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 22:19:54 +00:00
Dan Gohman
b3dbd4a0b6 Trim #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131429 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 22:14:50 +00:00
Dan Gohman
f316eb7074 Fix whitespace and 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131428 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 22:09:53 +00:00
Devang Patel
a8992b3e72 There is no need to force DebugLoc on a PHI at this point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131427 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 22:05:03 +00:00
Jim Grosbach
62427ae8d3 Track how many insns fast-isel successfully selects as well as how many it
misses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131426 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 21:51:07 +00:00
Eli Friedman
57f4b03621 Remove dead code. Fix associated test to use FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131424 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 21:28:22 +00:00
Devang Patel
227dfdb3c4 Preserve debug info for unused zero extended boolean argument.
Radar 9422775.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131422 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 21:24:05 +00:00
Charles Davis
cacdc4fc41 Add a method I forgot in the last commit. Don't worry, this one passed
self-host :).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131421 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 21:13:58 +00:00
Eli Friedman
482feb33b2 Make fast-isel work correctly s/uadd.with.overflow intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131420 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 21:06:17 +00:00
Eli Friedman
a4c920db7a Fix silly typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131419 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 20:34:53 +00:00
Eli Friedman
2586b8f936 Basic fast-isel of extractvalue. Not too helpful on its own, given the IR clang generates for cases like this, but it should become more useful soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131417 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 20:27:46 +00:00
Jason W Kim
97c07dac7f Add a FIXME reminder to remove ForceARMElfPIC switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131411 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 16:35:21 +00:00
Rafael Espindola
6469540adf sets bit 0 of the function address of thumb function in .symtab
("T is 1 if the target symbol S has type STT_FUNC and the
symbol addresses a Thumb instruction ;it is 0 otherwise."
from "ELF for the ARM Architecture" 4.7.1.2)

Patch by Koan-Sin Tan!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131406 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 16:17:21 +00:00
Rafael Espindola
ac53b0a48a Extra refactoring noticed by Eli Friedman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131405 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 15:48:45 +00:00
Rafael Espindola
0e00c6c561 Don't do tail calls in a function that call setjmp. The stack might be
corrupted when setjmp returns again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131399 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 03:05:33 +00:00
Charles Davis
baaa320168 Fix copy-pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131384 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-15 17:28:27 +00:00
Charles Davis
ff96a12db6 Add stub methods to MCStreamer for emitting Win64 exception-handling
information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131382 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-15 17:20:01 +00:00
Benjamin Kramer
10fcfb53fd SimplifyCFG: Use ComputeMaskedBits to prune dead cases from switch instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131345 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-14 15:57:25 +00:00
Stuart Hastings
67f071e697 Avoid combining GEPs that might overflow at runtime.
rdar://problem/9267970

Patch by Julien Lerouge!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131339 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-14 05:55:10 +00:00
Eli Friedman
d0118a2371 Fix a FIXME by moving the fast-isel implementation of the objectsize intrinsic from the x86 code to the generic code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131332 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-14 00:47:51 +00:00
Rafael Espindola
a3f88148e6 Don't produce a vmovntdq if we don't have AVX support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131330 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-14 00:30:01 +00:00
Eli Friedman
d25d16c901 Zap useless code; this hasn't done anything useful since fast-isel switched to being bottom-up (a very long time ago).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131329 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-14 00:19:32 +00:00
Jim Grosbach
1c3c8ea662 Be a bit more permissive about symbols we don't understand. Just skip them
rather than throwing an error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131322 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 23:11:30 +00:00
Dylan Noblesmith
f5895e9592 ExecutionEngine: move createJIT() definition (v2)
As an ExecutionEngine class function, its definition
really belongs in ExecutionEngine.cpp, not JIT.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131320 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 22:02:53 +00:00
Dylan Noblesmith
c5b28580a9 ExecutionEngine: push TargetMachine creation into clients (v2)
In particular, into EngineBuilder. This should only impact
the private API between the EE and EB classes, not external
clients, since JITCtor and MCJITCtor are both protected members.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131317 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 21:51:29 +00:00
Dylan Noblesmith
2ea29ba2a8 ExecutionEngine: fix JIT/MCJIT selectTarget() duplication (v2)
This prepares for making JITCtor/MCJITCtor take a
TargetMachine* directly from clients like EngineBuilder.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131316 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 21:36:16 +00:00
Jim Grosbach
ffa625072c Teach the RtDyld to tell the memory manager about how much space a function
actually takes rather than how much memory was allocated for it. This
is more accurate and should help the manager pack things more effectively.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131305 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 20:12:14 +00:00
Rafael Espindola
3fa8283744 Make codegen able to handle values of empty types. This is one way
to fix PR9900. I will keep it open until sable is able to comment on it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131294 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 15:18:06 +00:00
Julien Lerouge
eea6c95d5d Fix a source of non determinism in FindUsedTypes, use a SetVector instead of a
set.

rdar://9423996


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131283 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 05:20:42 +00:00
Andrew Trick
14ba1ff133 Convert SimplifyIVUsers into a worklist instead of a single pass over
the users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131277 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 01:12:21 +00:00
Stuart Hastings
88882247d2 Since I can't reproduce the failures from 131261, re-trying with a
simplified version.  <rdar://problem/9298790>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131274 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 00:51:54 +00:00
Stuart Hastings
8ad145d729 Revert 131266 and 131261 due to buildbot complaints.
rdar://problem/9298790


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131269 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 00:15:17 +00:00
Stuart Hastings
5adc646380 Non-fast-isel followup to 129634; correctly handle branches controlled
by non-CMP expressions.  The executable test case (129821) would test
this as well, if we had an "-O0 -disable-arm-fast-isel" LLVM-GCC
tester.  Alas, the ARM assembly would be very difficult to check with
FileCheck.

The thumb2-cbnz.ll test is affected; it generates larger code (tst.w
vs. cmp #0), but I believe the new version is correct.
rdar://problem/9298790


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131261 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 23:36:41 +00:00
Evan Cheng
6175e03825 Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131258 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 22:35:48 +00:00
Devang Patel
201e6cdc39 Doug convinced me that DW_AT_APPLE_objc_complete_type is more appropriate name.
s/DW_AT_APPLE_objc_class_extension/DW_AT_APPLE_objc_complete_type/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131244 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 21:29:42 +00:00
Jim Grosbach
757a142ea8 MCJIT section loading should just skip non-text sections rather than
erroring out completely. Some modules produce sections that aren't referenced,
so it's friendlier to clients like LLDB to just skip them, at least for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131243 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 21:21:16 +00:00
Evan Cheng
7139d35165 Re-enable branchfolding common code hoisting optimization. Fixed a liveness test bug and also taught it to update liveins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131241 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 20:30:01 +00:00
Devang Patel
b11f80e94b Let Objective-C front-end identify class extension, in dwarf output, using an attribute DW_AT_APPLE_objc_class_extension.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131238 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 19:06:16 +00:00
Evan Cheng
30adced41b Temporarily disable the transformation. It's breaking 186.crafty in some configuration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131235 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 18:44:58 +00:00
Jim Grosbach
c154514e2d The MCJIT memory manager needs to initialize its Module member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131234 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 18:21:23 +00:00
Akira Hatanaka
01765eb0a1 Fix setting of isCommutable flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131233 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 17:42:08 +00:00