[llvm] [LSR] Only apply postincrement discount on address uses (PR #149341)
John Brawn via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 17 09:04:06 PDT 2025
================
@@ -1,24 +1,30 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp %s -o - | FileCheck %s
+; FIXME: Loop strength reduction makes suboptimal choices here due to the
+; isLSRCostLess function preferring to minimise the number of addrecs even
+; when it increases the total number of adds.
+
----------------
john-brawn-arm wrote:
I'll be trying to fix this by adding ARMTTIImpl::isLSRCostLess which uses the Insns part of the cost (like AArch64TTIImpl::isLSRCostLess), but that causes other problems (something weird going on with the low overhead loops pass causing tail predication to not happen, loop strength reduction calculates NumBaseAdds incorrectly when multiple parts of a formula are loop-invariant) so I may not be able to.
https://github.com/llvm/llvm-project/pull/149341
More information about the llvm-commits
mailing list