summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add full register <imp-def> operands when the coalescer is creating partialJakob Stoklund Olesen2010-06-021-50/+50
| | | | | | | | | register updates. These operands tell the spiller that the other parts of the partially defined register are don't-care, and a reload is not necessary. llvm-svn: 105361
* 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
* Properly compose subregister indices when coalescing.Jakob Stoklund Olesen2010-06-011-13/+1
| | | | | | | The comment about ordering of subreg indices is no longer true. This exposed a bug in the new substVirtReg method that is also fixed. llvm-svn: 105294
* Disable invalid coalescer assertion.Jakob Stoklund Olesen2010-05-251-1/+4
| | | | llvm-svn: 104574
* - Change MachineInstr::findRegisterDefOperandIdx so it can also look for defsEvan Cheng2010-05-211-2/+3
| | | | | | | | | | 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
* Fix a crash when debugging the coalescer. DebugValue instructions are notBob Wilson2010-05-181-4/+13
| | | | | | in the coalescer's instruction map. llvm-svn: 104086
* It's not safe eliminate copies where src and dst have different sub-register ↵Evan Cheng2010-05-111-5/+7
| | | | | | indices. llvm-svn: 103450
* Fixes a coalescer bug that caused llc to crash on 2009-11-30-LiveVariablesBug.llEvan Cheng2010-05-061-4/+16
| | | | | | | | | | | with the fix in 103157. %reg1039:1<def> = VMOVS %S1<kill>, pred:14, pred:%reg0 is not coalescable since none of the super-registers of S1 are in reg1039's register class: DPR_VFP2. But it is still a legal copy instruction so it should not assert. llvm-svn: 103170
* Check that subregisters don't have independent values in ↵Jakob Stoklund Olesen2010-05-031-3/+14
| | | | | | | | RemoveCopyByCommutingDef(). This fixes PR6941. llvm-svn: 102970
* Don't use floating point in SimpleRegisterCoalescing.Jakob Stoklund Olesen2010-04-301-15/+10
| | | | | | Rounding differences causes tests to fail on Linux. llvm-svn: 102729
* Reject really weird coalescer case when trying to merge identical subregistersJakob Stoklund Olesen2010-04-291-0/+7
| | | | | | | | | | | | | of different register classes. e.g. %reg1048:3<def> = EXTRACT_SUBREG %RAX<kill>, 3 Where %reg1048 is a GR32 register. This is not impossible to handle, but it is pretty hard and very rare. This should unbreak the dragonegg builder. llvm-svn: 102672
* Fix typos in assertion strings.Dan Gohman2010-04-291-2/+2
| | | | llvm-svn: 102666
* Slightly verboser debug spew from coalescerJakob Stoklund Olesen2010-04-291-24/+25
| | | | llvm-svn: 102663
* Recompute kill flags from live intervals after coalescing instead of trying toJakob Stoklund Olesen2010-04-281-45/+21
| | | | | | | | | | | update them. Computing kill flags is notoriously difficult, and the coalescer would get it wrong sometimes, and it would completely skip physical registers. Now we simply remove kill flags based on the live intervals after coalescing. This is a few percent slower, but now we get correct kill flags for physical registers after coalescing. llvm-svn: 102510
* Do not try to optimize a copy that has already been marked for deletion.Evan Cheng2010-04-211-1/+2
| | | | llvm-svn: 102027
* - Clean up some crappy code which deals with coalescing of copies which look atEvan Cheng2010-04-211-52/+68
| | | | | | | extract_subreg / insert_subreg, etc. - Add support for more aggressive insert_subreg coalescing. llvm-svn: 101971
* Coalescer should not delete copy instructions whose defs are partially dead. ↵Evan Cheng2010-04-081-1/+1
| | | | | | | | e.g. %RDI<def,dead> = MOV64rr %RAX<kill>, %EDI<imp-def> llvm-svn: 100804
* Try trivial remat before the coalescer gives up on a vr / physreg coalescing ↵Evan Cheng2010-03-261-1/+7
| | | | | | for fear of tying up a physical register. llvm-svn: 99575
* Code clean up.Evan Cheng2010-03-251-11/+10
| | | | llvm-svn: 99544
* Remove an unused option.Evan Cheng2010-03-251-59/+29
| | | | llvm-svn: 99537
* Avoid being influenced by dbg_value instructions.Evan Cheng2010-03-251-1/+1
| | | | llvm-svn: 99465
* Free SavedLI even if SimpleRegisterCoalescing::JoinCopy() returns early.Jeffrey Yasskin2010-03-211-4/+5
| | | | llvm-svn: 99113
* Revert "Change coalescer complexity from N^2 to N logN by changing one letter."Jakob Stoklund Olesen2010-03-181-1/+12
| | | | | | This reverts commit 98776. It broke the llvm-gcc boot strap. llvm-svn: 98784
* Change coalescer complexity from N^2 to N logN by changing one letter.Jakob Stoklund Olesen2010-03-171-12/+1
| | | | | | | | | Remove ugly hack that aborted the coalescer before using N^2 time. This affects functions with very complicated live intervals for physical registers, i.e. functions with thousands of function calls. llvm-svn: 98776
* The check for coalescing a virtual register to a physical register, e.g.Evan Cheng2010-03-111-7/+18
| | | | | | | | | cl = EXTRACT_SUBREG reg1024, 1, is overly conservative. It should check for overlaps of vr's live interval with the super registers of the physical register (ECX in this case) and let JoinIntervals() handle checking the coalescing feasibility against the physical register (cl in this case). llvm-svn: 98251
* Disable physical register coalescing when the number of live ranges for theJakob Stoklund Olesen2010-03-091-0/+12
| | | | | | | | | | | | | physreg becomes ridiculously high. std::upper_bound may be log(N), but for sufficiently large live intervals, it becomes log(N)*cachemiss = a long long time. This patch improves coalescer time by 4500x for a function with 20000 function calls. The generated code is different, but not significantly worse - the allocator hints are almost as good as physreg coalescing anyway. llvm-svn: 98023
* Swap parameters of isSafeToMove and isSafeToReMat for consistency.Evan Cheng2010-03-021-1/+1
| | | | llvm-svn: 97578
* Remember to handle sub-registers when moving imp-defs to a rematted instruction.Jakob Stoklund Olesen2010-02-231-2/+17
| | | | llvm-svn: 96995
* Enable assertion to detect cyclic valno references.Jakob Stoklund Olesen2010-02-211-1/+1
| | | | | | This changes the stack overflow in PR6363 to an assertion failure. llvm-svn: 96744
* Fix PR6283.Jakob Stoklund Olesen2010-02-131-4/+22
| | | | | | | | | | | When coalescing with a physreg, remember to add imp-def and imp-kill when dealing with sub-registers. Also fix a related bug in VirtRegRewriter where substitutePhysReg may reallocate the operand list on an instruction and invalidate the reg_iterator. This can happen when a register is mentioned twice on the same instruction. llvm-svn: 96072
* Reapply coalescer fix for better cross-class coalescing.Jakob Stoklund Olesen2010-02-111-1/+1
| | | | | | This time with fixed test cases. llvm-svn: 95938
* Revert functional change. This broke a bunch of tests.Jakob Stoklund Olesen2010-02-111-1/+1
| | | | llvm-svn: 95921
* It is always good to do a cross-class join when the large register has a ↵Jakob Stoklund Olesen2010-02-111-6/+11
| | | | | | | | tiny interval. Also avoid division by zero. llvm-svn: 95917
* Ignore debug info one more place during coalescing.Dale Johannesen2010-02-101-0/+2
| | | | llvm-svn: 95819
* Fix "the the" and similar typos.Dan Gohman2010-02-101-1/+1
| | | | llvm-svn: 95781
* Skip DBG_VALUE many places in live intervals andDale Johannesen2010-02-101-17/+26
| | | | | | | | | register coalescing. This fixes many crashes and places where debug info affects codegen (when dbg.value is lowered to machine instructions, which it isn't yet in TOT). llvm-svn: 95739
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-091-18/+14
| | | | | | | | | 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
* Remember to update live-in lists when coalescing physregs.Jakob Stoklund Olesen2010-02-091-0/+17
| | | | | | Patch by M Wahab! llvm-svn: 95668
* Change errs() to dbgs().David Greene2010-01-051-64/+63
| | | | llvm-svn: 92592
* Add coalescer asserts.Jakob Stoklund Olesen2009-12-221-4/+6
| | | | llvm-svn: 91945
* Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.Lang Hames2009-12-221-2/+2
| | | | | | 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-110/+0
| | | | | | own pass: CalculateSpillWeights. llvm-svn: 91273
* Coalesce insert_subreg undef, x first to avoid phase ordering issue.Evan Cheng2009-12-111-4/+11
| | | | llvm-svn: 91103
* It's not safe to coalesce a move where src and dst registers have different ↵Evan Cheng2009-12-101-1/+7
| | | | | | | | subregister indices. e.g.: %reg16404:1<def> = MOV8rr %reg16412:2<kill> llvm-svn: 91061
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-031-14/+18
| | | | | | Patch by Howard Hinnant! llvm-svn: 90365
* Fix PR5391: support early clobber physical register def tied with a use (ewwww)Evan Cheng2009-12-011-0/+12
| | | | | | | | - A valno should be set HasRedefByEC if there is an early clobber def in the middle of its live ranges. It should not be set if the def of the valno is defined by an early clobber. - If a physical register def is tied to an use and it's an early clobber, it just means the HasRedefByEC is set since it's still one continuous live range. - Add a couple of missing checks for HasRedefByEC in the coalescer. In general, it should not coalesce a vr with a physical register if the physical register has a early clobber def somewhere. This is overly conservative but that's the price for using such a nasty inline asm "feature". llvm-svn: 90269
* Use CFG connectedness as a secondary sort key when deciding the order of ↵Jakob Stoklund Olesen2009-12-011-3/+13
| | | | | | | | | copy coalescing. This means that well connected blocks are copy coalesced before the less connected blocks. Connected blocks are more difficult to coalesce because intervals are more complicated, so handling them first gives a greater chance of success. llvm-svn: 90194
* Add MachineBasicBlock::getName, and use it in place of getBasicBlock()->getName.Jakob Stoklund Olesen2009-11-201-1/+1
| | | | | | Fix debug code that assumes getBasicBlock never returns NULL. llvm-svn: 89428
* - 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
* RangeIsDefinedByCopyFromReg() should check for subreg_to_reg, insert_subreg,Evan Cheng2009-11-041-6/+22
| | | | | | | | and extract_subreg as a "copy" that defines a valno. Also fixes a typo. These two issues prevent a simple subreg coalescing from happening before. llvm-svn: 86022
OpenPOWER on IntegriCloud