diff options
author | Dan Gohman <dan433584@gmail.com> | 2016-05-21 00:21:56 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2016-05-21 00:21:56 +0000 |
commit | b7c2400fa744c032dc96a2e180f24425911bc794 (patch) | |
tree | 484ce7a4b2401ae6b97de9e54543eb83d598703b /llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h | |
parent | 2907e51246a8cf0a440fa1767f94dc10eda195eb (diff) | |
download | bcm5719-llvm-b7c2400fa744c032dc96a2e180f24425911bc794.tar.gz bcm5719-llvm-b7c2400fa744c032dc96a2e180f24425911bc794.zip |
[WebAssembly] Optimize away return instructions using fallthroughs.
This saves a small amount of code size, and is a first small step toward
passing values on the stack across block boundaries.
Differential Review: http://reviews.llvm.org/D20450
llvm-svn: 270294
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h index 79950a6b257..c2f695db4a0 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h +++ b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h @@ -86,6 +86,12 @@ class WebAssemblyFunctionInfo final : public MachineFunctionInfo { assert(VReg = WARegs.size()); WARegs.push_back(WAReg); } + + // For a given stackified WAReg, return the id number to print with push/pop. + static unsigned getWARegStackId(unsigned Reg) { + assert(Reg & INT32_MIN); + return Reg & INT32_MAX; + } }; } // end namespace llvm |