[llvm] 03adc5f - Reset NoPHI MachineFunction property in X86CmovConversion

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 02:40:09 PDT 2023


Author: OCHyams
Date: 2023-06-28T10:35:52+01:00
New Revision: 03adc5f16fddf6410810801af1a67214d31ce8ed

URL: https://github.com/llvm/llvm-project/commit/03adc5f16fddf6410810801af1a67214d31ce8ed
DIFF: https://github.com/llvm/llvm-project/commit/03adc5f16fddf6410810801af1a67214d31ce8ed.diff

LOG: Reset NoPHI MachineFunction property in X86CmovConversion

In order to placate the machine-verifier, X86CmovConversion needs to reset the
NoPHI property when it inserts a PHI.

Fixes buildbot failure: https://lab.llvm.org/buildbot/#/builders/16/builds/50453

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D153950

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86CmovConversion.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86CmovConversion.cpp b/llvm/lib/Target/X86/X86CmovConversion.cpp
index 106fd3f1bc388..fae817f9485c4 100644
--- a/llvm/lib/Target/X86/X86CmovConversion.cpp
+++ b/llvm/lib/Target/X86/X86CmovConversion.cpp
@@ -862,6 +862,11 @@ void X86CmovConverterPass::convertCmovInstsToBranches(
     RegRewriteTable[DestReg] = std::make_pair(Op1Reg, Op2Reg);
   }
 
+  // Reset the NoPHIs property if a PHI was inserted to prevent a conflict with
+  // the MachineVerifier during testing.
+  if (MIItBegin != MIItEnd)
+    F->getProperties().reset(MachineFunctionProperties::Property::NoPHIs);
+
   // Now remove the CMOV(s).
   MBB->erase(MIItBegin, MIItEnd);
 


        


More information about the llvm-commits mailing list