[llvm] [PredicateInfo] Support select instructions (PR #229613)

Nikolas Klauser via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 01:49:10 PDT 2026


================
@@ -453,6 +453,31 @@ void PredicateInfoBuilder::processBranch(
           addInfoFor(OpsToRename, V, PB);
         }
       }
+
+      if (isa<Instruction>(Cond) || isa<Argument>(Cond)) {
+        for (User *U : Cond->users()) {
+          auto *SI = dyn_cast<SelectInst>(U);
+          if (!SI || SI->getCondition() != Cond ||
+              SI->getParent() != BranchBB ||
+              SI->getTrueValue() == SI->getFalseValue() || SI->use_empty())
----------------
philnik777 wrote:

What are the `SI->getTrueValue() == SI->getFalseValue()` and `SI->use_empty()` checks for?

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


More information about the llvm-commits mailing list