1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=mergeicmps -verify-dom-info -mtriple=x86_64-unknown-unknown -S | FileCheck %s --check-prefix=X86
4 source_filename = "qabstractitemmodeltester.cpp"
5 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 target triple = "x86_64--linux-gnu"
8 %class.B = type { i32, i32 }
9 %class.D = type { i32 }
10 %class.C = type { i8 }
11 %class.QMessageLogger = type { i8 }
13 $_ZN1D7compareI1BS1_EEbRKT_RKT0_PKcS9_S9_i = comdat any
15 @.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
17 ; Function Attrs: uwtable
18 define linkonce_odr dso_local zeroext i1 @_ZN1D7compareI1BS1_EEbRKT_RKT0_PKcS9_S9_i(ptr %this, ptr dereferenceable(8) %p1, ptr dereferenceable(8) %p2, ptr, ptr, ptr, i32) local_unnamed_addr #0 comdat align 2 {
19 ; X86-LABEL: @_ZN1D7compareI1BS1_EEbRKT_RKT0_PKcS9_S9_i(
21 ; X86-NEXT: [[REF_TMP:%.*]] = alloca [[CLASS_C:%.*]], align 1
22 ; X86-NEXT: [[TMP4:%.*]] = load i32, ptr [[P2:%.*]], align 4
23 ; X86-NEXT: [[TMP5:%.*]] = load i32, ptr [[P1:%.*]], align 4
24 ; X86-NEXT: [[CMP_ENTRY:%.*]] = icmp eq i32 [[TMP4]], [[TMP5]]
25 ; X86-NEXT: br i1 [[CMP_ENTRY]], label [[BB1:%.*]], label [[BB2:%.*]]
27 ; X86-NEXT: [[M_I:%.*]] = getelementptr inbounds [[CLASS_B:%.*]], ptr [[P2]], i64 0, i32 1
28 ; X86-NEXT: [[TMP6:%.*]] = load i32, ptr [[M_I]], align 4
29 ; X86-NEXT: [[M3_I:%.*]] = getelementptr inbounds [[CLASS_B]], ptr [[P1]], i64 0, i32 1
30 ; X86-NEXT: [[TMP7:%.*]] = load i32, ptr [[M3_I]], align 4
31 ; X86-NEXT: [[CMP1:%.*]] = icmp eq i32 [[TMP6]], [[TMP7]]
32 ; X86-NEXT: br label [[BB2]]
34 ; X86-NEXT: [[TMP8:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[CMP1]], [[BB1]] ]
35 ; X86-NEXT: [[TMP9:%.*]] = load i32, ptr [[THIS:%.*]], align 4
36 ; X86-NEXT: [[COND:%.*]] = icmp eq i32 [[TMP9]], 0
37 ; X86-NEXT: br i1 [[COND]], label [[BB3:%.*]], label [[SW_EPILOG:%.*]]
39 ; X86-NEXT: br i1 [[CMP_ENTRY]], label [[BB4:%.*]], label [[BB5:%.*]]
41 ; X86-NEXT: [[M_I_I:%.*]] = getelementptr inbounds [[CLASS_B]], ptr [[P2]], i64 0, i32 1
42 ; X86-NEXT: [[TMP10:%.*]] = load i32, ptr [[M_I_I]], align 4
43 ; X86-NEXT: [[M3_I_I:%.*]] = getelementptr inbounds [[CLASS_B]], ptr [[P1]], i64 0, i32 1
44 ; X86-NEXT: [[TMP11:%.*]] = load i32, ptr [[M3_I_I]], align 4
45 ; X86-NEXT: [[CMP4:%.*]] = icmp eq i32 [[TMP10]], [[TMP11]]
46 ; X86-NEXT: br label [[BB5]]
48 ; X86-NEXT: [[TMP12:%.*]] = phi i1 [ false, [[BB3]] ], [ [[CMP4]], [[BB4]] ]
49 ; X86-NEXT: br label [[SW_EPILOG]]
51 ; X86-NEXT: ret i1 [[TMP8]]
54 %ref.tmp = alloca %class.C, align 1
55 %4 = load i32, ptr %p2, align 4
56 %5 = load i32, ptr %p1, align 4
57 %cmp_entry = icmp eq i32 %4, %5
58 br i1 %cmp_entry, label %bb1, label %bb2
61 %m.i = getelementptr inbounds %class.B, ptr %p2, i64 0, i32 1
62 %6 = load i32, ptr %m.i, align 4
63 %m3.i = getelementptr inbounds %class.B, ptr %p1, i64 0, i32 1
64 %7 = load i32, ptr %m3.i, align 4
65 %cmp1 = icmp eq i32 %6, %7
68 bb2: ; preds = %entry, %bb1
69 %8 = phi i1 [ false, %entry ], [ %cmp1, %bb1 ]
70 %9 = load i32, ptr %this, align 4
71 %cond = icmp eq i32 %9, 0
72 br i1 %cond, label %bb3, label %sw.epilog
75 br i1 %cmp_entry, label %bb4, label %bb5
78 %m.i.i = getelementptr inbounds %class.B, ptr %p2, i64 0, i32 1
79 %10 = load i32, ptr %m.i.i, align 4
80 %m3.i.i = getelementptr inbounds %class.B, ptr %p1, i64 0, i32 1
81 %11 = load i32, ptr %m3.i.i, align 4
82 %cmp4 = icmp eq i32 %10, %11
85 bb5: ; preds = %bb3, %bb4
86 %12 = phi i1 [ false, %bb3 ], [ %cmp4, %bb4 ]
89 sw.epilog: ; preds = %bb2