1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

216 Commits

Author SHA1 Message Date
Evan Cheng
396c744dfa Indentation.
llvm-svn: 55880
2008-09-07 09:04:52 +00:00
Owen Anderson
453bcfcf8d 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
b22e9b050f FastISel support for AND and OR with type i1.
llvm-svn: 55846
2008-09-05 18:44:22 +00:00
Dan Gohman
525caf83e5 FastISel support for ConstantExprs.
llvm-svn: 55843
2008-09-05 18:18:20 +00:00
Dan Gohman
e64326ff34 FastISel support for unreachable.
llvm-svn: 55818
2008-09-05 01:08:41 +00:00
Owen Anderson
6d5b72d45a 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
18f659d804 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
18cc2a26df 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
d08396955c Oops, I accidentally broke the fallback case with my last commit.
llvm-svn: 55704
2008-09-03 17:51:57 +00:00
Owen Anderson
906c590bb8 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
5e0e6dfc7f 80 col violations.
llvm-svn: 55668
2008-09-02 21:59:13 +00:00
Owen Anderson
6c8f04643e 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
481731693d Implement null and undef values for FastISel.
llvm-svn: 55500
2008-08-28 21:19:07 +00:00
Owen Anderson
675ace60a1 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
8c991b6f8a 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
bb32ae5803 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
9e928e0b1f Fix FastISel's bitcast code for the case where getRegForValue fails.
llvm-svn: 55431
2008-08-27 20:41:38 +00:00
Owen Anderson
0b1a8af290 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
b76e1ca974 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
d5e34d9dce 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
6174651396 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
5e5f1c9e8f Basic FastISel support for floating-point constants.
llvm-svn: 55401
2008-08-27 01:09:54 +00:00
Owen Anderson
a0b7e0ab93 Fix handling of inttoptr and ptrtoint when unhandled operands are present.
llvm-svn: 55400
2008-08-27 00:35:37 +00:00
Owen Anderson
c5d2fe6354 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
a8911f33f8 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
0cee245fdc Add support for fast isel of zext.
llvm-svn: 55396
2008-08-26 23:14:49 +00:00
Owen Anderson
d33f25d615 Add support for fptosi of constants in fast isel.
llvm-svn: 55393
2008-08-26 22:34:28 +00:00
Dan Gohman
57b5f9b931 Refactor the bitcast code into its own function.
llvm-svn: 55387
2008-08-26 21:28:54 +00:00
Dan Gohman
58882d14c4 Make FastISel use the correct argument type when casting GEP indices.
llvm-svn: 55384
2008-08-26 20:57:08 +00:00
Dan Gohman
722e912650 Don't select binary instructions with illegal types.
llvm-svn: 55383
2008-08-26 20:52:40 +00:00
Owen Anderson
b15e88b671 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
821ddf6726 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
5fef19facf 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
76c3c73a7a Add support for fast isel of non-constant fptosi instructions.
llvm-svn: 55373
2008-08-26 17:44:42 +00:00
Owen Anderson
9264f41ef2 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
45e24233c7 Unbreak build.
llvm-svn: 55342
2008-08-25 22:20:39 +00:00
Owen Anderson
1532aad9a8 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
27491bbf2c 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
a5ce6c1747 Make MBBMap a DenseMap instead of a std::map.
llvm-svn: 55220
2008-08-23 02:44:46 +00:00
Dan Gohman
071122d2a3 Reapply r55191 and r55192.
llvm-svn: 55205
2008-08-22 21:28:19 +00:00
Bill Wendling
60e176391d 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
557a7db2eb Fix the InsertBranch call.
llvm-svn: 55192
2008-08-22 19:26:10 +00:00
Dan Gohman
3b161cdce8 Support non-fallthrough unconditional branches in FastISel.
llvm-svn: 55191
2008-08-22 19:21:41 +00:00
Dan Gohman
92921499ae 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
a398d11527 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
7c434de476 Have FastISel skip the multiply by 1 for getelementptr on i8*.
llvm-svn: 55129
2008-08-21 17:37:05 +00:00
Dan Gohman
f4269f7bea 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
a6e647dd7c Basic fast-isel support for instructions with constant int operands.
llvm-svn: 55099
2008-08-21 01:41:07 +00:00
Evan Cheng
45c46520da 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
71aa272ac4 Fix unused variable warnings.
llvm-svn: 55089
2008-08-20 23:53:10 +00:00
Evan Cheng
c55f07023a First cut, un-optimized (and untested) fast isel lowering of GetElementPtrInst.
llvm-svn: 55085
2008-08-20 22:45:34 +00:00
Dan Gohman
50af19179b Simplify the BuildMI calls even more.
llvm-svn: 55077
2008-08-20 21:10:53 +00:00
Dan Gohman
ddebe95287 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
96efa9606f Make more use of the BuildMI API.
llvm-svn: 55072
2008-08-20 18:16:32 +00:00
Dan Gohman
3606d17592 Minor code reorganization.
llvm-svn: 55071
2008-08-20 18:10:48 +00:00
Dan Gohman
44da988220 Minor whitespace cleanup.
llvm-svn: 55070
2008-08-20 18:09:38 +00:00
Dan Gohman
9e5e42e0d5 Fix 80 column violation.
llvm-svn: 55069
2008-08-20 18:09:02 +00:00
Dan Gohman
d0da06c817 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
f298c31918 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
455abe7436 Add FastISel support for floating-point operations.
llvm-svn: 55021
2008-08-20 00:23:20 +00:00
Dan Gohman
ce636764de Add FastISel support for several more binary operators.
llvm-svn: 55020
2008-08-20 00:11:48 +00:00
Dan Gohman
25efe2087b Support unconditional fall-through branches in FastISel.
llvm-svn: 55014
2008-08-19 22:31:46 +00:00
Dan Gohman
7a23fc0fb0 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
564f3c6773 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
6b146d5ec3 Make FastISel's constructor protected, and give it a destructor.
llvm-svn: 54793
2008-08-14 21:51:29 +00:00
Dan Gohman
4b1b033f89 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