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

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 17:22:36 PST 2024


goldsteinn wrote:

> > > Edit: The little test I added is an example.
> > 
> > 
> > Is there some inherent reason why that transform can only work with sitofp, rather than also uitofp with an s/signed/unsigned replacement everywhere? If there isn't, we should extend that transform instead.
> 
> An example extracted from `cpython/_ctypes_test.ll`: https://godbolt.org/z/jG6WWPqnE

I'm working on a patch to expand that fold.

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


More information about the llvm-commits mailing list