[llvm] r258860 - [WebAssembly] Remove check for FrameIndex operands in WebAssemblyPeephole

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 13:08:27 PST 2016


Author: dschuff
Date: Tue Jan 26 15:08:27 2016
New Revision: 258860

URL: http://llvm.org/viewvc/llvm-project?rev=258860&view=rev
Log:
[WebAssembly] Remove check for FrameIndex operands in WebAssemblyPeephole

This pass runs after FrameIndex elimination, so it should never see FI
operands. NFC

Modified:
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyPeephole.cpp

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyPeephole.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyPeephole.cpp?rev=258860&r1=258859&r2=258860&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyPeephole.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyPeephole.cpp Tue Jan 26 15:08:27 2016
@@ -114,21 +114,16 @@ bool WebAssemblyPeephole::runOnMachineFu
             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);
             }
           }
         }




More information about the llvm-commits mailing list