[llvm] 3dc3d43 - SPIRV: Simplify phi processing (#137050)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 30 03:48:21 PDT 2025


Author: Matt Arsenault
Date: 2025-04-30T12:48:18+02:00
New Revision: 3dc3d431e7385874f200a83bb2f291d2d45b1d16

URL: https://github.com/llvm/llvm-project/commit/3dc3d431e7385874f200a83bb2f291d2d45b1d16
DIFF: https://github.com/llvm/llvm-project/commit/3dc3d431e7385874f200a83bb2f291d2d45b1d16.diff

LOG: SPIRV: Simplify phi processing (#137050)

Added: 
    

Modified: 
    llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
index a6482d9df2ccb..6d2ecd563d200 100644
--- a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
@@ -2019,9 +2019,7 @@ static void patchPhis(const Module &M, SPIRVGlobalRegistry *GR,
     if (!MF)
       continue;
     for (auto &MBB : *MF) {
-      for (MachineInstr &MI : MBB) {
-        if (MI.getOpcode() != TargetOpcode::PHI)
-          continue;
+      for (MachineInstr &MI : MBB.phis()) {
         MI.setDesc(TII.get(SPIRV::OpPhi));
         Register ResTypeReg = GR->getSPIRVTypeID(
             GR->getSPIRVTypeForVReg(MI.getOperand(0).getReg(), MF));


        


More information about the llvm-commits mailing list