[llvm-commits] [llvm] r125226 - /llvm/trunk/lib/CodeGen/SplitKit.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Wed Feb 9 13:52:09 PST 2011
Author: stoklund
Date: Wed Feb 9 15:52:09 2011
New Revision: 125226
URL: http://llvm.org/viewvc/llvm-project?rev=125226&view=rev
Log:
Ignore <undef> uses when analyzing and rewriting.
Modified:
llvm/trunk/lib/CodeGen/SplitKit.cpp
Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=125226&r1=125225&r2=125226&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SplitKit.cpp (original)
+++ llvm/trunk/lib/CodeGen/SplitKit.cpp Wed Feb 9 15:52:09 2011
@@ -64,8 +64,12 @@
/// analyzeUses - Count instructions, basic blocks, and loops using CurLI.
void SplitAnalysis::analyzeUses() {
const MachineRegisterInfo &MRI = MF.getRegInfo();
- for (MachineRegisterInfo::reg_iterator I = MRI.reg_begin(CurLI->reg);
- MachineInstr *MI = I.skipInstruction();) {
+ for (MachineRegisterInfo::reg_iterator I = MRI.reg_begin(CurLI->reg),
+ E = MRI.reg_end(); I != E; ++I) {
+ MachineOperand &MO = I.getOperand();
+ if (MO.isUse() && MO.isUndef())
+ continue;
+ MachineInstr *MI = MO.getParent();
if (MI->isDebugValue() || !UsingInstrs.insert(MI))
continue;
UseSlots.push_back(LIS.getInstructionIndex(MI).getDefIndex());
@@ -918,6 +922,14 @@
MO.setReg(0);
continue;
}
+
+ // <undef> operands don't really read the register, so just assign them to
+ // the complement.
+ if (MO.isUse() && MO.isUndef()) {
+ MO.setReg(Edit.get(0)->reg);
+ continue;
+ }
+
SlotIndex Idx = LIS.getInstructionIndex(MI);
Idx = MO.isUse() ? Idx.getUseIndex() : Idx.getDefIndex();
More information about the llvm-commits
mailing list