[llvm] [LoopUnroll] Consider simplified operands while retrieving TTI instruction cost (PR #70929)

Sergey Kachkov via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 01:36:12 PST 2023


================
@@ -50,7 +50,7 @@ for.end:
 }
 
 ; CHECK-LABEL: @test_func_addrspacecast_cost_nonfree(
-; CHECK: br i1 %exitcond
+; CHECK-NOT: br i1 %exitcond
----------------
skachkov-sc wrote:

I've come up with the following solution: add some extra level of indirection to get GEP indices so they will not become constant after loop unrolling; this hides the changes introduced by this patch and preserves the behaviour of original test (with slight increasing of unroll threshold). This is done by loading the GEP index from some global array (the additional cost of this loading is the same for all tests).

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


More information about the llvm-commits mailing list