[llvm] Fix profile metadata propagation in InstCombine select folding (PR #179743)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 08:34:54 PDT 2026


================
@@ -3594,11 +3574,11 @@ Instruction *InstCombinerImpl::foldSelectOfBools(SelectInst &SI) {
     if (match(CondVal, m_OneUse(m_Select(m_Value(A), m_One(), m_Value(B)))) &&
         impliesPoisonOrCond(FalseVal, B, /*Expected=*/false)) {
       // (A || B) || C --> A || (B | C)
-      return replaceInstUsesWith(
-          SI, Builder.CreateLogicalOr(A, Builder.CreateOr(B, FalseVal), "",
-                                      ProfcheckDisableMetadataFixes
-                                          ? nullptr
-                                          : cast<SelectInst>(CondVal)));
+      Value *LOr = Builder.CreateLogicalOr(A, Builder.CreateOr(B, FalseVal));
----------------
mtrofin wrote:

the ones without the TODO and with `unknown` are that way intentionally (i.e. the TODO, or some other TODO, wouldn't apply), correct?

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


More information about the llvm-commits mailing list