oota-llvm.git
18 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

18 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

18 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

18 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

18 years agoignore generated files
Chris Lattner [Wed, 7 Sep 2005 23:47:44 +0000 (23:47 +0000)]
ignore generated files

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

18 years agoRemove some cases handled by the generated portion of the isel
Chris Lattner [Wed, 7 Sep 2005 23:45:15 +0000 (23:45 +0000)]
Remove some cases handled by the generated portion of the isel

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

18 years agoInitial cut of the dag isel generator. This is still very much a work in
Chris Lattner [Wed, 7 Sep 2005 23:44:43 +0000 (23:44 +0000)]
Initial cut of the dag isel generator.  This is still very much a work in
progress.  It correctly parses instructions and pattern fragments and glues
together pattern fragments into instructions.

The only code it generates currently is some boilerplate code for things
like the EntryNode.

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

18 years agoAnother round of dag combiner changes. This fixes some missing XOR folds
Nate Begeman [Wed, 7 Sep 2005 23:25:52 +0000 (23:25 +0000)]
Another round of dag combiner changes.  This fixes some missing XOR folds
as well as fixing how we replace old values with new values.

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

18 years agoFix a bug that Tzu-Chien Chiu noticed: live interval analysis does NOT
Chris Lattner [Wed, 7 Sep 2005 17:34:39 +0000 (17:34 +0000)]
Fix a bug that Tzu-Chien Chiu noticed: live interval analysis does NOT
preserve livevar

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

18 years agoImplement a common missing fold, (add (add x, c1), c2) -> (add x, c1+c2).
Nate Begeman [Wed, 7 Sep 2005 16:09:19 +0000 (16:09 +0000)]
Implement a common missing fold, (add (add x, c1), c2) -> (add x, c1+c2).
This restores all of stanford to being identical with and without the dag
combiner with the add folding turned off in sd.cpp.

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

18 years agoOn non-apple systems, when using -march=ppc32, do not print:
Chris Lattner [Wed, 7 Sep 2005 05:45:33 +0000 (05:45 +0000)]
On non-apple systems, when using -march=ppc32, do not print:

'' is not a recognized processor for this target (ignoring processor)

Default to "generic" instead of "" for the default CPU.

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

18 years agoPrint:
Chris Lattner [Wed, 7 Sep 2005 05:44:14 +0000 (05:44 +0000)]
Print:
'' is not a recognized processor for this target (ignoring processor)

instead of:

 is not a recognized processor for this target (ignoring processor)

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

18 years agoFix a bug nate ran into with replacealluseswith. In the recursive cse case,
Chris Lattner [Wed, 7 Sep 2005 05:37:01 +0000 (05:37 +0000)]
Fix a bug nate ran into with replacealluseswith.  In the recursive cse case,
we were losing a node, causing an assertion to fail.  Now we eagerly delete
discovered CSE's, and provide an optional vector to keep track of these
discovered equivalences.

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

18 years agoAdd a new argument to ReplaceAllUsesWith to keep track of nodes deleted by
Chris Lattner [Wed, 7 Sep 2005 05:36:18 +0000 (05:36 +0000)]
Add a new argument to ReplaceAllUsesWith to keep track of nodes deleted by
this method

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

18 years agoAdd an option to the DAG Combiner to enable it for beta runs, and turn on
Nate Begeman [Wed, 7 Sep 2005 00:15:36 +0000 (00:15 +0000)]
Add an option to the DAG Combiner to enable it for beta runs, and turn on
that option for PowerPC's beta.

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

18 years agoRename a class. These files are being migrated to the new isel and I want to
Chris Lattner [Tue, 6 Sep 2005 22:51:34 +0000 (22:51 +0000)]
Rename a class.  These files are being migrated to the new isel and I want to
reuse the names

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

18 years agoTest the new 64bit i64<->fp functionality
Nate Begeman [Tue, 6 Sep 2005 22:23:15 +0000 (22:23 +0000)]
Test the new 64bit i64<->fp functionality

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

18 years agoImplement i64<->fp using the fctidz/fcfid instructions on PowerPC when we
Nate Begeman [Tue, 6 Sep 2005 22:03:27 +0000 (22:03 +0000)]
Implement i64<->fp using the fctidz/fcfid instructions on PowerPC when we
are allowed to generate 64-bit-only PowerPC instructions for 32 bit hosts,
such as the PowerPC 970.

This speeds up 189.lucas from 81.99 to 32.64 seconds.

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

18 years agoregenerate
Chris Lattner [Tue, 6 Sep 2005 21:23:27 +0000 (21:23 +0000)]
regenerate

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

18 years agoTighten up the specification to allow TableGen/nested-comment.td to pass
Chris Lattner [Tue, 6 Sep 2005 21:23:09 +0000 (21:23 +0000)]
Tighten up the specification to allow TableGen/nested-comment.td to pass
(fixing a bug where / in a /* */ comment would cause it to not close).

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

18 years agonew testcase: tblgen should grok this.
Chris Lattner [Tue, 6 Sep 2005 21:22:15 +0000 (21:22 +0000)]
new testcase: tblgen should grok this.

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

18 years agoFix up the AssertXext problem, as well as adding it at calls
Andrew Lenharth [Tue, 6 Sep 2005 17:00:23 +0000 (17:00 +0000)]
Fix up the AssertXext problem, as well as adding it at calls

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

18 years agoAdd note about future optimization noted in the ppc compiler writer's guide
Nate Begeman [Tue, 6 Sep 2005 15:30:48 +0000 (15:30 +0000)]
Add note about future optimization noted in the ppc compiler writer's guide

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

18 years agoAdd accessor for 64bit flag, so that we can tell when it is safe to
Nate Begeman [Tue, 6 Sep 2005 15:30:12 +0000 (15:30 +0000)]
Add accessor for 64bit flag, so that we can tell when it is safe to
generate the fun in-register fp<->long instructions.

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

18 years agoNext round of DAGCombiner changes. This version now passes all the tests
Nate Begeman [Tue, 6 Sep 2005 04:43:02 +0000 (04:43 +0000)]
Next round of DAGCombiner changes.  This version now passes all the tests
I have run so far when run before Legalize.  It still needs to pick up the
SetCC folds, and nodes that use SetCC.

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

18 years agoAdd a requirement, patch contributed by Henrik Bach.
Chris Lattner [Tue, 6 Sep 2005 04:07:15 +0000 (04:07 +0000)]
Add a requirement, patch contributed by Henrik Bach.

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

18 years agorevert part of the last change, should fix regressions
Andrew Lenharth [Sun, 4 Sep 2005 06:12:19 +0000 (06:12 +0000)]
revert part of the last change, should fix regressions

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

18 years agoexplicitly specify an operands list for patterns with inputs (e.g. neg)
Chris Lattner [Sat, 3 Sep 2005 01:28:40 +0000 (01:28 +0000)]
explicitly specify an operands list for patterns with inputs (e.g. neg)

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

18 years agoinclude the dag isel fragment
Chris Lattner [Sat, 3 Sep 2005 01:17:22 +0000 (01:17 +0000)]
include the dag isel fragment

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

18 years agoask for a dag isel
Chris Lattner [Sat, 3 Sep 2005 01:15:41 +0000 (01:15 +0000)]
ask for a dag isel

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

18 years agoallow for a target to ask for a dag isel
Chris Lattner [Sat, 3 Sep 2005 01:15:25 +0000 (01:15 +0000)]
allow for a target to ask for a dag isel

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

18 years agoAdd an option and stuff implementation of a dag isel emitter
Chris Lattner [Sat, 3 Sep 2005 01:14:03 +0000 (01:14 +0000)]
Add an option and stuff implementation of a dag isel emitter

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

18 years agoFix a checking failure in gs
Chris Lattner [Sat, 3 Sep 2005 01:04:40 +0000 (01:04 +0000)]
Fix a checking failure in gs

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

18 years agoChange the isel to not break out of the big giant switch. Instead, the
Chris Lattner [Sat, 3 Sep 2005 00:53:47 +0000 (00:53 +0000)]
Change the isel to not break out of the big giant switch.  Instead, the
switch should never be exited, so its bottom is now unreachable.

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

18 years agorearrange logical ops to group them together more consistently.
Chris Lattner [Sat, 3 Sep 2005 00:21:51 +0000 (00:21 +0000)]
rearrange logical ops to group them together more consistently.
Define the PatFrag class which can be used to define subpatterns to match
things with.  Define 'not', and use it to define the patterns for andc,
nand, etc.

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

18 years agoAdd AND/OR/XOR
Chris Lattner [Fri, 2 Sep 2005 22:35:53 +0000 (22:35 +0000)]
Add AND/OR/XOR

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

18 years agoNext round of DAG Combiner changes. Just need to support multiple return
Nate Begeman [Fri, 2 Sep 2005 21:18:40 +0000 (21:18 +0000)]
Next round of DAG Combiner changes.  Just need to support multiple return
values, and then we should be able to hook it up.

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

18 years agoAdd some initial patterns to simple binary instructions, though they
Chris Lattner [Fri, 2 Sep 2005 21:18:00 +0000 (21:18 +0000)]
Add some initial patterns to simple binary instructions, though they
currently don't do anything.  This elides patterns for binary operators
that ping on the carry flag, since we don't model it yet.

This patch also removes PPC::SUB, because it is dead.

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

18 years agoClean up some code from the last checkin
Chris Lattner [Fri, 2 Sep 2005 20:32:45 +0000 (20:32 +0000)]
Clean up some code from the last checkin

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

18 years agoFix a bug in legalize where it would emit two calls to libcalls that return
Chris Lattner [Fri, 2 Sep 2005 20:26:58 +0000 (20:26 +0000)]
Fix a bug in legalize where it would emit two calls to libcalls that return
i64 values on targets that need that expanded to 32-bit registers.  This fixes
PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll and speeds up 189.lucas from
taking 122.72s to 81.96s on my desktop.

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

18 years agoTest that converting from double to int64 results in one libcall, not one
Chris Lattner [Fri, 2 Sep 2005 20:24:10 +0000 (20:24 +0000)]
Test that converting from double to int64 results in one libcall, not one
and a dead one.  This is a legalize bug

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

18 years agoturn on dag isel by default
Chris Lattner [Fri, 2 Sep 2005 19:53:54 +0000 (19:53 +0000)]
turn on dag isel by default

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

18 years agoMake sure to auto-cse nullary ops
Chris Lattner [Fri, 2 Sep 2005 19:36:17 +0000 (19:36 +0000)]
Make sure to auto-cse nullary ops

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

18 years agoadd a map for nullary ops
Chris Lattner [Fri, 2 Sep 2005 19:35:42 +0000 (19:35 +0000)]
add a map for nullary ops

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

18 years agoAdd help support for -mcpu and -mattr.
Jim Laskey [Fri, 2 Sep 2005 19:27:43 +0000 (19:27 +0000)]
Add help support for -mcpu and -mattr.

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

18 years agoFix some buggy logic where we would try to remove nodes with two operands
Chris Lattner [Fri, 2 Sep 2005 19:15:44 +0000 (19:15 +0000)]
Fix some buggy logic where we would try to remove nodes with two operands
from the binary ops map, even if they had multiple results.  This latent bug
caused a few failures with the dag isel last night.

To prevent stuff like this from happening in the future, add some really
strict checking to make sure that the CSE maps always match up with reality!

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

18 years agoPull out Lowering in preperation for multiple ISels. Oh, and get rid of some stuff
Andrew Lenharth [Fri, 2 Sep 2005 18:46:02 +0000 (18:46 +0000)]
Pull out Lowering in preperation for multiple ISels.  Oh, and get rid of some stuff

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

18 years agoDon't create zero sized stack objects even for array allocas with a zero
Chris Lattner [Fri, 2 Sep 2005 18:41:28 +0000 (18:41 +0000)]
Don't create zero sized stack objects even for array allocas with a zero
number of elements.

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

18 years agoDecouple fsqrt from gpul optimizations, implementing fsqrt.ll.
Chris Lattner [Fri, 2 Sep 2005 18:33:05 +0000 (18:33 +0000)]
Decouple fsqrt from gpul optimizations, implementing fsqrt.ll.
Remove the -enable-gpopt option which is subsumed by feature flags.

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

18 years agonew testcase to ensure fsqrt is generated for correct subtargets only, and
Chris Lattner [Fri, 2 Sep 2005 18:32:22 +0000 (18:32 +0000)]
new testcase to ensure fsqrt is generated for correct subtargets only, and
that the fsqrt feature works.

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

18 years agoMove a bunch of non-deprecated methods above the "deprecated line"
Chris Lattner [Fri, 2 Sep 2005 18:16:20 +0000 (18:16 +0000)]
Move a bunch of non-deprecated methods above the "deprecated line"

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

18 years agoFix the release build, noticed by Eric van Riet Paap
Chris Lattner [Fri, 2 Sep 2005 07:09:28 +0000 (07:09 +0000)]
Fix the release build, noticed by Eric van Riet Paap

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

18 years agoFix a problem that Dan Berlin noticed, where reassociation would not succeed
Chris Lattner [Fri, 2 Sep 2005 07:07:58 +0000 (07:07 +0000)]
Fix a problem that Dan Berlin noticed, where reassociation would not succeed
in building maximal expressions before simplifying them.  In particular, i
cases like this:

X-(A+B+X)

the code would consider A+B+X to be a maximal expression (not understanding
that the single use '-' would be turned into a + later), simplify it (a noop)
then later get simplified again.

Each of these simplify steps is where the cost of reassociation comes from,
so this patch should speed up the already fast pass a bit.

Thanks to Dan for noticing this!

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

18 years agoAvoid creating garbage instructions, just move the old add instruction
Chris Lattner [Fri, 2 Sep 2005 06:38:04 +0000 (06:38 +0000)]
Avoid creating garbage instructions, just move the old add instruction
to where we need it when converting -(A+B+C) -> -A + -B + -C.

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

18 years agonew testcase for recent bugfix
Chris Lattner [Fri, 2 Sep 2005 06:12:12 +0000 (06:12 +0000)]
new testcase for recent bugfix

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

18 years agoadd some assertions and fix problems where reassociate could access the
Chris Lattner [Fri, 2 Sep 2005 05:23:22 +0000 (05:23 +0000)]
add some assertions and fix problems where reassociate could access the
Ops vector out of range

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

18 years agoFix VC++ build errors
Jeff Cohen [Fri, 2 Sep 2005 02:51:42 +0000 (02:51 +0000)]
Fix VC++ build errors

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

18 years agoRestore this patch now that the latent bug has been fixed
Chris Lattner [Fri, 2 Sep 2005 01:24:55 +0000 (01:24 +0000)]
Restore this patch now that the latent bug has been fixed

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

18 years agoMake sure to legalize assert[zs]ext's operand correctly
Chris Lattner [Fri, 2 Sep 2005 01:15:01 +0000 (01:15 +0000)]
Make sure to legalize assert[zs]ext's operand correctly

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

18 years agoRevert the previous patch which causes a mysterious regression in toast.
Chris Lattner [Fri, 2 Sep 2005 00:47:05 +0000 (00:47 +0000)]
Revert the previous patch which causes a mysterious regression in toast.

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

18 years agoTeach live intervals to not crash on dead livein regs
Chris Lattner [Fri, 2 Sep 2005 00:20:32 +0000 (00:20 +0000)]
Teach live intervals to not crash on dead livein regs

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

18 years agoFor values that are live across basic blocks and need promotion, use ANY_EXTEND
Chris Lattner [Fri, 2 Sep 2005 00:19:37 +0000 (00:19 +0000)]
For values that are live across basic blocks and need promotion, use ANY_EXTEND
instead of ZERO_EXTEND to eliminate extraneous extensions.  This eliminates
dead zero extensions on formal arguments and other cases on PPC, implementing
the newly tightened up test/Regression/CodeGen/PowerPC/small-arguments.ll test.

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

18 years agolegalize ANY_EXTEND appropriately
Chris Lattner [Fri, 2 Sep 2005 00:18:10 +0000 (00:18 +0000)]
legalize ANY_EXTEND appropriately

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

18 years agoAdd support for ANY_EXTEND and add a few minor folds for it
Chris Lattner [Fri, 2 Sep 2005 00:17:32 +0000 (00:17 +0000)]
Add support for ANY_EXTEND and add a few minor folds for it

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

18 years agoHandle any_extend like zext
Chris Lattner [Fri, 2 Sep 2005 00:16:09 +0000 (00:16 +0000)]
Handle any_extend like zext

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

18 years agoHandle ANY_EXTEND like ZERO_EXTEND. Simplify the extend/truncate code on
Chris Lattner [Fri, 2 Sep 2005 00:15:30 +0000 (00:15 +0000)]
Handle ANY_EXTEND like ZERO_EXTEND.  Simplify the extend/truncate code on
the observation that it only has to handle i1 -> i64 and i64 -> i1.

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

18 years agoAdd a new ANY_EXTEND node, which operates like an extension but has undefined
Chris Lattner [Fri, 2 Sep 2005 00:14:40 +0000 (00:14 +0000)]
Add a new ANY_EXTEND node, which operates like an extension but has undefined
top bits.

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

18 years agoThis should permit NOT and's, not even dead ones.
Chris Lattner [Fri, 2 Sep 2005 00:13:56 +0000 (00:13 +0000)]
This should permit NOT and's, not even dead ones.

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

18 years agoImplement small-arguments.ll:test3 by teaching the DAG optimizer that
Chris Lattner [Thu, 1 Sep 2005 23:44:32 +0000 (23:44 +0000)]
Implement small-arguments.ll:test3 by teaching the DAG optimizer that
the results of calls to functions returning small values are properly
sign/zero extended.

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

18 years agoAnother case that shouldn't have sign extends: functions returning short
Chris Lattner [Thu, 1 Sep 2005 23:43:58 +0000 (23:43 +0000)]
Another case that shouldn't have sign extends: functions returning short
are known to return properly sign extended values, no need for an explicit
extension.

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

18 years agoFix some code in the current node combining code, spotted when it was moved
Nate Begeman [Thu, 1 Sep 2005 23:25:49 +0000 (23:25 +0000)]
Fix some code in the current node combining code, spotted when it was moved
over to DAGCombiner.cpp

1. Don't assume that SetCC returns i1 when folding (xor (setcc) constant)
2. Don't duplicate code in folding AND with AssertZext that is handled by
   MaskedValueIsZero

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

18 years agoImplement first round of feedback from chris (there's still a couple things
Nate Begeman [Thu, 1 Sep 2005 23:24:04 +0000 (23:24 +0000)]
Implement first round of feedback from chris (there's still a couple things
left to do).

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

18 years agoAlign functions to 16-byte boundaries, to eliminate noise in performance measurements...
Chris Lattner [Thu, 1 Sep 2005 23:08:50 +0000 (23:08 +0000)]
Align functions to 16-byte boundaries, to eliminate noise in performance measurements.  This improves the performance of 'treeadd' by about 20% with the dag
isel, restoring it to the pattern-isel level (which happens to get the alignment right).

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

18 years agoLocal labels on darwin apparently start with just 'L', not .L like other
Chris Lattner [Thu, 1 Sep 2005 21:48:35 +0000 (21:48 +0000)]
Local labels on darwin apparently start with just 'L', not .L like other
platforms.  This reduces executable size and makes shark realize the actual
bounds of functions instead of showing each MBB as a function :)

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

18 years ago1. Use SubtargetFeatures in llc/lli.
Jim Laskey [Thu, 1 Sep 2005 21:38:21 +0000 (21:38 +0000)]
1. Use SubtargetFeatures in llc/lli.

2. Propagate feature "string" to all targets.

3. Implement use of SubtargetFeatures in PowerPCTargetSubtarget.

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

18 years agoThis new class provides support for platform specific "features". The intent
Jim Laskey [Thu, 1 Sep 2005 21:36:18 +0000 (21:36 +0000)]
This new class provides support for platform specific "features".  The intent
is to manage processor specific attributes from the command line.  See examples
of use in llc/lli and PowerPCTargetSubtarget.

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

18 years agoImplement dynamic allocas correctly. In particular, because we were copying
Chris Lattner [Thu, 1 Sep 2005 21:31:30 +0000 (21:31 +0000)]
Implement dynamic allocas correctly.  In particular, because we were copying
directly out of R1 (without using a CopyFromReg, which uses a chain), multiple
allocas were getting CSE'd together, producing bogus code.  For this:

int %foo(bool %X, int %A, int %B) {
        br bool %X, label %T, label %F
F:
        %G = alloca int
        %H = alloca int
        store int %A, int* %G
        store int %B, int* %H
        %R = load int* %G
        ret int %R
T:
        ret int 0
}

We were generating:

_foo:
        stwu r1, -16(r1)
        stw r31, 4(r1)
        or r31, r1, r1
        stw r1, 12(r31)
        cmpwi cr0, r3, 0
        bne cr0, .LBB_foo_2     ; T
.LBB_foo_1:     ; F
        li r2, 16
        subf r2, r2, r1   ;; One alloca
        or r1, r2, r2
        or r3, r1, r1
        or r1, r2, r2
        or r2, r1, r1
        stw r4, 0(r3)
        stw r5, 0(r2)
        lwz r3, 0(r3)
        lwz r1, 12(r31)
        lwz r31, 4(r31)
        lwz r1, 0(r1)
        blr
.LBB_foo_2:     ; T
        li r3, 0
        lwz r1, 12(r31)
        lwz r31, 4(r31)
        lwz r1, 0(r1)
        blr

Now we generate:

_foo:
        stwu r1, -16(r1)
        stw r31, 4(r1)
        or r31, r1, r1
        stw r1, 12(r31)
        cmpwi cr0, r3, 0
        bne cr0, .LBB_foo_2     ; T
.LBB_foo_1:     ; F
        or r2, r1, r1
        li r3, 16
        subf r2, r3, r2  ;; Alloca 1
        or r1, r2, r2
        or r2, r1, r1
        or r6, r1, r1
        subf r3, r3, r6  ;; Alloca 2
        or r1, r3, r3
        or r3, r1, r1
        stw r4, 0(r2)
        stw r5, 0(r3)
        lwz r3, 0(r2)
        lwz r1, 12(r31)
        lwz r31, 4(r31)
        lwz r1, 0(r1)
        blr
.LBB_foo_2:     ; T
        li r3, 0
        lwz r1, 12(r31)
        lwz r31, 4(r31)
        lwz r1, 0(r1)
        blr

This fixes Povray and SPASS with the dag isel, the last two failing cases.
Tommorow we will hopefully turn it on by default! :)

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

18 years agoFix a bug where we were useing HA to get the high part, which seems like it
Chris Lattner [Thu, 1 Sep 2005 19:38:28 +0000 (19:38 +0000)]
Fix a bug where we were useing HA to get the high part, which seems like it
could cause a miscompile.  Fixing this didn't fix the two programs that fail
though.  :(

This also changes the implementation to follow the pattern selector more
closely, causing us to select 0 to li instead of lis.

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

18 years agoDo not select the operands being passed into SelectCC. IT does this itself
Chris Lattner [Thu, 1 Sep 2005 19:20:44 +0000 (19:20 +0000)]
Do not select the operands being passed into SelectCC.  IT does this itself
and selecting early prevents folding immediates into the cmpw* instructions

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

18 years agoIt is NDEBUG not _NDEBUG
Chris Lattner [Thu, 1 Sep 2005 18:44:10 +0000 (18:44 +0000)]
It is NDEBUG not _NDEBUG

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

18 years agoAdd the rest of the currently implemented visit routines to the switch
Nate Begeman [Thu, 1 Sep 2005 00:33:32 +0000 (00:33 +0000)]
Add the rest of the currently implemented visit routines to the switch
statement in visit().

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

18 years agoFirst pass at the DAG Combiner. It isn't used anywhere yet, but it should
Nate Begeman [Thu, 1 Sep 2005 00:19:25 +0000 (00:19 +0000)]
First pass at the DAG Combiner.  It isn't used anywhere yet, but it should
be mostly functional.  It currently has all folds from SelectionDAG.cpp
that do not involve a condition code.

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

18 years agoAdd regression test for efficient codegen of i32 x i32 -> hi32(i64) as
Nate Begeman [Thu, 1 Sep 2005 00:04:03 +0000 (00:04 +0000)]
Add regression test for efficient codegen of i32 x i32 -> hi32(i64) as
mulhs.

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

18 years agoremove an inappropriate comment
Chris Lattner [Wed, 31 Aug 2005 22:49:51 +0000 (22:49 +0000)]
remove an inappropriate comment

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

18 years agoIf a function has live ins/outs, print them
Chris Lattner [Wed, 31 Aug 2005 22:34:59 +0000 (22:34 +0000)]
If a function has live ins/outs, print them

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

18 years agoMove FCTIWZ handling out of the instruction selectors and into legalization,
Chris Lattner [Wed, 31 Aug 2005 21:09:52 +0000 (21:09 +0000)]
Move FCTIWZ handling out of the instruction selectors and into legalization,
getting them out of the business of making stack slots.

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

18 years agoRemove dead code
Chris Lattner [Wed, 31 Aug 2005 20:25:15 +0000 (20:25 +0000)]
Remove dead code

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

18 years agoMove SHL,SHR i64 -> legalizer
Chris Lattner [Wed, 31 Aug 2005 20:23:54 +0000 (20:23 +0000)]
Move SHL,SHR i64 -> legalizer

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

18 years agoRemove code that is now dead from the pattern isel.
Chris Lattner [Wed, 31 Aug 2005 19:11:36 +0000 (19:11 +0000)]
Remove code that is now dead from the pattern isel.

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

18 years agolower sra_parts on the dag, implementing it for the dag isel, and exposing
Chris Lattner [Wed, 31 Aug 2005 19:09:57 +0000 (19:09 +0000)]
lower sra_parts on the dag, implementing it for the dag isel, and exposing
the ops to dag optimization.

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

18 years agoAllow targets to custom expand shifts that are too large for their registers
Chris Lattner [Wed, 31 Aug 2005 19:01:53 +0000 (19:01 +0000)]
Allow targets to custom expand shifts that are too large for their registers

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

18 years agoAdd a testcase for nate's patch
Chris Lattner [Wed, 31 Aug 2005 18:19:50 +0000 (18:19 +0000)]
Add a testcase for nate's patch

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

18 years agoadd assert zext/sext to the dag isel
Chris Lattner [Wed, 31 Aug 2005 18:08:46 +0000 (18:08 +0000)]
add assert zext/sext to the dag isel

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

18 years agoHandle AssertSext/AssertZext nodes, fixing the regressions last night.
Chris Lattner [Wed, 31 Aug 2005 17:48:04 +0000 (17:48 +0000)]
Handle AssertSext/AssertZext nodes, fixing the regressions last night.

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

18 years agoFix VC++ precedence warnings
Jeff Cohen [Wed, 31 Aug 2005 02:47:06 +0000 (02:47 +0000)]
Fix VC++ precedence warnings

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

18 years agoEnable generation of AssertSext and AssertZext in the PPC backend.
Nate Begeman [Wed, 31 Aug 2005 01:58:39 +0000 (01:58 +0000)]
Enable generation of AssertSext and AssertZext in the PPC backend.

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

18 years agoFix 'ret long' to return the high and lo parts in the right registers. This
Chris Lattner [Wed, 31 Aug 2005 01:34:29 +0000 (01:34 +0000)]
Fix 'ret long' to return the high and lo parts in the right registers.  This
fixes crafty and probably others.

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

18 years agoSigh, not my day. Fix typo.
Nate Begeman [Wed, 31 Aug 2005 00:43:49 +0000 (00:43 +0000)]
Sigh, not my day.  Fix typo.

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

18 years agoFix a mistake in my previous patch pointed out by sabre; the AssertZext
Nate Begeman [Wed, 31 Aug 2005 00:43:08 +0000 (00:43 +0000)]
Fix a mistake in my previous patch pointed out by sabre; the AssertZext
case in MaskedValueIsZero was wrong.

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

18 years agoRemove some unnecessary casts, and add the AssertZext case to
Nate Begeman [Wed, 31 Aug 2005 00:27:53 +0000 (00:27 +0000)]
Remove some unnecessary casts, and add the AssertZext case to
MaskedValueIsZero.

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