[llvm] r270137 - [WebAssembly] Simplify code that never has to handle physical registers. NFC.
Dan Gohman via llvm-commits
llvm-commits at lists.llvm.org
Thu May 19 14:07:20 PDT 2016
Author: djg
Date: Thu May 19 16:07:20 2016
New Revision: 270137
URL: http://llvm.org/viewvc/llvm-project?rev=270137&view=rev
Log:
[WebAssembly] Simplify code that never has to handle physical registers. 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=270137&r1=270136&r2=270137&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyPeephole.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyPeephole.cpp Thu May 19 16:07:20 2016
@@ -48,13 +48,6 @@ FunctionPass *llvm::createWebAssemblyPee
return new WebAssemblyPeephole();
}
-static const TargetRegisterClass *GetRegClass(const MachineRegisterInfo &MRI,
- unsigned RegNo) {
- return TargetRegisterInfo::isVirtualRegister(RegNo)
- ? MRI.getRegClass(RegNo)
- : MRI.getTargetRegisterInfo()->getMinimalPhysRegClass(RegNo);
-}
-
/// If desirable, rewrite NewReg to a drop register.
static bool MaybeRewriteToDrop(unsigned OldReg, unsigned NewReg,
MachineOperand &MO,
@@ -63,7 +56,7 @@ static bool MaybeRewriteToDrop(unsigned
bool Changed = false;
if (OldReg == NewReg) {
Changed = true;
- unsigned NewReg = MRI.createVirtualRegister(GetRegClass(MRI, OldReg));
+ unsigned NewReg = MRI.createVirtualRegister(MRI.getRegClass(OldReg));
MO.setReg(NewReg);
MO.setIsDead();
MFI.stackifyVReg(NewReg);
@@ -127,7 +120,7 @@ bool WebAssemblyPeephole::runOnMachineFu
unsigned OldReg = MO.getReg();
unsigned NewReg = Op2.getReg();
- if (GetRegClass(MRI, NewReg) != GetRegClass(MRI, OldReg))
+ if (MRI.getRegClass(NewReg) != MRI.getRegClass(OldReg))
report_fatal_error("Peephole: call to builtin function with "
"wrong signature, from/to mismatch");
Changed |= MaybeRewriteToDrop(OldReg, NewReg, MO, MFI, MRI);
More information about the llvm-commits
mailing list