[llvm] r340328 - [WebAssembly] Change writeSPToMemory to writeSPToGlobal (NFC)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 21 12:52:19 PDT 2018


Author: aheejin
Date: Tue Aug 21 12:52:19 2018
New Revision: 340328

URL: http://llvm.org/viewvc/llvm-project?rev=340328&view=rev
Log:
[WebAssembly] Change writeSPToMemory to writeSPToGlobal (NFC)

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

Modified:
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp?rev=340328&r1=340327&r2=340328&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp Tue Aug 21 12:52:19 2018
@@ -97,7 +97,7 @@ bool WebAssemblyFrameLowering::needsSPWr
          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) {
@@ -120,7 +120,7 @@ WebAssemblyFrameLowering::eliminateCallF
   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);
 }
@@ -193,7 +193,7 @@ void WebAssemblyFrameLowering::emitProlo
         .addReg(WebAssembly::SP32);
   }
   if (StackSize && needsSPWriteback(MF, MFI)) {
-    writeSPToMemory(WebAssembly::SP32, MF, MBB, InsertPt, DL);
+    writeSPToGlobal(WebAssembly::SP32, MF, MBB, InsertPt, DL);
   }
 }
 
@@ -232,5 +232,5 @@ void WebAssemblyFrameLowering::emitEpilo
     SPReg = hasFP(MF) ? WebAssembly::FP32 : WebAssembly::SP32;
   }
 
-  writeSPToMemory(SPReg, MF, MBB, InsertPt, DL);
+  writeSPToGlobal(SPReg, MF, MBB, InsertPt, DL);
 }




More information about the llvm-commits mailing list