Skip to content

Commit

Permalink
[WebAssembly] Change writeSPToMemory to writeSPToGlobal (NFC)
Browse files Browse the repository at this point in the history
Summary: SP is now a __stack_pointer global and not a memory address anymore.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D51046

llvm-svn: 340328
  • Loading branch information
aheejin committed Aug 21, 2018
1 parent e063213 commit 20c9c44
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
Expand Up @@ -97,7 +97,7 @@ bool WebAssemblyFrameLowering::needsSPWriteback(
MF.getFunction().hasFnAttribute(Attribute::NoRedZone);
}

static void writeSPToMemory(unsigned SrcReg, MachineFunction &MF,
static void writeSPToGlobal(unsigned SrcReg, MachineFunction &MF,
MachineBasicBlock &MBB,
MachineBasicBlock::iterator &InsertStore,
const DebugLoc &DL) {
Expand All @@ -120,7 +120,7 @@ WebAssemblyFrameLowering::eliminateCallFramePseudoInstr(
if (I->getOpcode() == TII->getCallFrameDestroyOpcode() &&
needsSPWriteback(MF, MF.getFrameInfo())) {
DebugLoc DL = I->getDebugLoc();
writeSPToMemory(WebAssembly::SP32, MF, MBB, I, DL);
writeSPToGlobal(WebAssembly::SP32, MF, MBB, I, DL);
}
return MBB.erase(I);
}
Expand Down Expand Up @@ -193,7 +193,7 @@ void WebAssemblyFrameLowering::emitPrologue(MachineFunction &MF,
.addReg(WebAssembly::SP32);
}
if (StackSize && needsSPWriteback(MF, MFI)) {
writeSPToMemory(WebAssembly::SP32, MF, MBB, InsertPt, DL);
writeSPToGlobal(WebAssembly::SP32, MF, MBB, InsertPt, DL);
}
}

Expand Down Expand Up @@ -232,5 +232,5 @@ void WebAssemblyFrameLowering::emitEpilogue(MachineFunction &MF,
SPReg = hasFP(MF) ? WebAssembly::FP32 : WebAssembly::SP32;
}

writeSPToMemory(SPReg, MF, MBB, InsertPt, DL);
writeSPToGlobal(SPReg, MF, MBB, InsertPt, DL);
}

0 comments on commit 20c9c44

Please sign in to comment.