1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

20210 Commits

Author SHA1 Message Date
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
Chris Lattner
78e3912833 Testcase that uses an alloca
llvm-svn: 23451
2005-09-26 17:06:32 +00:00
Chris Lattner
c1fe36502e Add a debug printout, fix a crash on kc++
llvm-svn: 23450
2005-09-26 07:34:35 +00:00
Chris Lattner
7283d69b9f Implement loads/stores through GEP's of globals. This implements
ctor-list-opt.ll:CTOR5.

llvm-svn: 23449
2005-09-26 06:52:44 +00:00
Chris Lattner
0b9e00f69e add another case, this one that uses getelementptr instructions
llvm-svn: 23448
2005-09-26 06:51:50 +00:00
Chris Lattner
6488c9bbc1 Replace TraverseGEPInitializer with ConstantFoldLoadThroughGEPConstantExpr
llvm-svn: 23447
2005-09-26 05:34:07 +00:00
Chris Lattner
7c43a40871 Eliminate GetGEPGlobalInitializer in favor of the more powerful
ConstantFoldLoadThroughGEPConstantExpr function in the utils lib.

llvm-svn: 23446
2005-09-26 05:28:52 +00:00
Chris Lattner
6df0a740e8 Factor the GetGEPGlobalInitializer out of this pass and into Transforms/Utils
as ConstantFoldLoadThroughGEPConstantExpr.

llvm-svn: 23445
2005-09-26 05:28:06 +00:00
Chris Lattner
d8b3c644e1 Move the ConstantFoldLoadThroughGEPConstantExpr function out of the InstCombine
pass.

llvm-svn: 23444
2005-09-26 05:27:10 +00:00
Chris Lattner
2a5d66d0e1 add a new function
llvm-svn: 23443
2005-09-26 05:26:32 +00:00
Chris Lattner
e149840f04 add a comment
llvm-svn: 23442
2005-09-26 05:16:34 +00:00
Chris Lattner
2addd0dcab Add support for getelementptr, load, and correctly reject volatile stores.
llvm-svn: 23441
2005-09-26 05:15:37 +00:00
Chris Lattner
6bb22ee24c add a test for load
llvm-svn: 23440
2005-09-26 05:14:48 +00:00
Chris Lattner
8364e6b0db Add support for br/brcond/switch and phi
llvm-svn: 23439
2005-09-26 04:57:38 +00:00
Chris Lattner
8084f450d9 add another testcase with simple control flow
llvm-svn: 23438
2005-09-26 04:57:10 +00:00
Chris Lattner
1d43adff6d Add a simple interpreter to this code, allowing us to statically evaluate
global ctors that are simple enough.  This implements ctor-list-opt.ll:CTOR2.

llvm-svn: 23437
2005-09-26 04:44:35 +00:00
Chris Lattner
0952f82b26 make this harder: put some code into it
llvm-svn: 23436
2005-09-26 04:43:01 +00:00