From 94c6566055b856c9580a2b27bf4dd3aa8ac61482 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 16 Feb 2016 23:48:04 +0000 Subject: [WebAssembly] Implement __builtin_frame_address. Differential Revision: http://reviews.llvm.org/D17307 llvm-svn: 261032 --- llvm/lib/Target/WebAssembly/WebAssemblyRegNumbering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyRegNumbering.cpp') diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyRegNumbering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyRegNumbering.cpp index f38f635d822..76ea0d72f6d 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyRegNumbering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyRegNumbering.cpp @@ -108,11 +108,11 @@ bool WebAssemblyRegNumbering::runOnMachineFunction(MachineFunction &MF) { } } // Allocate locals for used physical registers - if (FrameInfo.getStackSize() > 0 || FrameInfo.adjustsStack()) { + bool HasFP = MF.getSubtarget().getFrameLowering()->hasFP(MF); + if (FrameInfo.getStackSize() > 0 || FrameInfo.adjustsStack() || HasFP) { DEBUG(dbgs() << "PReg SP " << CurReg << "\n"); MFI.addPReg(WebAssembly::SP32, CurReg++); } - bool HasFP = MF.getSubtarget().getFrameLowering()->hasFP(MF); if (HasFP) { DEBUG(dbgs() << "PReg FP " << CurReg << "\n"); MFI.addPReg(WebAssembly::FP32, CurReg++); -- cgit v1.2.3