summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLocal.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Do better with physical reg operands (typically, from inline asm)Dale Johannesen2009-12-161-16/+41
| | | | | | | | | | | | | | | | | | in local register allocator. If a reg-reg copy has a phys reg input and a virt reg output, and this is the last use of the phys reg, assign the phys reg to the virt reg. If a reg-reg copy has a phys reg output and we need to reload its spilled input, reload it directly into the phys reg than passing it through another reg. Following 76208, there is sometimes no dependency between the def of a phys reg and its use; this creates a window where that phys reg can be used for spilling (this is true in linear scan also). This is bad and needs to be fixed a better way, although 76208 works too well in practice to be reverted. However, there should normally be no spilling within inline asm blocks. The patch here goes a long way towards making this actually be true. llvm-svn: 91485
* 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
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* 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
* Distinquish stack slots from other stack objects. They (and fixed objects) ↵Evan Cheng2009-10-171-1/+1
| | | | | | get FixedStack PseudoSourceValues. llvm-svn: 84326
* Convert DOUT to DEBUG(errs()...).Bill Wendling2009-08-221-32/+37
| | | | llvm-svn: 79758
* Use setPreservesAll and setPreservesCFG in CodeGen passes.Dan Gohman2009-07-311-0/+1
| | | | llvm-svn: 77754
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-251-1/+1
| | | | | | | | | | - Some clients which used DOUT have moved to DEBUG. We are deprecating the "magic" DOUT behavior which avoided calling printing functions when the statement was disabled. In addition to being unnecessary magic, it had the downside of leaving code in -Asserts builds, and of hiding potentially unnecessary computations. llvm-svn: 77019
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-111-8/+14
| | | | | | and abort()/exit() -> llvm_report_error(). llvm-svn: 75363
* Fix pr4100. Do not remove no-op copies when they are dead. The registerBob Wilson2009-05-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | scavenger gets confused about register liveness if it doesn't see them. I'm not thrilled with this solution, but it only comes up when there are dead copies in the code, which is something that hopefully doesn't happen much. Here is what happens in pr4100: As shown in the following excerpt from the debug output of llc, the source of a move gets reloaded from the stack, inserting a new load instruction before the move. Since that source operand is a kill, the physical register is free to be reused for the destination of the move. The move ends up being a no-op, copying R3 to R3, so it is deleted. But, it leaves behind the load to reload %reg1028 into R3, and that load is not updated to show that it's destination operand (R3) is dead. The scavenger gets confused by that load because it thinks that R3 is live. Starting RegAlloc of: %reg1025<def,dead> = MOVr %reg1028<kill>, 14, %reg0, %reg0 Regs have values: Reloading %reg1028 into R3 Last use of R3[%reg1028], removing it from live set Assigning R3 to %reg1025 Register R3 [%reg1025] is never used, removing it from live set Alternative solutions might be either marking the load as dead, or zapping the load along with the no-op copy. I couldn't see an easy way to do either of those, though. llvm-svn: 71196
* Fix a comment (again).Bob Wilson2009-05-071-1/+1
| | | | llvm-svn: 71180
* Fix a comment.Bob Wilson2009-05-071-1/+1
| | | | llvm-svn: 71179
* Fix pr3954. The register scavenger asserts for inline assembly withBob Wilson2009-04-091-1/+1
| | | | | | | | | | | | 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
* Added MachineInstr::isRegTiedToDefOperand to check for two-addressness.Evan Cheng2009-03-191-1/+1
| | | | llvm-svn: 67335
* Local register allocator shouldn't assume only the entry and landing pad ↵Evan Cheng2009-01-291-16/+13
| | | | | | basic blocks have live-ins. llvm-svn: 63323
* Exit with nice warnings when register allocator run out of registers.Evan Cheng2009-01-291-40/+65
| | | | llvm-svn: 63267
* A slight compile time optimization. If the caller knows there isn't a free ↵Evan Cheng2009-01-291-6/+6
| | | | | | register getReg() should not call getFreeReg(). llvm-svn: 63263
* Change TargetInstrInfo::isMoveInstr to return source and destination ↵Evan Cheng2009-01-201-2/+3
| | | | | | sub-register indices as well. llvm-svn: 62600
* Drop the reg argument to isRegReDefinedByTwoAddr, which was redundant.Dan Gohman2008-12-051-1/+1
| | | | llvm-svn: 60586
* Minor fix debug for register allocation debug output.Matthijs Kooijman2008-11-241-2/+2
| | | | llvm-svn: 59961
* Fix command-line option printing to print two spaces where needed,Dan Gohman2008-10-141-1/+1
| | | | | | | | | instead of requiring all "short description" strings to begin with two spaces. This makes these strings less mysterious, and it fixes some cases where short description strings mistakenly did not begin with two spaces. llvm-svn: 57521
* Fix the case where an instruction is not properly marked as using all ↵Owen Anderson2008-10-081-1/+19
| | | | | | registers that alias its inputs. llvm-svn: 57286
* Fix a bug in the local allocator's liveness computation where itDan Gohman2008-10-041-3/+5
| | | | | | | | was setting kill flags on tied uses in two-address instructions. The kill flags were causing the allocator to think it could allocate the use and its tied def in different registers. llvm-svn: 57039
* Switch the MachineOperand accessors back to the short names likeDan Gohman2008-10-031-10/+10
| | | | | | isReg, etc., from isRegister, etc. llvm-svn: 57006
* Remove SelectionDag early allocation of registersDale Johannesen2008-09-241-0/+51
| | | | | | | for earlyclobbers. Teach Local RA about earlyclobber, and add some tests for it. llvm-svn: 56592
* Remove isImm(), isReg(), and friends, in favor of Dan Gohman2008-09-131-2/+2
| | | | | | | | | isImmediate(), isRegister(), and friends, to avoid confusion about having two different names with the same meaning. I'm not attached to the longer names, and would be ok with changing to the shorter names if others prefer it. llvm-svn: 56189
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-2/+1
| | | | llvm-svn: 55779
* consolidate DenseMapInfo implementations, and add one for std::pair.Chris Lattner2008-08-221-12/+0
| | | | | | Patch contributed by m-s. llvm-svn: 55167
* Change StackSlotForVirtReg (which maps vregs to frame indices) from std::map ↵Evan Cheng2008-07-101-8/+8
| | | | | | to IndexedMap. llvm-svn: 53414
* - Change the horrible N^2 isRegReDefinedByTwoAddr. Now callers must supply ↵Evan Cheng2008-07-101-15/+5
| | | | | | | | the operand index of def machineoperand and at most one full scan of non-implicit operands is needed. - Change local register allocator to use the new isRegReDefinedByTwoAddr instead of reinventing the wheel. llvm-svn: 53394
* Use DenseMap instead of std::map in local register allocation. This ↵Owen Anderson2008-07-101-3/+16
| | | | | | improves the time on instcombine from .31s to .22s llvm-svn: 53390
* Fix 403.gcc. Finally got the check for two-address-ness correct.Owen Anderson2008-07-101-10/+14
| | | | llvm-svn: 53389
* Revert r53367, which was breaking things.Owen Anderson2008-07-091-1/+3
| | | | llvm-svn: 53378
* Loosen our check here. Local regalloc only cares that the reg is used and ↵Owen Anderson2008-07-091-3/+1
| | | | | | | | def'd by the same instruction, but about the details of the relationship. llvm-svn: 53367
* Don't use an expensive check for two-address-ness when we have the ↵Owen Anderson2008-07-091-2/+13
| | | | | | | | information sitting around to determine it much more quickly, This speeds up the local register allocator from 0.37s to 0.31s on instcombine. llvm-svn: 53359
* Factor local liveness computation out into its own function.Owen Anderson2008-07-091-28/+36
| | | | llvm-svn: 53352
* Reuse the MO variable instead of recomputing it in RegAllocLocal.Dan Gohman2008-07-091-1/+1
| | | | | | Keep RegAllocSimple in sync. llvm-svn: 53351
* RegAllocLocal has a TargetInstrInfo data member. Use it insteadDan Gohman2008-07-091-5/+1
| | | | | | of having local variables duplicate it. llvm-svn: 53346
* Use find with std::map, when that's what's needed, instead of lower_boundDan Gohman2008-07-091-2/+2
| | | | | | with extra checks. llvm-svn: 53344
* Fix the build. Apparently MachineInstr& is no longer implicitly convertable ↵Owen Anderson2008-07-081-1/+1
| | | | | | to MachineBasicBlock::iterator. llvm-svn: 53260
* Make the local register allocator compute (purely local) liveness ↵Owen Anderson2008-07-081-4/+118
| | | | | | | | | information for itself rather than depending on LiveVariables. This decreases compile time from: 0.5909s (LV + Regalloc) to 0.421s (just regalloc). llvm-svn: 53256
* Teach local register allocator to deal with landing pad MBB's.Evan Cheng2008-05-281-4/+4
| | | | llvm-svn: 51647
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-5/+4
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Remove #include<map> from LiveVariables.h. Not referenced.Evan Cheng2008-04-021-0/+1
| | | | llvm-svn: 49099
* Refactor code. Remove duplicated functions that basically do the same thing asEvan Cheng2008-03-051-2/+1
| | | | | | findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies. llvm-svn: 47927
* If we reload a virtual register that's already been assigned, we want to markBill Wendling2008-02-291-1/+2
| | | | | | that instruction as its "last use". This fixes PR1925. llvm-svn: 47758
* Rename PrintableName to Name.Bill Wendling2008-02-261-8/+8
| | | | llvm-svn: 47629
* Change "Name" to "AsmName" in the target register info. Gee, a refactoring toolBill Wendling2008-02-261-8/+8
| | | | | | would have been a Godsend here! llvm-svn: 47625
* Really really bad local register allocator bug. On X86, it was never using ↵Evan Cheng2008-02-221-1/+1
| | | | | | | | ESI, EDI, and EBP because of a bug in RALocal::isPhysRegAvailable(). For example, when it checks if ESI is available, it then looks at registers aliases to ESI. SIL is marked -2 (not allocatable) but isPhysRegAvailable() incorrectly assumes it is in use and returns false for ESI. llvm-svn: 47499
* Add debugging printfs.Evan Cheng2008-02-221-0/+2
| | | | llvm-svn: 47496
OpenPOWER on IntegriCloud