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

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 21 00:14:13 PDT 2024


topperc wrote:

> > Apart from the correctness issues, we've seen some regressions on various benchmarks from LLVM Test Suite after this patch. Specifically, around 3-5% regression on x86-64 in various metrics of the [Interpolation](https://github.com/llvm/llvm-test-suite/tree/main/MicroBenchmarks/ImageProcessing/Interpolation) benchmarks, and up to 30% regression on a number of floating point-centric benchmarks from https://github.com/llvm/llvm-test-suite/tree/main/SingleSource/Benchmarks/Misc (flops-4.c, flops-5.c, flops-6.c, flops-8.c, fp-convert.c). The numbers vary depending on the microarchitecture, with Skylake being less affected (on the order of ~10%) and AMD Rome showing larger regressions (up to 30%).
> 
> FYI this patch saves ~3% instructions for some benchmarks from LLVM-test-suite on RISC-V. [dtcxzyw/llvm-ci#1115](https://github.com/dtcxzyw/llvm-ci/issues/1115) [dtcxzyw/llvm-ci#1114](https://github.com/dtcxzyw/llvm-ci/issues/1114)

Are you able to extract a reproducer that I can look at?

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


More information about the cfe-commits mailing list