xref: /llvm-project/llvm/test/Transforms/SLPVectorizer/X86/funclet.ll (revision e05def081e43f8fe8be7f3a4ed2749ae01ab0ab3)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -S -passes=slp-vectorizer < %s | FileCheck %s
3target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
4target triple = "i686-pc-windows-msvc18.0.0"
5
6define void @test1(ptr %a, ptr %b, ptr %c) #0 personality ptr @__CxxFrameHandler3 {
7; CHECK-LABEL: @test1(
8; CHECK-NEXT:  entry:
9; CHECK-NEXT:    invoke void @_CxxThrowException(ptr null, ptr null)
10; CHECK-NEXT:            to label [[UNREACHABLE:%.*]] unwind label [[CATCH_DISPATCH:%.*]]
11; CHECK:       catch.dispatch:
12; CHECK-NEXT:    [[TMP0:%.*]] = catchswitch within none [label %catch] unwind to caller
13; CHECK:       catch:
14; CHECK-NEXT:    [[TMP1:%.*]] = catchpad within [[TMP0]] [ptr null, i32 64, ptr null]
15; CHECK-NEXT:    [[I0:%.*]] = load double, ptr [[A:%.*]], align 8
16; CHECK-NEXT:    [[I1:%.*]] = load double, ptr [[B:%.*]], align 8
17; CHECK-NEXT:    [[MUL:%.*]] = fmul double [[I0]], [[I1]]
18; CHECK-NEXT:    [[CALL:%.*]] = tail call double @floor(double [[MUL]]) #[[ATTR1:[0-9]+]] [ "funclet"(token [[TMP1]]) ]
19; CHECK-NEXT:    [[ARRAYIDX3:%.*]] = getelementptr inbounds double, ptr [[A]], i64 1
20; CHECK-NEXT:    [[I3:%.*]] = load double, ptr [[ARRAYIDX3]], align 8
21; CHECK-NEXT:    [[ARRAYIDX4:%.*]] = getelementptr inbounds double, ptr [[B]], i64 1
22; CHECK-NEXT:    [[I4:%.*]] = load double, ptr [[ARRAYIDX4]], align 8
23; CHECK-NEXT:    [[MUL5:%.*]] = fmul double [[I3]], [[I4]]
24; CHECK-NEXT:    [[CALL5:%.*]] = tail call double @floor(double [[MUL5]]) #[[ATTR1]] [ "funclet"(token [[TMP1]]) ]
25; CHECK-NEXT:    store double [[CALL]], ptr [[C:%.*]], align 8
26; CHECK-NEXT:    [[ARRAYIDX5:%.*]] = getelementptr inbounds double, ptr [[C]], i64 1
27; CHECK-NEXT:    store double [[CALL5]], ptr [[ARRAYIDX5]], align 8
28; CHECK-NEXT:    catchret from [[TMP1]] to label [[TRY_CONT:%.*]]
29; CHECK:       try.cont:
30; CHECK-NEXT:    ret void
31; CHECK:       unreachable:
32; CHECK-NEXT:    unreachable
33;
34entry:
35  invoke void @_CxxThrowException(ptr null, ptr null)
36  to label %unreachable unwind label %catch.dispatch
37
38catch.dispatch:                                   ; preds = %entry
39  %0 = catchswitch within none [label %catch] unwind to caller
40
41catch:                                            ; preds = %catch.dispatch
42  %1 = catchpad within %0 [ptr null, i32 64, ptr null]
43  %i0 = load double, ptr %a, align 8
44  %i1 = load double, ptr %b, align 8
45  %mul = fmul double %i0, %i1
46  %call = tail call double @floor(double %mul) #1 [ "funclet"(token %1) ]
47  %arrayidx3 = getelementptr inbounds double, ptr %a, i64 1
48  %i3 = load double, ptr %arrayidx3, align 8
49  %arrayidx4 = getelementptr inbounds double, ptr %b, i64 1
50  %i4 = load double, ptr %arrayidx4, align 8
51  %mul5 = fmul double %i3, %i4
52  %call5 = tail call double @floor(double %mul5) #1 [ "funclet"(token %1) ]
53  store double %call, ptr %c, align 8
54  %arrayidx5 = getelementptr inbounds double, ptr %c, i64 1
55  store double %call5, ptr %arrayidx5, align 8
56  catchret from %1 to label %try.cont
57
58try.cont:                                         ; preds = %for.cond.cleanup
59  ret void
60
61unreachable:                                      ; preds = %entry
62  unreachable
63}
64
65declare x86_stdcallcc void @_CxxThrowException(ptr, ptr)
66
67declare i32 @__CxxFrameHandler3(...)
68
69declare double @floor(double) #1
70
71attributes #0 = { "target-features"="+sse2" }
72attributes #1 = { nounwind readnone willreturn }
73