1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -mtriple=x86_64-unknown-unknown -mergeicmps -verify-dom-info -S | FileCheck %s --check-prefix=X86
4 %S = type { i32, i32, i32, i32 }
6 define zeroext i1 @opeq1(
8 ; X86-NEXT: "entry+land.rhs.i+land.rhs.i.2+land.rhs.i.3":
9 ; X86-NEXT: [[PTR:%.*]] = alloca i32
10 ; X86-NEXT: store i32 42, i32* [[PTR]]
11 ; X86-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[S:%.*]], %S* [[A:%.*]], i64 0, i32 0
12 ; X86-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[S]], %S* [[B:%.*]], i64 0, i32 0
13 ; X86-NEXT: [[CSTR:%.*]] = bitcast i32* [[TMP0]] to i8*
14 ; X86-NEXT: [[CSTR1:%.*]] = bitcast i32* [[TMP1]] to i8*
15 ; X86-NEXT: [[MEMCMP:%.*]] = call i32 @memcmp(i8* [[CSTR]], i8* [[CSTR1]], i64 16)
16 ; X86-NEXT: [[TMP2:%.*]] = icmp eq i32 [[MEMCMP]], 0
17 ; X86-NEXT: br label [[OPEQ1_EXIT:%.*]]
19 ; X86-NEXT: ret i1 [[TMP2]]
21 %S* nocapture readonly dereferenceable(16) %a,
22 %S* nocapture readonly dereferenceable(16) %b) local_unnamed_addr #0 {
26 %first.i = getelementptr inbounds %S, %S* %a, i64 0, i32 0
27 %0 = load i32, i32* %first.i, align 4
28 %first1.i = getelementptr inbounds %S, %S* %b, i64 0, i32 0
29 %1 = load i32, i32* %first1.i, align 4
30 ; Does other work, has no interference, merge block
31 store i32 42, i32* %ptr
32 %cmp.i = icmp eq i32 %0, %1
33 br i1 %cmp.i, label %land.rhs.i, label %opeq1.exit
36 %second.i = getelementptr inbounds %S, %S* %a, i64 0, i32 1
37 %2 = load i32, i32* %second.i, align 4
38 %second2.i = getelementptr inbounds %S, %S* %b, i64 0, i32 1
39 %3 = load i32, i32* %second2.i, align 4
40 %cmp2.i = icmp eq i32 %2, %3
41 br i1 %cmp2.i, label %land.rhs.i.2, label %opeq1.exit
44 %third.i = getelementptr inbounds %S, %S* %a, i64 0, i32 2
45 %4 = load i32, i32* %third.i, align 4
46 %third2.i = getelementptr inbounds %S, %S* %b, i64 0, i32 2
47 %5 = load i32, i32* %third2.i, align 4
48 %cmp3.i = icmp eq i32 %4, %5
49 br i1 %cmp3.i, label %land.rhs.i.3, label %opeq1.exit
52 %fourth.i = getelementptr inbounds %S, %S* %a, i64 0, i32 3
53 %6 = load i32, i32* %fourth.i, align 4
54 %fourth2.i = getelementptr inbounds %S, %S* %b, i64 0, i32 3
55 %7 = load i32, i32* %fourth2.i, align 4
56 %cmp4.i = icmp eq i32 %6, %7
60 %8 = phi i1 [ false, %entry ], [ false, %land.rhs.i] , [ false, %land.rhs.i.2 ], [ %cmp4.i, %land.rhs.i.3 ]