1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

20376 Commits

Author SHA1 Message Date
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
Chris Lattner
94798a7441 add a new testcase for constant foldable calls
llvm-svn: 23464
2005-09-27 05:02:03 +00:00
Chris Lattner
b3b15ed0a3 Fix a bug where we would evaluate stores into linkonce objects which could be
potentially replaced at link-time.

llvm-svn: 23463
2005-09-27 04:50:03 +00:00
Chris Lattner
dc94923d86 Implement support for static constructors with calls in them. This is useful
because gccas runs globalopt before inlining.

This implements ctor-list-opt.ll:CTOR7

llvm-svn: 23462
2005-09-27 04:45:34 +00:00
Chris Lattner
f7576c59ae Add a more difficult testcase which uses a call to a helper function to do
the initialization

llvm-svn: 23461
2005-09-27 04:44:04 +00:00
Chris Lattner
5bc02b52dd Refactor this code a bit, no functionality changes.
llvm-svn: 23460
2005-09-27 04:27:01 +00:00
Chris Lattner
81a267f77f Move the post-lsr simplify cfg pass after lowereh, so it can clean up after
eh lowering as well.

llvm-svn: 23459
2005-09-27 00:14:41 +00:00
Chris Lattner
6fd1d34b03 minor pattern shuffling
llvm-svn: 23458
2005-09-26 22:20:16 +00:00
Chris Lattner
cdeed56e4e memoize the assert results
llvm-svn: 23457
2005-09-26 22:10:24 +00:00
Chris Lattner
5c061685a2 Emit the switch stmt cases in alphabetical order instead of pointer order,
which is not stable.

llvm-svn: 23456
2005-09-26 21:59:35 +00:00
Jim Laskey
22a1f0f44b Addition of a simple two pass scheduler. This version is currently hacked up
for testing and will require target machine info to do a proper scheduling.
The simple scheduler can be turned on using -sched=simple (defaults
to -sched=none)

llvm-svn: 23455
2005-09-26 21:57:04 +00:00
Chris Lattner
ad79bd3f47 implement a fixme: only select values once, even if used multiple times.
llvm-svn: 23454
2005-09-26 21:53:26 +00:00
Chris Lattner
fc4e38bf0a Remove some dead code. ctor evaluation subsumes empty ctor elim
llvm-svn: 23453
2005-09-26 20:38:20 +00:00
Chris Lattner
ade39df257 Add support for alloca, implementing ctor-list-opt.ll:CTOR6
llvm-svn: 23452
2005-09-26 17:07:09 +00:00