[llvm] [LV] Simplify epilogue VF selection by comparing against MaxTripCount (PR #186185)
Hassnaa Hamdi via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 20 04:58:47 PDT 2026
================
@@ -12,9 +12,9 @@ target triple = "aarch64-unknown-linux-gnu"
; DEBUG: LV: Found maximum trip count: 19
; DEBUG: LV: IC is 1
; DEBUG-VS1: LV: VF is vscale x 16
-; DEBUG-VS1: Main Loop VF:vscale x 16, Main Loop UF:1, Epilogue Loop VF:8, Epilogue Loop UF:1
+; DEBUG-VS1: Main Loop VF:vscale x 16, Main Loop UF:1, Epilogue Loop VF:vscale x 4, Epilogue Loop UF:1
; DEBUG-VS2: LV: VF is vscale x 8
----------------
hassnaaHamdi wrote:
Yes, it should be dead. I think the problem is because the SCEV calculation of the remaining iterations is :
`(zext i4 (3 + (-1 * (trunc i32 %tc to i4))) to i64) `
Maybe there should be analysis on %tc to prove that the min value is 0, and then the max value for the remaining iterations is 3.
https://github.com/llvm/llvm-project/pull/186185
More information about the llvm-commits
mailing list