summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PreAllocSplitting.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Now that PassInfo and Pass::ID have been separated, move the rest of the ↵Owen Anderson2010-08-231-2/+3
| | | | | | passes over to the new registration API. llvm-svn: 111815
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-2/+2
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-2/+2
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-2/+2
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.Jakob Stoklund Olesen2010-07-161-5/+1
| | | | | | TII::isMoveInstr is going tobe completely removed. llvm-svn: 108507
* Change TII::foldMemoryOperand API to require the machine instruction to beJakob Stoklund Olesen2010-07-091-12/+7
| | | | | | | | | | | | | | inserted in a MBB, and return an already inserted MI. This target API change is necessary to allow foldMemoryOperand to call storeToStackSlot and loadFromStackSlot when folding a COPY to a stack slot reference in a target independent way. The foldMemoryOperandImpl hook is going to change in the same way, but I'll wait until COPY folding is actually implemented. Most targets only fold copies and won't need to specialize this hook at all. llvm-svn: 107991
* Detect and handle COPY in many places.Jakob Stoklund Olesen2010-07-031-2/+4
| | | | | | | This code is transitional, it will soon be possible to eliminate isExtractSubreg, isInsertSubreg, and isMoveInstr in most places. llvm-svn: 107547
* Don't track kills in VNInfo. Use interval ends instead.Jakob Stoklund Olesen2010-06-251-45/+7
| | | | | | | | | | | | The VNInfo.kills vector was almost unused except for all the code keeping it updated. The few places using it were easily rewritten to check for interval ends instead. The two new methods LiveInterval::killedAt and killedInRange are replacements. This brings us down to 3 independent data structures tracking kills. llvm-svn: 106905
* Use pre-increment instead of post-increment when the result is not used.Dan Gohman2010-06-221-5/+5
| | | | llvm-svn: 106542
* Slightly change the meaning of the reMaterialize target hook when the originalJakob Stoklund Olesen2010-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | instruction defines subregisters. Any existing subreg indices on the original instruction are preserved or composed with the new subreg index. Also substitute multiple operands mentioning the original register by using the new MachineInstr::substituteRegister() function. This is necessary because there will soon be <imp-def> operands added to non read-modify-write partial definitions. This instruction: %reg1234:foo = FLAP %reg1234<imp-def> will reMaterialize(%reg3333, bar) like this: %reg3333:bar-foo = FLAP %reg333:bar<imp-def> Finally, replace the TargetRegisterInfo pointer argument with a reference to indicate that it cannot be NULL. llvm-svn: 105358
* - Change MachineInstr::findRegisterDefOperandIdx so it can also look for defsEvan Cheng2010-05-211-1/+1
| | | | | | | | | | that are aliases of the specified register. - Rename modifiesRegister to definesRegister since it's looking a def of the specific register or one of its super-registers. It's not looking for def of a sub-register or alias that could change the specified register. - Added modifiesRegister to look for defs of aliases. llvm-svn: 104377
* constify accessor.Chris Lattner2010-05-211-1/+1
| | | | llvm-svn: 104325
* Add argument TargetRegisterInfo to loadRegFromStackSlot and storeRegToStackSlot.Evan Cheng2010-05-061-3/+5
| | | | llvm-svn: 103193
* Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allowsBenjamin Kramer2010-03-301-1/+1
| | | | | | | only a single type of object to be allocated. Use it to make VNInfo destruction typesafe. llvm-svn: 99919
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-091-2/+1
| | | | | | | | | into TargetOpcodes.h. #include the new TargetOpcodes.h into MachineInstr. Add new inline accessors (like isPHI()) to MachineInstr, and start using them throughout the codebase. llvm-svn: 95687
* Simplify code. No intended functionality/performance change.Benjamin Kramer2010-01-071-37/+12
| | | | llvm-svn: 92938
* Change errs() to dbgs().David Greene2010-01-051-9/+9
| | | | llvm-svn: 92588
* Remove dead variable.Bill Wendling2009-12-281-2/+0
| | | | llvm-svn: 92179
* Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.Lang Hames2009-12-221-12/+9
| | | | | | This fixes an in-place update bug where code inserted at the end of basic blocks may not be covered by existing intervals which were live across the entire block. It is also consistent with the way ranges are specified for live intervals. llvm-svn: 91859
* Moved spill weight calculation out of SimpleRegisterCoalescing and into its ↵Lang Hames2009-12-141-0/+2
| | | | | | own pass: CalculateSpillWeights. llvm-svn: 91273
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-031-2/+2
| | | | | | Patch by Howard Hinnant! llvm-svn: 90365
* - Change TargetInstrInfo::reMaterialize to pass in TargetRegisterInfo.Evan Cheng2009-11-141-1/+1
| | | | | | | | - If destination is a physical register and it has a subreg index, use the sub-register instead. This fixes PR5423. llvm-svn: 88745
* Added an API to the SlotIndexes pass to allow new instructions to be ↵Lang Hames2009-11-141-53/+20
| | | | | | | | inserted into the numbering. PreAllocSplitting is now using this API to insert code. llvm-svn: 88725
* Add a bool flag to StackObjects telling whether they reference spillDavid Greene2009-11-121-2/+2
| | | | | | | | | | | | | slots. The AsmPrinter will use this information to determine whether to print a spill/reload comment. Remove default argument values. It's too easy to pass a wrong argument value when multiple arguments have default values. Make everything explicit to trap bugs early. Update all targets to adhere to the new interfaces.. llvm-svn: 87022
* Fixed an iteration condition in PreAllocSplitting. This should fix some ↵Lang Hames2009-11-121-1/+1
| | | | | | miscompilations casued by PreAllocSplitting. llvm-svn: 86919
* Fix DenseMap iterator constness.Jeffrey Yasskin2009-11-101-2/+2
| | | | | | | | | | | | | | | | | | | This patch forbids implicit conversion of DenseMap::const_iterator to DenseMap::iterator which was possible because DenseMapIterator inherited (publicly) from DenseMapConstIterator. Conversion the other way around is now allowed as one may expect. The template DenseMapConstIterator is removed and the template parameter IsConst which specifies whether the iterator is constant is added to DenseMapIterator. Actually IsConst parameter is not necessary since the constness can be determined from KeyT but this is not relevant to the fix and can be addressed later. Patch by Victor Zverovich! llvm-svn: 86636
* 80 col.Evan Cheng2009-11-091-2/+4
| | | | llvm-svn: 86521
* The Indexes Patch.Lang Hames2009-11-031-88/+110
| | | | | | | | | | | | | | | | This introduces a new pass, SlotIndexes, which is responsible for numbering instructions for register allocation (and other clients). SlotIndexes numbering is designed to match the existing scheme, so this patch should not cause any changes in the generated code. For consistency, and to avoid naming confusion, LiveIndex has been renamed SlotIndex. The processImplicitDefs method of the LiveIntervals analysis has been moved into its own pass so that it can be run prior to SlotIndexes. This was necessary to match the existing numbering scheme. llvm-svn: 85979
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* Oops. Backing out 84681 - needs to wait for the indexing patch.Lang Hames2009-10-201-54/+35
| | | | llvm-svn: 84682
* Added some debugging output to pre-alloc splitting.Lang Hames2009-10-201-35/+54
| | | | llvm-svn: 84681
* Distinquish stack slots from other stack objects. They (and fixed objects) ↵Evan Cheng2009-10-171-1/+1
| | | | | | get FixedStack PseudoSourceValues. llvm-svn: 84326
* Reset kill markers after live interval is reconstructed.Evan Cheng2009-10-091-6/+22
| | | | llvm-svn: 83608
* Remove code that makes no sense.Evan Cheng2009-10-081-2/+0
| | | | llvm-svn: 83589
* Oops. Renamed remaining MachineInstrIndex references.Lang Hames2009-10-031-4/+4
| | | | llvm-svn: 83255
* Renamed MachineInstrIndex to LiveIndex.Lang Hames2009-10-031-51/+51
| | | | llvm-svn: 83254
* Removed static qualifier from a few index related methods. These methods may ↵Lang Hames2009-09-091-16/+15
| | | | | | require a LiveIntervals instance in future. llvm-svn: 81374
* Replaces uses of unsigned for indexes in LiveInterval and VNInfo withLang Hames2009-09-041-72/+81
| | | | | | | | a new class, MachineInstrIndex, which hides arithmetic details from most clients. This is a step towards allowing the register allocator to update/insert code during allocation. llvm-svn: 81040
* Change Pass::print to take a raw ostream instead of std::ostream,Chris Lattner2009-08-231-4/+1
| | | | | | update all code that this affects. llvm-svn: 79830
* Modified VNInfo. The "copy" member is now a union which holds the copy for a ↵Lang Hames2009-08-101-1/+1
| | | | | | register interval, or the defining register for a stack interval. Access is via getCopy/setCopy and getReg/setReg. llvm-svn: 78620
* Use setPreservesAll and setPreservesCFG in CodeGen passes.Dan Gohman2009-07-311-0/+1
| | | | llvm-svn: 77754
* Let callers decide the sub-register index on the def operand of ↵Evan Cheng2009-07-161-2/+2
| | | | | | | | rematerialized instructions. Avoid remat'ing instructions whose def have sub-register indices for now. It's just really really hard to get all the cases right. llvm-svn: 75900
* Fix assert(0) conversion, as suggested by Chris.Torok Edwin2009-07-121-4/+1
| | | | llvm-svn: 75423
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-111-2/+2
| | | | | | and abort()/exit() -> llvm_report_error(). llvm-svn: 75363
* Improved tracking of value number kills. VN kills are now representedLang Hames2009-07-091-8/+9
| | | | | | | | | | | | as an (index,bool) pair. The bool flag records whether the kill is a PHI kill or not. This code will be used to enable splitting of live intervals containing PHI-kills. A slight change to live interval weights introduced an extra spill into lsr-code-insertion (outside the critical sections). The test condition has been updated to reflect this. llvm-svn: 75097
* VNInfo cleanup.Lang Hames2009-06-171-21/+21
| | | | llvm-svn: 73634
* In some rare cases, the register allocator can spill registers but end up ↵Evan Cheng2009-05-031-4/+3
| | | | | | | | | | not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However, reloads and restores might be folded into uses / defs and freed registers might not be used at all. VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants. Not yet enabled. This is part 1. More coming. llvm-svn: 70787
* Fix pr3954. The register scavenger asserts for inline assembly withBob Wilson2009-04-091-2/+2
| | | | | | | | | | | | register destinations that are tied to source operands. The TargetInstrDescr::findTiedToSrcOperand method silently fails for inline assembly. The existing MachineInstr::isRegReDefinedByTwoAddr was very close to doing what is needed, so this revision makes a few changes to that method and also renames it to isRegTiedToUseOperand (for consistency with the very similar isRegTiedToDefOperand and because it handles both two-address instructions and inline assembly with tied registers). llvm-svn: 68714
* Remove the "fast" cases for spill and restore point determination, as these ↵Owen Anderson2009-03-311-126/+59
| | | | | | | | were subtlely wrong in obscure cases. Patch the testcase to account for this change. llvm-svn: 68093
* Give the pre-alloc splitter access to the VirtRegMap. It doesn't do anythingOwen Anderson2009-03-141-0/+8
| | | | | | useful with it at the moment, but it will in the future. llvm-svn: 67012
OpenPOWER on IntegriCloud