[clang] [llvm] [InstCombine] Canonicalize `(sitofp x)` -> `(uitofp x)` if `x >= 0` (PR #82404)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 14 14:00:49 PDT 2024


goldsteinn wrote:

> We happen have a back-end where we do not have conversion instructions between unsigned int and FP, so this patch complicates things. Would it make sense to enable this canonicalization only if the target wants it?

We try to keep InstCombine as target agnostic as possible so probably not.
Thats why I was thinking of adding the `nneg` flag, so its extremely easy for the backend to undo this.

If we don't go with `nneg` and its causing issues on a lot of targets, revert might be the right approach.

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


More information about the cfe-commits mailing list