[llvm] 02a7cd5 - BPF: Remove unnecessary isReg check on phi operand (#208243)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 09:17:46 PDT 2026


Author: Matt Arsenault
Date: 2026-07-08T16:17:41Z
New Revision: 02a7cd5177af78e5c8342bec3f30125113071556

URL: https://github.com/llvm/llvm-project/commit/02a7cd5177af78e5c8342bec3f30125113071556
DIFF: https://github.com/llvm/llvm-project/commit/02a7cd5177af78e5c8342bec3f30125113071556.diff

LOG: BPF: Remove unnecessary isReg check on phi operand (#208243)

These must be a register. This pass has quite a lot of
defensive code against invalid MIR that should be deleted.

Added: 
    

Modified: 
    llvm/lib/Target/BPF/BPFMIPeephole.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/BPF/BPFMIPeephole.cpp b/llvm/lib/Target/BPF/BPFMIPeephole.cpp
index 637872ee2ebb8..675b1118d5c9e 100644
--- a/llvm/lib/Target/BPF/BPFMIPeephole.cpp
+++ b/llvm/lib/Target/BPF/BPFMIPeephole.cpp
@@ -121,9 +121,6 @@ bool BPFMIPeephole::isPhiFrom32Def(MachineInstr *PhiMI)
   for (unsigned i = 1, e = PhiMI->getNumOperands(); i < e; i += 2) {
     MachineOperand &opnd = PhiMI->getOperand(i);
 
-    if (!opnd.isReg())
-      return false;
-
     MachineInstr *PhiDef = MRI->getVRegDef(opnd.getReg());
     if (!PhiDef)
       return false;


        


More information about the llvm-commits mailing list