oota-llvm.git
19 years agoAdd FP versions of the binary operators, keeping the int and fp worlds seperate.
Chris Lattner [Wed, 28 Sep 2005 22:29:17 +0000 (22:29 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23505 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd FP versions of the binary operators, keeping the int and fp worlds seperate.
Chris Lattner [Wed, 28 Sep 2005 22:28:18 +0000 (22:28 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23504 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMark associative nodes as associative
Chris Lattner [Wed, 28 Sep 2005 20:58:39 +0000 (20:58 +0000)]
Mark associative nodes as associative

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23503 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd support for an associative marker
Chris Lattner [Wed, 28 Sep 2005 20:58:06 +0000 (20:58 +0000)]
add support for an associative marker

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23502 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEmit an error if instructions or patterns are defined but can never match.
Chris Lattner [Wed, 28 Sep 2005 19:27:25 +0000 (19:27 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23501 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoNate pointed out that mulh[us] are commutative as well. Thanks!
Chris Lattner [Wed, 28 Sep 2005 19:01:44 +0000 (19:01 +0000)]
Nate pointed out that mulh[us] are commutative as well. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23500 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agocollect commutativity information
Chris Lattner [Wed, 28 Sep 2005 18:28:29 +0000 (18:28 +0000)]
collect commutativity information

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23499 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoexpose commutativity information
Chris Lattner [Wed, 28 Sep 2005 18:27:58 +0000 (18:27 +0000)]
expose commutativity information

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23498 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAll (xor *) cases are autogenerated now
Chris Lattner [Wed, 28 Sep 2005 18:12:37 +0000 (18:12 +0000)]
All (xor *) cases are autogenerated now

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23497 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd support for missed eqv tests
Chris Lattner [Wed, 28 Sep 2005 18:10:51 +0000 (18:10 +0000)]
add support for missed eqv tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23496 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd testcase for nand
Chris Lattner [Wed, 28 Sep 2005 18:08:58 +0000 (18:08 +0000)]
add testcase for nand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23495 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement PowerPC/eqv-andc-orc-nor.ll:EQV3
Chris Lattner [Wed, 28 Sep 2005 18:04:52 +0000 (18:04 +0000)]
Implement PowerPC/eqv-andc-orc-nor.ll:EQV3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23494 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoConsolidate the eqv.ll and nor.ll files together.
Chris Lattner [Wed, 28 Sep 2005 18:04:22 +0000 (18:04 +0000)]
Consolidate the eqv.ll and nor.ll files together.
Add a missed eqv case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23493 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoPrefer cheaper patterns to more expensive ones. Print the costs to the generated
Chris Lattner [Wed, 28 Sep 2005 17:57:56 +0000 (17:57 +0000)]
Prefer cheaper patterns to more expensive ones.  Print the costs to the generated
file

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23492 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agosimple tests for nor generation
Chris Lattner [Wed, 28 Sep 2005 17:55:10 +0000 (17:55 +0000)]
simple tests for nor generation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23491 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agolearn to codegen not as NOR instead of xoris/xori
Chris Lattner [Wed, 28 Sep 2005 17:13:15 +0000 (17:13 +0000)]
learn to codegen not as NOR instead of xoris/xori

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23490 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoThese nodes are all autogenerated
Chris Lattner [Wed, 28 Sep 2005 17:07:09 +0000 (17:07 +0000)]
These nodes are all autogenerated

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23489 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoSelect Constant nodes to TargetConstant nodes
Chris Lattner [Wed, 28 Sep 2005 16:58:06 +0000 (16:58 +0000)]
Select Constant nodes to TargetConstant nodes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23488 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoConstant fold llvm.sqrt
Chris Lattner [Wed, 28 Sep 2005 01:34:32 +0000 (01:34 +0000)]
Constant fold llvm.sqrt

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23487 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd a note about a way to improve this code further, that I won't be getting
Chris Lattner [Tue, 27 Sep 2005 22:44:59 +0000 (22:44 +0000)]
add a note about a way to improve this code further, that I won't be getting
to right now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23485 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a regression in my previous patch, fixing GlobalOpt/2005-09-27-Crash.ll
Chris Lattner [Tue, 27 Sep 2005 22:28:11 +0000 (22:28 +0000)]
Fix a regression in my previous patch, fixing GlobalOpt/2005-09-27-Crash.ll
and PR632.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23484 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTestcase for PR632
Chris Lattner [Tue, 27 Sep 2005 22:27:19 +0000 (22:27 +0000)]
Testcase for PR632

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23483 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoDarwin, like many BSD systems, has a setjmp/longjmp which saves the signal mask
Chris Lattner [Tue, 27 Sep 2005 22:18:25 +0000 (22:18 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23482 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoIf the target prefers it, use _setjmp/_longjmp should be used instead of setjmp/longj...
Chris Lattner [Tue, 27 Sep 2005 22:15:53 +0000 (22:15 +0000)]
If the target prefers it, use _setjmp/_longjmp should be used instead of setjmp/longjmp for llvm.setjmp/llvm.longjmp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23481 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoinitialize new flag
Chris Lattner [Tue, 27 Sep 2005 22:13:56 +0000 (22:13 +0000)]
initialize new flag

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23480 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a new flag for targets where setjmp/longjmp saves/restores the signal mask,
Chris Lattner [Tue, 27 Sep 2005 22:13:36 +0000 (22:13 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23479 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAvoid spilling stack slots... to stack slots.
Chris Lattner [Tue, 27 Sep 2005 21:33:12 +0000 (21:33 +0000)]
Avoid spilling stack slots... to stack slots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23478 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoCompletely rewrite 'correct' eh support. This changes how setjmp insertion
Chris Lattner [Tue, 27 Sep 2005 21:18:17 +0000 (21:18 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23477 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake the pass name simpler
Chris Lattner [Tue, 27 Sep 2005 21:10:32 +0000 (21:10 +0000)]
Make the pass name simpler

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23476 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agofix CBackend/2005-09-27-VolatileFuncPtr.ll
Chris Lattner [Tue, 27 Sep 2005 20:52:44 +0000 (20:52 +0000)]
fix CBackend/2005-09-27-VolatileFuncPtr.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23475 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase the CBE creates invalid C code for
Chris Lattner [Tue, 27 Sep 2005 20:52:30 +0000 (20:52 +0000)]
new testcase the CBE creates invalid C code for

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23474 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoallow demotion to volatile values, add support for invoke
Chris Lattner [Tue, 27 Sep 2005 19:39:00 +0000 (19:39 +0000)]
allow demotion to volatile values, add support for invoke

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23473 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoallow demotion to volatile values
Chris Lattner [Tue, 27 Sep 2005 19:38:43 +0000 (19:38 +0000)]
allow demotion to volatile values

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23472 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a simple testcase for lowerinvoke
Chris Lattner [Tue, 27 Sep 2005 18:34:31 +0000 (18:34 +0000)]
Add a simple testcase for lowerinvoke

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23471 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake sure to clear the CodeGenMap after each basic block is selected to avoid
Chris Lattner [Tue, 27 Sep 2005 17:45:33 +0000 (17:45 +0000)]
Make sure to clear the CodeGenMap after each basic block is selected to avoid
cross MBB pollution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23470 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRemove some redundancies.
Jim Laskey [Tue, 27 Sep 2005 17:32:45 +0000 (17:32 +0000)]
Remove some redundancies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23469 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake this slightly more efficient by pushing actual type information down
Chris Lattner [Tue, 27 Sep 2005 06:38:05 +0000 (06:38 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23468 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoSplit SimpleConstantVal up into its components, so each Constant subclass getsa diffe...
Chris Lattner [Tue, 27 Sep 2005 06:09:08 +0000 (06:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23467 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoSplit SimpleConstantVal up into its components, so each Constant subclass gets
Chris Lattner [Tue, 27 Sep 2005 06:08:32 +0000 (06:08 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23466 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for external calls that we know how to constant fold. This implements
Chris Lattner [Tue, 27 Sep 2005 05:02:43 +0000 (05:02 +0000)]
Add support for external calls that we know how to constant fold.  This implements
ctor-list-opt.ll:CTOR8

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23465 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd a new testcase for constant foldable calls
Chris Lattner [Tue, 27 Sep 2005 05:02:03 +0000 (05:02 +0000)]
add a new testcase for constant foldable calls

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23464 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a bug where we would evaluate stores into linkonce objects which could be
Chris Lattner [Tue, 27 Sep 2005 04:50:03 +0000 (04:50 +0000)]
Fix a bug where we would evaluate stores into linkonce objects which could be
potentially replaced at link-time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23463 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement support for static constructors with calls in them. This is useful
Chris Lattner [Tue, 27 Sep 2005 04:45:34 +0000 (04:45 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23462 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a more difficult testcase which uses a call to a helper function to do
Chris Lattner [Tue, 27 Sep 2005 04:44:04 +0000 (04:44 +0000)]
Add a more difficult testcase which uses a call to a helper function to do
the initialization

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23461 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRefactor this code a bit, no functionality changes.
Chris Lattner [Tue, 27 Sep 2005 04:27:01 +0000 (04:27 +0000)]
Refactor this code a bit, no functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23460 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMove the post-lsr simplify cfg pass after lowereh, so it can clean up after
Chris Lattner [Tue, 27 Sep 2005 00:14:41 +0000 (00:14 +0000)]
Move the post-lsr simplify cfg pass after lowereh, so it can clean up after
eh lowering as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23459 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agominor pattern shuffling
Chris Lattner [Mon, 26 Sep 2005 22:20:16 +0000 (22:20 +0000)]
minor pattern shuffling

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23458 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agomemoize the assert results
Chris Lattner [Mon, 26 Sep 2005 22:10:24 +0000 (22:10 +0000)]
memoize the assert results

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23457 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEmit the switch stmt cases in alphabetical order instead of pointer order,
Chris Lattner [Mon, 26 Sep 2005 21:59:35 +0000 (21:59 +0000)]
Emit the switch stmt cases in alphabetical order instead of pointer order,
which is not stable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23456 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAddition of a simple two pass scheduler. This version is currently hacked up
Jim Laskey [Mon, 26 Sep 2005 21:57:04 +0000 (21:57 +0000)]
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)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23455 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoimplement a fixme: only select values once, even if used multiple times.
Chris Lattner [Mon, 26 Sep 2005 21:53:26 +0000 (21:53 +0000)]
implement a fixme: only select values once, even if used multiple times.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23454 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRemove some dead code. ctor evaluation subsumes empty ctor elim
Chris Lattner [Mon, 26 Sep 2005 20:38:20 +0000 (20:38 +0000)]
Remove some dead code.  ctor evaluation subsumes empty ctor elim

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23453 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for alloca, implementing ctor-list-opt.ll:CTOR6
Chris Lattner [Mon, 26 Sep 2005 17:07:09 +0000 (17:07 +0000)]
Add support for alloca, implementing ctor-list-opt.ll:CTOR6

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23452 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTestcase that uses an alloca
Chris Lattner [Mon, 26 Sep 2005 17:06:32 +0000 (17:06 +0000)]
Testcase that uses an alloca

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23451 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a debug printout, fix a crash on kc++
Chris Lattner [Mon, 26 Sep 2005 07:34:35 +0000 (07:34 +0000)]
Add a debug printout, fix a crash on kc++

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23450 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement loads/stores through GEP's of globals. This implements
Chris Lattner [Mon, 26 Sep 2005 06:52:44 +0000 (06:52 +0000)]
Implement loads/stores through GEP's of globals.  This implements
ctor-list-opt.ll:CTOR5.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23449 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd another case, this one that uses getelementptr instructions
Chris Lattner [Mon, 26 Sep 2005 06:51:50 +0000 (06:51 +0000)]
add another case, this one that uses getelementptr instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23448 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoReplace TraverseGEPInitializer with ConstantFoldLoadThroughGEPConstantExpr
Chris Lattner [Mon, 26 Sep 2005 05:34:07 +0000 (05:34 +0000)]
Replace TraverseGEPInitializer with ConstantFoldLoadThroughGEPConstantExpr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23447 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEliminate GetGEPGlobalInitializer in favor of the more powerful
Chris Lattner [Mon, 26 Sep 2005 05:28:52 +0000 (05:28 +0000)]
Eliminate GetGEPGlobalInitializer in favor of the more powerful
ConstantFoldLoadThroughGEPConstantExpr function in the utils lib.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23446 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFactor the GetGEPGlobalInitializer out of this pass and into Transforms/Utils
Chris Lattner [Mon, 26 Sep 2005 05:28:06 +0000 (05:28 +0000)]
Factor the GetGEPGlobalInitializer out of this pass and into Transforms/Utils
as ConstantFoldLoadThroughGEPConstantExpr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23445 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMove the ConstantFoldLoadThroughGEPConstantExpr function out of the InstCombine
Chris Lattner [Mon, 26 Sep 2005 05:27:10 +0000 (05:27 +0000)]
Move the ConstantFoldLoadThroughGEPConstantExpr function out of the InstCombine
pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23444 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd a new function
Chris Lattner [Mon, 26 Sep 2005 05:26:32 +0000 (05:26 +0000)]
add a new function

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23443 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd a comment
Chris Lattner [Mon, 26 Sep 2005 05:16:34 +0000 (05:16 +0000)]
add a comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23442 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for getelementptr, load, and correctly reject volatile stores.
Chris Lattner [Mon, 26 Sep 2005 05:15:37 +0000 (05:15 +0000)]
Add support for getelementptr, load, and correctly reject volatile stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23441 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd a test for load
Chris Lattner [Mon, 26 Sep 2005 05:14:48 +0000 (05:14 +0000)]
add a test for load

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23440 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for br/brcond/switch and phi
Chris Lattner [Mon, 26 Sep 2005 04:57:38 +0000 (04:57 +0000)]
Add support for br/brcond/switch and phi

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23439 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd another testcase with simple control flow
Chris Lattner [Mon, 26 Sep 2005 04:57:10 +0000 (04:57 +0000)]
add another testcase with simple control flow

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23438 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a simple interpreter to this code, allowing us to statically evaluate
Chris Lattner [Mon, 26 Sep 2005 04:44:35 +0000 (04:44 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23437 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agomake this harder: put some code into it
Chris Lattner [Mon, 26 Sep 2005 04:43:01 +0000 (04:43 +0000)]
make this harder: put some code into it

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23436 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agofactor some code into a InstallGlobalCtors method, add comments. No functionality...
Chris Lattner [Mon, 26 Sep 2005 02:31:18 +0000 (02:31 +0000)]
factor some code into a InstallGlobalCtors method, add comments.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23435 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake the global opt optimizer work on modules with a null terminator, by
Chris Lattner [Mon, 26 Sep 2005 02:19:27 +0000 (02:19 +0000)]
Make the global opt optimizer work on modules with a null terminator, by
accepting the null even with a non-65535 init prio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23434 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFactor this code out into a few methods.
Chris Lattner [Mon, 26 Sep 2005 01:43:45 +0000 (01:43 +0000)]
Factor this code out into a few methods.
Implement the start of global ctor optimization.  It is currently smart
enough to remove the global ctor for cases like this:

struct foo {
  foo() {}
} x;

... saving a bit of startup time for the program.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23433 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase for static ctor list optimizations
Chris Lattner [Mon, 26 Sep 2005 01:42:03 +0000 (01:42 +0000)]
new testcase for static ctor list optimizations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23432 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix VC++ build errors.
Jeff Cohen [Sun, 25 Sep 2005 19:04:43 +0000 (19:04 +0000)]
Fix VC++ build errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23431 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix some logic I broke that caused a regression on
Chris Lattner [Sun, 25 Sep 2005 07:06:48 +0000 (07:06 +0000)]
Fix some logic I broke that caused a regression on
SimplifyLibCalls/2005-05-20-sprintf-crash.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23430 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMove MaskedValueIsZero up.
Chris Lattner [Sat, 24 Sep 2005 23:43:33 +0000 (23:43 +0000)]
Move MaskedValueIsZero up.
Match a bunch of idioms for sign extensions, implementing InstCombine/signext.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23428 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAll of these should turn into sign extends (e.g. extsh/extsb on PPC)
Chris Lattner [Sat, 24 Sep 2005 23:42:18 +0000 (23:42 +0000)]
All of these should turn into sign extends (e.g. extsh/extsb on PPC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23427 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd long-overdue helpers for getting constants with known upper bits
Chris Lattner [Sat, 24 Sep 2005 22:57:28 +0000 (22:57 +0000)]
Add long-overdue helpers for getting constants with known upper bits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23426 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoSimplify this code a bit by relying on recursive simplification. Support
Chris Lattner [Sat, 24 Sep 2005 22:17:06 +0000 (22:17 +0000)]
Simplify this code a bit by relying on recursive simplification.  Support
sprintf("%s", P)'s that have uses.

s/hasNUses(0)/use_empty()/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23425 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEnhance this to check for a crash, add a case that crashes simplifylibcalls,
Chris Lattner [Sat, 24 Sep 2005 22:16:04 +0000 (22:16 +0000)]
Enhance this to check for a crash, add a case that crashes simplifylibcalls,
and add a case that has uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23424 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase that crashes the CFE
Chris Lattner [Sat, 24 Sep 2005 20:54:33 +0000 (20:54 +0000)]
new testcase that crashes the CFE

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23423 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase for PR630
Chris Lattner [Sat, 24 Sep 2005 08:38:28 +0000 (08:38 +0000)]
new testcase for PR630

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23422 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for a marker byte that indicates that we shouldn't add the user
Chris Lattner [Sat, 24 Sep 2005 08:24:28 +0000 (08:24 +0000)]
Add support for a marker byte that indicates that we shouldn't add the user
prefix to a symbol name

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23421 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agochange proto slightly
Chris Lattner [Sat, 24 Sep 2005 08:23:53 +0000 (08:23 +0000)]
change proto slightly

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23420 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agomemoize translations
Chris Lattner [Sat, 24 Sep 2005 00:50:51 +0000 (00:50 +0000)]
memoize translations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23419 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTeach the dag isel generator how to construct arbitrary immediates. The
Chris Lattner [Sat, 24 Sep 2005 00:41:58 +0000 (00:41 +0000)]
Teach the dag isel generator how to construct arbitrary immediates.  The
generated isel now tries li then lis, then lis+ori.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23418 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTeach the DAG isel generator to emit code that creates nodes.
Chris Lattner [Sat, 24 Sep 2005 00:40:24 +0000 (00:40 +0000)]
Teach the DAG isel generator to emit code that creates nodes.

Fix a few corner cases parsing things like (i32 imm:$foo)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23417 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEmit better code (no more copies for var references), and support DAG patterns
Chris Lattner [Fri, 23 Sep 2005 23:16:51 +0000 (23:16 +0000)]
Emit better code (no more copies for var references), and support DAG patterns
(e.g. things like rotates).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23416 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a fixme by passing around SDOperand's instead of SDNode*'s
Chris Lattner [Fri, 23 Sep 2005 21:53:45 +0000 (21:53 +0000)]
Fix a fixme by passing around SDOperand's instead of SDNode*'s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23415 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEmit code that matches the incoming DAG pattern and checks predicates.
Chris Lattner [Fri, 23 Sep 2005 21:33:23 +0000 (21:33 +0000)]
Emit code that matches the incoming DAG pattern and checks predicates.
This does not check that types match yet, but PPC only has one integer type
;-).

This also doesn't have the code to build the resultant dag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23414 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoemit information about the order patterns are to be matched.
Chris Lattner [Fri, 23 Sep 2005 20:52:47 +0000 (20:52 +0000)]
emit information about the order patterns are to be matched.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23413 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agostart filling in the switch stmt
Chris Lattner [Fri, 23 Sep 2005 19:36:15 +0000 (19:36 +0000)]
start filling in the switch stmt

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23412 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoremove some debugging code
Chris Lattner [Fri, 23 Sep 2005 18:49:09 +0000 (18:49 +0000)]
remove some debugging code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23411 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFold two consequtive branches that share a common destination between them.
Chris Lattner [Fri, 23 Sep 2005 18:47:20 +0000 (18:47 +0000)]
Fold two consequtive branches that share a common destination between them.
This implements SimplifyCFG/branch-fold.ll, and is useful on ?:/min/max heavy
code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23410 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase
Chris Lattner [Fri, 23 Sep 2005 18:43:57 +0000 (18:43 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23409 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agosimplify some logic further
Chris Lattner [Fri, 23 Sep 2005 07:23:18 +0000 (07:23 +0000)]
simplify some logic further

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23408 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agopull a bunch of logic out of SimplifyCFG into a helper fn
Chris Lattner [Fri, 23 Sep 2005 06:39:30 +0000 (06:39 +0000)]
pull a bunch of logic out of SimplifyCFG into a helper fn

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23407 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agospeed up Archive::isBytecodeArchive in the case when the archive doesn't have
Chris Lattner [Fri, 23 Sep 2005 06:22:58 +0000 (06:22 +0000)]
speed up Archive::isBytecodeArchive in the case when the archive doesn't have
an llvm-ranlib symtab.  This speeds up gccld -native on an almost empty .o file
from 1.63s to 0.18s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23406 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoSpeed up isBytecodeLPath from 20s to .01s in common cases. This makes -native
Chris Lattner [Fri, 23 Sep 2005 06:11:24 +0000 (06:11 +0000)]
Speed up isBytecodeLPath from 20s to .01s in common cases.  This makes -native
not completely painful to use.  Once we decide a directory has a bytecode
library, we know it this function returns true, no need to scan entire directories.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23405 91177308-0d34-0410-b5e6-96231b3b80d8

19 years ago1. Do not use .c_str() to keep a persistent handle on a temporary string.
Chris Lattner [Fri, 23 Sep 2005 06:05:46 +0000 (06:05 +0000)]
1. Do not use .c_str() to keep a persistent handle on a temporary string.
2. Concatenate -lfoo and -L/bar options into a single option instead of
   passing "-L /bar" (for example) which doesn't work on Darwin.
3. Send -v output to stderr instead of stdout

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23404 91177308-0d34-0410-b5e6-96231b3b80d8