aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-11-23 19:30:43 +0000
committerDan Gohman <dan433584@gmail.com>2015-11-23 19:30:43 +0000
commitaa0a4bd05b4e99b6f749112604bb942d42988814 (patch)
treec57861e9d550298d358fb0a0523b14f111c2e387 /llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
parent941ad901462adf558966847041f79cd7af70ebf8 (diff)
downloadllvm-aa0a4bd05b4e99b6f749112604bb942d42988814.zip
llvm-aa0a4bd05b4e99b6f749112604bb942d42988814.tar.gz
llvm-aa0a4bd05b4e99b6f749112604bb942d42988814.tar.bz2
[WebAssembly] Don't use set_local instructions explicitly.
The current approach to using get_local and set_local is to use them implicitly, as register uses and defs. Introduce new copy instructions which are themselves no-ops except for the get_local and set_local that they imply, so that we use get_local and set_local consistently. llvm-svn: 253905
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
index 97e8487..2f1d5eb 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
@@ -37,19 +37,19 @@ void WebAssemblyInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
const TargetRegisterClass *RC =
MBB.getParent()->getRegInfo().getRegClass(SrcReg);
- unsigned SetLocalOpcode;
+ unsigned CopyLocalOpcode;
if (RC == &WebAssembly::I32RegClass)
- SetLocalOpcode = WebAssembly::SET_LOCAL_I32;
+ CopyLocalOpcode = WebAssembly::COPY_LOCAL_I32;
else if (RC == &WebAssembly::I64RegClass)
- SetLocalOpcode = WebAssembly::SET_LOCAL_I64;
+ CopyLocalOpcode = WebAssembly::COPY_LOCAL_I64;
else if (RC == &WebAssembly::F32RegClass)
- SetLocalOpcode = WebAssembly::SET_LOCAL_F32;
+ CopyLocalOpcode = WebAssembly::COPY_LOCAL_F32;
else if (RC == &WebAssembly::F64RegClass)
- SetLocalOpcode = WebAssembly::SET_LOCAL_F64;
+ CopyLocalOpcode = WebAssembly::COPY_LOCAL_F64;
else
llvm_unreachable("Unexpected register class");
- BuildMI(MBB, I, DL, get(SetLocalOpcode), DestReg)
+ BuildMI(MBB, I, DL, get(CopyLocalOpcode), DestReg)
.addReg(SrcReg, KillSrc ? RegState::Kill : 0);
}