diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-10-22 03:01:44 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-10-22 03:01:44 +0000 |
| commit | 85576037816cdc4f77460531f4ca722e0836314b (patch) | |
| tree | 6cbc3b9d62d46015c2dc0877ea2e15310f5f2f92 /llvm/lib/CodeGen/VirtRegMap.cpp | |
| parent | fd6f3257b86b46e76b5a965d70ec1df43a960d18 (diff) | |
| download | bcm5719-llvm-85576037816cdc4f77460531f4ca722e0836314b.tar.gz bcm5719-llvm-85576037816cdc4f77460531f4ca722e0836314b.zip | |
- Only perform the unfolding optimization when the folding in question is modref.
- Remove a bogus assertion.
llvm-svn: 43211
Diffstat (limited to 'llvm/lib/CodeGen/VirtRegMap.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/VirtRegMap.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index 4f3a96307cf..f8a104f0da2 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -821,11 +821,8 @@ bool LocalSpiller::PrepForUnfoldOpti(MachineBasicBlock &MBB, unsigned Idx = NewMI->findRegisterUseOperandIdx(VirtReg); MachineInstr *FoldedMI = MRI->foldMemoryOperand(NewMI, Idx, SS); if (FoldedMI) { - if (VRM.hasPhys(UnfoldVR)) - assert(VRM.getPhys(UnfoldVR) == UnfoldPR); - else + if (!VRM.hasPhys(UnfoldVR)) VRM.assignVirt2Phys(UnfoldVR, UnfoldPR); - VRM.virtFolded(VirtReg, FoldedMI, VirtRegMap::isRef); MII = MBB.insert(MII, FoldedMI); VRM.RemoveFromFoldedVirtMap(&MI); @@ -1190,7 +1187,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) { if (DeadStore) { bool isDead = !(MR & VirtRegMap::isRef); MachineInstr *NewStore = NULL; - if (MR & VirtRegMap::isMod) { + if (MR & VirtRegMap::isModRef) { unsigned PhysReg = Spills.getSpillSlotOrReMatPhysReg(SS); SmallVector<MachineInstr*, 4> NewMIs; if (PhysReg && |

