summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-10-01 06:21:53 +0000
committerHeejin Ahn <aheejin@gmail.com>2019-10-01 06:21:53 +0000
commit61d5c76a181360ca8f039b2f6c914a18540684b5 (patch)
treea64ab6feb4a6ad459956348462b89c258a127c4a /llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h
parent5b5274eaf8c26064b6d10b43171f6252c10f576e (diff)
downloadbcm5719-llvm-61d5c76a181360ca8f039b2f6c914a18540684b5.tar.gz
bcm5719-llvm-61d5c76a181360ca8f039b2f6c914a18540684b5.zip
[WebAssembly] Unstackify regs after fixing unwinding mismatches
Summary: Fixing unwind mismatches for exception handling can result in splicing existing BBs and moving some of instructions to new BBs. In this case some of stackified def registers in the original BB can be used in the split BB. For example, we have this BB and suppose %r0 is a stackified register. ``` bb.1: %r0 = call @foo ... use %r0 ... ``` After fixing unwind mismatches in CFGStackify, `bb.1` can be split and some instructions can be moved to a newly created BB: ``` bb.1: %r0 = call @foo bb.split (new): ... use %r0 ... ``` In this case we should make %r0 un-stackified, because its use is now in another BB. When spliting a BB, this CL unstackifies all def registers that have uses in the new split BB. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68218 llvm-svn: 373301
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h
index 91e5055ad59..16e2f439298 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h
@@ -101,6 +101,11 @@ public:
VRegStackified.resize(I + 1);
VRegStackified.set(I);
}
+ void unstackifyVReg(unsigned VReg) {
+ auto I = Register::virtReg2Index(VReg);
+ if (I < VRegStackified.size())
+ VRegStackified.reset(I);
+ }
bool isVRegStackified(unsigned VReg) const {
auto I = Register::virtReg2Index(VReg);
if (I >= VRegStackified.size())
OpenPOWER on IntegriCloud