[llvm] d251d6f - [VectorCombine] Fix load extract scalarization tests with assumes.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon May 24 06:12:08 PDT 2021
Author: Florian Hahn
Date: 2021-05-24T13:14:13+01:00
New Revision: d251d6f8128bbc38378a69e7fec405f0935a89de
URL: https://github.com/llvm/llvm-project/commit/d251d6f8128bbc38378a69e7fec405f0935a89de
DIFF: https://github.com/llvm/llvm-project/commit/d251d6f8128bbc38378a69e7fec405f0935a89de.diff
LOG: [VectorCombine] Fix load extract scalarization tests with assumes.
The input IR for @load_extract_idx_var_i64_known_valid_by_assume
and @load_extract_idx_var_i64_not_known_valid_by_assume_after_load
has been swapped.
This patch fixes the test so that @load_extract_idx_var_i64_known_valid_by_assume
has the assume before the load and the other test has it after.
Added:
Modified:
llvm/test/Transforms/VectorCombine/AArch64/load-extractelement-scalarization.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/VectorCombine/AArch64/load-extractelement-scalarization.ll b/llvm/test/Transforms/VectorCombine/AArch64/load-extractelement-scalarization.ll
index d71b589828a2e..7179909701ee3 100644
--- a/llvm/test/Transforms/VectorCombine/AArch64/load-extractelement-scalarization.ll
+++ b/llvm/test/Transforms/VectorCombine/AArch64/load-extractelement-scalarization.ll
@@ -89,17 +89,17 @@ define i32 @load_extract_idx_var_i64_known_valid_by_assume(<4 x i32>* %x, i64 %i
; CHECK-LABEL: @load_extract_idx_var_i64_known_valid_by_assume(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[IDX:%.*]], 4
+; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[LV:%.*]] = load <4 x i32>, <4 x i32>* [[X:%.*]], align 16
; CHECK-NEXT: call void @maythrow()
-; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[R:%.*]] = extractelement <4 x i32> [[LV]], i64 [[IDX]]
; CHECK-NEXT: ret i32 [[R]]
;
entry:
%cmp = icmp ult i64 %idx, 4
+ call void @llvm.assume(i1 %cmp)
%lv = load <4 x i32>, <4 x i32>* %x
call void @maythrow()
- call void @llvm.assume(i1 %cmp)
%r = extractelement <4 x i32> %lv, i64 %idx
ret i32 %r
}
@@ -108,15 +108,17 @@ define i32 @load_extract_idx_var_i64_not_known_valid_by_assume_after_load(<4 x i
; CHECK-LABEL: @load_extract_idx_var_i64_not_known_valid_by_assume_after_load(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[IDX:%.*]], 4
-; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[LV:%.*]] = load <4 x i32>, <4 x i32>* [[X:%.*]], align 16
+; CHECK-NEXT: call void @maythrow()
+; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[R:%.*]] = extractelement <4 x i32> [[LV]], i64 [[IDX]]
; CHECK-NEXT: ret i32 [[R]]
;
entry:
%cmp = icmp ult i64 %idx, 4
- call void @llvm.assume(i1 %cmp)
%lv = load <4 x i32>, <4 x i32>* %x
+ call void @maythrow()
+ call void @llvm.assume(i1 %cmp)
%r = extractelement <4 x i32> %lv, i64 %idx
ret i32 %r
}
More information about the llvm-commits
mailing list