summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Optimize DAGCombiner's worklist processing. Previously it startedDan Gohman2008-08-281-77/+102
| | | | | | | | | | | | | its work by putting all nodes in the worklist, requiring a big dynamic allocation. Now, DAGCombiner just iterates over the AllNodes list and maintains a worklist for nodes that are newly created or need to be revisited. This allows the worklist to stay small in most cases, so it can be a SmallVector. This has the side effect of making DAGCombine not miss a folding opportunity in alloca-align-rounding.ll. llvm-svn: 55498
* Move CaseBlock, JumpTable, and BitTestBlock to be members ofDan Gohman2008-08-281-80/+77
| | | | | | | | SelectionDAGLowering instead of being in an anonymous namespace. This fixes warnings about SelectionDAGLowering having fields using anonymous namespaces. llvm-svn: 55497
* Fix a FastISel bug where the instructions from lowering the argumentsDan Gohman2008-08-281-12/+16
| | | | | | were being emitted after the first instructions of the entry block. llvm-svn: 55496
* Reduce the size of the Parts vector.Rafael Espindola2008-08-281-3/+4
| | | | llvm-svn: 55483
* Hook up support for fast-isel of trunc instructions, using the newly working ↵Owen Anderson2008-08-281-1/+4
| | | | | | support for EXTRACT_SUBREG. llvm-svn: 55482
* FastEmitInst_extractsubreg doesn't need to be passed the register class. It ↵Owen Anderson2008-08-281-2/+2
| | | | | | can get it from MachineRegisterInfo instead. llvm-svn: 55476
* Revert r55467; it causes regressions in UnitTests/Vector/divides,Dan Gohman2008-08-282-68/+4
| | | | | | Benchmarks/sim/sim, and others on x86-64. llvm-svn: 55475
* Correctly resize the Parts array.Rafael Espindola2008-08-281-1/+1
| | | | llvm-svn: 55471
* If a copy isn't coalesced, but its src is defined by trivial computation. ↵Evan Cheng2008-08-282-4/+68
| | | | | | Re-materialize the src to replace the copy. llvm-svn: 55467
* Split the ATOMIC NodeType's to include the size, e.g.Dale Johannesen2008-08-283-75/+424
| | | | | | | | | | | | | | | | 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. llvm-svn: 55457
* Reorganize the lifetimes of the major objects SelectionDAGISelDan Gohman2008-08-272-232/+345
| | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 55450
* Add a helper method that will be used to support EXTRACT_SUBREG for ↵Owen Anderson2008-08-271-0/+11
| | | | | | selecting trunc's in fast-isel. llvm-svn: 55439
* Move the check whether it's worth remating to caller.Evan Cheng2008-08-272-3/+2
| | | | llvm-svn: 55434
* Fix FastISel's bitcast code for the case where getRegForValue fails.Dan Gohman2008-08-271-1/+4
| | | | llvm-svn: 55431
* Refactor isSafeToReMat out of 2addr pass.Evan Cheng2008-08-272-29/+26
| | | | llvm-svn: 55430
* Use TargetLowering to get the types in fast isel, which handles pointer ↵Owen Anderson2008-08-271-4/+4
| | | | | | types correctly for our purposes. llvm-svn: 55428
* Don't check TLI.getOperationAction. The FastISel way is toDan Gohman2008-08-271-6/+2
| | | | | | | just try to do the action and let the tablegen-generated code determine if there is target-support for an operation. llvm-svn: 55427
* Add a new FastISel method, getRegForValue, which takes care ofDan Gohman2008-08-271-133/+95
| | | | | | | the details of materializing constants and other values into registers, and make use of it in several places. llvm-svn: 55426
* Add a comment about the current floating-point constant code in FastISel.Dan Gohman2008-08-271-0/+6
| | | | llvm-svn: 55425
* Optimize ScheduleDAGRRList's topological sort to use one pass insteadDan Gohman2008-08-271-19/+8
| | | | | | | | of two, and to not need a scratch std::vector. Also, compute the ordering immediately in the result array, instead of in another scratch std::vector that is copied to the result array. llvm-svn: 55421
* Optimize ScheduleDAG's ComputeDepths and ComputeHeights to not needDan Gohman2008-08-271-14/+14
| | | | | | a scratch std::vector. llvm-svn: 55420
* Remove the std::ostream form of PseudoSourceValue's print,Dan Gohman2008-08-271-3/+0
| | | | | | which isn't needed anymore. llvm-svn: 55419
* Basic FastISel support for floating-point constants.Dan Gohman2008-08-271-0/+74
| | | | llvm-svn: 55401
* Fix handling of inttoptr and ptrtoint when unhandled operands are present.Owen Anderson2008-08-271-2/+6
| | | | llvm-svn: 55400
* Add support for fast isel of inttoptr and ptrtoint in the cases where ↵Owen Anderson2008-08-271-0/+19
| | | | | | truncation is not needed. llvm-svn: 55399
* Factor out a large amoutn of the cast handling code in fast isel into helper ↵Owen Anderson2008-08-261-107/+81
| | | | | | | | methods. This simultaneously makes the code simpler and adds support for sext as well. llvm-svn: 55398
* Add support for fast isel of zext.Owen Anderson2008-08-261-0/+29
| | | | llvm-svn: 55396
* disallow direct access to SDValue::ResNo, provide a getter insteadGabor Greif2008-08-267-56/+56
| | | | llvm-svn: 55394
* Add support for fptosi of constants in fast isel.Owen Anderson2008-08-261-3/+29
| | | | llvm-svn: 55393
* Optimize SelectionDAG's topological sort to use one pass insteadDan Gohman2008-08-262-56/+12
| | | | | | | | of two, and to not need a scratch std::vector. Also, use the SelectionDAG's topological sort in LegalizeDAG instead of having a separate implementation. llvm-svn: 55389
* Refactor the bitcast code into its own function.Dan Gohman2008-08-261-58/+69
| | | | llvm-svn: 55387
* Make FastISel use the correct argument type when casting GEP indices.Dan Gohman2008-08-261-6/+7
| | | | llvm-svn: 55384
* Don't select binary instructions with illegal types.Dan Gohman2008-08-261-0/+6
| | | | llvm-svn: 55383
* Add support for fast isel of sitofp, and remove some unnecessary and ↵Owen Anderson2008-08-261-4/+28
| | | | | | imprecise legality checks. llvm-svn: 55381
* Use a combination of copyRegToReg and ISD::BIT_CONVERT when doing fast isel ↵Owen Anderson2008-08-261-8/+19
| | | | | | | | of bitcasts, allowing it to support the full range of conversions people might ask for in a correct manner. llvm-svn: 55378
* Make TargetInstrInfo::copyRegToReg return a bool indicating whether the copy ↵Owen Anderson2008-08-261-5/+5
| | | | | | | | | 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
* Add support for fast isel of non-constant fptosi instructions.Owen Anderson2008-08-261-5/+43
| | | | llvm-svn: 55373
* typo fix.Chris Lattner2008-08-261-1/+1
| | | | llvm-svn: 55355
* Actually recycle SDNode allocations. SelectionDAG is usingDan Gohman2008-08-261-2/+6
| | | | | | | | RecyclingAllocator, but this change is needed for the nodes to actually be recycled. This cuts SelectionDAG's memory usage high-water-mark in half in some cases. llvm-svn: 55351
* Add a RetVT parameter to emitted FastISel methods, so that we will be able ↵Owen Anderson2008-08-251-18/+23
| | | | | | | | to pass the desired return type down. This is not currently used. llvm-svn: 55345
* Unbreak build.Evan Cheng2008-08-251-2/+2
| | | | llvm-svn: 55342
* Expand bitcast support in fast isel to support bitcasts of non-constant ↵Owen Anderson2008-08-251-1/+29
| | | | | | values by emitting reg-reg copies. llvm-svn: 55340
* Add support for fast isel of (integer) immediate materialization pattens, ↵Owen Anderson2008-08-251-2/+29
| | | | | | | | and use them to support bitcast of constants in fast isel. llvm-svn: 55325
* simplify PseudoSourceValue printing a bit. Unnest all of ↵Chris Lattner2008-08-242-47/+46
| | | | | | PseudoSourceValue.cpp from the llvm namespace. llvm-svn: 55293
* Print PseudoSourceValue.Evan Cheng2008-08-242-2/+9
| | | | llvm-svn: 55291
* make sure to flush the stream after dumping, to make sure it goes out ↵Chris Lattner2008-08-241-0/+1
| | | | | | immediately. llvm-svn: 55288
* get MachineConstantPool off std::ostream, onto raw_ostream. It would beChris Lattner2008-08-232-18/+23
| | | | | | really nice if someone converted MachineFunction::print to raw_ostream. llvm-svn: 55268
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-232-75/+78
| | | | | | | | | | | | | | | | | | | | | | | | use raw_ostream instead of std::ostream. Among other goodness, this speeds up llvm-dis of kc++ with a release build from 0.85s to 0.49s (88% faster). Other interesting changes: 1) This makes Value::print be non-virtual. 2) AP[S]Int and ConstantRange can no longer print to ostream directly, use raw_ostream instead. 3) This fixes a bug in raw_os_ostream where it didn't flush itself when destroyed. 4) This adds a new SDNode::print method, instead of only allowing "dump". A lot of APIs have both std::ostream and raw_ostream versions, it would be useful to go through and systematically anihilate the std::ostream versions. This passes dejagnu, but there may be minor fallout, plz let me know if so and I'll fix it. llvm-svn: 55263
* Make MBBMap a DenseMap instead of a std::map.Dan Gohman2008-08-232-4/+4
| | | | llvm-svn: 55220
* Move the point at which FastISel taps into the SelectionDAGISelDan Gohman2008-08-232-238/+263
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 55219
OpenPOWER on IntegriCloud