[llvm] [VectorCombine][test] Supplement tests of the load-extractelement seq… (PR #65442)
Ben Shi via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 6 19:41:40 PDT 2023
================
@@ -213,6 +265,23 @@ entry:
ret i32 %r
}
+define i32 @vscale_load_extract_idx_var_i64_not_known_valid_by_assume(ptr %x, i64 %idx) {
+; CHECK-LABEL: @vscale_load_extract_idx_var_i64_not_known_valid_by_assume(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[IDX:%.*]], 5
+; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
+; CHECK-NEXT: [[LV:%.*]] = load <vscale x 4 x i32>, ptr [[X:%.*]], align 16
+; CHECK-NEXT: [[R:%.*]] = extractelement <vscale x 4 x i32> [[LV]], i64 [[IDX]]
+; CHECK-NEXT: ret i32 [[R]]
+;
+entry:
+ %cmp = icmp ult i64 %idx, 5
----------------
benshi001 wrote:
I have added a new test as you suggested.
https://github.com/llvm/llvm-project/pull/65442
More information about the llvm-commits
mailing list