1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -instcombine -S < %s | FileCheck %s
3 ; RUN: opt -passes=instcombine -S < %s | FileCheck %s
5 define linkonce_odr dso_local void @foo(<256 x i32>* %arrayidx16, <256 x i32>* %arrayidx29, <256 x i32>* %arrayidx35) local_unnamed_addr {
8 ; CHECK-NEXT: br label [[FOR_COND9:%.*]]
10 ; CHECK-NEXT: br i1 undef, label [[FOR_BODY14:%.*]], label [[EXIT:%.*]]
12 ; CHECK-NEXT: [[T5:%.*]] = load <256 x i32>, <256 x i32>* [[ARRAYIDX16:%.*]], align 64
13 ; CHECK-NEXT: br label [[FOR_COND18:%.*]]
15 ; CHECK-NEXT: [[SUB_C_SROA_0_0:%.*]] = phi <256 x i32> [ [[T5]], [[FOR_BODY14]] ], [ [[T12:%.*]], [[FOR_BODY24:%.*]] ]
16 ; CHECK-NEXT: br i1 undef, label [[FOR_BODY24]], label [[FOR_COND_CLEANUP23:%.*]]
17 ; CHECK: for.cond.cleanup23:
18 ; CHECK-NEXT: store <256 x i32> [[SUB_C_SROA_0_0]], <256 x i32>* [[ARRAYIDX16]], align 64
19 ; CHECK-NEXT: br label [[FOR_COND9]]
21 ; CHECK-NEXT: [[T6:%.*]] = load <256 x i32>, <256 x i32>* [[ARRAYIDX29:%.*]], align 64
22 ; CHECK-NEXT: [[T7:%.*]] = load <256 x i32>, <256 x i32>* [[ARRAYIDX35:%.*]], align 64
23 ; CHECK-NEXT: [[T8:%.*]] = bitcast <256 x i32> [[SUB_C_SROA_0_0]] to x86_amx
24 ; CHECK-NEXT: [[T9:%.*]] = bitcast <256 x i32> [[T6]] to x86_amx
25 ; CHECK-NEXT: [[T10:%.*]] = bitcast <256 x i32> [[T7]] to x86_amx
26 ; CHECK-NEXT: [[T11:%.*]] = call x86_amx @llvm.x86.tdpbssd.internal(i16 1, i16 4, i16 4, x86_amx [[T8]], x86_amx [[T9]], x86_amx [[T10]])
27 ; CHECK-NEXT: [[T12]] = bitcast x86_amx [[T11]] to <256 x i32>
28 ; CHECK-NEXT: br label [[FOR_COND18]]
30 ; CHECK-NEXT: ret void
34 for.cond9: ; preds = %for.cond, %for.cond.cleanup23
35 br i1 undef, label %for.body14, label %exit
38 %t5 = load <256 x i32>, <256 x i32>* %arrayidx16, align 64
41 for.cond18: ; preds = %for.body24, %for.body14
42 %sub_c.sroa.0.0 = phi <256 x i32> [ %t5, %for.body14 ], [ %t12, %for.body24 ]
43 br i1 undef, label %for.body24, label %for.cond.cleanup23
45 for.cond.cleanup23: ; preds = %for.cond18
46 store <256 x i32> %sub_c.sroa.0.0, <256 x i32>* %arrayidx16, align 64
49 for.body24: ; preds = %for.cond18
50 %t6 = load <256 x i32>, <256 x i32>* %arrayidx29, align 64
51 %t7 = load <256 x i32>, <256 x i32>* %arrayidx35, align 64
52 %t8 = bitcast <256 x i32> %sub_c.sroa.0.0 to x86_amx
53 %t9 = bitcast <256 x i32> %t6 to x86_amx
54 %t10 = bitcast <256 x i32> %t7 to x86_amx
55 %t11 = call x86_amx @llvm.x86.tdpbssd.internal(i16 1, i16 4, i16 4, x86_amx %t8, x86_amx %t9, x86_amx %t10) #12
56 %t12 = bitcast x86_amx %t11 to <256 x i32>
63 declare x86_amx @llvm.x86.tileloadd64.internal(i16, i16, i8*, i64)
64 declare x86_amx @llvm.x86.tdpbssd.internal(i16, i16, i16, x86_amx, x86_amx, x86_amx)
65 declare void @llvm.x86.tilestored64.internal(i16, i16, i8*, i64, x86_amx)