Commit Graph

91 Commits

Author SHA1 Message Date
Owen Anderson 343310a715 Add support for fast isel of zext.
llvm-svn: 55396
2008-08-26 23:14:49 +00:00
Owen Anderson 655c1dc63d Add support for fptosi of constants in fast isel.
llvm-svn: 55393
2008-08-26 22:34:28 +00:00
Dan Gohman 6fda9208d9 Refactor the bitcast code into its own function.
llvm-svn: 55387
2008-08-26 21:28:54 +00:00
Dan Gohman b5e04bfb18 Make FastISel use the correct argument type when casting GEP indices.
llvm-svn: 55384
2008-08-26 20:57:08 +00:00
Dan Gohman 3bcbbece19 Don't select binary instructions with illegal types.
llvm-svn: 55383
2008-08-26 20:52:40 +00:00
Owen Anderson 3c4dc434ee Add support for fast isel of sitofp, and remove some unnecessary and imprecise legality checks.
llvm-svn: 55381
2008-08-26 20:37:00 +00:00
Owen Anderson e0ac9765b2 Use a combination of copyRegToReg and ISD::BIT_CONVERT when doing fast isel of bitcasts,
allowing it to support the full range of conversions people might ask for in a correct manner.

llvm-svn: 55378
2008-08-26 18:51:24 +00:00
Owen Anderson 27fb3dcbc7 Make TargetInstrInfo::copyRegToReg return a bool indicating whether the copy requested
was inserted or not.  This allows bitcast in fast isel to properly handle the case
where an appropriate reg-to-reg copy is not available.

llvm-svn: 55375
2008-08-26 18:03:31 +00:00
Owen Anderson bf05ebaccf Add support for fast isel of non-constant fptosi instructions.
llvm-svn: 55373
2008-08-26 17:44:42 +00:00
Owen Anderson 8dd01ccdd8 Add a RetVT parameter to emitted FastISel methods, so that we will be able to pass the desired return
type down.  This is not currently used.

llvm-svn: 55345
2008-08-25 23:58:18 +00:00
Evan Cheng 2c067325d6 Unbreak build.
llvm-svn: 55342
2008-08-25 22:20:39 +00:00
Owen Anderson 126afc5cb9 Expand bitcast support in fast isel to support bitcasts of non-constant values by emitting reg-reg copies.
llvm-svn: 55340
2008-08-25 21:32:34 +00:00
Owen Anderson 32635dbfb2 Add support for fast isel of (integer) immediate materialization pattens, and use them to support
bitcast of constants in fast isel.

llvm-svn: 55325
2008-08-25 20:20:32 +00:00
Dan Gohman 48a3623591 Make MBBMap a DenseMap instead of a std::map.
llvm-svn: 55220
2008-08-23 02:44:46 +00:00
Dan Gohman 2db3f8a095 Reapply r55191 and r55192.
llvm-svn: 55205
2008-08-22 21:28:19 +00:00
Bill Wendling fc4f64eed0 Reverting r55190, r55191, and r55192. They broke the build with this error message:
{standard input}:17:bad register name `%sil'
make[4]: *** [libgcc/./_addvsi3.o] Error 1
make[4]: *** Waiting for unfinished jobs....
{standard input}:23:bad register name `%dil'
{standard input}:28:bad register name `%dil'
make[4]: *** [libgcc/./_addvdi3.o] Error 1
{standard input}:18:bad register name `%sil'
make[4]: *** [libgcc/./_subvsi3.o] Error 1

llvm-svn: 55200
2008-08-22 20:51:05 +00:00
Dan Gohman 04968da460 Fix the InsertBranch call.
llvm-svn: 55192
2008-08-22 19:26:10 +00:00
Dan Gohman 87ff7058e7 Support non-fallthrough unconditional branches in FastISel.
llvm-svn: 55191
2008-08-22 19:21:41 +00:00
Dan Gohman a2292c0d34 Add FastISel support for PHINodes. Machine PHI nodes
are not yet updated properly, but that's a separate
task.

llvm-svn: 55187
2008-08-22 17:37:48 +00:00
Dan Gohman 49e19e906f Factor out the predicate check code from DAGISelEmitter.cpp
and use it in FastISelEmitter.cpp, and make FastISel
subtarget aware. Among other things, this lets it work
properly on x86 targets that don't have SSE, where it
successfully selects x87 instructions.

llvm-svn: 55156
2008-08-22 00:20:26 +00:00
Dan Gohman 6a7461ad9b Have FastISel skip the multiply by 1 for getelementptr on i8*.
llvm-svn: 55129
2008-08-21 17:37:05 +00:00
Dan Gohman efb7d2d03d MVT::getMVT uses iPTR for pointer types, while we need the actual
intptr_t type in this case. FastISel can now select simple
getelementptr instructions.

llvm-svn: 55125
2008-08-21 17:25:26 +00:00
Dan Gohman fe9056584b Basic fast-isel support for instructions with constant int operands.
llvm-svn: 55099
2008-08-21 01:41:07 +00:00
Evan Cheng 4b5c038cd0 Type of first GEP operand is always the same as the target pointer type.
llvm-svn: 55097
2008-08-21 01:19:11 +00:00
Dan Gohman 6a0780cdd7 Fix unused variable warnings.
llvm-svn: 55089
2008-08-20 23:53:10 +00:00
Evan Cheng 864fcc198d First cut, un-optimized (and untested) fast isel lowering of GetElementPtrInst.
llvm-svn: 55085
2008-08-20 22:45:34 +00:00
Dan Gohman a4305cec93 Simplify the BuildMI calls even more.
llvm-svn: 55077
2008-08-20 21:10:53 +00:00
Dan Gohman 02c84b8910 Simplify FastISel's constructor argument list, make the FastISel
class hold a MachineRegisterInfo member, and make the
MachineBasicBlock be passed in to SelectInstructions rather
than the FastISel constructor.

llvm-svn: 55076
2008-08-20 21:05:57 +00:00
Dan Gohman 07a34a5f69 Make more use of the BuildMI API.
llvm-svn: 55072
2008-08-20 18:16:32 +00:00
Dan Gohman 24e8f0cfe6 Minor code reorganization.
llvm-svn: 55071
2008-08-20 18:10:48 +00:00
Dan Gohman 2471f6ce0f Minor whitespace cleanup.
llvm-svn: 55070
2008-08-20 18:09:38 +00:00
Dan Gohman 39a5ffb03f Fix 80 column violation.
llvm-svn: 55069
2008-08-20 18:09:02 +00:00
Dan Gohman e8f9a00424 Fix FastISel to recognize that the last block in the function does
not have a fall-through successor.

llvm-svn: 55033
2008-08-20 01:17:01 +00:00
Dan Gohman f6884373c2 Fix FastISel to recognize unhandled operands, such as constants
that aren't available as virtual registers (for now).

llvm-svn: 55026
2008-08-20 00:35:17 +00:00
Dan Gohman b16a7783c5 Add FastISel support for floating-point operations.
llvm-svn: 55021
2008-08-20 00:23:20 +00:00
Dan Gohman a3e4d5a5e1 Add FastISel support for several more binary operators.
llvm-svn: 55020
2008-08-20 00:11:48 +00:00
Dan Gohman 214343fbbe Support unconditional fall-through branches in FastISel.
llvm-svn: 55014
2008-08-19 22:31:46 +00:00
Dan Gohman 547ce65467 Use the BuildMI overload that sets up a destination register
instead of the one that doesn't and then adding it manually.

llvm-svn: 55006
2008-08-19 20:46:54 +00:00
Dan Gohman c55fdcc935 Handle the case where target-specific fastisel code doesn't have
a desired opcode.

llvm-svn: 55005
2008-08-19 20:43:22 +00:00
Dan Gohman c44423853a Make FastISel's constructor protected, and give it a destructor.
llvm-svn: 54793
2008-08-14 21:51:29 +00:00
Dan Gohman b2226e21c3 Initial checkin of the new "fast" instruction selection support. See
the comments in FastISelEmitter.cpp for details on what this is.
This is currently experimental and unusable.

llvm-svn: 54751
2008-08-13 20:19:35 +00:00