Commit Graph

91 Commits

Author SHA1 Message Date
Devang Patel 44afc82ebe Verify debug info.
llvm-svn: 62545
2009-01-19 23:21:49 +00:00
Devang Patel 76d190cf4a Validate dbg_* intrinsics before lowering them.
llvm-svn: 62286
2009-01-15 23:41:32 +00:00
Devang Patel 5c6e1e3b7d Use DebugInfo interface to lower dbg_* intrinsics.
llvm-svn: 62127
2009-01-13 00:35:13 +00:00
Duncan Sands dc020f9c3c Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.

llvm-svn: 62099
2009-01-12 20:38:59 +00:00
Dan Gohman 4c31524bec Factor out the code for sign-extending/truncating gep indices
and use it in x86 address mode folding. Also, make
getRegForValue return 0 for illegal types even if it has a
ValueMap for them, because Argument values are put in the
ValueMap. This fixes PR3181.

llvm-svn: 60696
2008-12-08 07:57:47 +00:00
Evan Cheng a8fd1f2c8e Eliminate some unused variable compile time warnings.
llvm-svn: 59952
2008-11-24 07:09:49 +00:00
Devang Patel 8af0a362f1 Emit label for llvm.dbg.func.start of the inlined function.
llvm-svn: 58814
2008-11-06 21:28:20 +00:00
Dan Gohman e7ced74558 FastISel support for exception-handling constructs.
- Move the EH landing-pad code and adjust it so that it works
   with FastISel as well as with SDISel.
 - Add FastISel support for @llvm.eh.exception and
   @llvm.eh.selector.

llvm-svn: 57539
2008-10-14 23:54:11 +00:00
Chris Lattner c52af45304 calls can be supported.
llvm-svn: 57428
2008-10-13 01:59:13 +00:00
Dale Johannesen 4f0bd68cfe Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger.  Restore return value to
IEEE754.  Adjust all users accordingly.

llvm-svn: 57329
2008-10-09 23:00:39 +00:00
Dan Gohman c1d47c56f9 Avoid emitting redundant materializations of integer constants
for things like null pointers, which at this level aren't
different from regular integer constants.

llvm-svn: 57265
2008-10-07 22:03:27 +00:00
Dan Gohman 4e072a75cc Implement fast-isel support for zero-extending from i1.
It turns out that this is a fairly common operation,
and it's easy enough to handle.

llvm-svn: 56990
2008-10-03 01:28:47 +00:00
Dan Gohman 1ab1d31f7a Optimize conditional branches in X86FastISel. This replaces
sequences like this:
       sete    %al
       testb   %al, %al
       jne     LBB11_1
with this:
       je      LBB11_1

llvm-svn: 56969
2008-10-02 22:15:21 +00:00
Dan Gohman b486350b15 Move the primary fast-isel top-level comments to FastISel.cpp, where
they'll be a little more visible. Also, update and reword them a bit.

llvm-svn: 56877
2008-09-30 20:48:29 +00:00
Dan Gohman 5e490a7567 Support for i1 XOR in FastISel. It is actually safe because
i1 operands are assumed to already by zero-extended.

llvm-svn: 56615
2008-09-25 17:22:52 +00:00
Dan Gohman 32a733e2c7 FastISel support for debug info.
llvm-svn: 56610
2008-09-25 17:05:24 +00:00
Dan Gohman 3663f156f7 Fix a recent fast-isel coverage regression - don't bail out before
giving the target a chance to materialize constants.

llvm-svn: 56605
2008-09-25 01:28:51 +00:00
Dan Gohman 918fe08a56 Arrange for FastISel code to have access to the MachineModuleInfo
object. This will be needed to support debug info.

llvm-svn: 56508
2008-09-23 21:53:34 +00:00
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