Commit Graph

19718 Commits

Author SHA1 Message Date
Chris Lattner a9d68f140e The variable SAR's only take one operand too
llvm-svn: 22888
2005-08-19 00:31:37 +00:00
Chris Lattner 145695927a Stop adding bogus operands to variable shifts on X86. These instructions
only take one operand.  The other comes implicitly in through CL.

llvm-svn: 22887
2005-08-19 00:16:17 +00:00
Nate Begeman be1f314a47 Remove the X86 and PowerPC Simple instruction selectors; their time has
passed.

llvm-svn: 22886
2005-08-18 23:53:15 +00:00
Chris Lattner 17727bad02 Figure out how many operands each instruction has, keep track of whether
or not it's variable.

llvm-svn: 22885
2005-08-18 23:38:41 +00:00
Nate Begeman 33acb2c135 Add shifts.
llvm-svn: 22884
2005-08-18 23:38:00 +00:00
Chris Lattner 4bd805e785 Fix operand numbers by marking variable arity nodes as such and by fixing
the operand lists of a few other nodes.

llvm-svn: 22883
2005-08-18 23:25:33 +00:00
Chris Lattner 51e851d0e6 MFLR doesn't take an operand, the LR register is implicit
llvm-svn: 22882
2005-08-18 23:24:50 +00:00
Chris Lattner 5cfa377947 Add a new flag
llvm-svn: 22881
2005-08-18 23:17:07 +00:00
Chris Lattner b015303c5e revert this change, which causes breakage, temporarily
llvm-svn: 22880
2005-08-18 22:12:31 +00:00
Chris Lattner 99df668f48 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.

llvm-svn: 22879
2005-08-18 21:36:47 +00:00
Chris Lattner 0c8c2c102d add a new -view-sched-dags option to view dags as they are sent to the scheduler.
llvm-svn: 22878
2005-08-18 20:11:49 +00:00
Chris Lattner 4e00ff6e70 Move this to the emitter
llvm-svn: 22877
2005-08-18 20:08:53 +00:00
Chris Lattner d342de9aaa 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). :)

llvm-svn: 22876
2005-08-18 20:07:59 +00:00
Jim Laskey e7b3cf73e5 Unmangled names.
llvm-svn: 22875
2005-08-18 20:06:09 +00:00
Chris Lattner 762c5e799c Add ScheduleDAG.cpp to the project
llvm-svn: 22874
2005-08-18 19:52:06 +00:00
Chris Lattner 6f52a04fc7 Fill in the numOperands field of the TargetInstrDescriptor struct from the
.td file.

llvm-svn: 22873
2005-08-18 19:45:37 +00:00
Jim Laskey 35ca73d335 1. Fix comment.
2. Get an exact count of 'li ' instructions.

llvm-svn: 22872
2005-08-18 19:38:57 +00:00
Jim Laskey 6645e001c3 Add regression test to make sure that constants are generated optimally.
llvm-svn: 22871
2005-08-18 19:32:46 +00:00
Jim Laskey 18b9b8df86 More optimal solution for loading constants.
llvm-svn: 22870
2005-08-18 18:58:23 +00:00
Chris Lattner 015d73996d After selecting the instructions for a basic block, emit the instructions
llvm-svn: 22869
2005-08-18 18:46:06 +00:00
Chris Lattner 1b4727de7d new file, obviously just a stub
llvm-svn: 22868
2005-08-18 18:45:24 +00:00
Chris Lattner a88fa6085f add a method
llvm-svn: 22867
2005-08-18 18:44:33 +00:00
Chris Lattner 15b5c7ca84 remove some unused stuff
llvm-svn: 22866
2005-08-18 18:34:00 +00:00
Nate Begeman d16a26a8d4 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.

llvm-svn: 22865
2005-08-18 18:14:49 +00:00
Nate Begeman d32638706a 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

llvm-svn: 22864
2005-08-18 18:01:39 +00:00
Chris Lattner 1a908c8920 Enable critical edge splitting by default
llvm-svn: 22863
2005-08-18 17:35:14 +00:00
Chris Lattner 37faf35b35 replace switch stmt with an assert, generate li 0 instead of lis 0 for 0,
to make the code follow people's expectations better.

llvm-svn: 22861
2005-08-18 17:16:52 +00:00
Jim Laskey 32d4c85278 Handle loading of 0x????0000 constants with a single instruction.
llvm-svn: 22858
2005-08-18 15:52:30 +00:00
Nate Begeman b3821a3943 Add support for ISD::AND, and its various optimized forms.
llvm-svn: 22857
2005-08-18 07:30:46 +00:00
Nate Begeman 19a271a67b Add support for target DAG nodes that take 4 operands, such as PowerPC's
rlwinm.

llvm-svn: 22856
2005-08-18 07:30:15 +00:00
Nate Begeman cfb9a74c2e Maintain consistency in negating things
llvm-svn: 22855
2005-08-18 05:44:50 +00:00
Nate Begeman 72d6f8800d Implement XOR, remove a broken sign_extend_inreg case
llvm-svn: 22854
2005-08-18 05:00:13 +00:00
Chris Lattner 802080d812 Fix printing of VTSDNodes
llvm-svn: 22853
2005-08-18 03:31:02 +00:00
Nate Begeman 70d9c5c340 Add a testcase for load short -> uint, which is currently emitted as a
zextload + sign_extend_inreg rather than a sextload.

llvm-svn: 22852
2005-08-18 03:11:44 +00:00
Nate Begeman 4bfb4a215d Add a bunch more simple nodes.
llvm-svn: 22851
2005-08-18 03:04:18 +00:00
Nate Begeman 457367f14c Add a couple more nodes that are easy to handle
llvm-svn: 22850
2005-08-18 00:53:47 +00:00
Nate Begeman 74d5529b88 Be fruitful and multiply!
llvm-svn: 22849
2005-08-18 00:21:41 +00:00
Jim Laskey 04160c6d8d Better version of isIntImmediate.
llvm-svn: 22848
2005-08-18 00:15:15 +00:00
Jim Laskey 2a1f2df82a messed up
llvm-svn: 22847
2005-08-17 23:57:24 +00:00
Jim Laskey 5e56202916 include/llvm/Support/MathExtras.h
llvm-svn: 22846
2005-08-17 23:54:12 +00:00
Nate Begeman 3fcf47d8f0 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.

llvm-svn: 22845
2005-08-17 23:46:35 +00:00
Nate Begeman cc0132b2dc 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.

llvm-svn: 22844
2005-08-17 23:44:54 +00:00
Chris Lattner ea7dfd53d6 Fix Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll, a crash
on 177.mesa

llvm-svn: 22843
2005-08-17 21:22:41 +00:00
Chris Lattner 9b2efaf9c8 new testcase distilled from mesa
llvm-svn: 22842
2005-08-17 21:21:47 +00:00
Jim Laskey d66e616545 Move the code dependency for MathExtras.h from SelectionDAGNodes.h.
Added some class dividers in SelectionDAG.cpp.

llvm-svn: 22841
2005-08-17 20:08:02 +00:00
Jim Laskey 8ad8f71447 Move code dependency for MathExtras.h out of Constants.h.
llvm-svn: 22840
2005-08-17 20:06:22 +00:00
Jim Laskey 17e7599ecb Promote dependency for MathExtras.h out of Constants.h.
llvm-svn: 22839
2005-08-17 20:04:34 +00:00
Jim Laskey b74c666186 Culling out use of unions for converting FP to bits and vice versa.
llvm-svn: 22838
2005-08-17 19:34:49 +00:00
Chris Lattner c6aa80668e add a beta option for turning on dag->dag isel
llvm-svn: 22837
2005-08-17 19:33:30 +00:00
Chris Lattner 43ff01e2e6 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.

llvm-svn: 22836
2005-08-17 19:33:03 +00:00