summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Commit message (Collapse)AuthorAge
* Add a bit to mark operands of asm's that conflictDale Johannesen2008-09-17
| | | | | | | | | | | with an earlyclobber operand elsewhere. Propagate this bit and the earlyclobber bit through SDISel. Change linear-scan RA not to allocate regs in a way that conflicts with an earlyclobber. See also comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56290 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't take the time to CheckDAGForTailCallsAndFixThem when tail callsDan Gohman2008-09-16
| | | | | | | | are not enabled. Instead just omit the tail call flag when calls are created. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56235 91177308-0d34-0410-b5e6-96231b3b80d8
* Define CallSDNode, an SDNode subclass for use with ISD::CALL.Dan Gohman2008-09-13
| | | | | | | | | | | | | | Currently it just holds the calling convention and flags for isVarArgs and isTailCall. And it has several utility methods, which eliminate magic 5+2*i and similar index computations in several places. CallSDNodes are not CSE'd. Teach UpdateNodeOperands to handle nodes that are not CSE'd gracefully. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56183 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ConstantSDNode::getValue to getZExtValue, for consistencyDan Gohman2008-09-12
| | | | | | | | with ConstantInt. This led to fixing a bug in TargetLowering.cpp using getValue instead of getAPIntValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56159 91177308-0d34-0410-b5e6-96231b3b80d8
* Add X86FastISel support for static allocas, and refencesDan Gohman2008-09-10
| | | | | | | | to static allocas. As part of this change, refactor the address mode code for laods and stores. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56066 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a break statement that I accidentally deleted whenDan Gohman2008-09-10
| | | | | | | | I shuffled the fast-isel command-line options around. This fixes a bunch of fast-isel failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56057 91177308-0d34-0410-b5e6-96231b3b80d8
* Change -fast-isel-no-abort to -fast-isel-abort, which now defaultsDan Gohman2008-09-09
| | | | | | | | | to being off by default. Also, add assertion checks to check that the various fast-isel-related command-line options are only used when -fast-isel itself is enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56029 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new option, -fast-isel-verbose, that can be used withDan Gohman2008-09-09
| | | | | | | | -fast-isel-no-abort to get a dump of all unhandled instructions, without an abort. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56021 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the code that protected FastISel from aborting inDan Gohman2008-09-09
| | | | | | | | | the case of loads, stores, and conditional branches. It can handle those now, so any that aren't handled should trigger the abort. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55977 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a few I's that were meant to be renamed to BI's.Dan Gohman2008-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55942 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid redefinition and nnbreak windows build.Evan Cheng2008-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55911 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the code that inserts copies for function livein registersDan Gohman2008-09-05
| | | | | | | | | | out of ScheduleDAGEmit.cpp and into SelectionDAGISel.cpp. This allows it to be run exactly once per function, even if multiple SelectionDAG iterations happen in the entry block, as may happen with FastISel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55863 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
* Create HandlePHINodesInSuccessorBlocksFast, a version ofDan Gohman2008-09-03
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55746 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the SelectionDAG-building code, including the FunctionLoweringInfoDan Gohman2008-09-03
| | | | | | | | and SelectionDAGLowering classes, out of SelectionDAGISel.cpp and put it in a separate file, SelectionDAGBuild.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55701 91177308-0d34-0410-b5e6-96231b3b80d8
* If TargetSelectInstruction returns true, move to next instruction.Evan Cheng2008-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55692 91177308-0d34-0410-b5e6-96231b3b80d8
* Ensure that HandlePHINodesInSuccessorBlocks is run for all blocks,Dan Gohman2008-09-02
| | | | | | | | even in FastISel mode in the case where FastISel successfully selects all the instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55641 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a target callback for FastISel.Dan Gohman2008-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55512 91177308-0d34-0410-b5e6-96231b3b80d8
* erect abstraction boundaries for accessing SDValue members, rename Val -> ↵Gabor Greif2008-08-28
| | | | | | Node to reflect semantics git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55504 91177308-0d34-0410-b5e6-96231b3b80d8
* Move CaseBlock, JumpTable, and BitTestBlock to be members ofDan Gohman2008-08-28
| | | | | | | | | SelectionDAGLowering instead of being in an anonymous namespace. This fixes warnings about SelectionDAGLowering having fields using anonymous namespaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55497 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a FastISel bug where the instructions from lowering the argumentsDan Gohman2008-08-28
| | | | | | | were being emitted after the first instructions of the entry block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55496 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce the size of the Parts vector.Rafael Espindola2008-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55483 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly resize the Parts array.Rafael Espindola2008-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55471 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the ATOMIC NodeType's to include the size, e.g.Dale Johannesen2008-08-28
| | | | | | | | | | | | | | | | | | ATOMIC_LOAD_ADD_{8,16,32,64} instead of ATOMIC_LOAD_ADD. Increased the Hardcoded Constant OpActionsCapacity to match. Large but boring; no functional change. This is to support partial-word atomics on ppc; i8 is not a valid type there, so by the time we get to lowering, the ATOMIC_LOAD nodes looks the same whether the type was i8 or i32. The information can be added to the AtomicSDNode, but that is the largest SDNode; I don't fully understand the SDNode allocation, but it is sensitive to the largest node size, so increasing that must be bad. This is the alternative. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55457 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorganize the lifetimes of the major objects SelectionDAGISelDan Gohman2008-08-27
| | | | | | | | | | | | | | | | | | | | | works with. SelectionDAG, FunctionLoweringInfo, and SelectionDAGLowering objects now get created once per SelectionDAGISel instance, and can be reused across blocks and across functions. Previously, they were created and destroyed each time they were needed. This reorganization simplifies the handling of PHI nodes, and also SwitchCases, JumpTables, and BitTestBlocks. This simplification has the side effect of fixing a bug in FastISel where successor PHI nodes weren't being updated correctly. This is also a step towards making the transition from FastISel into and out of SelectionDAG faster, and also making plain SelectionDAG faster on code with lots of little blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55450 91177308-0d34-0410-b5e6-96231b3b80d8
* disallow direct access to SDValue::ResNo, provide a getter insteadGabor Greif2008-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55394 91177308-0d34-0410-b5e6-96231b3b80d8
* typo fix.Chris Lattner2008-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55355 91177308-0d34-0410-b5e6-96231b3b80d8
* Make MBBMap a DenseMap instead of a std::map.Dan Gohman2008-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55220 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the point at which FastISel taps into the SelectionDAGISelDan Gohman2008-08-23
| | | | | | | | | | | | | | | | | | | process up to a higher level. This allows FastISel to leverage more of SelectionDAGISel's infastructure, such as updating Machine PHI nodes. Also, implement transitioning from SDISel back to FastISel in the middle of a block, so it's now possible to go back and forth. This allows FastISel to hand individual CallInsts and other complicated things off to SDISel to handle, while handling the rest of the block itself. To help support this, reorganize the SelectionDAG class so that it is allocated once and reused throughout a function, instead of being completely reallocated for each block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55219 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid creating shift-by-zero SDNodes in the common case ofDan Gohman2008-08-23
| | | | | | | | i8* getelementptr. DAGCombine eliminates these, but this is a fairly common case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55214 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r55191 and r55192.Dan Gohman2008-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55205 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting r55190, r55191, and r55192. They broke the build with this error ↵Bill Wendling2008-08-22
| | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55200 91177308-0d34-0410-b5e6-96231b3b80d8
* Support non-fallthrough unconditional branches in FastISel.Dan Gohman2008-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55191 91177308-0d34-0410-b5e6-96231b3b80d8
* First cut, un-optimized (and untested) fast isel lowering of GetElementPtrInst.Evan Cheng2008-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55085 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify FastISel's constructor argument list, make the FastISelDan Gohman2008-08-20
| | | | | | | | | class hold a MachineRegisterInfo member, and make the MachineBasicBlock be passed in to SelectInstructions rather than the FastISel constructor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55076 91177308-0d34-0410-b5e6-96231b3b80d8
* Dump the instruction that foiled ISel even when -debug is not used.Dan Gohman2008-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55075 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill off SimpleBBISel, it's replaced by FastISel.Evan Cheng2008-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55067 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable DAGCombine's alignment inference in "fast" codegen mode.Dan Gohman2008-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55059 91177308-0d34-0410-b5e6-96231b3b80d8
* Use BitVector instead of std::vector<unsigned char>.Dan Gohman2008-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55054 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a leak in the FastISel code that Chris pointed out.Dan Gohman2008-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55031 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for running SelectionDAG if FastISel fails. This is underDan Gohman2008-08-20
| | | | | | | | a command-line option, so that the default behavior is an abort, which is useful for exposing code that isn't supported yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55028 91177308-0d34-0410-b5e6-96231b3b80d8
* Add code to call FastISel, and a command-line option to enable it.Dan Gohman2008-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55015 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename some GC classes so that their roll will hopefully be clearer.Gordon Henriksen2008-08-17
| | | | | | | | | | | | | | | | | | In particular, Collector was confusing to implementors. Several thought that this compile-time class was the place to implement their runtime GC heap. Of course, it doesn't even exist at runtime. Specifically, the renames are: Collector -> GCStrategy CollectorMetadata -> GCFunctionInfo CollectorModuleMetadata -> GCModuleInfo CollectorRegistry -> GCRegistry Function::getCollector -> getGC (setGC, hasGC, clearGC) Several accessors and nested types have also been renamed to be consistent. These changes should be obvious. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54899 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor GC metadata table assembly generation out of Collector in preparation ↵Gordon Henriksen2008-08-17
| | | | | | for splitting AsmPrinter into its own library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54881 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename SelectionDAGISel's FastISel to Fast, to begin to makeDan Gohman2008-08-13
| | | | | | | room for the new FastISel instruction selection code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54749 91177308-0d34-0410-b5e6-96231b3b80d8
* Add skeleton of simple basic block instruction selector.Evan Cheng2008-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54522 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor code that finalize PHI nodes, jump tables, etc. out of ↵Evan Cheng2008-08-07
| | | | | | SelectBasicBlock. No functionality changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54438 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the -disable-correct-folding option, which was ugly and is no longer ↵Owen Anderson2008-08-05
| | | | | | needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54361 91177308-0d34-0410-b5e6-96231b3b80d8
* This option doesn't need to be a target option. It can be in SDISel instead.Owen Anderson2008-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54336 91177308-0d34-0410-b5e6-96231b3b80d8
* - Fix SelectionDAG to generate correct CFGs.Owen Anderson2008-08-04
| | | | | | | | | - Add a basic machine-level dead block eliminator. These two have to go together, since many other parts of the code generator are unable to handle the unreachable blocks otherwise created. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54333 91177308-0d34-0410-b5e6-96231b3b80d8