summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterCoalescer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused DstSubIdx argument.Jakob Stoklund Olesen2011-10-051-23/+5
| | | | llvm-svn: 141214
* Also add <def,undef> flags when coalescing sub-registers.Jakob Stoklund Olesen2011-10-051-0/+8
| | | | | | | | RegisterCoalescer can create sub-register defs when it is joining a register with a sub-register. Add <undef> flags to these new sub-register defs where appropriate. llvm-svn: 141138
* Move getCommonSubClass() into TRI.Jakob Stoklund Olesen2011-09-301-2/+2
| | | | | | It will soon need the context. llvm-svn: 140896
* Revert r139782, "RemoveCopyByCommutingDef doesn't need hasPHIKill()."Jakob Stoklund Olesen2011-09-151-8/+8
| | | | | | | | | | It does, after all. RemoveCopyByCommutingDef rewrites the uses of one particular value number in A. It doesn't know how to rewrite phi uses, so there can't be any. llvm-svn: 139787
* RemoveCopyByCommutingDef doesn't need hasPHIKill().Jakob Stoklund Olesen2011-09-151-8/+8
| | | | | | | | | | | Instead, let HasOtherReachingDefs() test for defs in B that overlap any phi-defs in A as well. This test is slightly different, but almost identical. A perfectly precise test would only check those phi-defs in A that are reachable from AValNo. llvm-svn: 139782
* It is safe to remat a value killed by phis.Jakob Stoklund Olesen2011-09-151-3/+1
| | | | | | | | | | | | | The source live range is recomputed using shrinkToUses() which does handle phis correctly. The hasPHIKill() condition was relevant in the old days when ReMaterializeTrivialDef() tried to recompute the live range itself. The shrinkToUses() function will mark the original def as dead when no more uses and phi kills remain. It is then removed by runOnMachineFunction(). llvm-svn: 139781
* [regcoalescing] bug fix for RegistersDefinedFromSameValue.Andrew Trick2011-09-151-2/+5
| | | | | | | An improper SlotIndex->VNInfo lookup was leading to unsafe copy removal. Fixes PR10920 401.bzip2 miscompile with no IV rewrite. llvm-svn: 139765
* Simplify by using isFullCopy().Jakob Stoklund Olesen2011-09-021-3/+1
| | | | llvm-svn: 139019
* Inflate register classes after coalescing.Jakob Stoklund Olesen2011-08-091-2/+35
| | | | | | | | | | | | | | | | | | | | | | | Coalescing can remove copy-like instructions with sub-register operands that constrained the register class. Examples are: x86: GR32_ABCD:sub_8bit_hi -> GR32 arm: DPR_VFP2:ssub0 -> DPR Recompute the register class of any virtual registers that are used by less instructions after coalescing. This affects code generation for the Cortex-A8 where we use NEON instructions for f32 operations, c.f. fp_convert.ll: vadd.f32 d16, d1, d0 vcvt.s32.f32 d0, d16 The register allocator is now free to use d16 for the temporary, and that comes first in the allocation order because it doesn't interfere with any s-registers. llvm-svn: 137133
* Rename member variables to follow coding standards.Jakob Stoklund Olesen2011-08-091-198/+198
| | | | | | No functional change. llvm-svn: 137094
* Move the RegisterCoalescer private to its implementation file.Jakob Stoklund Olesen2011-08-091-1/+123
| | | | | | RegisterCoalescer.h still has the CoalescerPair class interface. llvm-svn: 137088
* Refer to the RegisterCoalescer pass by ID.Jakob Stoklund Olesen2011-08-091-4/+2
| | | | | | | A public interface is no longer needed since RegisterCoalescer is not an analysis any more. llvm-svn: 137082
* Eliminate copies of undefined values during coalescing.Jakob Stoklund Olesen2011-07-261-0/+50
| | | | | | | | | | These copies would coalesce easily, but the resulting value would be defined by a deleted instruction. Now we also remove the undefined value number from the destination register. This fixes PR10503. llvm-svn: 136174
* Fix an easy fixme.Rafael Espindola2011-07-031-6/+10
| | | | llvm-svn: 134364
* Use getVNInfoAt.Rafael Espindola2011-07-021-2/+1
| | | | llvm-svn: 134312
* Check the VN of the src register at the two copies, not just theRafael Espindola2011-07-021-1/+6
| | | | | | register number. llvm-svn: 134309
* Disable commit 134216 ("Add 134199 back, but disable the optimization when ↵Duncan Sands2011-07-011-0/+1
| | | | | | | | | the second copy is a kill") to see if it fixes the i386 dragonegg buildbot, which is timing out because gcc built with dragonegg is going into an infinite loop. llvm-svn: 134237
* Avoid DenseMap lookup.Rafael Espindola2011-07-011-6/+8
| | | | llvm-svn: 134231
* Fix off by one error. I misunderstood the comment about killedAt.Rafael Espindola2011-07-011-1/+1
| | | | llvm-svn: 134229
* Check the liveinterval, not the kill flag.Rafael Espindola2011-07-011-7/+10
| | | | llvm-svn: 134228
* Add 134199 back, but disable the optimization when the second copy is a kill.Rafael Espindola2011-07-011-10/+100
| | | | llvm-svn: 134216
* Revert my previous patch while I debug llvm-gcc bootstrap.Rafael Espindola2011-06-301-95/+10
| | | | llvm-svn: 134201
* Don't give up on coalescing A and B when we findRafael Espindola2011-06-301-10/+95
| | | | | | | | | | | | A = X B = X Instead, proceed as if we had found A = X B = A llvm-svn: 134199
* make compose and isMoveInstr static functions.Rafael Espindola2011-06-291-9/+10
| | | | llvm-svn: 134093
* - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo andEvan Cheng2011-06-281-9/+9
| | | | | | | | sink them into MC layer. - Added MCInstrInfo, which captures the tablegen generated static data. Chang TargetInstrInfo so it's based off MCInstrInfo. llvm-svn: 134021
* More refactoring. Move getRegClass from TargetOperandInfo to TargetInstrInfo.Evan Cheng2011-06-271-2/+2
| | | | llvm-svn: 133944
* There is only one register coalescer. Merge it into the base class andRafael Espindola2011-06-261-51/+25
| | | | | | remove the analysis group. llvm-svn: 133899
* Merge SimpleRegisterCoalescing.cpp into RegisterCoalescer.cpp.Rafael Espindola2011-06-261-2/+1523
| | | | llvm-svn: 133897
* Move RegisterCoalescer.h to lib/CodeGen.Rafael Espindola2011-06-261-1/+1
| | | | llvm-svn: 133895
* Analysis groups need to initialize their default implementations.Owen Anderson2010-10-131-1/+2
| | | | llvm-svn: 116441
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Hide analysis group registration behind a macro, just like pass registration.Owen Anderson2010-10-061-1/+1
| | | | llvm-svn: 115835
* Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.Jakob Stoklund Olesen2010-07-161-2/+1
| | | | | | TII::isMoveInstr is going tobe completely removed. llvm-svn: 108507
* Convert EXTRACT_SUBREG to COPY when emitting machine instrs.Jakob Stoklund Olesen2010-07-081-5/+0
| | | | | | | | | 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-1/+1
| | | | | | | Fix X86InstrInfo::convertToThreeAddressWithLEA to generate COPY instead of INSERT_SUBREG. llvm-svn: 107878
* Revert "Remove references to INSERT_SUBREG after de-SSA" r107725.Jakob Stoklund Olesen2010-07-071-1/+1
| | | | | | Buildbot breakage. llvm-svn: 107744
* Remove references to INSERT_SUBREG after de-SSAJakob Stoklund Olesen2010-07-061-1/+1
| | | | llvm-svn: 107732
* Be more forgiving when calculating alias interference for physreg coalescing.Jakob Stoklund Olesen2010-07-061-1/+0
| | | | | | | | | | | | 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-1/+6
| | | | | | | This code is transitional, it will soon be possible to eliminate isExtractSubreg, isInsertSubreg, and isMoveInstr in most places. llvm-svn: 107547
* Be more strict about subreg-to-subreg copies in CoalescerPair.Jakob Stoklund Olesen2010-06-241-5/+15
| | | | | | Also keep track of the original DstREg before subregister adjustments. llvm-svn: 106753
* Revert "Replace a big gob of old coalescer logic with the new CoalescerPair ↵Jakob Stoklund Olesen2010-06-241-15/+5
| | | | | | | | class." Whiny buildbots. llvm-svn: 106710
* Replace a big gob of old coalescer logic with the new CoalescerPair class.Jakob Stoklund Olesen2010-06-241-5/+15
| | | | | | | | 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
* Add CoalescerPair helper class.Jakob Stoklund Olesen2010-06-151-0/+147
| | | | | | | | | | | | | | | | | | | | 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
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-3/+1
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-1/+1
| | | | llvm-svn: 46930
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Pluggable coalescers inplementation.David Greene2007-09-061-0/+43
llvm-svn: 41743
OpenPOWER on IntegriCloud