From e7305cc4b3644e2e82684603f0b37a9ec1798e4c Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 26 Jan 2016 21:08:27 +0000 Subject: [PATCH] [WebAssembly] Remove check for FrameIndex operands in WebAssemblyPeephole This pass runs after FrameIndex elimination, so it should never see FI operands. NFC llvm-svn: 258860 --- .../lib/Target/WebAssembly/WebAssemblyPeephole.cpp | 23 +++++++++------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyPeephole.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyPeephole.cpp index 40b809b..1a8afee 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyPeephole.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyPeephole.cpp @@ -114,21 +114,16 @@ bool WebAssemblyPeephole::runOnMachineFunction(MachineFunction &MF) { LibFunc::Func Func; if (LibInfo.getLibFunc(Name, Func)) { const auto &Op2 = MI.getOperand(2); - if (Op2.isReg()) { - MachineOperand &MO = MI.getOperand(0); - unsigned OldReg = MO.getReg(); - unsigned NewReg = Op2.getReg(); - if (MRI.getRegClass(NewReg) != MRI.getRegClass(OldReg)) - report_fatal_error("Peephole: call to builtin function with " - "wrong signature, from/to mismatch"); - Changed |= MaybeRewriteToDiscard(OldReg, NewReg, MO, MFI, MRI); - } else if (Op2.isFI()) { - break; - } else { + if (!Op2.isReg()) report_fatal_error("Peephole: call to builtin function with " - "wrong signature, not consuming reg or " - "frame index"); - } + "wrong signature, not consuming reg"); + MachineOperand &MO = MI.getOperand(0); + unsigned OldReg = MO.getReg(); + unsigned NewReg = Op2.getReg(); + if (MRI.getRegClass(NewReg) != MRI.getRegClass(OldReg)) + report_fatal_error("Peephole: call to builtin function with " + "wrong signature, from/to mismatch"); + Changed |= MaybeRewriteToDiscard(OldReg, NewReg, MO, MFI, MRI); } } } -- 2.7.4