Commit Graph

40070 Commits

Author SHA1 Message Date
Duncan Sands
9bed0f58eb Add two missing SINT_TO_FP libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 16:57:02 +00:00
Duncan Sands
edfba7e707 Port a shift-by-1 optimization from LegalizeDAG: it
was presumably added after the rest of the code was
copied to LegalizeTypes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53459 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 16:54:57 +00:00
Duncan Sands
dddc6291fb Add support for 128 bit shifts and 32 bit shifts
on 16 bit machines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 16:52:29 +00:00
Nick Lewycky
7d9843fc37 Document 'mask' in this calculation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53454 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 08:16:26 +00:00
Duncan Sands
569d8f7087 Align comments, colons and cases. Remove trailing
whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53453 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 07:37:30 +00:00
Nick Lewycky
1f26c188f8 Remove misleading constant from comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53452 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 07:36:19 +00:00
Nick Lewycky
4bf1e59819 Add another optimization from PR2330. Also catch some missing cases that are
similar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53451 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 07:20:53 +00:00
Bill Wendling
71ca353ae6 The frame address on an x86-64 box needs to be offset by -8, not -4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53450 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 07:18:52 +00:00
Chris Lattner
d01bee7170 a missed optimization that Eli spotted
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 06:40:29 +00:00
Chris Lattner
f9685ac68e another bug in the same line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53448 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 06:38:16 +00:00
Chris Lattner
a8ff4a88bb fix a bug spotted by Eli's eagle eyes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53447 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 06:36:01 +00:00
Chris Lattner
183661e43a simplify and merge a bunch of code. Instead of comparing against
the min/max values for an integer type, compare against the min/max
values we can prove contain the input.  This might be a tighter bound,
so this is general goodness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 05:40:05 +00:00
Chris Lattner
84dff672a4 fold away (x <= cst) earlier, allowing us to not have to
handle them in some code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53445 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 05:08:55 +00:00
Chris Lattner
85b5eb0505 Fix folding of icmp's of i1 where the comparison is signed. The code
was using the algorithm for folding unsigned comparisons which is
completely wrong.  This has been broken since the signless types change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53444 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 04:20:58 +00:00
Chris Lattner
f299184565 Fix a bogus optimization: folding (slt (zext i1 A to i32), 1) -> (slt i1 A, true)
This cause a regression in InstCombine/JavaCompare, which was doing the right
thing on accident.  To handle the missed case, generalize the comparisons based
on masked bits a little bit to handle comparisons against the max value. For 
example, we can now xform (slt i32 (and X, 4), 4) -> (setne i32 (and X, 4), 4)




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53443 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 04:09:09 +00:00
Chris Lattner
99672cb130 make this condition more precise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53442 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 03:54:57 +00:00
Chris Lattner
1913b94c11 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53440 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 00:30:39 +00:00
Chris Lattner
d15990189d Implement PR2538
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53438 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 00:30:06 +00:00
Chris Lattner
c563e1d8fe Fix a bug in the soft-float handling of FCOPYSIGN that Duncan noticed
when working on legalizetypes.  Both legalizetypes and legalizeops now
produce hte same code for CodeGen/ARM/fcopysign.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 23:46:13 +00:00
Chris Lattner
70587ea813 make legalize types be a command line option: -enable-legalize-types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 23:37:50 +00:00
Ted Kremenek
0ebf14c4bb Make typedef public to make MSVC++ happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 23:24:20 +00:00
Ted Kremenek
3000357ab5 Make some typedefs public to make MSVC++ happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 23:09:45 +00:00
Ted Kremenek
ccaa6540fc Make typedefs in ilist public (Visual C++ errors out when they are private).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:58:10 +00:00
Bill Wendling
98fd7f6b2f Pull r53428 from Gaz into mainline:
Remove warnings about unused/shadowed variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:57:49 +00:00
Ted Kremenek
07f3cf76c6 Added ImmutableMap constructor that accepts a const TreeTy*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:57:10 +00:00
Bill Wendling
bbcec684e3 Put CPPBackend tests into their own directory and run them only if they're
supported.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53427 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:35:32 +00:00
Dan Gohman
4f4b348437 Tidy up #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53426 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 22:26:19 +00:00
Dan Gohman
ea8a8651fa Add a SubclassData field to SDNode, similar to what's done
in Value, to make use of some otherwise unused space. Use this
field to shrink LoadSDNode and StoreSDNode by moving the
addressing mode and ext/trunc fields there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53422 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 21:44:59 +00:00
Dan Gohman
90b58e0317 Fix a copy+pasto in an assertion string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 19:58:23 +00:00
Dan Gohman
46e7730c81 Stack objects have nonnegative indices, not just positive indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53418 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 19:57:25 +00:00
Dan Gohman
358f5ac972 Escape the graph name. This unbreaks -view-cfg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53417 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 19:55:54 +00:00
Dan Gohman
1bf85e569b Remove this file; the code that it went with is no longer
in the repository.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53416 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 19:55:04 +00:00
Dan Gohman
fdeb4b3f1d Make stack slot coloring's debug output more consistent with
other passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 19:49:32 +00:00
Evan Cheng
bdb10fe0f6 Change StackSlotForVirtReg (which maps vregs to frame indices) from std::map to IndexedMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53414 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 18:23:23 +00:00
Chris Lattner
6291d69c4c Remove extraneous vertical whitespace before Eric gets the wrong idea ;-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53411 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 16:49:53 +00:00
Chris Lattner
85e7ac0353 Fix an altivec constant miscompilation that Duncan found through
his work on legalizetypes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53410 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 16:33:38 +00:00
Duncan Sands
5ac319ac71 Add support for 128 bit multiplicative operations.
Lack of these caused a bootstrap failure with Fortran
on x86-64 with LegalizeTypes turned on.  While there,
be nice to 16 bit machines and support expansion of
i32 too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 15:35:05 +00:00
Duncan Sands
be1ad4de29 Add a mysteriously missing libcall, FPTOSINT_F80_I32.
Be nice to 16 bit machines by supporting FP_TO_XINT
expansion for these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 15:33:02 +00:00
Duncan Sands
03dc093a2e Fix a FIXME: use an apint in CTTZ legalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 15:30:54 +00:00
Duncan Sands
ae099d5442 Remove PromoteIntRes_FP_ROUND - not sure what it
was doing there: FP_ROUND returns a float, not an
integer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 15:29:55 +00:00
Duncan Sands
c5ffb45934 Make sure the alignment of the temporary created
in CreateStackStoreLoad is good enough for both
the source and destination types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53404 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 15:26:17 +00:00
Duncan Sands
f4e4629ee8 Make the LegalizeType method naming scheme more regular.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 15:25:04 +00:00
Duncan Sands
e1d97b1a74 Don't barf when dumping a constant that contains
a ginormous value (eg: i128 -1).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 11:23:14 +00:00
Duncan Sands
df99c29e7b Correct a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53401 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 11:21:59 +00:00
Matthijs Kooijman
d16918f843 Restructure dead argument elimination, try #3 :-)
Rewrite the DeadArgumentElimination pass, to use a more explicit tracking of
dependencies between return values and/or arguments. Also make the handling of
arguments and return values the same.

The pass now looks properly inside returned structs, but only at the first
level (ie, not inside nested structs).

This version fixed a few more bugs and was cleaned up a bit. It now passes all
of LLVM's testing, and should still pass SPEC2006. There is still a minor bug
with regard to returning nested structs. Since there is currently nothing that
emits such IR, I will fix that in a seperate commit (partly because it requires
a non-trivial fix).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53400 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 10:24:08 +00:00
Evan Cheng
ef0732d25a - Change the horrible N^2 isRegReDefinedByTwoAddr. Now callers must supply the operand index of def machineoperand and at most one full scan of non-implicit operands is needed.
- Change local register allocator to use the new isRegReDefinedByTwoAddr instead of reinventing the wheel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 07:35:43 +00:00
Nick Lewycky
5dcc41f5b3 Fix overzealous optimization. Thanks to Duncan Sands for pointing out my error!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53393 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 05:51:40 +00:00
Owen Anderson
743a1e6a9c Use DenseMap instead of std::map in local register allocation. This improves the time on instcombine from .31s to .22s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 01:56:35 +00:00
Owen Anderson
ecee36ece6 Fix 403.gcc. Finally got the check for two-address-ness correct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 01:53:01 +00:00
Owen Anderson
c007848b5a Fix the build by adding a #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53388 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 01:44:27 +00:00