oota-llvm.git
19 years agoVerify that xform functions only occur in logical places
Chris Lattner [Wed, 14 Sep 2005 23:05:13 +0000 (23:05 +0000)]
Verify that xform functions only occur in logical places

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

19 years agoPromote xform fns to be explicit nodes in result patterns, and clean off
Chris Lattner [Wed, 14 Sep 2005 23:01:59 +0000 (23:01 +0000)]
Promote xform fns to be explicit nodes in result patterns, and clean off
predicates since they will have already matched at this point.

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

19 years agostart building the instruction dest pattern correctly. Change the xform
Chris Lattner [Wed, 14 Sep 2005 22:55:26 +0000 (22:55 +0000)]
start building the instruction dest pattern correctly.  Change the xform
functions to preserve the Record for the xform instead of making it into a
function name.

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

19 years agocatch unnamed inputs
Chris Lattner [Wed, 14 Sep 2005 22:06:36 +0000 (22:06 +0000)]
catch unnamed inputs

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

19 years agocheck that there are no unexpected operands
Chris Lattner [Wed, 14 Sep 2005 21:59:34 +0000 (21:59 +0000)]
check that there are no unexpected operands

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

19 years agoforce all instruction operands to be named.
Chris Lattner [Wed, 14 Sep 2005 21:13:50 +0000 (21:13 +0000)]
force all instruction operands to be named.

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

19 years agoGive all operands names
Chris Lattner [Wed, 14 Sep 2005 21:11:13 +0000 (21:11 +0000)]
Give all operands names

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

19 years agogive all operands names
Chris Lattner [Wed, 14 Sep 2005 21:10:24 +0000 (21:10 +0000)]
give all operands names

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

19 years agoCheck that operands have unique names. REJECT instructions with broken operand
Chris Lattner [Wed, 14 Sep 2005 21:05:02 +0000 (21:05 +0000)]
Check that operands have unique names.  REJECT instructions with broken operand
lists: only don't parse them if they are entirely missing (sparcv9).

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

19 years agofix a broke range check
Chris Lattner [Wed, 14 Sep 2005 21:04:12 +0000 (21:04 +0000)]
fix a broke range check

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

19 years agoParse significantly more of the instruction pattern, now collecting and
Chris Lattner [Wed, 14 Sep 2005 20:53:42 +0000 (20:53 +0000)]
Parse significantly more of the instruction pattern, now collecting and
verifying information about the operands.

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

19 years agoFix some issues exposed by more testing. XORIS had the wrong operands
Chris Lattner [Wed, 14 Sep 2005 20:53:05 +0000 (20:53 +0000)]
Fix some issues exposed by more testing.  XORIS had the wrong operands
specified.  The various *imm operands defined by PPC are really all i32,
even though the actual immediate is restricted to a smaller value in it.

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

19 years agoVerify that set destinations occur first in the instruction operand list.
Chris Lattner [Wed, 14 Sep 2005 18:19:25 +0000 (18:19 +0000)]
Verify that set destinations occur first in the instruction operand list.

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

19 years agoFix some bugs noticed by new checking code
Chris Lattner [Wed, 14 Sep 2005 18:18:39 +0000 (18:18 +0000)]
Fix some bugs noticed by new checking code

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

19 years agoadd an accessor
Chris Lattner [Wed, 14 Sep 2005 18:02:53 +0000 (18:02 +0000)]
add an accessor

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

19 years agoFix the regression last night compiling povray
Chris Lattner [Wed, 14 Sep 2005 17:32:56 +0000 (17:32 +0000)]
Fix the regression last night compiling povray

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

19 years agofix a major regression from my patch this afternoon
Chris Lattner [Wed, 14 Sep 2005 06:06:45 +0000 (06:06 +0000)]
fix a major regression from my patch this afternoon

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

19 years agoremove some code that isn't ready for prime time
Chris Lattner [Wed, 14 Sep 2005 06:03:10 +0000 (06:03 +0000)]
remove some code that isn't ready for prime time

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

19 years agoSwitch to a slightly more structured representation for instructions
Chris Lattner [Wed, 14 Sep 2005 04:03:16 +0000 (04:03 +0000)]
Switch to a slightly more structured representation for instructions

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

19 years agoAdd some more checking/verification code
Chris Lattner [Wed, 14 Sep 2005 02:11:12 +0000 (02:11 +0000)]
Add some more checking/verification code

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

19 years agostart parsing instructions into patterns, start doing many more checks of
Chris Lattner [Wed, 14 Sep 2005 00:09:24 +0000 (00:09 +0000)]
start parsing instructions into patterns, start doing many more checks of
'set's.

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

19 years agowe don't need this proto any longer
Chris Lattner [Tue, 13 Sep 2005 22:05:21 +0000 (22:05 +0000)]
we don't need this proto any longer

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

19 years agodon't emit the namespace inside the class!
Chris Lattner [Tue, 13 Sep 2005 22:05:02 +0000 (22:05 +0000)]
don't emit the namespace inside the class!

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

19 years agoEmit code suitable for emission into the ISel class, allowing us to use/define
Chris Lattner [Tue, 13 Sep 2005 22:03:37 +0000 (22:03 +0000)]
Emit code suitable for emission into the ISel class, allowing us to use/define
methods.

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

19 years agomove the #include for the generated code into the isel class body so we
Chris Lattner [Tue, 13 Sep 2005 22:03:06 +0000 (22:03 +0000)]
move the #include for the generated code into the isel class body so we
can use/define class methods

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

19 years agocontinue xform function parsing
Chris Lattner [Tue, 13 Sep 2005 21:59:15 +0000 (21:59 +0000)]
continue xform function parsing

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

19 years agoStart parsing node transformation information
Chris Lattner [Tue, 13 Sep 2005 21:51:00 +0000 (21:51 +0000)]
Start parsing node transformation information

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

19 years agoAdd a new Record::getValueAsCode method to mirror the other getValueAs*
Chris Lattner [Tue, 13 Sep 2005 21:44:28 +0000 (21:44 +0000)]
Add a new Record::getValueAsCode method to mirror the other getValueAs*
methods.  Use it to simplify some code.

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

19 years agocompletely eliminate TreePattern::PatternType
Chris Lattner [Tue, 13 Sep 2005 21:20:49 +0000 (21:20 +0000)]
completely eliminate TreePattern::PatternType

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

19 years agoChange the arg lowering code to use copyfromreg from vregs associated
Chris Lattner [Tue, 13 Sep 2005 19:33:40 +0000 (19:33 +0000)]
Change the arg lowering code to use copyfromreg from vregs associated
with incoming arguments instead of the pregs themselves.  This fixes
the scheduler from causing problems by moving a copyfromreg for an argument
to after a select_cc node (now it can, and bad things won't happen).

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

19 years agoThis has been moved to the target-indep code
Chris Lattner [Tue, 13 Sep 2005 19:32:18 +0000 (19:32 +0000)]
This has been moved to the target-indep code

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

19 years agoThis code is no longer needed, it is moved to the target-indep code
Chris Lattner [Tue, 13 Sep 2005 19:31:44 +0000 (19:31 +0000)]
This code is no longer needed, it is moved to the target-indep code

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

19 years agoIf a function has liveins, and if the target requested that they be plopped
Chris Lattner [Tue, 13 Sep 2005 19:30:54 +0000 (19:30 +0000)]
If a function has liveins, and if the target requested that they be plopped
into particular vregs, emit copies into the entry MBB.

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

19 years agoMajik numbers are bad
Chris Lattner [Tue, 13 Sep 2005 19:03:13 +0000 (19:03 +0000)]
Majik numbers are bad

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

19 years agoRemove some dead vectors
Chris Lattner [Tue, 13 Sep 2005 18:47:49 +0000 (18:47 +0000)]
Remove some dead vectors

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

19 years agoAdd a simple xform to simplify array accesses with casts in the way.
Chris Lattner [Tue, 13 Sep 2005 18:36:04 +0000 (18:36 +0000)]
Add a simple xform to simplify array accesses with casts in the way.
This is useful for 178.galgel where resolution of dope vectors (by the
optimizer) causes the scales to become apparent.

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

19 years agoFix an issue where LSR would miss rewriting a use of an IV expression by a PHI node...
Chris Lattner [Tue, 13 Sep 2005 02:09:55 +0000 (02:09 +0000)]
Fix an issue where LSR would miss rewriting a use of an IV expression by a PHI node that is not the original PHI.

This fixes up a dot-product loop in galgel, speeding it up from 18.47s to
16.13s.

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

19 years agofails since linux-itanium headers are Different
Duraid Madina [Tue, 13 Sep 2005 01:03:53 +0000 (01:03 +0000)]
fails since linux-itanium headers are Different

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

19 years agoAdd a helper function, allowing us to simplify some code a bit, changing
Chris Lattner [Tue, 13 Sep 2005 00:40:14 +0000 (00:40 +0000)]
Add a helper function, allowing us to simplify some code a bit, changing
indentation, no functionality change

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

19 years agoImplement a simple xform to turn code like this:
Chris Lattner [Mon, 12 Sep 2005 23:23:25 +0000 (23:23 +0000)]
Implement a simple xform to turn code like this:

  if () { store A -> P; } else { store B -> P; }

into a PHI node with one store, in the most trival case.  This implements
load.ll:test10.

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

19 years agonew testcase
Chris Lattner [Mon, 12 Sep 2005 23:22:17 +0000 (23:22 +0000)]
new testcase

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

19 years agoAnother load-peephole optimization: do gcse when two loads are next to
Chris Lattner [Mon, 12 Sep 2005 22:21:03 +0000 (22:21 +0000)]
Another load-peephole optimization: do gcse when two loads are next to
each other.  This implements InstCombine/load.ll:test9

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

19 years agonew testcase
Chris Lattner [Mon, 12 Sep 2005 22:19:46 +0000 (22:19 +0000)]
new testcase

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

19 years agoImplement a trivial form of store->load forwarding where the store and the
Chris Lattner [Mon, 12 Sep 2005 22:00:15 +0000 (22:00 +0000)]
Implement a trivial form of store->load forwarding where the store and the
load are exactly consequtive.  This is picked up by other passes, but this
triggers thousands of times in fortran programs that use static locals
(and is thus a compile-time speedup).

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

19 years agonew testcase
Chris Lattner [Mon, 12 Sep 2005 21:59:22 +0000 (21:59 +0000)]
new testcase

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

19 years agoFix a regression from last night, which caused this pass to create invalid
Chris Lattner [Mon, 12 Sep 2005 17:11:27 +0000 (17:11 +0000)]
Fix a regression from last night, which caused this pass to create invalid
code for IV uses outside of loops that are not dominated by the latch block.
We should only convert these uses to use the post-inc value if they ARE
dominated by the latch block.

Also use a new LoopInfo method to simplify some code.

This fixes Transforms/LoopStrengthReduce/2005-09-12-UsesOutOutsideOfLoop.ll

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

19 years agorelax pattern match on name
Chris Lattner [Mon, 12 Sep 2005 17:09:40 +0000 (17:09 +0000)]
relax pattern match on name

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

19 years agonew testcase
Chris Lattner [Mon, 12 Sep 2005 17:08:15 +0000 (17:08 +0000)]
new testcase

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

19 years agoAdd a new getLoopLatch() method.
Chris Lattner [Mon, 12 Sep 2005 17:03:55 +0000 (17:03 +0000)]
Add a new getLoopLatch() method.

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

19 years agonew method
Chris Lattner [Mon, 12 Sep 2005 17:03:16 +0000 (17:03 +0000)]
new method

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

19 years ago_test:
Chris Lattner [Mon, 12 Sep 2005 06:04:47 +0000 (06:04 +0000)]
_test:
        li r2, 0
LBB_test_1:     ; no_exit.2
        li r5, 0
        stw r5, 0(r3)
        addi r2, r2, 1
        addi r3, r3, 4
        cmpwi cr0, r2, 701
        blt cr0, LBB_test_1     ; no_exit.2
LBB_test_2:     ; loopexit.2.loopexit
        addi r2, r2, 1
        stw r2, 0(r4)
        blr
[zion ~/llvm]$ cat > ~/xx
Uses of IV's outside of the loop should use hte post-incremented version
of the IV, not the preincremented version.  This helps many loops (e.g. in sixtrack)
which used to generate code like this (this is the code from the
dont-hoist-simple-loop-constants.ll testcase):

_test:
        li r2, 0                 **** IV starts at 0
LBB_test_1:     ; no_exit.2
        or r5, r2, r2            **** Copy for loop exit
        li r2, 0
        stw r2, 0(r3)
        addi r3, r3, 4
        addi r2, r5, 1
        addi r6, r5, 2           **** IV+2
        cmpwi cr0, r6, 701
        blt cr0, LBB_test_1     ; no_exit.2
LBB_test_2:     ; loopexit.2.loopexit
        addi r2, r5, 2       ****  IV+2
        stw r2, 0(r4)
        blr

And now generated code like this:

_test:
        li r2, 1               *** IV starts at 1
LBB_test_1:     ; no_exit.2
        li r5, 0
        stw r5, 0(r3)
        addi r2, r2, 1
        addi r3, r3, 4
        cmpwi cr0, r2, 701     *** IV.postinc + 0
        blt cr0, LBB_test_1
LBB_test_2:     ; loopexit.2.loopexit
        stw r2, 0(r4)          *** IV.postinc + 0
        blr

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

19 years agonew testcase
Chris Lattner [Mon, 12 Sep 2005 05:50:15 +0000 (05:50 +0000)]
new testcase

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

19 years agoRegenerate
Chris Lattner [Mon, 12 Sep 2005 05:30:06 +0000 (05:30 +0000)]
Regenerate

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

19 years agoRearrange two rules, which apparently makes some versions of bison happier.
Chris Lattner [Mon, 12 Sep 2005 05:29:43 +0000 (05:29 +0000)]
Rearrange two rules, which apparently makes some versions of bison happier.

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

19 years agoMake sure to disable 64-bit extensions for this test
Chris Lattner [Sun, 11 Sep 2005 03:50:38 +0000 (03:50 +0000)]
Make sure to disable 64-bit extensions for this test

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

19 years agoFix more Visual Studio build problems.
Jeff Cohen [Sat, 10 Sep 2005 02:33:17 +0000 (02:33 +0000)]
Fix more Visual Studio build problems.

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

19 years agoFix miscellaneous Visual Studio build problems.
Jeff Cohen [Sat, 10 Sep 2005 02:00:02 +0000 (02:00 +0000)]
Fix miscellaneous Visual Studio build problems.

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

19 years agoimplement Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll.
Chris Lattner [Sat, 10 Sep 2005 01:18:45 +0000 (01:18 +0000)]
implement Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll.

We used to emit this code for it:

_test:
        li r2, 1     ;; Value tying up a register for the whole loop
        li r5, 0
LBB_test_1:     ; no_exit.2
        or r6, r5, r5
        li r5, 0
        stw r5, 0(r3)
        addi r5, r6, 1
        addi r3, r3, 4
        add r7, r2, r5  ;; should be addi r7, r5, 1
        cmpwi cr0, r7, 701
        blt cr0, LBB_test_1     ; no_exit.2
LBB_test_2:     ; loopexit.2.loopexit
        addi r2, r6, 2
        stw r2, 0(r4)
        blr

now we emit this:

_test:
        li r2, 0
LBB_test_1:     ; no_exit.2
        or r5, r2, r2
        li r2, 0
        stw r2, 0(r3)
        addi r3, r3, 4
        addi r2, r5, 1
        addi r6, r5, 2   ;; whoa, fold those adds!
        cmpwi cr0, r6, 701
        blt cr0, LBB_test_1     ; no_exit.2
LBB_test_2:     ; loopexit.2.loopexit
        addi r2, r5, 2
        stw r2, 0(r4)
        blr

more improvement coming.

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

19 years agonew testcase
Chris Lattner [Sat, 10 Sep 2005 01:14:37 +0000 (01:14 +0000)]
new testcase

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

19 years agoPowerPC cannot truncstore i1 natively
Chris Lattner [Sat, 10 Sep 2005 00:21:06 +0000 (00:21 +0000)]
PowerPC cannot truncstore i1 natively

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

19 years agoAllow targets to say they don't support truncstore i1 (which includes a mask
Chris Lattner [Sat, 10 Sep 2005 00:20:18 +0000 (00:20 +0000)]
Allow targets to say they don't support truncstore i1 (which includes a mask
when storing to an 8-bit memory location), as most don't.

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

19 years agoAdd a missing #include, patch courtesy of Baptiste Lepilleur.
Chris Lattner [Fri, 9 Sep 2005 23:53:39 +0000 (23:53 +0000)]
Add a missing #include, patch courtesy of Baptiste Lepilleur.

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

19 years agoFix a problem duraid encountered on itanium where this folding:
Chris Lattner [Fri, 9 Sep 2005 23:00:07 +0000 (23:00 +0000)]
Fix a problem duraid encountered on itanium where this folding:
select (x < y), 1, 0 -> (x < y) incorrectly: the setcc returns i1 but the
select returned i32.  Add the zero extend as needed.

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

19 years agoFix a crash viewing dags that have target nodes in them
Chris Lattner [Fri, 9 Sep 2005 22:35:03 +0000 (22:35 +0000)]
Fix a crash viewing dags that have target nodes in them

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

19 years agoI forgot that we always spill fp values as 64-bits. Implement spill folding
Chris Lattner [Fri, 9 Sep 2005 21:59:44 +0000 (21:59 +0000)]
I forgot that we always spill fp values as 64-bits.  Implement spill folding
for FP as well.  This triggers a couple dozen times on 177.mesa (for example).

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

19 years agoFix a problem that Nate noticed, where spill code was not getting coallesced
Chris Lattner [Fri, 9 Sep 2005 21:46:49 +0000 (21:46 +0000)]
Fix a problem that Nate noticed, where spill code was not getting coallesced
with copies, leading to code like this:

       lwz r4, 380(r1)
       or r10, r4, r4    ;; Last use of r4

By teaching the PPC backend how to fold spills into copies, we now get this
code:

       lwz r10, 380(r1)

wow. :)

This reduces a testcase nate sent me from 1505 instructions to 1484.

Note that this could handle FP values but doesn't currently, for reasons
mentioned in the patch

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

19 years agocode cleanup
Chris Lattner [Fri, 9 Sep 2005 20:51:08 +0000 (20:51 +0000)]
code cleanup

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

19 years agoUse continue in the use-processing loop to make it clear what the early exits
Chris Lattner [Fri, 9 Sep 2005 20:29:51 +0000 (20:29 +0000)]
Use continue in the use-processing loop to make it clear what the early exits
are, simplify logic, and cause things to not be nested as deeply.  This also
uses MRI->areAliases instead of an explicit loop.

No functionality change, just code cleanup.

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

19 years agoLast round of 2-node folds from SD.cpp. Will move on to 3 node ops such
Nate Begeman [Fri, 9 Sep 2005 19:49:52 +0000 (19:49 +0000)]
Last round of 2-node folds from SD.cpp.  Will  move on to 3 node ops such
as setcc and select next.

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

19 years agoremove debugging code *slaps head*
Chris Lattner [Fri, 9 Sep 2005 19:19:20 +0000 (19:19 +0000)]
remove debugging code *slaps head*

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

19 years agoWhen spilling a live range that is used multiple times by one instruction,
Chris Lattner [Fri, 9 Sep 2005 19:17:47 +0000 (19:17 +0000)]
When spilling a live range that is used multiple times by one instruction,
only add a reload live range once for the instruction.  This is one step
towards fixing a regalloc pessimization that Nate notice, but is later undone
by the spiller (so no code is changed).

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

19 years agoTeach the code generator that rlwimi is commutable if the rotate amount
Chris Lattner [Fri, 9 Sep 2005 18:17:41 +0000 (18:17 +0000)]
Teach the code generator that rlwimi is commutable if the rotate amount
is zero.  This lets the register allocator elide some copies in some cases.

This implements CodeGen/PowerPC/rlwimi-commute.ll

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

19 years agoAdded targets to speed up build of llc.
Jim Laskey [Fri, 9 Sep 2005 17:50:20 +0000 (17:50 +0000)]
Added targets to speed up build of llc.

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

19 years agoNew testcase, neither should require a register-register copy
Chris Lattner [Fri, 9 Sep 2005 17:48:57 +0000 (17:48 +0000)]
New testcase, neither should require a register-register copy

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

19 years agoadd an accessor to provide more checking
Chris Lattner [Fri, 9 Sep 2005 01:15:01 +0000 (01:15 +0000)]
add an accessor to provide more checking

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

19 years agouse new accessors to simplify code. Add checking to make sure top-level instr
Chris Lattner [Fri, 9 Sep 2005 01:11:44 +0000 (01:11 +0000)]
use new accessors to simplify code.  Add checking to make sure top-level instr
definitions are void

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

19 years agoadd some accessors
Chris Lattner [Fri, 9 Sep 2005 01:11:17 +0000 (01:11 +0000)]
add some accessors

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

19 years agoIntroduce two new concepts:
Chris Lattner [Fri, 9 Sep 2005 00:39:56 +0000 (00:39 +0000)]
Introduce two new concepts:
1. Add support for defining Pattern's, which can match expressions when there
   is no instruction that directly implements something.  Instructions usually
   implicitly define patterns.
2. Add support for defining SDNodeXForm's, which are node transformations.
   This seperates the concept of a node xform out from the existing predicate
   support.

Using this new stuff, we add a few instruction patterns, one for testing, and
two for OR/XOR by an arbitrary immediate.

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

19 years agoFix incorrect comment
Chris Lattner [Thu, 8 Sep 2005 23:26:30 +0000 (23:26 +0000)]
Fix incorrect comment

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

19 years agoImplement a complete type inference system for dag patterns, based on the
Chris Lattner [Thu, 8 Sep 2005 23:22:48 +0000 (23:22 +0000)]
Implement a complete type inference system for dag patterns, based on the
constraints defined in the DAG node definitions in the .td files.  This
allows us to infer (and check!) the types for all nodes in the current
ppc .td file.  For example, instead of:

Inst pattern EQV:       (set GPRC:i32:$rT, (xor (xor GPRC:i32:$rA, GPRC:i32:$rB), (imm)<<Predicate_immAllOnes>>))

we now fully infer:

Inst pattern EQV:       (set:void GPRC:i32:$rT, (xor:i32 (xor:i32 GPRC:i32:$rA, GPRC:i32:$rB), (imm:i32)<<Predicate_immAllOnes>>))

from:  (set GPRC:$rT, (not (xor GPRC:$rA, GPRC:$rB)))

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

19 years agowhitespace/comment changes, no functionality diffs
Chris Lattner [Thu, 8 Sep 2005 23:17:26 +0000 (23:17 +0000)]
whitespace/comment changes, no functionality diffs

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

19 years agoCompute the value types that are natively supported by a target.
Chris Lattner [Thu, 8 Sep 2005 21:43:21 +0000 (21:43 +0000)]
Compute the value types that are natively supported by a target.

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

19 years agoParse information about type constraints on SDNodes
Chris Lattner [Thu, 8 Sep 2005 21:27:15 +0000 (21:27 +0000)]
Parse information about type constraints on SDNodes

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

19 years agouse node info in the one place we currently use it
Chris Lattner [Thu, 8 Sep 2005 21:04:46 +0000 (21:04 +0000)]
use node info in the one place we currently use it

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

19 years agostart parsing SDNode info records
Chris Lattner [Thu, 8 Sep 2005 21:03:01 +0000 (21:03 +0000)]
start parsing SDNode info records

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

19 years agoMove yet more folds over to the dag combiner from sd.cpp
Nate Begeman [Thu, 8 Sep 2005 20:18:10 +0000 (20:18 +0000)]
Move yet more folds over to the dag combiner from sd.cpp

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

19 years agoAdd a bunch of stuff needed for node type inference. Move 'BLR' down with
Chris Lattner [Thu, 8 Sep 2005 19:50:41 +0000 (19:50 +0000)]
Add a bunch of stuff needed for node type inference.  Move 'BLR' down with
the rest of the instructions, add comment markers to seperate portions of
the file into logical parts

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

19 years agoFix indentation
Chris Lattner [Thu, 8 Sep 2005 19:47:28 +0000 (19:47 +0000)]
Fix indentation

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

19 years agoregenerate
Chris Lattner [Thu, 8 Sep 2005 18:48:47 +0000 (18:48 +0000)]
regenerate

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

19 years agoAdd support for automatically created anonymous definitions.
Chris Lattner [Thu, 8 Sep 2005 18:48:23 +0000 (18:48 +0000)]
Add support for automatically created anonymous definitions.
This implements Regression/TableGen/AnonDefinitionOnDemand.td

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

19 years agox and X should be structurally identical
Chris Lattner [Thu, 8 Sep 2005 18:47:43 +0000 (18:47 +0000)]
x and X should be structurally identical

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

19 years agonew expression type
Chris Lattner [Thu, 8 Sep 2005 18:47:21 +0000 (18:47 +0000)]
new expression type

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

19 years agoregenerate
Chris Lattner [Thu, 8 Sep 2005 18:22:57 +0000 (18:22 +0000)]
regenerate

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

19 years agoTabs to spaces.
Chris Lattner [Thu, 8 Sep 2005 18:22:35 +0000 (18:22 +0000)]
Tabs to spaces.

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

19 years agoKeep names even when inlining. This allows us to realize that ADDI is:
Chris Lattner [Thu, 8 Sep 2005 17:45:12 +0000 (17:45 +0000)]
Keep names even when inlining.  This allows us to realize that ADDI is:

(set GPRC:i32:$rD, (add GPRC:i32:$rA, (imm)<<Predicate_immSExt16>>:$imm))

not:

(set GPRC:i32:$rD, (add GPRC:i32:$rA, (imm)<<Predicate_immSExt16>>))

(we keep the ":$imm")

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

19 years agoadd patterns for x?oris?
Chris Lattner [Thu, 8 Sep 2005 17:40:49 +0000 (17:40 +0000)]
add patterns for x?oris?

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

19 years agoadd patterns to the addi/addis/mulli etc instructions. Define predicates
Chris Lattner [Thu, 8 Sep 2005 17:33:10 +0000 (17:33 +0000)]
add patterns to the addi/addis/mulli etc instructions.  Define predicates
for matching signed 16-bit and shifted 16-bit ppc immediates

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

19 years agoAdd patterns for some new instructions, allowing the use of the ineg fragment.
Chris Lattner [Thu, 8 Sep 2005 17:01:54 +0000 (17:01 +0000)]
Add patterns for some new instructions, allowing the use of the ineg fragment.

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

19 years agoadd some missing PPC backend files
Chris Lattner [Wed, 7 Sep 2005 23:57:00 +0000 (23:57 +0000)]
add some missing PPC backend files

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

19 years agoAdd tblgen fpcmp and the nightly tester to the utils folder
Chris Lattner [Wed, 7 Sep 2005 23:53:49 +0000 (23:53 +0000)]
Add tblgen fpcmp and the nightly tester to the utils folder

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