Skip to content

Commit 4216c4b

Browse files
committed
Update test files for load and store with allign
1 parent 1aa17ba commit 4216c4b

File tree

2 files changed

+46
-78
lines changed

2 files changed

+46
-78
lines changed

clang/test/CIR/CodeGen/vector-ext.cpp

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,7 @@ void foo14() {
988988
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
989989
// OGCG: %[[GE:.*]] = fcmp oge <4 x float> %[[TMP_A]], %[[TMP_B]]
990990
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[GE]] to <4 x i32>
991+
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
991992

992993
void foo16() {
993994
vi4 a = {1, 2, 3, 4};
@@ -1007,24 +1008,24 @@ void foo16() {
10071008
// CIR: %[[CONST_4:.*]] = cir.const #cir.int<4> : !s32i
10081009
// CIR: %[[VEC_A_VAL:.*]] = cir.vec.create(%[[CONST_1]], %[[CONST_2]], %[[CONST_3]], %[[CONST_4]] :
10091010
// CIR-SAME: !s32i, !s32i, !s32i, !s32i) : !cir.vector<4 x !s32i>
1010-
// CIR: cir.store %[[VEC_A_VAL]], %[[VEC_A]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
1011-
// CIR: %[[TMP_A:.*]] = cir.load %[[VEC_A]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
1011+
// CIR: cir.store{{.*}} %[[VEC_A_VAL]], %[[VEC_A]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
1012+
// CIR: %[[TMP_A:.*]] = cir.load{{.*}} %[[VEC_A]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
10121013
// CIR: %[[SH_AMOUNT:.*]] = cir.const #cir.int<3> : !s32i
10131014
// CIR: %[[SPLAT_VEC:.*]] = cir.vec.splat %[[SH_AMOUNT]] : !s32i, !cir.vector<4 x !s32i>
10141015
// CIR: %[[SHL:.*]] = cir.shift(left, %[[TMP_A]] : !cir.vector<4 x !s32i>, %[[SPLAT_VEC]] : !cir.vector<4 x !s32i>) -> !cir.vector<4 x !s32i>
1015-
// CIR: cir.store %[[SHL]], %[[SHL_RES]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
1016+
// CIR: cir.store{{.*}} %[[SHL]], %[[SHL_RES]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
10161017
// CIR: %[[CONST_1:.*]] = cir.const #cir.int<1> : !u32i
10171018
// CIR: %[[CONST_2:.*]] = cir.const #cir.int<2> : !u32i
10181019
// CIR: %[[CONST_3:.*]] = cir.const #cir.int<3> : !u32i
10191020
// CIR: %[[CONST_4:.*]] = cir.const #cir.int<4> : !u32i
10201021
// CIR: %[[VEC_B_VAL:.*]] = cir.vec.create(%[[CONST_1]], %[[CONST_2]], %[[CONST_3]], %[[CONST_4]] :
10211022
// CIR-SAME: !u32i, !u32i, !u32i, !u32i) : !cir.vector<4 x !u32i>
1022-
// CIR: cir.store %[[VEC_B_VAL]], %[[VEC_B]] : !cir.vector<4 x !u32i>, !cir.ptr<!cir.vector<4 x !u32i>>
1023-
// CIR: %[[TMP_B:.*]] = cir.load %[[VEC_B]] : !cir.ptr<!cir.vector<4 x !u32i>>, !cir.vector<4 x !u32i>
1023+
// CIR: cir.store{{.*}} %[[VEC_B_VAL]], %[[VEC_B]] : !cir.vector<4 x !u32i>, !cir.ptr<!cir.vector<4 x !u32i>>
1024+
// CIR: %[[TMP_B:.*]] = cir.load{{.*}} %[[VEC_B]] : !cir.ptr<!cir.vector<4 x !u32i>>, !cir.vector<4 x !u32i>
10241025
// CIR: %[[SH_AMOUNT:.*]] = cir.const #cir.int<3> : !u32i
10251026
// CIR: %[[SPLAT_VEC:.*]] = cir.vec.splat %[[SH_AMOUNT]] : !u32i, !cir.vector<4 x !u32i>
10261027
// CIR: %[[SHR:.*]] = cir.shift(right, %[[TMP_B]] : !cir.vector<4 x !u32i>, %[[SPLAT_VEC]] : !cir.vector<4 x !u32i>) -> !cir.vector<4 x !u32i>
1027-
// CIR: cir.store %[[SHR]], %[[SHR_RES]] : !cir.vector<4 x !u32i>, !cir.ptr<!cir.vector<4 x !u32i>>
1028+
// CIR: cir.store{{.*}} %[[SHR]], %[[SHR_RES]] : !cir.vector<4 x !u32i>, !cir.ptr<!cir.vector<4 x !u32i>>
10281029

10291030
// LLVM: %[[VEC_A:.*]] = alloca <4 x i32>, i64 1, align 16
10301031
// LLVM: %[[SHL_RES:.*]] = alloca <4 x i32>, i64 1, align 16
@@ -1051,36 +1052,3 @@ void foo16() {
10511052
// OGCG: %[[TMP_B:.*]] = load <4 x i32>, ptr %[[VEC_B]], align 16
10521053
// OGCG: %[[SHR:.*]] = lshr <4 x i32> %[[TMP_B]], splat (i32 3)
10531054
// OGCG: store <4 x i32> %[[SHR]], ptr %[[SHR_RES]], align 16
1054-
// OGCG: %[[VEC_B:.*]] = alloca <4 x float>, align 16
1055-
// OGCG: store <4 x float> <float {{.*}}, float {{.*}}, float {{.*}}, float {{.*}}>, ptr %[[VEC_A]], align 16
1056-
// OGCG: store <4 x float> <float {{.*}}, float {{.*}}, float {{.*}}, float {{.*}}>, ptr %[[VEC_B]], align 16
1057-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1058-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1059-
// OGCG: %[[EQ:.*]] = fcmp oeq <4 x float> %[[TMP_A]], %[[TMP_B]]
1060-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[EQ]] to <4 x i32>
1061-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
1062-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1063-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1064-
// OGCG: %[[NE:.*]] = fcmp une <4 x float> %[[TMP_A]], %[[TMP_B]]
1065-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[NE]] to <4 x i32>
1066-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
1067-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1068-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1069-
// OGCG: %[[LT:.*]] = fcmp olt <4 x float> %[[TMP_A]], %[[TMP_B]]
1070-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[LT]] to <4 x i32>
1071-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
1072-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1073-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1074-
// OGCG: %[[GT:.*]] = fcmp ogt <4 x float> %[[TMP_A]], %[[TMP_B]]
1075-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[GT]] to <4 x i32>
1076-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
1077-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1078-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1079-
// OGCG: %[[LE:.*]] = fcmp ole <4 x float> %[[TMP_A]], %[[TMP_B]]
1080-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[LE]] to <4 x i32>
1081-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
1082-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1083-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1084-
// OGCG: %[[GE:.*]] = fcmp oge <4 x float> %[[TMP_A]], %[[TMP_B]]
1085-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[GE]] to <4 x i32>
1086-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16

clang/test/CIR/CodeGen/vector.cpp

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,39 @@ void foo14() {
934934
// LLVM: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
935935

936936
// OGCG: %[[VEC_A:.*]] = alloca <4 x float>, align 16
937+
// OGCG: %[[VEC_B:.*]] = alloca <4 x float>, align 16
938+
// OGCG: store <4 x float> <float {{.*}}, float {{.*}}, float {{.*}}, float {{.*}}>, ptr %[[VEC_A]], align 16
939+
// OGCG: store <4 x float> <float {{.*}}, float {{.*}}, float {{.*}}, float {{.*}}>, ptr %[[VEC_B]], align 16
940+
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
941+
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
942+
// OGCG: %[[EQ:.*]] = fcmp oeq <4 x float> %[[TMP_A]], %[[TMP_B]]
943+
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[EQ]] to <4 x i32>
944+
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
945+
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
946+
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
947+
// OGCG: %[[NE:.*]] = fcmp une <4 x float> %[[TMP_A]], %[[TMP_B]]
948+
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[NE]] to <4 x i32>
949+
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
950+
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
951+
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
952+
// OGCG: %[[LT:.*]] = fcmp olt <4 x float> %[[TMP_A]], %[[TMP_B]]
953+
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[LT]] to <4 x i32>
954+
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
955+
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
956+
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
957+
// OGCG: %[[GT:.*]] = fcmp ogt <4 x float> %[[TMP_A]], %[[TMP_B]]
958+
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[GT]] to <4 x i32>
959+
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
960+
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
961+
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
962+
// OGCG: %[[LE:.*]] = fcmp ole <4 x float> %[[TMP_A]], %[[TMP_B]]
963+
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[LE]] to <4 x i32>
964+
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
965+
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
966+
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
967+
// OGCG: %[[GE:.*]] = fcmp oge <4 x float> %[[TMP_A]], %[[TMP_B]]
968+
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[GE]] to <4 x i32>
969+
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
937970

938971
void foo16() {
939972
vi4 a = {1, 2, 3, 4};
@@ -953,24 +986,24 @@ void foo16() {
953986
// CIR: %[[CONST_4:.*]] = cir.const #cir.int<4> : !s32i
954987
// CIR: %[[VEC_A_VAL:.*]] = cir.vec.create(%[[CONST_1]], %[[CONST_2]], %[[CONST_3]], %[[CONST_4]] :
955988
// CIR-SAME: !s32i, !s32i, !s32i, !s32i) : !cir.vector<4 x !s32i>
956-
// CIR: cir.store %[[VEC_A_VAL]], %[[VEC_A]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
957-
// CIR: %[[TMP_A:.*]] = cir.load %[[VEC_A]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
989+
// CIR: cir.store{{.*}} %[[VEC_A_VAL]], %[[VEC_A]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
990+
// CIR: %[[TMP_A:.*]] = cir.load{{.*}} %[[VEC_A]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
958991
// CIR: %[[SH_AMOUNT:.*]] = cir.const #cir.int<3> : !s32i
959992
// CIR: %[[SPLAT_VEC:.*]] = cir.vec.splat %[[SH_AMOUNT]] : !s32i, !cir.vector<4 x !s32i>
960993
// CIR: %[[SHL:.*]] = cir.shift(left, %[[TMP_A]] : !cir.vector<4 x !s32i>, %[[SPLAT_VEC]] : !cir.vector<4 x !s32i>) -> !cir.vector<4 x !s32i>
961-
// CIR: cir.store %[[SHL]], %[[SHL_RES]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
994+
// CIR: cir.store{{.*}} %[[SHL]], %[[SHL_RES]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
962995
// CIR: %[[CONST_1:.*]] = cir.const #cir.int<1> : !u32i
963996
// CIR: %[[CONST_2:.*]] = cir.const #cir.int<2> : !u32i
964997
// CIR: %[[CONST_3:.*]] = cir.const #cir.int<3> : !u32i
965998
// CIR: %[[CONST_4:.*]] = cir.const #cir.int<4> : !u32i
966999
// CIR: %[[VEC_B_VAL:.*]] = cir.vec.create(%[[CONST_1]], %[[CONST_2]], %[[CONST_3]], %[[CONST_4]] :
9671000
// CIR-SAME: !u32i, !u32i, !u32i, !u32i) : !cir.vector<4 x !u32i>
968-
// CIR: cir.store %[[VEC_B_VAL]], %[[VEC_B]] : !cir.vector<4 x !u32i>, !cir.ptr<!cir.vector<4 x !u32i>>
969-
// CIR: %[[TMP_B:.*]] = cir.load %[[VEC_B]] : !cir.ptr<!cir.vector<4 x !u32i>>, !cir.vector<4 x !u32i>
1001+
// CIR: cir.store{{.*}} %[[VEC_B_VAL]], %[[VEC_B]] : !cir.vector<4 x !u32i>, !cir.ptr<!cir.vector<4 x !u32i>>
1002+
// CIR: %[[TMP_B:.*]] = cir.load{{.*}} %[[VEC_B]] : !cir.ptr<!cir.vector<4 x !u32i>>, !cir.vector<4 x !u32i>
9701003
// CIR: %[[SH_AMOUNT:.*]] = cir.const #cir.int<3> : !u32i
9711004
// CIR: %[[SPLAT_VEC:.*]] = cir.vec.splat %[[SH_AMOUNT]] : !u32i, !cir.vector<4 x !u32i>
9721005
// CIR: %[[SHR:.*]] = cir.shift(right, %[[TMP_B]] : !cir.vector<4 x !u32i>, %[[SPLAT_VEC]] : !cir.vector<4 x !u32i>) -> !cir.vector<4 x !u32i>
973-
// CIR: cir.store %[[SHR]], %[[SHR_RES]] : !cir.vector<4 x !u32i>, !cir.ptr<!cir.vector<4 x !u32i>>
1006+
// CIR: cir.store{{.*}} %[[SHR]], %[[SHR_RES]] : !cir.vector<4 x !u32i>, !cir.ptr<!cir.vector<4 x !u32i>>
9741007

9751008
// LLVM: %[[VEC_A:.*]] = alloca <4 x i32>, i64 1, align 16
9761009
// LLVM: %[[SHL_RES:.*]] = alloca <4 x i32>, i64 1, align 16
@@ -997,36 +1030,3 @@ void foo16() {
9971030
// OGCG: %[[TMP_B:.*]] = load <4 x i32>, ptr %[[VEC_B]], align 16
9981031
// OGCG: %[[SHR:.*]] = lshr <4 x i32> %[[TMP_B]], splat (i32 3)
9991032
// OGCG: store <4 x i32> %[[SHR]], ptr %[[SHR_RES]], align 16
1000-
// OGCG: %[[VEC_B:.*]] = alloca <4 x float>, align 16
1001-
// OGCG: store <4 x float> <float {{.*}}, float {{.*}}, float {{.*}}, float {{.*}}>, ptr %[[VEC_A]], align 16
1002-
// OGCG: store <4 x float> <float {{.*}}, float {{.*}}, float {{.*}}, float {{.*}}>, ptr %[[VEC_B]], align 16
1003-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1004-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1005-
// OGCG: %[[EQ:.*]] = fcmp oeq <4 x float> %[[TMP_A]], %[[TMP_B]]
1006-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[EQ]] to <4 x i32>
1007-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
1008-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1009-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1010-
// OGCG: %[[NE:.*]] = fcmp une <4 x float> %[[TMP_A]], %[[TMP_B]]
1011-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[NE]] to <4 x i32>
1012-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
1013-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1014-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1015-
// OGCG: %[[LT:.*]] = fcmp olt <4 x float> %[[TMP_A]], %[[TMP_B]]
1016-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[LT]] to <4 x i32>
1017-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
1018-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1019-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1020-
// OGCG: %[[GT:.*]] = fcmp ogt <4 x float> %[[TMP_A]], %[[TMP_B]]
1021-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[GT]] to <4 x i32>
1022-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
1023-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1024-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1025-
// OGCG: %[[LE:.*]] = fcmp ole <4 x float> %[[TMP_A]], %[[TMP_B]]
1026-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[LE]] to <4 x i32>
1027-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16
1028-
// OGCG: %[[TMP_A:.*]] = load <4 x float>, ptr %[[VEC_A]], align 16
1029-
// OGCG: %[[TMP_B:.*]] = load <4 x float>, ptr %[[VEC_B]], align 16
1030-
// OGCG: %[[GE:.*]] = fcmp oge <4 x float> %[[TMP_A]], %[[TMP_B]]
1031-
// OGCG: %[[RES:.*]] = sext <4 x i1> %[[GE]] to <4 x i32>
1032-
// OGCG: store <4 x i32> %[[RES]], ptr {{.*}}, align 16

0 commit comments

Comments
 (0)