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 | cbfb9b27efd2b4fc1fbc02addf4d41a7d8d8d8eb (patch) | |
tree | d7535cfa5925d166b85d40f57ebfe65a62e70b98 /lib | |
parent | d958a5a9feea7239a73c2068f43f237db550f46e (diff) | |
download | external_llvm-cbfb9b27efd2b4fc1fbc02addf4d41a7d8d8d8eb.zip external_llvm-cbfb9b27efd2b4fc1fbc02addf4d41a7d8d8d8eb.tar.gz external_llvm-cbfb9b27efd2b4fc1fbc02addf4d41a7d8d8d8eb.tar.bz2 |
- Only perform the unfolding optimization when the folding in question is modref.
- Remove a bogus assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/VirtRegMap.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index 4f3a963..f8a104f 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/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 && |