xref: /llvm-project/polly/test/IstAstInfo/runtime_context_with_error_blocks.ll (revision e1f056f692d869708c1898d9d65a69ac5584a0ed)
1; RUN: opt %loadNPMPolly '-passes=print<polly-ast>' -polly-invariant-load-hoisting=true -disable-output < %s | FileCheck %s
2;
3; Verify we do not simplify the runtime check to "true" due to the domain
4; constraints as the test contains an error block that influenced the domains
5; already.
6;
7; CHECK: if (p_0_loaded_from_this <= -1 || p_0_loaded_from_this >= 1)
8;
9target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
10
11%"class.std::ctype" = type <{ %"class.std::locale::facet.base", [4 x i8], ptr, i8, [7 x i8], ptr, ptr, ptr, i8, [256 x i8], [256 x i8], i8, [6 x i8] }>
12%"class.std::locale::facet.base" = type <{ ptr, i32 }>
13%struct.__locale_struct = type { [13 x ptr], ptr, ptr, ptr, [13 x ptr] }
14%struct.__locale_data = type opaque
15
16$_ZNKSt5ctypeIcE5widenEc = comdat any
17
18; Function Attrs: uwtable
19define weak_odr signext i8 @_ZNKSt5ctypeIcE5widenEc(ptr %this, i8 signext %__c) #0 comdat align 2 {
20entry:
21  br label %entry.split
22
23entry.split:                                      ; preds = %entry
24  %_M_widen_ok = getelementptr inbounds %"class.std::ctype", ptr %this, i64 0, i32 8
25  %0 = load i8, ptr %_M_widen_ok, align 8, !tbaa !1
26  %tobool = icmp eq i8 %0, 0
27  br i1 %tobool, label %if.end, label %if.then
28
29if.then:                                          ; preds = %entry.split
30  %idxprom = zext i8 %__c to i64
31  %arrayidx = getelementptr inbounds %"class.std::ctype", ptr %this, i64 0, i32 9, i64 %idxprom
32  %1 = load i8, ptr %arrayidx, align 1, !tbaa !7
33  br label %return
34
35if.end:                                           ; preds = %entry.split
36  tail call void @_ZNKSt5ctypeIcE13_M_widen_initEv(ptr %this)
37  %vtable = load ptr, ptr %this, align 8, !tbaa !8
38  %vfn = getelementptr inbounds ptr, ptr %vtable, i64 6
39  %2 = load ptr, ptr %vfn, align 8
40  %call = tail call signext i8 %2(ptr %this, i8 signext %__c)
41  br label %return
42
43return:                                           ; preds = %if.end, %if.then
44  %retval.0 = phi i8 [ %1, %if.then ], [ %call, %if.end ]
45  ret i8 %retval.0
46}
47
48declare void @_ZNKSt5ctypeIcE13_M_widen_initEv(ptr) #1
49
50attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
51attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
52
53!llvm.ident = !{!0}
54
55!0 = !{!"clang version 3.8.0"}
56!1 = !{!2, !4, i64 56}
57!2 = !{!"_ZTSSt5ctypeIcE", !3, i64 16, !6, i64 24, !3, i64 32, !3, i64 40, !3, i64 48, !4, i64 56, !4, i64 57, !4, i64 313, !4, i64 569}
58!3 = !{!"any pointer", !4, i64 0}
59!4 = !{!"omnipotent char", !5, i64 0}
60!5 = !{!"Simple C/C++ TBAA"}
61!6 = !{!"bool", !4, i64 0}
62!7 = !{!4, !4, i64 0}
63!8 = !{!9, !9, i64 0}
64!9 = !{!"vtable pointer", !5, i64 0}
65