Chris Lattner
0405309282
this can only be fptrunc.
...
llvm-svn: 32473
2006-12-12 05:21:51 +00:00
Chris Lattner
0b46ffb643
This case isn't needed with recent changes to ConstantInt::get
...
llvm-svn: 32472
2006-12-12 05:19:46 +00:00
Chris Lattner
0ecfce975c
split up inttoptr from ptrtoint handling, the cases aren't similar at all.
...
llvm-svn: 32471
2006-12-12 05:18:19 +00:00
Chris Lattner
4c064bcc3e
the operand of a bitcast is always the right size, just emit it in place.
...
llvm-svn: 32470
2006-12-12 05:14:13 +00:00
Reid Spencer
562b83c7df
Change inferred getCast into specific getCast. Passes all tests.
...
llvm-svn: 32469
2006-12-12 05:05:00 +00:00
Chris Lattner
a9b75a7e35
Patch for PR1045 and Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll
...
llvm-svn: 32468
2006-12-12 04:24:41 +00:00
Chris Lattner
6b7c163064
new testcase for pr1045
...
llvm-svn: 32467
2006-12-12 04:24:17 +00:00
Chris Lattner
0fd9c58f6a
Revert Nate's patch to fix X86/store-fp-constant.ll. With the dag combiner
...
and legalizer separated like they currently are, I don't see a way to handle
this xform.
llvm-svn: 32466
2006-12-12 04:18:56 +00:00
Chris Lattner
df2345fcbe
make this code more aggressive about turning store fpimm into store int imm.
...
This is not sufficient to fix X86/store-fp-constant.ll
llvm-svn: 32465
2006-12-12 04:16:14 +00:00
Chris Lattner
3ad109dafb
This should check for darwin literal sections as well.
...
llvm-svn: 32464
2006-12-12 03:59:46 +00:00
Chris Lattner
51c27947c6
teach scev to analyze X*4|1 like X*4+c. This allows us to produce:
...
LBB1_1: #bb
movdqa (%esi), %xmm2
movaps %xmm2, %xmm3
punpcklbw %xmm0, %xmm3
movaps %xmm3, %xmm4
punpcklwd %xmm0, %xmm4
cvtdq2ps %xmm4, %xmm4
mulps %xmm1, %xmm4
movaps %xmm4, (%edi)
leal 1(,%eax,4), %ebx
shll $4, %ebx
punpckhwd %xmm0, %xmm3
cvtdq2ps %xmm3, %xmm3
mulps %xmm1, %xmm3
movaps %xmm3, (%edx,%ebx)
leal 2(,%eax,4), %ebx
shll $4, %ebx
punpckhbw %xmm0, %xmm2
movaps %xmm2, %xmm3
punpcklwd %xmm0, %xmm3
cvtdq2ps %xmm3, %xmm3
mulps %xmm1, %xmm3
movaps %xmm3, (%edx,%ebx)
leal 3(,%eax,4), %ebx
shll $4, %ebx
punpckhwd %xmm0, %xmm2
cvtdq2ps %xmm2, %xmm2
mulps %xmm1, %xmm2
movaps %xmm2, (%edx,%ebx)
addl $64, %edi
incl %eax
addl $16, %esi
cmpl %ecx, %eax
jne LBB1_1 #bb
instead of:
LBB1_1: #bb
movdqa (%esi), %xmm2
movaps %xmm2, %xmm3
punpcklbw %xmm0, %xmm3
movaps %xmm3, %xmm4
punpcklwd %xmm0, %xmm4
cvtdq2ps %xmm4, %xmm4
mulps %xmm1, %xmm4
movaps %xmm4, (%edi)
leal 1(,%eax,4), %ebx
shll $4, %ebx
punpckhwd %xmm0, %xmm3
cvtdq2ps %xmm3, %xmm3
mulps %xmm1, %xmm3
movaps %xmm3, (%edx,%ebx)
leal 2(,%eax,4), %ebx
shll $4, %ebx
punpckhbw %xmm0, %xmm2
movaps %xmm2, %xmm3
punpcklwd %xmm0, %xmm3
cvtdq2ps %xmm3, %xmm3
mulps %xmm1, %xmm3
movaps %xmm3, (%edx,%ebx)
leal 3(,%eax,4), %ebx
shll $4, %ebx
punpckhwd %xmm0, %xmm2
cvtdq2ps %xmm2, %xmm2
mulps %xmm1, %xmm2
movaps %xmm2, (%edx,%ebx)
addl $64, %edi
incl %eax
addl $16, %esi
cmpl %ecx, %eax
jne LBB1_1 #bb
for a testcase.
llvm-svn: 32463
2006-12-12 02:26:09 +00:00
Reid Spencer
5af6b6baf1
Tidy up a bit.
...
llvm-svn: 32462
2006-12-12 01:32:02 +00:00
Reid Spencer
3ccf5596ee
Generate the correct cast opcode for constant expressions.
...
llvm-svn: 32461
2006-12-12 01:31:37 +00:00
Reid Spencer
5bc563a190
Change inferred cast creation calls to more specific cast creations.
...
llvm-svn: 32460
2006-12-12 01:17:41 +00:00
Rafael Espindola
d29cb12dfc
use MVN to handle small negative constants
...
llvm-svn: 32459
2006-12-12 01:03:11 +00:00
Reid Spencer
496ce1c8c7
Don't bother upgrading this.
...
llvm-svn: 32458
2006-12-12 00:53:31 +00:00
Reid Spencer
3fbfed6e2c
Implement getIntegerCast and getFPCast for ConstantExpr. These are similar
...
to the createIntegerCast and createFPCast for CastInst instructions.
llvm-svn: 32457
2006-12-12 00:51:07 +00:00
Reid Spencer
a82b285a69
Implement createIntegerCast and createFPCast factory methods for handling
...
integer and floating point cast creation. createIntegerCast generates
ZExt/SExt, BitCast or Trunc. createFPCast generates FPExt, Bitcast, or
FPTrunc.
llvm-svn: 32456
2006-12-12 00:49:44 +00:00
Reid Spencer
5b4bc02c1f
Fix PR1040:
...
Don't rebuild llvm-config if none of the library dependencies changed.
llvm-svn: 32455
2006-12-12 00:43:38 +00:00
Rafael Espindola
b8163fd828
add mvn
...
llvm-svn: 32454
2006-12-12 00:37:38 +00:00
Reid Spencer
d2390e3b0a
Fix the BitCastUnion type for 32-bit targets.
...
llvm-svn: 32453
2006-12-12 00:11:08 +00:00
Rafael Espindola
e3aafd29a9
add note
...
llvm-svn: 32452
2006-12-11 23:56:10 +00:00
Chris Lattner
fb4898fdd8
Another step forward in PPC64 JIT support: we now no-longer need stubs
...
emitted for external globals in PPC64-JIT-PIC mode (which is good because
we didn't handle them before!).
This also fixes a bug handling the picbase delta, which we would get wrong
in some cases.
llvm-svn: 32451
2006-12-11 23:22:45 +00:00
Reid Spencer
0ed6e66cf3
Create the cast constant expression that was read instead of attempting
...
to infer the cast from its operand and type. This fixes:
test/Regression/Bytecode/2006-12-11-Cast-ConstExpr.ll
llvm-svn: 32450
2006-12-11 23:20:20 +00:00
Reid Spencer
ae700cd02a
Test case for ensuring correct reading back of cast constant expressions.
...
llvm-svn: 32449
2006-12-11 23:19:53 +00:00
Chris Lattner
7f60301c69
getInstrItineraryData shouldn't copy the itineraries
...
llvm-svn: 32448
2006-12-11 21:42:55 +00:00
Reid Spencer
f48e2567ae
Fix constant folding of FP->int due to cut & paste error in last commit.
...
llvm-svn: 32447
2006-12-11 21:27:28 +00:00
Reid Spencer
3991c4af05
Add a test for constant folding of bitcast to/from floating point.
...
llvm-svn: 32446
2006-12-11 21:25:10 +00:00
Reid Spencer
6567a0ac08
Provide a test for int<->float and long<->double bitcasts.
...
llvm-svn: 32445
2006-12-11 20:40:28 +00:00
Reid Spencer
0549f720b2
Implement correct bitcast of int<->float and long<->double by using a
...
union to perform the bitcast.
llvm-svn: 32444
2006-12-11 20:39:15 +00:00
Evan Cheng
e182862c91
Re-apply changes that were backed out and fix a naughty typo.
...
llvm-svn: 32442
2006-12-11 19:27:14 +00:00
John Criswell
d5817b08f5
It seems the llvm::OStream class does not handle stream manipulators.
...
For now, just grab the stream and perform the output on it directly.
llvm-svn: 32441
2006-12-11 19:15:36 +00:00
Chris Lattner
7124b0d561
Revert changes that broke oggenc on ppc
...
llvm-svn: 32440
2006-12-11 18:53:38 +00:00
Jim Laskey
e2a261ad36
Missing opcode.
...
llvm-svn: 32439
2006-12-11 18:45:56 +00:00
Chris Lattner
f512c0d8e5
Implement correct constant folding of bitcast. This implements
...
Transforms/ConstProp/bitcast.ll and fixes
SingleSource/Regression/C/2003-10-12-GlobalVarInitializers
llvm-svn: 32438
2006-12-11 18:30:27 +00:00
Chris Lattner
e1ea74ac70
constant folding of bitcast is broken.
...
llvm-svn: 32437
2006-12-11 18:29:07 +00:00
Jim Laskey
911ae665d0
Layout proper frame for ppc64.
...
llvm-svn: 32436
2006-12-11 18:10:54 +00:00
Reid Spencer
d5ba7eadcc
Provide a script that can track down which optimization pass causes
...
different code to be produced between two llvm builds that differe slightly.
This is useful in tracking down mis-optimization bugs.
llvm-svn: 32435
2006-12-11 17:42:12 +00:00
Evan Cheng
93c75d4cfb
Don't convert store double C, Ptr to store long C, Ptr if i64 is not a legal type.
...
llvm-svn: 32434
2006-12-11 17:25:19 +00:00
Evan Cheng
4eebfee858
f32 / f64 node is expanded to one i32 / i64 node.
...
llvm-svn: 32433
2006-12-11 06:50:04 +00:00
Evan Cheng
44f9ec68ab
Clean up some bad code.
...
llvm-svn: 32432
2006-12-11 06:25:26 +00:00
Nate Begeman
2566f75e7a
Move something that should be in the dag combiner from the legalizer to the
...
dag combiner.
llvm-svn: 32431
2006-12-11 02:23:46 +00:00
Nate Begeman
b1b1aaa4e5
Properly mangles symbol table names
...
Supports constant pools
Supports relocations to jump tables
Supports relocations within the data segment (global = address of global)
Allocates memory in a non-hacky for all non-code objects.
llvm-svn: 32430
2006-12-11 02:20:45 +00:00
Nate Begeman
3d2e738f0c
Add a default relocation type, and allow clients to set the ConstantVal
...
field after creation.
llvm-svn: 32429
2006-12-11 02:19:29 +00:00
Chris Lattner
6ea5a77a93
fix typo
...
llvm-svn: 32428
2006-12-11 02:16:58 +00:00
Chris Lattner
8f2a26ac12
Update note, with the SROA change, we now produce:
...
_pairtest:
movl 8(%esp), %eax
movl 4(%esp), %ecx
movd %eax, %xmm0
movd %ecx, %xmm1
addss %xmm0, %xmm1
movl 12(%esp), %eax
movss %xmm1, (%eax)
ret
instead of:
_pairtest:
subl $12, %esp
movl 20(%esp), %eax
movl %eax, 4(%esp)
movl 16(%esp), %eax
movl %eax, (%esp)
movss (%esp), %xmm0
addss 4(%esp), %xmm0
movl 24(%esp), %eax
movss %xmm0, (%eax)
addl $12, %esp
ret
llvm-svn: 32427
2006-12-11 01:20:25 +00:00
Chris Lattner
28e7eaf6b8
trunc to integer, not to FP.
...
llvm-svn: 32426
2006-12-11 01:17:00 +00:00
Chris Lattner
fe54dfef65
the xform is done by scalarrepl not the code generator.
...
llvm-svn: 32425
2006-12-11 01:03:32 +00:00
Chris Lattner
a6428b2ce4
this is done
...
llvm-svn: 32424
2006-12-11 01:01:03 +00:00
Chris Lattner
48e3989461
Evan implemented the machineinstr improvements.
...
The rot example works if the type is cast to ubyte.
Move sroa examples together and upgrade them to HEAD syntax.
llvm-svn: 32423
2006-12-11 00:44:03 +00:00