[llvm] [RISCV] Match (ext (op a, b)) to (wop a, b) (PR #137508)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 27 06:29:04 PDT 2025
NexMing wrote:
> > > If there is a risk of overflow, is it correct to match `(ext (op a, b))` to `(wop a, b)`?
> >
> >
> > Yes, you are right. This transformation is not correct.
>
> Is there a generic mechanism to analyze if the result won't overflow? Apparently for ABD cases this holds, but how to detect such cases?
If you just want to optimize ABD, you can combine `(vzext (abd (x), (y)))` into your desired form in DAGCombine.
https://github.com/llvm/llvm-project/pull/137508
More information about the llvm-commits
mailing list