oota-llvm.git
19 years agoAdd a setName method to Record.
Chris Lattner [Fri, 19 Aug 2005 17:58:11 +0000 (17:58 +0000)]
Add a setName method to Record.

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

19 years agoFor now, just emit empty operand info structures.
Chris Lattner [Fri, 19 Aug 2005 16:57:28 +0000 (16:57 +0000)]
For now, just emit empty operand info structures.

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

19 years agoSparcv9 gets no operand info
Chris Lattner [Fri, 19 Aug 2005 16:56:56 +0000 (16:56 +0000)]
Sparcv9 gets no operand info

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

19 years agoAdd a new field to TargetInstrDescriptor for tracking information about
Chris Lattner [Fri, 19 Aug 2005 16:56:26 +0000 (16:56 +0000)]
Add a new field to TargetInstrDescriptor for tracking information about
operands.

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

19 years agoFix VC++ constant truncation warning.
Jeff Cohen [Fri, 19 Aug 2005 16:19:21 +0000 (16:19 +0000)]
Fix VC++ constant truncation warning.

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

19 years agoUpdate Visual Studio projects for removed file.
Jeff Cohen [Fri, 19 Aug 2005 13:51:22 +0000 (13:51 +0000)]
Update Visual Studio projects for removed file.

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

19 years agoa bugfix (up top) and a quick repair job: disable generation of dep.z
Duraid Madina [Fri, 19 Aug 2005 13:25:50 +0000 (13:25 +0000)]
a bugfix (up top) and a quick repair job: disable generation of dep.z
(which died about a week ago) so we're back to load-(2^n-1)-then-AND
sequences. slow, but things should now be Almost Completely Working,
modulo those pesky alignment/ABI issues.

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

19 years agoFix a problem jeffc noticed
Chris Lattner [Fri, 19 Aug 2005 06:16:04 +0000 (06:16 +0000)]
Fix a problem jeffc noticed

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

19 years agoFix VC++ precedence warning.
Jeff Cohen [Fri, 19 Aug 2005 04:39:48 +0000 (04:39 +0000)]
Fix VC++ precedence warning.

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

19 years agoFix a bug where we were passing the wrong number of arguments to an
Nate Begeman [Fri, 19 Aug 2005 03:42:28 +0000 (03:42 +0000)]
Fix a bug where we were passing the wrong number of arguments to an
instruction.

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

19 years agoremove dead args
Chris Lattner [Fri, 19 Aug 2005 01:17:18 +0000 (01:17 +0000)]
remove dead args

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

19 years agoremove dead options
Chris Lattner [Fri, 19 Aug 2005 01:16:18 +0000 (01:16 +0000)]
remove dead options

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

19 years agoremove dead flags
Chris Lattner [Fri, 19 Aug 2005 01:14:40 +0000 (01:14 +0000)]
remove dead flags

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

19 years agoThe code emitter generator only supports targets with 32-bit instruction
Chris Lattner [Fri, 19 Aug 2005 01:04:33 +0000 (01:04 +0000)]
The code emitter generator only supports targets with 32-bit instruction
words.  There is no way for one of these targets to have a > 32-bit immediate!

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

19 years agoFix computation of # operands, add a temporary hack for CopyToReg
Chris Lattner [Fri, 19 Aug 2005 01:01:34 +0000 (01:01 +0000)]
Fix computation of # operands, add a temporary hack for CopyToReg

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

19 years agonow that all of the targets are clean w.r.t. the number of operands for each
Chris Lattner [Fri, 19 Aug 2005 00:59:49 +0000 (00:59 +0000)]
now that all of the targets are clean w.r.t. the number of operands for each
instruction defined, actually emit this to the InstrInfoDescriptor, which
allows an assert in the machineinstrbuilder to do some checking for us,
and is required by the dag->dag emitter

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

19 years agoAdd support for target nodes with more than 3 operands, required by ppc
Nate Begeman [Fri, 19 Aug 2005 00:56:28 +0000 (00:56 +0000)]
Add support for target nodes with more than 3 operands, required by ppc

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

19 years agomark variable arity instructions as such. Alpha wins the battle for
Chris Lattner [Fri, 19 Aug 2005 00:51:37 +0000 (00:51 +0000)]
mark variable arity instructions as such.  Alpha wins the battle for
cleanest backend in this metric :)

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

19 years agoMark some instructions as variable_ops, and PSEUDO_ALLOC as taking a GPR.
Chris Lattner [Fri, 19 Aug 2005 00:47:42 +0000 (00:47 +0000)]
Mark some instructions as variable_ops, and PSEUDO_ALLOC as taking a GPR.
I'm not convinced this is all of them,  but I can't do much testing, because
IA64 LLC crashes on big programs :(

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

19 years agoadd a few missing cases
Chris Lattner [Fri, 19 Aug 2005 00:41:29 +0000 (00:41 +0000)]
add a few missing cases

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

19 years agoGive ADJCALLSTACKDOWN/UP the correct operands.
Chris Lattner [Fri, 19 Aug 2005 00:38:22 +0000 (00:38 +0000)]
Give ADJCALLSTACKDOWN/UP the correct operands.
Give a whole bunch of other stuff variable operands, particularly FP.  The
FP stackifier is playing fast and loose with operands here, so we have to
mark them all as variable.  This will have to be fixed before we can dag->dag
the X86 backend.  The solution is for the pre-stackifier and post-stackifier
instructions to all be disjoint.

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

19 years agoISD::OR, and it's accompanying SelectBitfieldInsert
Nate Begeman [Fri, 19 Aug 2005 00:38:14 +0000 (00:38 +0000)]
ISD::OR, and it's accompanying SelectBitfieldInsert

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

19 years agoThe variable SAR's only take one operand too
Chris Lattner [Fri, 19 Aug 2005 00:31:37 +0000 (00:31 +0000)]
The variable SAR's only take one operand too

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

19 years agoStop adding bogus operands to variable shifts on X86. These instructions
Chris Lattner [Fri, 19 Aug 2005 00:16:17 +0000 (00:16 +0000)]
Stop adding bogus operands to variable shifts on X86.  These instructions
only take one operand.  The other comes implicitly in through CL.

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

19 years agoRemove the X86 and PowerPC Simple instruction selectors; their time has
Nate Begeman [Thu, 18 Aug 2005 23:53:15 +0000 (23:53 +0000)]
Remove the X86 and PowerPC Simple instruction selectors; their time has
passed.

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

19 years agoFigure out how many operands each instruction has, keep track of whether
Chris Lattner [Thu, 18 Aug 2005 23:38:41 +0000 (23:38 +0000)]
Figure out how many operands each instruction has, keep track of whether
or not it's variable.

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

19 years agoAdd shifts.
Nate Begeman [Thu, 18 Aug 2005 23:38:00 +0000 (23:38 +0000)]
Add shifts.

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

19 years agoFix operand numbers by marking variable arity nodes as such and by fixing
Chris Lattner [Thu, 18 Aug 2005 23:25:33 +0000 (23:25 +0000)]
Fix operand numbers by marking variable arity nodes as such and by fixing
the operand lists of a few other nodes.

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

19 years agoMFLR doesn't take an operand, the LR register is implicit
Chris Lattner [Thu, 18 Aug 2005 23:24:50 +0000 (23:24 +0000)]
MFLR doesn't take an operand, the LR register is implicit

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

19 years agoAdd a new flag
Chris Lattner [Thu, 18 Aug 2005 23:17:07 +0000 (23:17 +0000)]
Add a new flag

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

19 years agorevert this change, which causes breakage, temporarily
Chris Lattner [Thu, 18 Aug 2005 22:12:31 +0000 (22:12 +0000)]
revert this change, which causes breakage, temporarily

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

19 years agoWhen emitting implicit use/def lists, only emit each unique list once. Though
Chris Lattner [Thu, 18 Aug 2005 21:36:47 +0000 (21:36 +0000)]
When emitting implicit use/def lists, only emit each unique list once.  Though
LLVM is able to merge identical static const globals, GCC isn't, and this caused
some bloat in the generated data.  This has a marginal effect on PPC, shrinking
the implicit sets from 10->4, but shrinks X86 from 179 to 23, a much bigger
reduction.

This should speed up the register allocator as well by reducing the dcache
footprint for this static data.

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

19 years agoadd a new -view-sched-dags option to view dags as they are sent to the scheduler.
Chris Lattner [Thu, 18 Aug 2005 20:11:49 +0000 (20:11 +0000)]
add a new -view-sched-dags option to view dags as they are sent to the scheduler.

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

19 years agoMove this to the emitter
Chris Lattner [Thu, 18 Aug 2005 20:08:53 +0000 (20:08 +0000)]
Move this to the emitter

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

19 years agoImplement the first chunk of a code emitter. This is sophisticated enough to
Chris Lattner [Thu, 18 Aug 2005 20:07:59 +0000 (20:07 +0000)]
Implement the first chunk of a code emitter.  This is sophisticated enough to
codegen:

_empty:
.LBB_empty_0:   ;
        blr

but can't do anything more (yet). :)

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

19 years agoUnmangled names.
Jim Laskey [Thu, 18 Aug 2005 20:06:09 +0000 (20:06 +0000)]
Unmangled names.

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

19 years agoAdd ScheduleDAG.cpp to the project
Chris Lattner [Thu, 18 Aug 2005 19:52:06 +0000 (19:52 +0000)]
Add ScheduleDAG.cpp to the project

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

19 years agoFill in the numOperands field of the TargetInstrDescriptor struct from the
Chris Lattner [Thu, 18 Aug 2005 19:45:37 +0000 (19:45 +0000)]
Fill in the numOperands field of the TargetInstrDescriptor struct from the
.td file.

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

19 years ago1. Fix comment.
Jim Laskey [Thu, 18 Aug 2005 19:38:57 +0000 (19:38 +0000)]
1. Fix comment.

2. Get an exact count of 'li ' instructions.

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

19 years agoAdd regression test to make sure that constants are generated optimally.
Jim Laskey [Thu, 18 Aug 2005 19:32:46 +0000 (19:32 +0000)]
Add regression test to make sure that constants are generated optimally.

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

19 years agoMore optimal solution for loading constants.
Jim Laskey [Thu, 18 Aug 2005 18:58:23 +0000 (18:58 +0000)]
More optimal solution for loading constants.

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

19 years agoAfter selecting the instructions for a basic block, emit the instructions
Chris Lattner [Thu, 18 Aug 2005 18:46:06 +0000 (18:46 +0000)]
After selecting the instructions for a basic block, emit the instructions

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

19 years agonew file, obviously just a stub
Chris Lattner [Thu, 18 Aug 2005 18:45:24 +0000 (18:45 +0000)]
new file, obviously just a stub

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

19 years agoadd a method
Chris Lattner [Thu, 18 Aug 2005 18:44:33 +0000 (18:44 +0000)]
add a method

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

19 years agoremove some unused stuff
Chris Lattner [Thu, 18 Aug 2005 18:34:00 +0000 (18:34 +0000)]
remove some unused stuff

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

19 years agoFix int foo() { return 65535; } by using the top 16 bits of the constant
Nate Begeman [Thu, 18 Aug 2005 18:14:49 +0000 (18:14 +0000)]
Fix int foo() { return 65535; } by using the top 16 bits of the constant
as the argument to LIS rather than the result of HA16(constant).

The DAG->DAG ISel was already doing the right thing.

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

19 years agoImprove ISD::Constant codegen.
Nate Begeman [Thu, 18 Aug 2005 18:01:39 +0000 (18:01 +0000)]
Improve ISD::Constant codegen.
Now for int foo() { return -1; } we generate:
_foo:
        li r3, -1
        blr

instead of
_foo:
        lis r2, -1
        ori r3, r2, 65535
        blr

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

19 years agoEnable critical edge splitting by default
Chris Lattner [Thu, 18 Aug 2005 17:35:14 +0000 (17:35 +0000)]
Enable critical edge splitting by default

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

19 years agoreplace switch stmt with an assert, generate li 0 instead of lis 0 for 0,
Chris Lattner [Thu, 18 Aug 2005 17:16:52 +0000 (17:16 +0000)]
replace switch stmt with an assert, generate li 0 instead of lis 0 for 0,
to make the code follow people's expectations better.

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

19 years agoHandle loading of 0x????0000 constants with a single instruction.
Jim Laskey [Thu, 18 Aug 2005 15:52:30 +0000 (15:52 +0000)]
Handle loading of 0x????0000 constants with a single instruction.

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

19 years agoAdd support for ISD::AND, and its various optimized forms.
Nate Begeman [Thu, 18 Aug 2005 07:30:46 +0000 (07:30 +0000)]
Add support for ISD::AND, and its various optimized forms.

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

19 years agoAdd support for target DAG nodes that take 4 operands, such as PowerPC's
Nate Begeman [Thu, 18 Aug 2005 07:30:15 +0000 (07:30 +0000)]
Add support for target DAG nodes that take 4 operands, such as PowerPC's
rlwinm.

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

19 years agoMaintain consistency in negating things
Nate Begeman [Thu, 18 Aug 2005 05:44:50 +0000 (05:44 +0000)]
Maintain consistency in negating things

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

19 years agoImplement XOR, remove a broken sign_extend_inreg case
Nate Begeman [Thu, 18 Aug 2005 05:00:13 +0000 (05:00 +0000)]
Implement XOR, remove a broken sign_extend_inreg case

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

19 years agoFix printing of VTSDNodes
Chris Lattner [Thu, 18 Aug 2005 03:31:02 +0000 (03:31 +0000)]
Fix printing of VTSDNodes

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

19 years agoAdd a testcase for load short -> uint, which is currently emitted as a
Nate Begeman [Thu, 18 Aug 2005 03:11:44 +0000 (03:11 +0000)]
Add a testcase for load short -> uint, which is currently emitted as a
zextload + sign_extend_inreg rather than a sextload.

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

19 years agoAdd a bunch more simple nodes.
Nate Begeman [Thu, 18 Aug 2005 03:04:18 +0000 (03:04 +0000)]
Add a bunch more simple nodes.

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

19 years agoAdd a couple more nodes that are easy to handle
Nate Begeman [Thu, 18 Aug 2005 00:53:47 +0000 (00:53 +0000)]
Add a couple more nodes that are easy to handle

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

19 years agoBe fruitful and multiply!
Nate Begeman [Thu, 18 Aug 2005 00:21:41 +0000 (00:21 +0000)]
Be fruitful and multiply!

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

19 years agoBetter version of isIntImmediate.
Jim Laskey [Thu, 18 Aug 2005 00:15:15 +0000 (00:15 +0000)]
Better version of isIntImmediate.

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

19 years agomessed up
Jim Laskey [Wed, 17 Aug 2005 23:57:24 +0000 (23:57 +0000)]
messed up

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

19 years agoinclude/llvm/Support/MathExtras.h
Jim Laskey [Wed, 17 Aug 2005 23:54:12 +0000 (23:54 +0000)]
include/llvm/Support/MathExtras.h

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

19 years agoTeach the DAG->DAG ISel about FNEG, and how it can be used to invert
Nate Begeman [Wed, 17 Aug 2005 23:46:35 +0000 (23:46 +0000)]
Teach the DAG->DAG ISel about FNEG, and how it can be used to invert
several of the PowerPC opcodes that come in both negated and non-negated
forms.

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

19 years agoAdd two new methods isTargetOpcode() which returns true if the node type
Nate Begeman [Wed, 17 Aug 2005 23:44:54 +0000 (23:44 +0000)]
Add two new methods isTargetOpcode() which returns true if the node type
is greater than the range of building selection dag node types, and
getTargetOpcode(), which returns the node opcode less the value of
isd::builtin_op_end, which specifies the end of the builtin types.

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

19 years agoFix Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll, a crash
Chris Lattner [Wed, 17 Aug 2005 21:22:41 +0000 (21:22 +0000)]
Fix Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll, a crash
on 177.mesa

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

19 years agonew testcase distilled from mesa
Chris Lattner [Wed, 17 Aug 2005 21:21:47 +0000 (21:21 +0000)]
new testcase distilled from mesa

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

19 years agoMove the code dependency for MathExtras.h from SelectionDAGNodes.h.
Jim Laskey [Wed, 17 Aug 2005 20:08:02 +0000 (20:08 +0000)]
Move the code dependency for MathExtras.h from SelectionDAGNodes.h.

Added some class dividers in SelectionDAG.cpp.

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

19 years agoMove code dependency for MathExtras.h out of Constants.h.
Jim Laskey [Wed, 17 Aug 2005 20:06:22 +0000 (20:06 +0000)]
Move code dependency for MathExtras.h out of Constants.h.

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

19 years agoPromote dependency for MathExtras.h out of Constants.h.
Jim Laskey [Wed, 17 Aug 2005 20:04:34 +0000 (20:04 +0000)]
Promote dependency for MathExtras.h out of Constants.h.

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

19 years agoCulling out use of unions for converting FP to bits and vice versa.
Jim Laskey [Wed, 17 Aug 2005 19:34:49 +0000 (19:34 +0000)]
Culling out use of unions for converting FP to bits and vice versa.

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

19 years agoadd a beta option for turning on dag->dag isel
Chris Lattner [Wed, 17 Aug 2005 19:33:30 +0000 (19:33 +0000)]
add a beta option for turning on dag->dag isel

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

19 years agoinitial hack at a dag->dag instruction selector. This is obviously woefully
Chris Lattner [Wed, 17 Aug 2005 19:33:03 +0000 (19:33 +0000)]
initial hack at a dag->dag instruction selector.  This is obviously woefully
incomplete, but it is a start.  It handles basic argument/retval stuff, immediates,
add and sub.

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

19 years agoadd prototype, remove dead proto
Chris Lattner [Wed, 17 Aug 2005 19:32:03 +0000 (19:32 +0000)]
add prototype, remove dead proto

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

19 years agoFix a bug in RemoveDeadNodes where it would crash when its "optional"
Chris Lattner [Wed, 17 Aug 2005 19:00:20 +0000 (19:00 +0000)]
Fix a bug in RemoveDeadNodes where it would crash when its "optional"
argument is not specified.

Implement ReplaceAllUsesWith.

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

19 years agoadd ReplaceAllUsesWith, and a helper to implemented it
Chris Lattner [Wed, 17 Aug 2005 18:59:17 +0000 (18:59 +0000)]
add ReplaceAllUsesWith, and a helper to implemented it

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

19 years agoMake removeUser more efficient, add a matching addUser.
Chris Lattner [Wed, 17 Aug 2005 18:58:38 +0000 (18:58 +0000)]
Make removeUser more efficient, add a matching addUser.
Fix the setOperands methods I added to update use/def information correctly.

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

19 years agoSwitched to using BitsToDouble for int_to_float to avoid aliasing problem.
Jim Laskey [Wed, 17 Aug 2005 17:42:52 +0000 (17:42 +0000)]
Switched to using BitsToDouble for int_to_float to avoid aliasing problem.

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

19 years agoAdded support for converting raw bits to FP, and FP to raw bits. The intent
Jim Laskey [Wed, 17 Aug 2005 17:27:47 +0000 (17:27 +0000)]
Added support for converting raw bits to FP, and FP to raw bits.  The intent
is to avoid the distraction of the union declarations.

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

19 years agoFix some bugs in the alpha backend, some of which I introduced yesterday,
Chris Lattner [Wed, 17 Aug 2005 17:08:24 +0000 (17:08 +0000)]
Fix some bugs in the alpha backend, some of which I introduced yesterday,
and some that were preexisting.  All alpha regtests pass now.

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

19 years agoChange hex float constants for the sake of VC++.
Jim Laskey [Wed, 17 Aug 2005 09:44:59 +0000 (09:44 +0000)]
Change hex float constants for the sake of VC++.

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

19 years agoThis was moved to the .cpp file
Chris Lattner [Wed, 17 Aug 2005 06:46:50 +0000 (06:46 +0000)]
This was moved to the .cpp file

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

19 years agoAdd a new beta option for critical edge splitting, to avoid a problem that
Chris Lattner [Wed, 17 Aug 2005 06:37:43 +0000 (06:37 +0000)]
Add a new beta option for critical edge splitting, to avoid a problem that
Nate noticed in yacr2 (and I know occurs in other places as well).

This is still rough, as the critical edge blocks are not intelligently placed
but is added to get some idea to see if this improves performance.

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

19 years agoUse a new helper to split critical edges, making the code simpler.
Chris Lattner [Wed, 17 Aug 2005 06:35:16 +0000 (06:35 +0000)]
Use a new helper to split critical edges, making the code simpler.

Do not claim to not change the CFG.  We do change the cfg to split critical
edges.  This isn't causing us a problem now, but could likely do so in the
future.

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

19 years agoadd a helper
Chris Lattner [Wed, 17 Aug 2005 06:34:37 +0000 (06:34 +0000)]
add a helper

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

19 years agoFix a regression on X86, where FP values can be promoted too.
Chris Lattner [Wed, 17 Aug 2005 06:06:25 +0000 (06:06 +0000)]
Fix a regression on X86, where FP values can be promoted too.

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

19 years agoFix grammar
Misha Brukman [Wed, 17 Aug 2005 02:38:56 +0000 (02:38 +0000)]
Fix grammar

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

19 years agomake sure to remove a node from the use list of its operands when we replace
Chris Lattner [Wed, 17 Aug 2005 01:54:00 +0000 (01:54 +0000)]
make sure to remove a node from the use list of its operands when we replace
it.

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

19 years agoFix a few small typos I noticed when converting this over to the DAG->DAG
Chris Lattner [Wed, 17 Aug 2005 01:25:14 +0000 (01:25 +0000)]
Fix a few small typos I noticed when converting this over to the DAG->DAG
selector.  Also, there is no difference between addSImm and addImm, so just
use addImm, folding some branches.

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

19 years agoRemoved UINT_TO_FP and SINT_TO_FP from ISel outright.
Jim Laskey [Wed, 17 Aug 2005 01:14:38 +0000 (01:14 +0000)]
Removed UINT_TO_FP and SINT_TO_FP from ISel outright.

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

19 years agothinko. Should fix s4addl.ll regression
Andrew Lenharth [Wed, 17 Aug 2005 00:47:24 +0000 (00:47 +0000)]
thinko.  Should fix s4addl.ll regression

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

19 years agoRemove ISel code generation for UINT_TO_FP and SINT_TO_FP. Now asserts if
Jim Laskey [Wed, 17 Aug 2005 00:41:40 +0000 (00:41 +0000)]
Remove ISel code generation for UINT_TO_FP and SINT_TO_FP.  Now asserts if
marked as legal.

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

19 years agoMake UINT_TO_FP and SINT_TO_FP use generic expansion.
Jim Laskey [Wed, 17 Aug 2005 00:40:22 +0000 (00:40 +0000)]
Make UINT_TO_FP and SINT_TO_FP use generic expansion.

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

19 years agoAdded generic code expansion for [signed|unsigned] i32 to [f32|f64] casts in the
Jim Laskey [Wed, 17 Aug 2005 00:39:29 +0000 (00:39 +0000)]
Added generic code expansion for [signed|unsigned] i32 to [f32|f64] casts in the
legalizer.  PowerPC now uses this expansion instead of ISel version.

Example:

// signed integer to double conversion
double f1(signed x) {
  return (double)x;
}

// unsigned integer to double conversion
double f2(unsigned x) {
  return (double)x;
}

// signed integer to float conversion
float f3(signed x) {
  return (float)x;
}

// unsigned integer to float conversion
float f4(unsigned x) {
  return (float)x;
}

Byte Code:

internal fastcc double %_Z2f1i(int %x) {
entry:
        %tmp.1 = cast int %x to double          ; <double> [#uses=1]
        ret double %tmp.1
}

internal fastcc double %_Z2f2j(uint %x) {
entry:
        %tmp.1 = cast uint %x to double         ; <double> [#uses=1]
        ret double %tmp.1
}

internal fastcc float %_Z2f3i(int %x) {
entry:
        %tmp.1 = cast int %x to float           ; <float> [#uses=1]
        ret float %tmp.1
}

internal fastcc float %_Z2f4j(uint %x) {
entry:
        %tmp.1 = cast uint %x to float          ; <float> [#uses=1]
        ret float %tmp.1
}

internal fastcc double %_Z2g1i(int %x) {
entry:
        %buffer = alloca [2 x uint]             ; <[2 x uint]*> [#uses=3]
        %tmp.0 = getelementptr [2 x uint]* %buffer, int 0, int 0                ; <uint*> [#uses=1]
        store uint 1127219200, uint* %tmp.0
        %tmp.2 = cast int %x to uint            ; <uint> [#uses=1]
        %tmp.3 = xor uint %tmp.2, 2147483648            ; <uint> [#uses=1]
        %tmp.5 = getelementptr [2 x uint]* %buffer, int 0, int 1                ; <uint*> [#uses=1]
        store uint %tmp.3, uint* %tmp.5
        %tmp.9 = cast [2 x uint]* %buffer to double*            ; <double*> [#uses=1]
        %tmp.10 = load double* %tmp.9           ; <double> [#uses=1]
        %tmp.13 = load double* cast (long* %signed_bias to double*)             ; <double> [#uses=1]
        %tmp.14 = sub double %tmp.10, %tmp.13           ; <double> [#uses=1]
        ret double %tmp.14
}

internal fastcc double %_Z2g2j(uint %x) {
entry:
        %buffer = alloca [2 x uint]             ; <[2 x uint]*> [#uses=3]
        %tmp.0 = getelementptr [2 x uint]* %buffer, int 0, int 0                ; <uint*> [#uses=1]
        store uint 1127219200, uint* %tmp.0
        %tmp.1 = getelementptr [2 x uint]* %buffer, int 0, int 1                ; <uint*> [#uses=1]
        store uint %x, uint* %tmp.1
        %tmp.4 = cast [2 x uint]* %buffer to double*            ; <double*> [#uses=1]
        %tmp.5 = load double* %tmp.4            ; <double> [#uses=1]
        %tmp.8 = load double* cast (long* %unsigned_bias to double*)            ; <double> [#uses=1]
        %tmp.9 = sub double %tmp.5, %tmp.8              ; <double> [#uses=1]
        ret double %tmp.9
}

internal fastcc float %_Z2g3i(int %x) {
entry:
        %buffer = alloca [2 x uint]             ; <[2 x uint]*> [#uses=3]
        %tmp.0 = getelementptr [2 x uint]* %buffer, int 0, int 0                ; <uint*> [#uses=1]
        store uint 1127219200, uint* %tmp.0
        %tmp.2 = cast int %x to uint            ; <uint> [#uses=1]
        %tmp.3 = xor uint %tmp.2, 2147483648            ; <uint> [#uses=1]
        %tmp.5 = getelementptr [2 x uint]* %buffer, int 0, int 1                ; <uint*> [#uses=1]
        store uint %tmp.3, uint* %tmp.5
        %tmp.9 = cast [2 x uint]* %buffer to double*            ; <double*> [#uses=1]
        %tmp.10 = load double* %tmp.9           ; <double> [#uses=1]
        %tmp.13 = load double* cast (long* %signed_bias to double*)             ; <double> [#uses=1]
        %tmp.14 = sub double %tmp.10, %tmp.13           ; <double> [#uses=1]
        %tmp.16 = cast double %tmp.14 to float          ; <float> [#uses=1]
        ret float %tmp.16
}

internal fastcc float %_Z2g4j(uint %x) {
entry:
        %buffer = alloca [2 x uint]             ; <[2 x uint]*> [#uses=3]
        %tmp.0 = getelementptr [2 x uint]* %buffer, int 0, int 0                ; <uint*> [#uses=1]
        store uint 1127219200, uint* %tmp.0
        %tmp.1 = getelementptr [2 x uint]* %buffer, int 0, int 1                ; <uint*> [#uses=1]
        store uint %x, uint* %tmp.1
        %tmp.4 = cast [2 x uint]* %buffer to double*            ; <double*> [#uses=1]
        %tmp.5 = load double* %tmp.4            ; <double> [#uses=1]
        %tmp.8 = load double* cast (long* %unsigned_bias to double*)            ; <double> [#uses=1]
        %tmp.9 = sub double %tmp.5, %tmp.8              ; <double> [#uses=1]
        %tmp.11 = cast double %tmp.9 to float           ; <float> [#uses=1]
        ret float %tmp.11
}

PowerPC Code:

        .machine ppc970

        .const
        .align  2
.CPIl1__Z2f1i_0:                                        ; float 0x4330000080000000
        .long   1501560836      ; float 4.5036e+15
        .text
        .align  2
        .globl  l1__Z2f1i
l1__Z2f1i:
.LBBl1__Z2f1i_0:        ; entry
        xoris r2, r3, 32768
        stw r2, -4(r1)
        lis r2, 17200
        stw r2, -8(r1)
        lfd f0, -8(r1)
        lis r2, ha16(.CPIl1__Z2f1i_0)
        lfs f1, lo16(.CPIl1__Z2f1i_0)(r2)
        fsub f1, f0, f1
        blr

        .const
        .align  2
.CPIl2__Z2f2j_0:                                        ; float 0x4330000000000000
        .long   1501560832      ; float 4.5036e+15
        .text
        .align  2
        .globl  l2__Z2f2j
l2__Z2f2j:
.LBBl2__Z2f2j_0:        ; entry
        stw r3, -4(r1)
        lis r2, 17200
        stw r2, -8(r1)
        lfd f0, -8(r1)
        lis r2, ha16(.CPIl2__Z2f2j_0)
        lfs f1, lo16(.CPIl2__Z2f2j_0)(r2)
        fsub f1, f0, f1
        blr

        .const
        .align  2
.CPIl3__Z2f3i_0:                                        ; float 0x4330000080000000
        .long   1501560836      ; float 4.5036e+15
        .text
        .align  2
        .globl  l3__Z2f3i
l3__Z2f3i:
.LBBl3__Z2f3i_0:        ; entry
        xoris r2, r3, 32768
        stw r2, -4(r1)
        lis r2, 17200
        stw r2, -8(r1)
        lfd f0, -8(r1)
        lis r2, ha16(.CPIl3__Z2f3i_0)
        lfs f1, lo16(.CPIl3__Z2f3i_0)(r2)
        fsub f0, f0, f1
        frsp f1, f0
        blr

        .const
        .align  2
.CPIl4__Z2f4j_0:                                        ; float 0x4330000000000000
        .long   1501560832      ; float 4.5036e+15
        .text
        .align  2
        .globl  l4__Z2f4j
l4__Z2f4j:
.LBBl4__Z2f4j_0:        ; entry
        stw r3, -4(r1)
        lis r2, 17200
        stw r2, -8(r1)
        lfd f0, -8(r1)
        lis r2, ha16(.CPIl4__Z2f4j_0)
        lfs f1, lo16(.CPIl4__Z2f4j_0)(r2)
        fsub f0, f0, f1
        frsp f1, f0
        blr

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

19 years agoadd a new TargetConstant node
Chris Lattner [Wed, 17 Aug 2005 00:34:06 +0000 (00:34 +0000)]
add a new TargetConstant node

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

19 years agoadd some helper methods, and a new TargetConstant node, which is not
Chris Lattner [Wed, 17 Aug 2005 00:33:30 +0000 (00:33 +0000)]
add some helper methods, and a new TargetConstant node, which is not
subjected to folding.

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

19 years agoImplement a couple improvements:
Nate Begeman [Wed, 17 Aug 2005 00:20:08 +0000 (00:20 +0000)]
Implement a couple improvements:
Remove dead code in ISD::Constant handling
Add support for add long, imm16

We now codegen 'long long foo(long long a) { return ++a; }'
as:
addic r4, r4, 1
addze r3, r3
blr

instead of:
li r2, 1
li r5, 0
addc r2, r4, r2
adde r3, r3, r5
blr

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

19 years agoremove a dead enum value, making a comment above correct again
Chris Lattner [Tue, 16 Aug 2005 22:04:58 +0000 (22:04 +0000)]
remove a dead enum value, making a comment above correct again

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

19 years agoThis is a dummy, it doesn't matter what the ValueType is
Chris Lattner [Tue, 16 Aug 2005 21:59:52 +0000 (21:59 +0000)]
This is a dummy, it doesn't matter what the ValueType is

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

19 years agoupdates for changes in nodes
Chris Lattner [Tue, 16 Aug 2005 21:58:15 +0000 (21:58 +0000)]
updates for changes in nodes

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

19 years agoupdate the backends to work with the new CopyFromReg/CopyToReg/ImplicitDef nodes
Chris Lattner [Tue, 16 Aug 2005 21:56:37 +0000 (21:56 +0000)]
update the backends to work with the new CopyFromReg/CopyToReg/ImplicitDef nodes

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