Commit Graph

20585 Commits

Author SHA1 Message Date
Bill Wendling
0713a22423 Added comment explaining why we are doing this check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43353 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 18:23:45 +00:00
Duncan Sands
2e606cfc7a Small formatting changes. Add a sanity check.
Use NVT rather than looking it up, since we have
it to hand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43341 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 12:35:51 +00:00
Duncan Sands
cac99db7da Promote SETCC operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43340 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 12:32:31 +00:00
Duncan Sands
a3d10d808e Correctly extract the ValueType from a VTSDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43339 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 12:30:51 +00:00
Evan Cheng
cdf43b1fad If a loop termination compare instruction is the only use of its stride,
and the compaison is against a constant value, try eliminate the stride
by moving the compare instruction to another stride and change its
constant operand accordingly. e.g.

loop:
...
v1 = v1 + 3
v2 = v2 + 1
if (v2 < 10) goto loop
=>
loop:
...
v1 = v1 + 3
if (v1 < 30) goto loop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43336 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 09:11:16 +00:00
Owen Anderson
f92ff03f71 Fix for PR1741.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43326 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 02:36:18 +00:00
Ted Kremenek
fe2a012338 Implemented prototype serialization of pointers, including support
for backpatching.

Added Deserialize::ReadVal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43319 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 00:10:21 +00:00
Dale Johannesen
8eadd5a6db Another expansion for i64 multiply, suitable for PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43314 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 22:26:08 +00:00
Dale Johannesen
0fcee0639e Fix off by 1 bug in printf->puts lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43309 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 20:14:50 +00:00
Ted Kremenek
6e9b496643 Split Serialization.h into separate headers: Serialize.h and
Deserialize.h Serialization.h now includes trait speciailizations for
unsigned long, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43307 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 19:06:40 +00:00
Chris Lattner
be3e348c7c simplify some code by using the new isNaN predicate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43305 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 18:54:45 +00:00
Chris Lattner
99c65745a2 Implement a couple of foldings for ordered and unordered comparisons,
implementing cases related to PR1738.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43289 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 05:38:08 +00:00
Bill Wendling
30eeb3c6c0 Fix comment and use the "Size" variable that's already provided.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43271 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 23:36:57 +00:00
Bill Wendling
8b1c68cee4 If there's an unaligned memcpy to/from the stack, don't lower it. Just call the
memcpy library function instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43270 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 23:32:40 +00:00
Dale Johannesen
79217064c6 Disable a couple more things for ppcf128.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43267 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 23:20:14 +00:00
Bill Wendling
803396fce2 This broke lots. Reverting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43264 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 22:04:26 +00:00
Bill Wendling
de09040946 Lowering a memcpy to the stack is killing PPC. The ARM and X86 backends already
have their own custom memcpy lowering code. This code needs to be factored out
into a target-independent lowering method with hooks to the backend. In the
meantime, just call memcpy if we're trying to copy onto a stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43262 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 21:30:25 +00:00
Ted Kremenek
0b2d7aaf5c Added preliminary implementation of generic object serialization to bitcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43261 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 21:29:33 +00:00
Owen Anderson
d20cc14dbf Make DomTree and PostDomTree thin wrappers around DomTreeBase, rather than inheriting from it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43259 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 20:58:37 +00:00
Evan Cheng
7bb175b4d1 It's possible to commute instrctions with more than 3 operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43256 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 20:14:40 +00:00
Evan Cheng
e11fb34381 isSubRegOf() is a dup of isSubRegister.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43249 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 06:51:50 +00:00
Evan Cheng
152b7e1874 Temporary solution: added a different set of BCTRL_Macho / BCTRL_ELF with right callee-saved defs set for ppc64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43248 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 06:42:42 +00:00
Evan Cheng
4102eb57bb Fix memcpy lowering when addresses are 4-byte aligned but size is not multiple of 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 22:11:27 +00:00
Dan Gohman
ac72058dd6 The #include <iterator> isn't needed in this header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43232 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 20:44:10 +00:00
Dan Gohman
02e4fa7d5f Strength reduction improvements.
- Avoid attempting stride-reuse in the case that there are users that
   aren't addresses. In that case, there will be places where the
   multiplications won't be folded away, so it's better to try to
   strength-reduce them.

 - Several SSE intrinsics have operands that strength-reduction can
   treat as addresses. The previous item makes this more visible, as
   any non-address use of an IV can inhibit stride-reuse.

 - Make ValidStride aware of whether there's likely to be a base
   register in the address computation. This prevents it from thinking
   that things like stride 9 are valid on x86 when the base register is
   already occupied.

Also, XFAIL the 2007-08-10-LEA16Use32.ll test; the new logic to avoid
stride-reuse elimintes the LEA in the loop, so the test is no longer
testing what it was intended to test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43231 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 20:40:42 +00:00
Dan Gohman
8368805e25 Fix the folding of multiplication into addresses on x86, which was broken
by the recent {U,S}MUL_LOHI changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43230 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 20:22:24 +00:00
Evan Cheng
3311876c3c Use ptr type in the immediate field of a BxA instruction so we don't end up selecting 32-bit call instruction for ppc64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43228 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 19:46:19 +00:00
Evan Cheng
76500d52be Add missing paratheses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43227 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 19:42:28 +00:00
Duncan Sands
fec3ad3e5f Support for expanding extending loads of integers with
funky bit-widths.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 19:00:05 +00:00
Dan Gohman
246b2564d3 Move the SCEV object factors from being static members of the individual
SCEV subclasses to being non-static member functions of the ScalarEvolution
class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43224 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 18:31:58 +00:00
Duncan Sands
245741d2a1 Fix up the logic for result expanding the various extension
operations so they work right for integers with funky
bit-widths.  For example, consider extending i48 to i64
on a 32 bit machine.  The i64 result is expanded to 2 x i32.
We know that the i48 operand will be promoted to i64, then
also expanded to 2 x i32.  If we had the expanded promoted
operand to hand, then expanding the result would be trivial.
Unfortunately at this stage we can only get hold of the
promoted operand.  So instead we kind of hand-expand, doing
explicit shifting and truncating to get the top and bottom
halves of the i64 operand into 2 x i32, which are then used
to expand the result.  This is harmless, because when the
promoted operand is finally expanded all this bit fiddling
turns into trivial operations which are eliminated either
by the expansion code itself or the DAG combiner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43223 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 18:26:21 +00:00
Evan Cheng
42b08be973 Fix an unfolding bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43212 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 03:03:20 +00:00
Evan Cheng
cbfb9b27ef - Only perform the unfolding optimization when the folding in question is modref.
- Remove a bogus assertion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43211 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 03:01:44 +00:00
Chris Lattner
d958a5a9fe add a mechanism for the JIT to invoke a function to lazily create functions as they are referenced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43210 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 02:50:12 +00:00
Chris Lattner
ec2fcafbea llvm-gcc3 is dead, along with it __main.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43209 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 02:39:47 +00:00
Anton Korobeynikov
a024e8ceda Reg2Mem cleanup and optimizations:
- enable phi instructions demotion to stack
 - create alloca instructions in the entry block


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43208 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-21 23:05:16 +00:00
Chris Lattner
c6185038b8 LoadLibraryPermanently doesn't throw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43207 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-21 22:58:11 +00:00
Chris Lattner
8b5295b7bb Add a convenience method for creating EE's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43206 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-21 22:57:11 +00:00
Dale Johannesen
61c7ef34e3 Allow for copysign having f80 second argument.
Fixes 5550319.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43205 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-21 01:07:44 +00:00
Chris Lattner
d0e908e830 Add promote operand support for [su]int_to_fp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43204 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-20 22:57:56 +00:00
Chris Lattner
be5a0a4668 Add result promotion of FP_TO_*INT, fixing CodeGen/X86/trunc-to-bool.ll
with the new legalizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43199 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-20 04:32:38 +00:00
Chris Lattner
aaeb0c8666 simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43198 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-20 04:09:48 +00:00
Chris Lattner
d20154c762 Implement promote and expand for operands of memcpy and friends.
This fixes CodeGen/X86/mem*.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43197 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-20 04:07:07 +00:00
Evan Cheng
b9d5e7cdc9 Added missing curly braces which renders the if clause useless in debug build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43196 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-20 04:01:47 +00:00
Dale Johannesen
e526962fc5 Fix a few places vector operations were not getting
the operand's type from the right place.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43195 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-20 00:07:52 +00:00
Evan Cheng
f7c9695a38 Resolve unfold tables ambiguity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43194 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 23:50:58 +00:00
Evan Cheng
66f7163545 Local spiller optimization:
Turn a store folding instruction into a load folding instruction. e.g.
     xorl  %edi, %eax
     movl  %eax, -32(%ebp)
     movl  -36(%ebp), %eax
     orl   %eax, -32(%ebp)
=>
     xorl  %edi, %eax
     orl   -36(%ebp), %eax
     mov   %eax, -32(%ebp)
This enables the unfolding optimization for a subsequent instruction which will
also eliminate the newly introduced store instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43192 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 21:23:22 +00:00
Bill Wendling
80629c85f1 Don't branch fold inline asm statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43191 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 21:09:55 +00:00
Duncan Sands
7f5f6851c3 Add support for a few more nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43190 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 20:29:48 +00:00
Dale Johannesen
b6210fc92b Redo "last ppc long double fix" as Chris wants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43189 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 20:29:00 +00:00