Skip to content

Commit ad9d243

Browse files
committed
[clang][test] Fix manual tests to support local alloca freeze insertion
1 parent a07bf80 commit ad9d243

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

clang/test/CodeGenCXX/align-avx-complete-objects.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ float TestAlign(void)
2626
// CHECK-NEXT: [[TWO:%.*]] = load volatile <8 x float>, ptr [[ONE]], align 16
2727
// CHECK-NEXT: [[THREE:%.*]] = load ptr, ptr [[P]], align 8
2828
// CHECK-NEXT: store volatile <8 x float> [[TWO]], ptr [[THREE]], align 16
29+
// CHECK-NEXT: [[FREEZE1:%.+]] = freeze <8 x float> poison
30+
// CHECK-NEXT: store <8 x float> [[FREEZE1]], ptr [[R]], align 32
2931
// CHECK-NEXT: [[FOUR:%.*]] = load ptr, ptr [[P]], align 8
3032
// CHECK-NEXT: [[FIVE:%.*]] = load volatile <8 x float>, ptr [[FOUR]], align 16
3133
// CHECK-NEXT: store <8 x float> [[FIVE]], ptr [[R]], align 32
@@ -61,6 +63,8 @@ float TestAlign2(void)
6163
// CHECK-NEXT: [[TWO:%.*]] = load volatile <8 x float>, ptr [[ONE]], align 32
6264
// CHECK-NEXT: [[THREE:%.*]] = load ptr, ptr [[P]], align 8
6365
// CHECK-NEXT: store volatile <8 x float> [[TWO]], ptr [[THREE]], align 32
66+
// CHECK-NEXT: [[FREEZE1:%.+]] = freeze <8 x float> poison
67+
// CHECK-NEXT: store <8 x float> [[FREEZE1]], ptr [[R]], align 32
6468
// CHECK-NEXT: [[FOUR:%.*]] = load ptr, ptr [[P]], align 8
6569
// CHECK-NEXT: [[FIVE:%.*]] = load volatile <8 x float>, ptr [[FOUR]], align 32
6670
// CHECK-NEXT: store <8 x float> [[FIVE]], ptr [[R]], align 32

clang/test/CodeGenCXX/auto-var-init.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ TEST_CUSTOM(smallenum, smallenum, { (smallenum)42 });
16971697
TEST_UNINIT(intvec16, int __attribute__((vector_size(16))));
16981698
// CHECK-LABEL: @test_intvec16_uninit()
16991699
// CHECK: %uninit = alloca <4 x i32>, align
1700-
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
1700+
// CHECK: call void @{{.*}}used{{.*}}%uninit)
17011701
// PATTERN-LABEL: @test_intvec16_uninit()
17021702
// PATTERN: store <4 x i32> <i32 [[I32]], i32 [[I32]], i32 [[I32]], i32 [[I32]]>, ptr %uninit, align 16, !annotation [[AUTO_INIT]]
17031703
// ZERO-LABEL: @test_intvec16_uninit()
@@ -1706,21 +1706,21 @@ TEST_UNINIT(intvec16, int __attribute__((vector_size(16))));
17061706
TEST_BRACES(intvec16, int __attribute__((vector_size(16))));
17071707
// CHECK-LABEL: @test_intvec16_braces()
17081708
// CHECK: %braces = alloca <4 x i32>, align [[ALIGN:[0-9]*]]
1709-
// CHECK-NEXT: store <4 x i32> zeroinitializer, ptr %braces, align [[ALIGN]]
1709+
// CHECK: store <4 x i32> zeroinitializer, ptr %braces, align [[ALIGN]]
17101710
// CHECK-NOT: !annotation
17111711
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
17121712

17131713
TEST_CUSTOM(intvec16, int __attribute__((vector_size(16))), { 0x44444444, 0x44444444, 0x44444444, 0x44444444 });
17141714
// CHECK-LABEL: @test_intvec16_custom()
17151715
// CHECK: %custom = alloca <4 x i32>, align [[ALIGN:[0-9]*]]
1716-
// CHECK-NEXT: store <4 x i32> <i32 1145324612, i32 1145324612, i32 1145324612, i32 1145324612>, ptr %custom, align [[ALIGN]]
1716+
// CHECK: store <4 x i32> <i32 1145324612, i32 1145324612, i32 1145324612, i32 1145324612>, ptr %custom, align [[ALIGN]]
17171717
// CHECK-NOT: !annotation
17181718
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
17191719

17201720
TEST_UNINIT(longlongvec32, long long __attribute__((vector_size(32))));
17211721
// CHECK-LABEL: @test_longlongvec32_uninit()
17221722
// CHECK: %uninit = alloca <4 x i64>, align
1723-
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
1723+
// CHECK: call void @{{.*}}used{{.*}}%uninit)
17241724
// PATTERN-LABEL: @test_longlongvec32_uninit()
17251725
// PATTERN: store <4 x i64> <i64 [[I64]], i64 [[I64]], i64 [[I64]], i64 [[I64]]>, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
17261726
// ZERO-LABEL: @test_longlongvec32_uninit()
@@ -1729,20 +1729,20 @@ TEST_UNINIT(longlongvec32, long long __attribute__((vector_size(32))));
17291729
TEST_BRACES(longlongvec32, long long __attribute__((vector_size(32))));
17301730
// CHECK-LABEL: @test_longlongvec32_braces()
17311731
// CHECK: %braces = alloca <4 x i64>, align [[ALIGN:[0-9]*]]
1732-
// CHECK-NEXT: store <4 x i64> zeroinitializer, ptr %braces, align [[ALIGN]]
1732+
// CHECK: store <4 x i64> zeroinitializer, ptr %braces, align [[ALIGN]]
17331733
// CHECK-NOT: !annotation
17341734
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
17351735

17361736
TEST_CUSTOM(longlongvec32, long long __attribute__((vector_size(32))), { 0x3333333333333333, 0x3333333333333333, 0x3333333333333333, 0x3333333333333333 });
17371737
// CHECK-LABEL: @test_longlongvec32_custom()
17381738
// CHECK: %custom = alloca <4 x i64>, align [[ALIGN:[0-9]*]]
1739-
// CHECK-NEXT: store <4 x i64> <i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323>, ptr %custom, align [[ALIGN]]
1739+
// CHECK: store <4 x i64> <i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323>, ptr %custom, align [[ALIGN]]
17401740
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
17411741

17421742
TEST_UNINIT(floatvec16, float __attribute__((vector_size(16))));
17431743
// CHECK-LABEL: @test_floatvec16_uninit()
17441744
// CHECK: %uninit = alloca <4 x float>, align
1745-
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
1745+
// CHECK: call void @{{.*}}used{{.*}}%uninit)
17461746
// PATTERN-LABEL: @test_floatvec16_uninit()
17471747
// PATTERN: store <4 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, ptr %uninit, align 16, !annotation [[AUTO_INIT]]
17481748
// ZERO-LABEL: @test_floatvec16_uninit()
@@ -1751,21 +1751,21 @@ TEST_UNINIT(floatvec16, float __attribute__((vector_size(16))));
17511751
TEST_BRACES(floatvec16, float __attribute__((vector_size(16))));
17521752
// CHECK-LABEL: @test_floatvec16_braces()
17531753
// CHECK: %braces = alloca <4 x float>, align [[ALIGN:[0-9]*]]
1754-
// CHECK-NEXT: store <4 x float> zeroinitializer, ptr %braces, align [[ALIGN]]
1754+
// CHECK: store <4 x float> zeroinitializer, ptr %braces, align [[ALIGN]]
17551755
// CHECK-NOT: !annotation
17561756
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
17571757

17581758
TEST_CUSTOM(floatvec16, float __attribute__((vector_size(16))), { 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433 });
17591759
// CHECK-LABEL: @test_floatvec16_custom()
17601760
// CHECK: %custom = alloca <4 x float>, align [[ALIGN:[0-9]*]]
1761-
// CHECK-NEXT: store <4 x float> <float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000>, ptr %custom, align [[ALIGN]]
1761+
// CHECK: store <4 x float> <float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000>, ptr %custom, align [[ALIGN]]
17621762
// CHECK-NOT: !annotation
17631763
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
17641764

17651765
TEST_UNINIT(doublevec32, double __attribute__((vector_size(32))));
17661766
// CHECK-LABEL: @test_doublevec32_uninit()
17671767
// CHECK: %uninit = alloca <4 x double>, align
1768-
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
1768+
// CHECK: call void @{{.*}}used{{.*}}%uninit)
17691769
// PATTERN-LABEL: @test_doublevec32_uninit()
17701770
// PATTERN: store <4 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
17711771
// ZERO-LABEL: @test_doublevec32_uninit()
@@ -1774,22 +1774,22 @@ TEST_UNINIT(doublevec32, double __attribute__((vector_size(32))));
17741774
TEST_BRACES(doublevec32, double __attribute__((vector_size(32))));
17751775
// CHECK-LABEL: @test_doublevec32_braces()
17761776
// CHECK: %braces = alloca <4 x double>, align [[ALIGN:[0-9]*]]
1777-
// CHECK-NEXT: store <4 x double> zeroinitializer, ptr %braces, align [[ALIGN]]
1777+
// CHECK: store <4 x double> zeroinitializer, ptr %braces, align [[ALIGN]]
17781778
// CHECK-NOT: !annotation
17791779
// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)
17801780

17811781
TEST_CUSTOM(doublevec32, double __attribute__((vector_size(32))), { 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433 });
17821782
// CHECK-LABEL: @test_doublevec32_custom()
17831783
// CHECK: %custom = alloca <4 x double>, align [[ALIGN:[0-9]*]]
1784-
// CHECK-NEXT: store <4 x double> <double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18>, ptr %custom, align [[ALIGN]]
1784+
// CHECK: store <4 x double> <double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18>, ptr %custom, align [[ALIGN]]
17851785
// CHECK-NOT: !annotation
17861786
// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)
17871787

17881788
// TODO: This vector has tail padding
17891789
TEST_UNINIT(doublevec24, double __attribute__((vector_size(24))));
17901790
// CHECK-LABEL: @test_doublevec24_uninit()
17911791
// CHECK: %uninit = alloca <3 x double>, align
1792-
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
1792+
// CHECK: call void @{{.*}}used{{.*}}%uninit)
17931793
// PATTERN-LABEL: @test_doublevec24_uninit()
17941794
// PATTERN: store <3 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
17951795
// ZERO-LABEL: @test_doublevec24_uninit()
@@ -1799,7 +1799,7 @@ TEST_UNINIT(doublevec24, double __attribute__((vector_size(24))));
17991799
TEST_UNINIT(longdoublevec32, long double __attribute__((vector_size(sizeof(long double)*2))));
18001800
// CHECK-LABEL: @test_longdoublevec32_uninit()
18011801
// CHECK: %uninit = alloca <2 x x86_fp80>, align
1802-
// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
1802+
// CHECK: call void @{{.*}}used{{.*}}%uninit)
18031803
// PATTERN-LABEL: @test_longdoublevec32_uninit()
18041804
// PATTERN: store <2 x x86_fp80> <x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF, x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF>, ptr %uninit, align 32, !annotation [[AUTO_INIT]]
18051805
// ZERO-LABEL: @test_longdoublevec32_uninit()

clang/test/CodeGenCXX/ext-int.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ void TakesVarargs(int i, ...) {
297297
// WIN: store ptr %[[NEXT5]], ptr %[[ARGS]]
298298
// WIN64: %[[LOADP5:.+]] = load ptr, ptr %[[CUR5]]
299299
// WIN64: %[[LOADV5:.+]] = load <8 x i32>, ptr %[[LOADP5]]
300-
// WIN32: %[[LOADV5:.+]] = load <8 x i32>, ptr %argp.cur10
300+
// WIN32: %[[LOADV5:.+]] = load <8 x i32>, ptr %argp.cur12
301301
// WIN: store <8 x i32> %[[LOADV5]], ptr
302302

303303
__builtin_va_end(args);

0 commit comments

Comments
 (0)