[llvm] InstSimplify: support floating-point equivalences (PR #115152)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 11 05:09:18 PST 2024
artagnon wrote:
> For example, if we have something like `x == C : sin(C) : sin(x)`, then we should generally not fold that to `sin(x)`, because we cannot guarantee that `sin(x)` at runtime folds to the same `sin(C)` that the host libm produced.
>
> We should be able to avoid this by passing the non-determinism flag to the constant folding API in simplifyWithOpReplaced, for the non-refining case.
Thanks for catching this subtle point. I do think `x == C : sin(x) : sin(C)` should fold, as I've demonstrated in the test case.
https://github.com/llvm/llvm-project/pull/115152
More information about the llvm-commits
mailing list