[llvm] BPF: Fix misfolding subregisters (PR #208244)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 07:31:10 PDT 2026


================
@@ -89,24 +90,26 @@ void BPFMIPeephole::initialize(MachineFunction &MFParm) {
   MF = &MFParm;
   MRI = &MF->getRegInfo();
   TII = MF->getSubtarget<BPFSubtarget>().getInstrInfo();
+  TRI = &TII->getRegisterInfo();
   LLVM_DEBUG(dbgs() << "*** BPF MachineSSA ZEXT Elim peephole pass ***\n\n");
 }
 
 bool BPFMIPeephole::isCopyFrom32Def(MachineInstr *CopyMI)
 {
   MachineOperand &opnd = CopyMI->getOperand(1);
 
-  if (!opnd.isReg())
-    return false;
----------------
yonghong-song wrote:

This is correct, CopyMI has src/dest both with registers, so the above can be removed.

https://github.com/llvm/llvm-project/pull/208244


More information about the llvm-commits mailing list