summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveVariables.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* - Remove calls to copyKillDeadInfo which is an N^2 function. Instead, ↵Evan Cheng2008-07-031-47/+0
| | | | | | | | propagate kill / dead markers as new instructions are constructed in foldMemoryOperand, convertToThressAddress, etc. - Also remove LiveVariables::instructionChanged, etc. Replace all calls with cheaper calls which update VarInfo kill list. llvm-svn: 53097
* Use std::replace instead of std::find and push_back.Evan Cheng2008-07-031-2/+1
| | | | llvm-svn: 53063
* - Add LiveVariables::replaceKillInstruction. This does a subset of ↵Evan Cheng2008-07-031-0/+9
| | | | | | | | instructionChanged. That is, it only update the VarInfo.kills if the new instruction is known to have the correct dead and kill markers. - CommuteInstruction copies kill / dead markers over to new instruction. So use replaceKillInstruction instead. llvm-svn: 53061
* Use a SmallSet when we can to reduce memory allocations.Owen Anderson2008-06-271-1/+2
| | | | | | This speeds up a particular testcase from 0.0302s to 0.0222s in LiveVariables. llvm-svn: 52819
* Fix the text in an assert string.Dan Gohman2008-06-251-1/+1
| | | | llvm-svn: 52744
* This situation can occur:Bill Wendling2008-06-231-2/+17
| | | | | | | | | | | | | | | | | | | ,------. | | | v | t2 = phi ... t1 ... | | | v | t1 = ... | ... = ... t1 ... | | `------' where there is a use in a PHI node that's a predecessor to the defining block. We don't want to mark all predecessors as having the value "alive" in this case. Also, the assert was too restrictive and didn't handle this case. llvm-svn: 52655
* Rewrite LiveVariable liveness computation. The new implementation is much ↵Evan Cheng2008-04-161-219/+239
| | | | | | | | simplified. It eliminated the nasty recursive routines and removed the partial def / use bookkeeping. There is also potential for performance improvement by replacing the conservative handling of partial physical register definitions. The code is currently disabled until live interval analysis is taught of the name scheme. This patch also fixed a couple of nasty corner cases. llvm-svn: 49784
* Now that I am told MachineRegisterInfo also tracks physical register uses / ↵Evan Cheng2008-04-021-24/+64
| | | | | | defs, I can do away with the horribleness I introduced a while back. It's impossible to detect if there is any use of a physical register below an instruction (and before any def of the register) with some cheap book keeping. llvm-svn: 49105
* Fix live variables issues:Evan Cheng2008-03-191-6/+43
| | | | | | | | | | | 1. If part of a register is re-defined, an implicit kill and an implicit def are added to denote read / mod / write. However, this should only be necessary if the register is actually read later. This is a performance issue. 2. If a sub-register is being defined, and it doesn't have a previous use, do not add a implicit kill to the last use of a super-register: = EAX, AX<imp-use,kill> ... AX = In this case, EAX is live but AX is killed, this is wrong and will cause the coalescer to do bad things. llvm-svn: 48521
* Refactor code. Remove duplicated functions that basically do the same thing asEvan Cheng2008-03-051-70/+24
| | | | | | findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies. llvm-svn: 47927
* Clear PhysRegPartUse for the sub register as well.Bill Wendling2008-02-211-1/+1
| | | | llvm-svn: 47453
* Remove one of the fixmes that I put in there. From Evan:Bill Wendling2008-02-201-2/+3
| | | | | | | | No need to go up more levels. A def of a register also sets its sub-registers (so if PhysRegInfo[SuperReg] is NULL, it means SuperReg's super registers are not previously defined). llvm-svn: 47399
* Improve some comments explaining the "handle kills" stuff better.Bill Wendling2008-02-201-2/+4
| | | | llvm-svn: 47395
* Fix comment.Bill Wendling2008-02-201-2/+1
| | | | llvm-svn: 47389
* Added some comments and reformatted others. No functionality change.Bill Wendling2008-02-201-28/+43
| | | | | | | Added two "FIXMEs" for code that looks dubious to me (but I could be wrong). llvm-svn: 47366
* More constification of things. More comments added. No functionalityBill Wendling2008-02-201-44/+76
| | | | | | changes. (Sorry for any formatting changes that creeped in.) llvm-svn: 47362
* No functionality change:Bill Wendling2008-02-201-31/+42
| | | | | | | - Constified some MachineOperand values. - Added/Modified some comments. llvm-svn: 47358
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-19/+19
| | | | llvm-svn: 46930
* If a vr is already marked alive in a bb, then it has PHI uses that are ↵Evan Cheng2008-02-051-2/+3
| | | | | | visited earlier, then it is not killed in the def block (i.e. not dead). llvm-svn: 46763
* Move some functionality for adding flags to MachineInstr's into methods on ↵Owen Anderson2008-01-241-106/+14
| | | | | | MachineInstr rather than LiveVariables. llvm-svn: 46295
* Move some calls to getVRegDef higher in the callgraph, so they don't get ↵Owen Anderson2008-01-151-11/+11
| | | | | | executed as frequently in performance sensitive code. llvm-svn: 46027
* Remove DefInst from LiveVariables::VarInfo. Use the facilities on ↵Owen Anderson2008-01-151-27/+20
| | | | | | MachineRegisterInfo instead. llvm-svn: 46016
* rename TargetInstrDescriptor -> TargetInstrDesc.Chris Lattner2008-01-071-1/+1
| | | | | | | Make MachineInstr::getDesc return a reference instead of a pointer, since it can never be null. llvm-svn: 45695
* Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptorChris Lattner2008-01-071-2/+1
| | | | llvm-svn: 45680
* Rename SSARegMap -> MachineRegisterInfo in keeping with the idea Chris Lattner2007-12-311-2/+4
| | | | | | | | | | | | | | that "machine" classes are used to represent the current state of the code being compiled. Given this expanded name, we can start moving other stuff into it. For now, move the UsedPhysRegs and LiveIn/LoveOuts vectors from MachineFunction into it. Update all the clients to match. This also reduces some needless #includes, such as MachineModuleInfo from MachineFunction. llvm-svn: 45467
* Add new shorter predicates for testing machine operands for various types: Chris Lattner2007-12-301-1/+1
| | | | | | | | | | | | e.g. MO.isMBB() instead of MO.isMachineBasicBlock(). I don't plan on switching everything over, so new clients should just start using the shorter names. Remove old long accessors, switching everything over to use the short accessor: getMachineBasicBlock() -> getMBB(), getConstantPoolIndex() -> getIndex(), setMachineBasicBlock -> setMBB(), etc. llvm-svn: 45464
* More cleanups for MachineOperand:Chris Lattner2007-12-301-6/+6
| | | | | | | | | | - Eliminate the static "print" method for operands, moving it into MachineOperand::print. - Change various set* methods for register flags to take a bool for the value to set it to. Remove unset* methods. - Group methods more logically by operand flavor in MachineOperand.h llvm-svn: 45461
* Start using the simplified methods for adding operands.Chris Lattner2007-12-301-9/+15
| | | | llvm-svn: 45432
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Live interval splitting:Evan Cheng2007-11-171-10/+39
| | | | | | | | | | | | | | | | | | | When a live interval is being spilled, rather than creating short, non-spillable intervals for every def / use, split the interval at BB boundaries. That is, for every BB where the live interval is defined or used, create a new interval that covers all the defs and uses in the BB. This is designed to eliminate one common problem: multiple reloads of the same value in a single basic block. Note, it does *not* decrease the number of spills since no copies are inserted so the split intervals are *connected* through spill and reloads (or rematerialization). The newly created intervals can be spilled again, in that case, since it does not span multiple basic blocks, it's spilled in the usual manner. However, it can reuse the same stack slot as the previously split interval. This is currently controlled by -split-intervals-at-bb. llvm-svn: 44198
* Bring UsedBlocks back. StrongPHIElimination needs this information.Owen Anderson2007-11-081-1/+8
| | | | llvm-svn: 43866
* Handle cases where a register and one of its super-register are both marked asEvan Cheng2007-11-051-2/+4
| | | | | | defined on the same instruction. This fixes PR1767. llvm-svn: 43699
* Remove isReg, isImm, and isMBB, and change all their users to use Dan Gohman2007-09-141-7/+7
| | | | | | | isRegister, isImmediate, and isMachineBasicBlock, which are equivalent, and more popular. llvm-svn: 41958
* Fixed a typo that's causing a missing kill marker.Evan Cheng2007-09-121-4/+3
| | | | llvm-svn: 41893
* Sometimes a MI can define a register as well as defining a super-register at theEvan Cheng2007-09-111-6/+7
| | | | | | same time. Do not mark the "smaller" def as dead. llvm-svn: 41871
* Bugs: missing partial uses and redundant partial defs.Evan Cheng2007-08-011-4/+20
| | | | llvm-svn: 40688
* Don't assume that only Uses can be kills. Defs are marked as kills initiallyDan Gohman2007-07-201-8/+6
| | | | | | | | when there are no uses. This fixes a dangling-pointer bug, where pointers to deleted instructions were not removed from kills lists. More info here: http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-July/009749.html llvm-svn: 40131
* Dead code.Evan Cheng2007-07-171-1/+0
| | | | llvm-svn: 39979
* Replace std::set with SmallPtrSet.Evan Cheng2007-06-271-3/+5
| | | | llvm-svn: 37746
* Properly handle kills of a physical register which has sub-registers that ↵Evan Cheng2007-06-261-13/+73
| | | | | | are read by later instructions. llvm-svn: 37739
* When marking a register as being implicitly defined, make sure to clear its ↵Evan Cheng2007-05-141-0/+2
| | | | | | partial use info as well. llvm-svn: 37046
* Eliminate MarkVirtRegAliveInBlock recursion.Evan Cheng2007-05-081-4/+17
| | | | llvm-svn: 36943
* Drop 'const'Devang Patel2007-05-031-1/+1
| | | | llvm-svn: 36662
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-1/+1
| | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. llvm-svn: 36652
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-0/+1
| | | | llvm-svn: 36632
* Rename findRegisterUseOperand to findRegisterUseOperandIdx to avoid confusion.Evan Cheng2007-04-261-1/+2
| | | | llvm-svn: 36483
* Minor bug.Evan Cheng2007-04-261-2/+2
| | | | llvm-svn: 36473
* Be careful when to add implicit kill / dead operands. Don't add them during ↵Evan Cheng2007-04-261-9/+17
| | | | | | / post reg-allocation. llvm-svn: 36458
* Clean up.Evan Cheng2007-04-251-3/+1
| | | | llvm-svn: 36449
* Data structure change to improve compile time (especially in debug mode).Evan Cheng2007-04-251-12/+23
| | | | llvm-svn: 36447
OpenPOWER on IntegriCloud