[llvm] [LV] Calculating explicit vector length using vector trip count (PR #89580)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 02:33:31 PDT 2024


================
@@ -58,12 +50,12 @@ define void @gather_scatter(ptr noalias %in, ptr noalias %out, ptr noalias %inde
 ; IF-EVL-NEXT:    [[INDEX_EVL_NEXT]] = add i64 [[TMP23]], [[EVL_BASED_IV]]
 ; IF-EVL-NEXT:    [[INDEX_NEXT]] = add i64 [[INDEX1]], [[TMP10]]
 ; IF-EVL-NEXT:    [[VEC_IND_NEXT]] = add <vscale x 2 x i64> [[VEC_IND]], [[DOTSPLAT]]
-; IF-EVL-NEXT:    [[TMP24:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
+; IF-EVL-NEXT:    [[TMP24:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N]]
----------------
Mel-Chen wrote:

My bad, you are right.
I think I should first use index.evl.next as the condition for branch-on-count instead of vec.ind.next, or directly reuse the canonical IV as evl.based.iv and change its step to evl.
Do you have any suggestions or preferences?

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


More information about the llvm-commits mailing list