brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · a8069fb Raw
87 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=mergeicmps -S | FileCheck %s --check-prefix=NOEXPANSION3 4%"struct.std::pair" = type { i32, i32 }5 6define zeroext i1 @opeq1(7; NOEXPANSION-LABEL: @opeq1(8; NOEXPANSION-NEXT:  entry:9; NOEXPANSION-NEXT:    [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 410; NOEXPANSION-NEXT:    [[TMP1:%.*]] = load i32, ptr [[B:%.*]], align 411; NOEXPANSION-NEXT:    [[CMP_I:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]]12; NOEXPANSION-NEXT:    br i1 [[CMP_I]], label [[LAND_RHS_I:%.*]], label [[OPEQ1_EXIT:%.*]]13; NOEXPANSION:       land.rhs.i:14; NOEXPANSION-NEXT:    [[SECOND_I:%.*]] = getelementptr inbounds %"struct.std::pair", ptr [[A]], i64 0, i32 115; NOEXPANSION-NEXT:    [[TMP2:%.*]] = load i32, ptr [[SECOND_I]], align 416; NOEXPANSION-NEXT:    [[SECOND2_I:%.*]] = getelementptr inbounds %"struct.std::pair", ptr [[B]], i64 0, i32 117; NOEXPANSION-NEXT:    [[TMP3:%.*]] = load i32, ptr [[SECOND2_I]], align 418; NOEXPANSION-NEXT:    [[CMP3_I:%.*]] = icmp eq i32 [[TMP2]], [[TMP3]]19; NOEXPANSION-NEXT:    br label [[OPEQ1_EXIT]]20; NOEXPANSION:       opeq1.exit:21; NOEXPANSION-NEXT:    [[TMP4:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[CMP3_I]], [[LAND_RHS_I]] ]22; NOEXPANSION-NEXT:    ret i1 [[TMP4]]23;24  ptr nocapture readonly dereferenceable(8) %a,25  ptr nocapture readonly dereferenceable(8) %b) local_unnamed_addr #0 {26entry:27  %0 = load i32, ptr %a, align 428  %1 = load i32, ptr %b, align 429  %cmp.i = icmp eq i32 %0, %130  br i1 %cmp.i, label %land.rhs.i, label %opeq1.exit31 32land.rhs.i:33  %second.i = getelementptr inbounds %"struct.std::pair", ptr %a, i64 0, i32 134  %2 = load i32, ptr %second.i, align 435  %second2.i = getelementptr inbounds %"struct.std::pair", ptr %b, i64 0, i32 136  %3 = load i32, ptr %second2.i, align 437  %cmp3.i = icmp eq i32 %2, %338  br label %opeq1.exit39 40opeq1.exit:41  %4 = phi i1 [ false, %entry ], [ %cmp3.i, %land.rhs.i ]42  ret i1 %443}44 45; Same as above, but the two blocks are in inverse order.46define zeroext i1 @opeq1_inverse(47; NOEXPANSION-LABEL: @opeq1_inverse(48; NOEXPANSION-NEXT:  entry:49; NOEXPANSION-NEXT:    [[FIRST_I:%.*]] = getelementptr inbounds %"struct.std::pair", ptr [[A:%.*]], i64 0, i32 150; NOEXPANSION-NEXT:    [[TMP0:%.*]] = load i32, ptr [[FIRST_I]], align 451; NOEXPANSION-NEXT:    [[FIRST1_I:%.*]] = getelementptr inbounds %"struct.std::pair", ptr [[B:%.*]], i64 0, i32 152; NOEXPANSION-NEXT:    [[TMP1:%.*]] = load i32, ptr [[FIRST1_I]], align 453; NOEXPANSION-NEXT:    [[CMP_I:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]]54; NOEXPANSION-NEXT:    br i1 [[CMP_I]], label [[LAND_RHS_I:%.*]], label [[OPEQ1_EXIT:%.*]]55; NOEXPANSION:       land.rhs.i:56; NOEXPANSION-NEXT:    [[TMP2:%.*]] = load i32, ptr [[A]], align 457; NOEXPANSION-NEXT:    [[TMP3:%.*]] = load i32, ptr [[B]], align 458; NOEXPANSION-NEXT:    [[CMP3_I:%.*]] = icmp eq i32 [[TMP2]], [[TMP3]]59; NOEXPANSION-NEXT:    br label [[OPEQ1_EXIT]]60; NOEXPANSION:       opeq1.exit:61; NOEXPANSION-NEXT:    [[TMP4:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[CMP3_I]], [[LAND_RHS_I]] ]62; NOEXPANSION-NEXT:    ret i1 [[TMP4]]63;64  ptr nocapture readonly dereferenceable(8) %a,65  ptr nocapture readonly dereferenceable(8) %b) local_unnamed_addr #0 {66entry:67  %first.i = getelementptr inbounds %"struct.std::pair", ptr %a, i64 0, i32 168  %0 = load i32, ptr %first.i, align 469  %first1.i = getelementptr inbounds %"struct.std::pair", ptr %b, i64 0, i32 170  %1 = load i32, ptr %first1.i, align 471  %cmp.i = icmp eq i32 %0, %172  br i1 %cmp.i, label %land.rhs.i, label %opeq1.exit73 74land.rhs.i:75  %2 = load i32, ptr %a, align 476  %3 = load i32, ptr %b, align 477  %cmp3.i = icmp eq i32 %2, %378  br label %opeq1.exit79 80opeq1.exit:81  %4 = phi i1 [ false, %entry ], [ %cmp3.i, %land.rhs.i ]82  ret i1 %483}84 85 86 87