[llvm] [LoopFlatten] Use loop versioning when overflow can't be disproven (PR #78576)

John Brawn via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 10:30:55 PST 2024


john-brawn-arm wrote:

> Looks like a very good addition. Just a quick question. The pass is off by default, but have you benchmarked this? Just wanted to check if there are no unexpected results (e.g. the extra runtime checks regressing things).

This improves several EEMBC benchmarks on cortex-m processors (or rather undoes the regression caused by https://github.com/llvm/llvm-project/commit/e13bed4c5f3544c076ce57e36d9a11eefa5a7815 canonicalizing in a way that removes the inbounds qualifier on gep instructions), and doesn't cause any noticeable regressions in those benchmarks.

Running the llvm-test-suite benchmarks Intel desktop this patch causes no significant changes to the results. In fact it has no effect when compiling for a 64-bit target at all, as then overflow is handled by widening the induction variable from 32 to 64 bit. Compiling with -m32 it does cause changes to benchmarks, but it's all in initialization code that contributes a negligible amount to the runtime.

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


More information about the llvm-commits mailing list