[llvm] [CHR] Make Selects Created in MergedCondition have Unknown Profdata (PR #167534)

Peter Waller via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 29 10:19:34 PST 2025


================
@@ -1992,6 +1992,8 @@ void CHR::addToMergedCondition(bool IsTrueBiased, Value *Cond,
 
   // Use logical and to avoid propagating poison from later conditions.
   MergedCondition = IRB.CreateLogicalAnd(MergedCondition, Cond);
----------------
peterwaller-arm wrote:

`CreateLogicalAnd` returns a `Value` and can do constant folding, resulting in an undefined behaviour from the `*cast<Instruction>(...)` below which I've seen appear as a crash. I've published a possible fix (and reproducer) at https://github.com/llvm/llvm-project/pull/173902.

cc @boomanaiden154 @mtrofin 

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


More information about the llvm-commits mailing list