- Only perform the unfolding optimization when the folding in question is modref.

- Remove a bogus assertion.

llvm-svn: 43211
This commit is contained in:
Evan Cheng 2007-10-22 03:01:44 +00:00
parent fd6f3257b8
commit 8557603781
1 changed files with 2 additions and 5 deletions

View File

@ -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 &&