[llvm-branch-commits] [llvm] AMDGPU: Make sqrt and rsq intrinsics propagate poison (PR #130914)

Shilei Tian via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Mar 12 06:20:15 PDT 2025


================
@@ -548,6 +548,8 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
   case Intrinsic::amdgcn_sqrt:
   case Intrinsic::amdgcn_rsq: {
     Value *Src = II.getArgOperand(0);
+    if (isa<PoisonValue>(Src))
+      return IC.replaceInstUsesWith(II, Src);
----------------
shiltian wrote:

Why does `undef` give `QNaN` while `poison` give `poison`?

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


More information about the llvm-branch-commits mailing list