summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove some checks for StrongPHIElim. These checks make it impossible to use anCameron Zwarich2010-12-191-4/+2
| | | | | | | | | | | alternative register allocator that does not require LiveIntervals by specifying it on the command-line for a target that has StrongPHIElimination enabled by default. These checks are pretty meaningless anyways, since StrongPHIElimination and PHIElimination are never used at the same time. llvm-svn: 122176
* Fix a comment typo.Bob Wilson2010-12-171-2/+2
| | | | llvm-svn: 122016
* Update LiveDebugVariables during coalescing.Jakob Stoklund Olesen2010-12-021-0/+4
| | | | llvm-svn: 120720
* Implement the first half of LiveDebugVariables.Jakob Stoklund Olesen2010-12-021-0/+5
| | | | | | | | | | | | | | | | | | | Scan the MachineFunction for DBG_VALUE instructions, and replace them with a data structure similar to LiveIntervals. The live range of a DBG_VALUE is determined by propagating it down the dominator tree until a new DBG_VALUE is found. When a DBG_VALUE lives in a register, its live range is confined to the live range of the register's value. LiveDebugVariables runs before coalescing, so DBG_VALUEs are not artificially extended when registers are joined. The missing half will recreate DBG_VALUE instructions from the intervals when register allocation is complete. The pass is disabled by default. It can be enabled with the temporary command line option -live-debug-variables. llvm-svn: 120636
* Unbreak build.Evan Cheng2010-10-221-10/+0
| | | | llvm-svn: 117155
* Transfer implicit ops when forming load multiple and return instructions.Evan Cheng2010-10-221-1/+1
| | | | llvm-svn: 117151
* When SimpleRegisterCoalescing is trimming kill flags on a physical registerJakob Stoklund Olesen2010-10-201-1/+11
| | | | | | | | | | | operand, also check if subregisters are killed. Add <imp-def> operands for subregisters that remain alive after a super register is killed. I don't have a testcase for this that reproduces on trunk. <rdar://problem/8441758> llvm-svn: 116940
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-121-1/+11
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Drop the use of LiveInterval::iterator and the LiveRange class inJakob Stoklund Olesen2010-10-011-14/+7
| | | | | | RemoveCopyByCommutingDef. llvm-svn: 115386
* When RemoveCopyByCommutingDef is creating additional identity copies, just useJakob Stoklund Olesen2010-10-011-47/+7
| | | | | | | | | | | LiveInterval::MergeValueNumberInto instead of trying to extend LiveRanges and getting it wrong. This fixed PR8249 where a valno with a multi-segment live range was defined by an identity copy created by RemoveCopyByCommutingDef. Some of the live segments disappeared. llvm-svn: 115385
* Pretty up the debug output during RemoveCopyByCommutingDef.Jakob Stoklund Olesen2010-10-011-19/+7
| | | | llvm-svn: 115384
* Fixed some tests to avoid LiveIntervals::getInstructionFromIndex(..) ↵Lang Hames2010-09-261-5/+5
| | | | | | overhead where possible. Thanks to Jakob for the suggestions. llvm-svn: 114798
* Avoid using VNInfo::getCopy as much as possible. I want to get rid of it.Jakob Stoklund Olesen2010-09-251-10/+6
| | | | llvm-svn: 114794
* Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing ↵Lang Hames2010-09-251-10/+9
| | | | | | whether LiveIntervals::getInstructionFromIndex(def) returns NULL. llvm-svn: 114791
* Teach RemoveCopyByCommutingDef to check all aliases, not just subregisters.Jakob Stoklund Olesen2010-09-011-16/+14
| | | | | | | This caused a miscompilation in WebKit where %RAX had conflicting defs when RemoveCopyByCommutingDef was commuting a %EAX use. llvm-svn: 112751
* Add experimental -disable-physical-join command line option.Jakob Stoklund Olesen2010-08-311-0/+10
| | | | | | | | | | Eventually, we want to disable physreg coalescing completely, and let the register allocator do its job using hints. This option makes it possible to measure the impact of disabling physreg coalescing. llvm-svn: 112567
* Now that PassInfo and Pass::ID have been separated, move the rest of the ↵Owen Anderson2010-08-231-5/+3
| | | | | | passes over to the new registration API. llvm-svn: 111815
* Transpose the calculation of spill weights such that we are calculating oneJakob Stoklund Olesen2010-08-101-4/+1
| | | | | | | | | | | | | | register at a time. This turns out to be slightly faster than iterating over instructions, but more importantly, it allows us to compute spill weights for new registers created after the spill weight pass has run. Also compute the allocation hint at the same time as the spill weight. This allows us to use the spill weight as a cost metric for copies, and choose the most profitable hint if there is more than one possibility. The new hints provide a very small (< 0.1%) but universal code size improvement. llvm-svn: 110631
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Be more aggressive about removing joined physreg copies.Jakob Stoklund Olesen2010-08-051-3/+10
| | | | | | | When a joined COPY changes subreg liveness, we keep it around as a KILL, otherwise it is safe to delete. llvm-svn: 110403
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | 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-78/+21
| | | | | | TII::isMoveInstr is going tobe completely removed. llvm-svn: 108507
* Remat uncoalescable COPY instrsJakob Stoklund Olesen2010-07-091-0/+11
| | | | llvm-svn: 108010
* Avoid creating %physreg:subidx operands in ↵Jakob Stoklund Olesen2010-07-091-1/+4
| | | | | | | | SimpleRegisterCoalescing::RemoveCopyByCommutingDef. This fixes PR7602. llvm-svn: 107957
* Deal with a few remaining spots that assume physical registers have live ↵Jakob Stoklund Olesen2010-07-091-2/+4
| | | | | | | | intervals. This fixes PR7601. llvm-svn: 107955
* Fix broken isCopy handling in TrimLiveIntervalToLastUse.Jakob Stoklund Olesen2010-07-091-3/+7
| | | | llvm-svn: 107950
* Revert "Fix broken isCopy handling in TrimLiveIntervalToLastUse"Jakob Stoklund Olesen2010-07-081-7/+3
| | | | | | This reverts commit 107921. It broke the clang self host. llvm-svn: 107926
* Fix broken isCopy handling in TrimLiveIntervalToLastUseJakob Stoklund Olesen2010-07-081-3/+7
| | | | llvm-svn: 107921
* Convert EXTRACT_SUBREG to COPY when emitting machine instrs.Jakob Stoklund Olesen2010-07-081-3/+7
| | | | | | | | | EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead. Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg(). The isMoveInstr hook will be removed later. llvm-svn: 107879
* Remove references to INSERT_SUBREG after de-SSA.Jakob Stoklund Olesen2010-07-081-6/+1
| | | | | | | Fix X86InstrInfo::convertToThreeAddressWithLEA to generate COPY instead of INSERT_SUBREG. llvm-svn: 107878
* Fix more places assuming subregisters have live intervalsJakob Stoklund Olesen2010-07-071-1/+6
| | | | llvm-svn: 107780
* Revert "Remove references to INSERT_SUBREG after de-SSA" r107725.Jakob Stoklund Olesen2010-07-071-1/+6
| | | | | | Buildbot breakage. llvm-svn: 107744
* Remove references to INSERT_SUBREG after de-SSAJakob Stoklund Olesen2010-07-061-6/+1
| | | | llvm-svn: 107732
* One more case assuming that subregs have live ranges.Jakob Stoklund Olesen2010-07-061-2/+2
| | | | llvm-svn: 107700
* Fix buildbot breakage where a def is missing.Jakob Stoklund Olesen2010-07-061-0/+2
| | | | llvm-svn: 107698
* Be more forgiving when calculating alias interference for physreg coalescing.Jakob Stoklund Olesen2010-07-061-102/+58
| | | | | | | | | | | | It is OK for an alias live range to overlap if there is a copy to or from the physical register. CoalescerPair can work out if the copy is coalescable independently of the alias. This means that we can join with the actual destination interval instead of using the getOrigDstReg() hack. It is no longer necessary to merge clobber ranges into subregisters. llvm-svn: 107695
* Detect and handle COPY in many places.Jakob Stoklund Olesen2010-07-031-18/+23
| | | | | | | This code is transitional, it will soon be possible to eliminate isExtractSubreg, isInsertSubreg, and isMoveInstr in most places. llvm-svn: 107547
* Use skipInstruction() as a simpler way of iterating over instructions using ↵Jakob Stoklund Olesen2010-06-301-10/+2
| | | | | | SrcReg llvm-svn: 107234
* After physreg coalescing, physical registers might not have live ranges whereJakob Stoklund Olesen2010-06-281-1/+2
| | | | | | | | | | you would expect. Don't assert on that case, just give up. This fixes PR7513. llvm-svn: 107046
* Don't track kills in VNInfo. Use interval ends instead.Jakob Stoklund Olesen2010-06-251-40/+5
| | | | | | | | | | | | 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
* We should remove the live range from the destination register only if *all* defsBill Wendling2010-06-251-2/+2
| | | | | | | | | are dead, not just the def of this register. I.e., a register could be dead, but it's subreg isn't. Testcase to follow with a subsequent patch. llvm-svn: 106878
* Teach AdjustCopiesBackFrom to also use CoalescerPair to identify compatible ↵Jakob Stoklund Olesen2010-06-241-14/+12
| | | | | | copies. llvm-svn: 106780
* Replace a big gob of old coalescer logic with the new CoalescerPair class.Jakob Stoklund Olesen2010-06-241-691/+206
| | | | | | | | | | CoalescerPair can determine if a copy can be coalesced, and which register gets merged away. The old logic in SimpleRegisterCoalescing had evolved into something a bit too convoluted. This second attempt fixes some crashes that only occurred Linux. llvm-svn: 106769
* Revert "Replace a big gob of old coalescer logic with the new CoalescerPair ↵Jakob Stoklund Olesen2010-06-241-180/+518
| | | | | | | | class." Whiny buildbots. llvm-svn: 106710
* Replace a big gob of old coalescer logic with the new CoalescerPair class.Jakob Stoklund Olesen2010-06-241-518/+180
| | | | | | | | CoalescerPair can determine if a copy can be coalesced, and which register gets merged away. The old logic in SimpleRegisterCoalescing had evolved into something a bit too convoluted. llvm-svn: 106701
* Remove the SimpleJoin optimization from SimpleRegisterCoalescing.Jakob Stoklund Olesen2010-06-221-476/+67
| | | | | | | | | Measurements show that it does not speed up coalescing, so there is no reason the keep the added complexity around. Also clean out some unused methods and static functions. llvm-svn: 106548
* Fix an exotic bug that only showed up in an internal test case.Jakob Stoklund Olesen2010-06-151-2/+4
| | | | | | | | SimpleRegisterCoalescing::JoinIntervals() uses CoalescerPair to determine if a copy is coalescable, and in very rare cases it can return true where LHS is not live - the coalescable copy can come from an alias of the physreg in LHS. llvm-svn: 106021
* Add CoalescerPair helper class.Jakob Stoklund Olesen2010-06-151-33/+20
| | | | | | | | | | | | | | | | | | | | Given a copy instruction, CoalescerPair can determine which registers to coalesce in order to eliminate the copy. It deals with all the subreg fun to determine a tuple (DstReg, SrcReg, SubIdx) such that: - SrcReg is a virtual register that will disappear after coalescing. - DstReg is a virtual or physical register whose live range will be extended. - SubIdx is 0 when DstReg is a physical register. - SrcReg can be joined with DstReg:SubIdx. CoalescerPair::isCoalescable() determines if another copy instruction is compatible with the same tuple. This fixes some NEON miscompilations where shuffles are getting coalesced as if they were copies. The CoalescerPair class will replace a lot of the spaghetti logic in JoinCopy later. llvm-svn: 105997
OpenPOWER on IntegriCloud