[llvm] [InstCombine] Propagate poison pow[i] (PR #146750)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 2 16:59:01 PDT 2025


badumbatish wrote:

ok i digged around and prototyped in the codebase a bit, and together with this comment

>>But I guess we'll still need to figure out how to handle the case whenever not all arguments are constant, e.g only one operand is poison. Should that be handled by ValueTracking?

> Yeah. Generally we should handle these cases in propagatesPoison and simplifyIntrinsic...

I think these are not in ConstantFolding at the moment. but in InstructionSimplify. 

I tried handling this in ConstantFolding but it was clunky with how the Operands array to be passed in is <Const*>, requiring both arguments to pow[i] to both be poison to be foldable.

Tagging @dtcxzyw for some directions


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


More information about the llvm-commits mailing list