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

Yingwei Zheng via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 20 23:00:36 PDT 2024


dtcxzyw 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.
https://github.com/dtcxzyw/llvm-ci/issues/1115
https://github.com/dtcxzyw/llvm-ci/issues/1114

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


More information about the cfe-commits mailing list