[clang] [llvm] [ValueTracking] Teach isGuaranteedNotToBeUndefOrPoison about splats (PR #163570)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 20 01:17:23 PDT 2025


================
@@ -7695,6 +7695,11 @@ static bool isGuaranteedNotToBeUndefOrPoison(
         }
         if (IsWellDefined)
           return true;
+      } else if (auto *Splat = isa<ShuffleVectorInst>(Opr) ? getSplatValue(Opr)
----------------
nikic wrote:

The precise rules for determining the result type of a ternary operator are exceedingly complicated, but the tl;dr is that nullptr is of type nullptr_t, which implicitly converts to all pointer types, and that's what makes this work.

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


More information about the llvm-commits mailing list