mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 21:29:41 +00:00
- 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
This commit is contained in:
parent
d958a5a9fe
commit
cbfb9b27ef
@ -821,11 +821,8 @@ bool LocalSpiller::PrepForUnfoldOpti(MachineBasicBlock &MBB,
|
|||||||
unsigned Idx = NewMI->findRegisterUseOperandIdx(VirtReg);
|
unsigned Idx = NewMI->findRegisterUseOperandIdx(VirtReg);
|
||||||
MachineInstr *FoldedMI = MRI->foldMemoryOperand(NewMI, Idx, SS);
|
MachineInstr *FoldedMI = MRI->foldMemoryOperand(NewMI, Idx, SS);
|
||||||
if (FoldedMI) {
|
if (FoldedMI) {
|
||||||
if (VRM.hasPhys(UnfoldVR))
|
if (!VRM.hasPhys(UnfoldVR))
|
||||||
assert(VRM.getPhys(UnfoldVR) == UnfoldPR);
|
|
||||||
else
|
|
||||||
VRM.assignVirt2Phys(UnfoldVR, UnfoldPR);
|
VRM.assignVirt2Phys(UnfoldVR, UnfoldPR);
|
||||||
|
|
||||||
VRM.virtFolded(VirtReg, FoldedMI, VirtRegMap::isRef);
|
VRM.virtFolded(VirtReg, FoldedMI, VirtRegMap::isRef);
|
||||||
MII = MBB.insert(MII, FoldedMI);
|
MII = MBB.insert(MII, FoldedMI);
|
||||||
VRM.RemoveFromFoldedVirtMap(&MI);
|
VRM.RemoveFromFoldedVirtMap(&MI);
|
||||||
@ -1190,7 +1187,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) {
|
|||||||
if (DeadStore) {
|
if (DeadStore) {
|
||||||
bool isDead = !(MR & VirtRegMap::isRef);
|
bool isDead = !(MR & VirtRegMap::isRef);
|
||||||
MachineInstr *NewStore = NULL;
|
MachineInstr *NewStore = NULL;
|
||||||
if (MR & VirtRegMap::isMod) {
|
if (MR & VirtRegMap::isModRef) {
|
||||||
unsigned PhysReg = Spills.getSpillSlotOrReMatPhysReg(SS);
|
unsigned PhysReg = Spills.getSpillSlotOrReMatPhysReg(SS);
|
||||||
SmallVector<MachineInstr*, 4> NewMIs;
|
SmallVector<MachineInstr*, 4> NewMIs;
|
||||||
if (PhysReg &&
|
if (PhysReg &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user