[llvm] [InstCombine] Propagate poison pow[i] (PR #146750)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 4 10:14:27 PDT 2025
================
@@ -6793,6 +6793,9 @@ static Value *simplifyIntrinsic(CallBase *Call, Value *Callee,
Function *F = cast<Function>(Callee);
Intrinsic::ID IID = F->getIntrinsicID();
+ if (IID != Intrinsic::not_intrinsic && intrinsicPropagatesPoison(IID) &&
+ any_of(Args, IsaPred<PoisonValue>))
+ return PoisonValue::get(F->getReturnType());
----------------
badumbatish wrote:
this generalizes the handling of poison propagation, but which intrinsics will be poison-propagated will be gated by intrinsicPropagatesPoison.
This is akin to how #146878 handles its poison propagation. Since we only add the case of pow[i] to the switch statement it shouldn't add support for others.
https://github.com/llvm/llvm-project/pull/146750
More information about the llvm-commits
mailing list