Chris Lattner
3c9cb55f13
Never rely on ReplaceAllUsesWith when selecting, use CodeGenMap instead.
...
ReplaceAllUsesWith does not replace scalars SDOperand floating around on
the stack, permitting things to be selected multiple times.
llvm-svn: 23515
2005-09-29 00:59:32 +00:00
Chris Lattner
0c905d0186
Codegen ADD X, IMM -> addis/addi if needed.
...
This implements PowerPC/fold-li.ll
llvm-svn: 23514
2005-09-28 23:07:13 +00:00
Chris Lattner
7ae5d2a51d
add a testcase for a feature we regressed on because noone wrote the test! :(
...
llvm-svn: 23513
2005-09-28 23:03:11 +00:00
Chris Lattner
04dae1b9ce
Autogen MUL, move FP cases together
...
llvm-svn: 23512
2005-09-28 22:53:16 +00:00
Chris Lattner
6f2adbd5b0
disentangle FP from INT versions of div/mul
...
llvm-svn: 23511
2005-09-28 22:50:24 +00:00
Chris Lattner
95601538e4
Use the autogenerated matcher for ADD/SUB
...
llvm-svn: 23510
2005-09-28 22:47:28 +00:00
Chris Lattner
57694930e5
add a patter for SUBFIC
...
llvm-svn: 23509
2005-09-28 22:47:06 +00:00
Chris Lattner
e3d0ea8e0f
Mark int binops as int-only, add FP binops. Mark FADD/FMUL as commutative but
...
not associative. Add [SU]REM.
llvm-svn: 23508
2005-09-28 22:38:27 +00:00
Chris Lattner
8503ee5b01
wrap a long line
...
llvm-svn: 23507
2005-09-28 22:30:58 +00:00
Chris Lattner
9a2fb006e4
Add FP versions of the binary operators, keeping the int and fp worlds seperate.
...
llvm-svn: 23506
2005-09-28 22:29:58 +00:00
Chris Lattner
d3b3d07c41
Add FP versions of the binary operators, keeping the int and fp worlds seperate.
...
Though I have done extensive testing, it is possible that this will break
things in configs I can't test. Please let me know if this causes a problem
and I'll fix it ASAP.
llvm-svn: 23505
2005-09-28 22:29:17 +00:00
Chris Lattner
61f3785147
Add FP versions of the binary operators, keeping the int and fp worlds seperate.
...
Though I have done extensive testing, it is possible that this will break
things in configs I can't test. Please let me know if this causes a problem
and I'll fix it ASAP.
llvm-svn: 23504
2005-09-28 22:28:18 +00:00
Chris Lattner
97cd256caf
Mark associative nodes as associative
...
llvm-svn: 23503
2005-09-28 20:58:39 +00:00
Chris Lattner
86a339dc34
add support for an associative marker
...
llvm-svn: 23502
2005-09-28 20:58:06 +00:00
Chris Lattner
0231f57a46
Emit an error if instructions or patterns are defined but can never match.
...
Currently we check that immediate values live on the RHS of commutative
operators. Defining ORI like this, for example:
def ORI : DForm_4<24, (ops GPRC:$dst, GPRC:$src1, u16imm:$src2),
"ori $dst, $src1, $src2",
[(set GPRC:$dst, (or immZExt16:$src2, GPRC:$src1))]>;
results in:
tblgen: In ORI: Instruction can never match: Immediate values must be on the RHS of commutative operators!
llvm-svn: 23501
2005-09-28 19:27:25 +00:00
Chris Lattner
2c54044630
Nate pointed out that mulh[us] are commutative as well. Thanks!
...
llvm-svn: 23500
2005-09-28 19:01:44 +00:00
Chris Lattner
18ccb532b5
collect commutativity information
...
llvm-svn: 23499
2005-09-28 18:28:29 +00:00
Chris Lattner
f9cb3cd512
expose commutativity information
...
llvm-svn: 23498
2005-09-28 18:27:58 +00:00
Chris Lattner
64a7b30379
All (xor *) cases are autogenerated now
...
llvm-svn: 23497
2005-09-28 18:12:37 +00:00
Chris Lattner
90179cf384
add support for missed eqv tests
...
llvm-svn: 23496
2005-09-28 18:10:51 +00:00
Chris Lattner
eb8d9090c3
add testcase for nand
...
llvm-svn: 23495
2005-09-28 18:08:58 +00:00
Chris Lattner
82eb231e2f
Implement PowerPC/eqv-andc-orc-nor.ll:EQV3
...
llvm-svn: 23494
2005-09-28 18:04:52 +00:00
Chris Lattner
816f712c69
Consolidate the eqv.ll and nor.ll files together.
...
Add a missed eqv case.
llvm-svn: 23493
2005-09-28 18:04:22 +00:00
Chris Lattner
5dae8ab260
Prefer cheaper patterns to more expensive ones. Print the costs to the generated
...
file
llvm-svn: 23492
2005-09-28 17:57:56 +00:00
Chris Lattner
26c05140ee
simple tests for nor generation
...
llvm-svn: 23491
2005-09-28 17:55:10 +00:00
Chris Lattner
2d240ce480
learn to codegen not as NOR instead of xoris/xori
...
llvm-svn: 23490
2005-09-28 17:13:15 +00:00
Chris Lattner
dad2994a3a
These nodes are all autogenerated
...
llvm-svn: 23489
2005-09-28 17:07:09 +00:00
Chris Lattner
eeead91a84
Select Constant nodes to TargetConstant nodes
...
llvm-svn: 23488
2005-09-28 16:58:06 +00:00
Chris Lattner
6ce1d7dabb
Constant fold llvm.sqrt
...
llvm-svn: 23487
2005-09-28 01:34:32 +00:00
Chris Lattner
cd79ed877a
add a note about a way to improve this code further, that I won't be getting
...
to right now.
llvm-svn: 23485
2005-09-27 22:44:59 +00:00
Chris Lattner
80e4480cfa
Fix a regression in my previous patch, fixing GlobalOpt/2005-09-27-Crash.ll
...
and PR632.
llvm-svn: 23484
2005-09-27 22:28:11 +00:00
Chris Lattner
14ade87e75
Testcase for PR632
...
llvm-svn: 23483
2005-09-27 22:27:19 +00:00
Chris Lattner
4bc65cb445
Darwin, like many BSD systems, has a setjmp/longjmp which saves the signal mask
...
on setjmp calls and restores it on longjmp calls (both of which require syscalls).
This makes the calls REALLY slow. Use _setjmp/_longjmp instead. This speeds up
hexxagon from 120.31s to 15.68s: from 5.53x slower than GCC to 28% faster than GCC.
llvm-svn: 23482
2005-09-27 22:18:25 +00:00
Chris Lattner
4655e9de38
If the target prefers it, use _setjmp/_longjmp should be used instead of setjmp/longjmp for llvm.setjmp/llvm.longjmp.
...
llvm-svn: 23481
2005-09-27 22:15:53 +00:00
Chris Lattner
c7eb6f9169
initialize new flag
...
llvm-svn: 23480
2005-09-27 22:13:56 +00:00
Chris Lattner
62922d5727
Add a new flag for targets where setjmp/longjmp saves/restores the signal mask,
...
and _setjmp/_longjmp should be used instead (for llvm.setjmp/llvm.longjmp).
llvm-svn: 23479
2005-09-27 22:13:36 +00:00
Chris Lattner
8ff6df40ba
Avoid spilling stack slots... to stack slots.
...
llvm-svn: 23478
2005-09-27 21:33:12 +00:00
Chris Lattner
b2fa69f4b2
Completely rewrite 'correct' eh support. This changes how setjmp insertion
...
is performed so it is only at most once per function that contains an invoke
instead of once per invoke in the function. This patch has the following perks:
1. It fixes PR631, which complains about slowness.
2. If fixes PR240, which complains about non-volatile vars being live across
setjmp/longjmps.
3. It improves (but does not fix) the jmpbuf alignment issue on itanium by not
forcing the jmpbufs to always be 8-bytes off the alignment of the structure.
4. It speeds up 253.perlbmk from 338s to 13.70s (a 25x improvement!), making us
now about 4% faster than GCC.
Further improvements are also possible.
llvm-svn: 23477
2005-09-27 21:18:17 +00:00
Chris Lattner
29f2ba1384
Make the pass name simpler
...
llvm-svn: 23476
2005-09-27 21:10:32 +00:00
Chris Lattner
bcba1677fd
fix CBackend/2005-09-27-VolatileFuncPtr.ll
...
llvm-svn: 23475
2005-09-27 20:52:44 +00:00
Chris Lattner
379b92a59d
new testcase the CBE creates invalid C code for
...
llvm-svn: 23474
2005-09-27 20:52:30 +00:00
Chris Lattner
92b0563eb3
allow demotion to volatile values, add support for invoke
...
llvm-svn: 23473
2005-09-27 19:39:00 +00:00
Chris Lattner
dbef366ea5
allow demotion to volatile values
...
llvm-svn: 23472
2005-09-27 19:38:43 +00:00
Chris Lattner
521f09d4c5
Add a simple testcase for lowerinvoke
...
llvm-svn: 23471
2005-09-27 18:34:31 +00:00
Chris Lattner
6d1a2716a4
Make sure to clear the CodeGenMap after each basic block is selected to avoid
...
cross MBB pollution.
llvm-svn: 23470
2005-09-27 17:45:33 +00:00
Jim Laskey
5a82322c66
Remove some redundancies.
...
llvm-svn: 23469
2005-09-27 17:32:45 +00:00
Chris Lattner
96f29dbdbe
Make this slightly more efficient by pushing actual type information down
...
into the evaluator. This shrinks a release build of instcombine's text
section from 216363 to 215975 bytes (on PPC).
llvm-svn: 23468
2005-09-27 06:38:05 +00:00
Chris Lattner
20786460b5
Split SimpleConstantVal up into its components, so each Constant subclass getsa different enum value. This allows 'classof' for these to be really simple,not needing to call getType() anymore.
...
This speeds up isa/dyncast/etc for constants, and also makes them smaller.
For example, the text section of a release build of InstCombine.cpp shrinks
from 230037 bytes to 216363 bytes, a 6% reduction.
llvm-svn: 23467
2005-09-27 06:09:08 +00:00
Chris Lattner
92616caa1a
Split SimpleConstantVal up into its components, so each Constant subclass gets
...
a different enum value. This allows 'classof' for these to be really simple,
not needing to call getType() anymore.
This speeds up isa/dyncast/etc for constants, and also makes them smaller.
For example, the text section of a release build of InstCombine.cpp shrinks
from 230037 bytes to 216363 bytes, a 6% reduction.
llvm-svn: 23466
2005-09-27 06:08:32 +00:00
Chris Lattner
e242673da3
Add support for external calls that we know how to constant fold. This implements
...
ctor-list-opt.ll:CTOR8
llvm-svn: 23465
2005-09-27 05:02:43 +00:00