[llvm] [InstCombine] Don't check uses of constant exprs (PR #113684)

Mikael Holmén via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 05:54:30 PDT 2024


================
@@ -3753,7 +3753,7 @@ Instruction *InstCombinerImpl::visitBranchInst(BranchInst &BI) {
   }
 
   // Replace all dominated uses of the condition with true/false
-  if (BI.getSuccessor(0) != BI.getSuccessor(1)) {
+  if (!isa<Constant>(Cond) && BI.getSuccessor(0) != BI.getSuccessor(1)) {
----------------
mikaelholmen wrote:

Maybe add a comment about why we must avoid Constants ?

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


More information about the llvm-commits mailing list