Commit Graph

73 Commits

Author SHA1 Message Date
Dan Gohman 9801ba451a Refactor X86SelectConstAddr, folding it into X86SelectAddress. This
results in better code for globals. Also, unbreak the local CSE for
GlobalValue stub loads.

llvm-svn: 56371
2008-09-19 22:16:54 +00:00
Dan Gohman 940bafb687 FastISel support for i1 constants.
llvm-svn: 56068
2008-09-10 21:01:08 +00:00
Dan Gohman 39d82f902a Add X86FastISel support for static allocas, and refences
to static allocas. As part of this change, refactor the
address mode code for laods and stores.

llvm-svn: 56066
2008-09-10 20:11:02 +00:00
Owen Anderson 4a58bd331b Clean this up, based on Evan's suggestions.
llvm-svn: 56009
2008-09-09 20:47:17 +00:00
Owen Anderson 8529085f4f Check for type legality before materializing integer constants in fast isel. With this change,
all of MultiSource/Applications passes on Darwin/X86 under FastISel.

llvm-svn: 55982
2008-09-09 06:32:02 +00:00
Evan Cheng 1e97901388 Fix a constant lowering bug. Now we can do load and store instructions with funky getelementptr embedded in the address operand.
llvm-svn: 55975
2008-09-09 01:26:59 +00:00
Evan Cheng e775d3526c Add fast isel physical register definition support.
llvm-svn: 55892
2008-09-08 08:38:20 +00:00
Evan Cheng b9a0abb129 Indentation.
llvm-svn: 55880
2008-09-07 09:04:52 +00:00
Owen Anderson 1dd2e40521 Revert r55859. This is breaking the build in the abscence of its companion commit.
llvm-svn: 55865
2008-09-05 23:36:01 +00:00
Dan Gohman fd634599dc FastISel support for AND and OR with type i1.
llvm-svn: 55846
2008-09-05 18:44:22 +00:00
Dan Gohman fcf545690c FastISel support for ConstantExprs.
llvm-svn: 55843
2008-09-05 18:18:20 +00:00
Dan Gohman ea56bdde34 FastISel support for unreachable.
llvm-svn: 55818
2008-09-05 01:08:41 +00:00
Owen Anderson 50288e3c99 Add initial support for selecting constant materializations that require constant
pool loads on X86 in fast isel.  This isn't actually used yet.

llvm-svn: 55814
2008-09-05 00:06:23 +00:00
Dan Gohman e039d5580e Do trivial local CSE for constants and other non-Instruction values
in FastISel.

llvm-svn: 55748
2008-09-03 23:32:19 +00:00
Dan Gohman 7bda51f5a4 Create HandlePHINodesInSuccessorBlocksFast, a version of
HandlePHINodesInSuccessorBlocks that works FastISel-style. This
allows PHI nodes to be updated correctly while using FastISel.

This also involves some code reorganization; ValueMap and
MBBMap are now members of the FastISel class, so they needn't
be passed around explicitly anymore. Also, SelectInstructions
is changed to SelectInstruction, and only does one instruction
at a time.

llvm-svn: 55746
2008-09-03 23:12:08 +00:00
Owen Anderson b1b9398ea7 Oops, I accidentally broke the fallback case with my last commit.
llvm-svn: 55704
2008-09-03 17:51:57 +00:00
Owen Anderson ea666816c2 Fix an issue where we were reusing materializations of constants in blocks not dominated by the materialization. This is
the simple fix, materializing the constant before every use.  It might be better to either track domination of uses or
to materialize all constants and the beginning of the function and let remat sort when to do materialization at uses.

llvm-svn: 55703
2008-09-03 17:37:03 +00:00
Evan Cheng 09ff2e7372 80 col violations.
llvm-svn: 55668
2008-09-02 21:59:13 +00:00
Owen Anderson 6f0c51d9da Fix an issue where a use might be selected before a def, and then we didn't respect the pre-chosen vreg
assignment when selecting the def.  This is the naive solution to the problem: insert a copy to the pre-chosen
vreg.  Other solutions might be preferable, such as:
  1) Passing the dest reg into FastEmit_.  However, this would require the higher level code to know about reg classes, which they don't currently.
  2) Selecting blocks in reverse postorder.  This has some compile time cost for computing the order, and we'd need to measure its impact.

llvm-svn: 55555
2008-08-30 00:38:46 +00:00
Dan Gohman c45733f194 Implement null and undef values for FastISel.
llvm-svn: 55500
2008-08-28 21:19:07 +00:00
Owen Anderson d8a82b75e2 Hook up support for fast-isel of trunc instructions, using the newly working support for EXTRACT_SUBREG.
llvm-svn: 55482
2008-08-28 18:26:01 +00:00
Owen Anderson 9cd1a5e530 FastEmitInst_extractsubreg doesn't need to be passed the register class. It can get it from MachineRegisterInfo instead.
llvm-svn: 55476
2008-08-28 17:47:37 +00:00
Owen Anderson 5f57bc2247 Add a helper method that will be used to support EXTRACT_SUBREG for selecting trunc's in fast-isel.
llvm-svn: 55439
2008-08-27 22:30:02 +00:00
Dan Gohman 61cfa3095d Fix FastISel's bitcast code for the case where getRegForValue fails.
llvm-svn: 55431
2008-08-27 20:41:38 +00:00
Owen Anderson 90609850b2 Use TargetLowering to get the types in fast isel, which handles pointer types correctly for our purposes.
llvm-svn: 55428
2008-08-27 18:58:30 +00:00
Dan Gohman d01789be23 Don't check TLI.getOperationAction. The FastISel way is to
just try to do the action and let the tablegen-generated code
determine if there is target-support for an operation.

llvm-svn: 55427
2008-08-27 18:15:05 +00:00
Dan Gohman b0b5a27438 Add a new FastISel method, getRegForValue, which takes care of
the details of materializing constants and other values into
registers, and make use of it in several places.

llvm-svn: 55426
2008-08-27 18:10:19 +00:00
Dan Gohman f2a6c1579f Add a comment about the current floating-point constant code in FastISel.
llvm-svn: 55425
2008-08-27 18:01:42 +00:00
Dan Gohman 5ca269e684 Basic FastISel support for floating-point constants.
llvm-svn: 55401
2008-08-27 01:09:54 +00:00
Owen Anderson 54aff7bb23 Fix handling of inttoptr and ptrtoint when unhandled operands are present.
llvm-svn: 55400
2008-08-27 00:35:37 +00:00
Owen Anderson 140549256f Add support for fast isel of inttoptr and ptrtoint in the cases where truncation is not needed.
llvm-svn: 55399
2008-08-27 00:31:01 +00:00
Owen Anderson ca1711a5b5 Factor out a large amoutn of the cast handling code in fast isel into helper methods.
This simultaneously makes the code simpler and adds support for sext as well.

llvm-svn: 55398
2008-08-26 23:46:32 +00:00
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