blob: 3e9af6c1d8b4925f4c96ed5ac0a643ea3ea6bf22 [file] [log] [blame]
Clement Courbete2e8a5c2017-10-10 08:00:45 +00001; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -mergeicmps -mtriple=x86_64-unknown-unknown -S | FileCheck %s
3
4%"struct.std::pair" = type { i32, i32 }
5
6define zeroext i1 @opeq(
7; CHECK-LABEL: @opeq(
8; CHECK-NEXT: entry:
9; CHECK-NEXT: [[FIRST_I:%.*]] = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* [[A:%.*]], i64 0, i32 0
10; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[FIRST_I]], align 4
11; CHECK-NEXT: [[FIRST1_I:%.*]] = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* [[B:%.*]], i64 0, i32 0
12; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[FIRST1_I]], align 4
13; CHECK-NEXT: [[CMP_I:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]]
14; CHECK-NEXT: br i1 [[CMP_I]], label [[LAND_RHS_I:%.*]], label [[OPEQ1_EXIT:%.*]]
15; CHECK: land.rhs.i:
16; CHECK-NEXT: [[SECOND_I:%.*]] = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* [[A]], i64 0, i32 1
17; CHECK-NEXT: [[TMP2:%.*]] = load volatile i32, i32* [[SECOND_I]], align 4
18; CHECK-NEXT: [[SECOND2_I:%.*]] = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* [[B]], i64 0, i32 1
19; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[SECOND2_I]], align 4
20; CHECK-NEXT: [[CMP3_I:%.*]] = icmp eq i32 [[TMP2]], [[TMP3]]
21; CHECK-NEXT: br label [[OPEQ1_EXIT]]
22; CHECK: opeq1.exit:
23; CHECK-NEXT: [[TMP4:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[CMP3_I]], [[LAND_RHS_I]] ]
24; CHECK-NEXT: ret i1 [[TMP4]]
25;
26 %"struct.std::pair"* nocapture readonly dereferenceable(8) %a,
27 %"struct.std::pair"* nocapture readonly dereferenceable(8) %b) local_unnamed_addr #0 {
28entry:
29 %first.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %a, i64 0, i32 0
30 %0 = load i32, i32* %first.i, align 4
31 %first1.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %b, i64 0, i32 0
32 %1 = load i32, i32* %first1.i, align 4
33 %cmp.i = icmp eq i32 %0, %1
34 br i1 %cmp.i, label %land.rhs.i, label %opeq1.exit
35
36land.rhs.i:
37 %second.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %a, i64 0, i32 1
38 %2 = load volatile i32, i32* %second.i, align 4
39 %second2.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %b, i64 0, i32 1
40 %3 = load i32, i32* %second2.i, align 4
41 %cmp3.i = icmp eq i32 %2, %3
42 br label %opeq1.exit
43
44opeq1.exit:
45 %4 = phi i1 [ false, %entry ], [ %cmp3.i, %land.rhs.i ]
46 ret i1 %4
47}
48