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

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 16:57:57 PST 2024


dtcxzyw 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

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


More information about the llvm-commits mailing list