Clement Courbet | a43e965 | 2018-02-02 15:54:17 +0000 | [diff] [blame^] | 1 | ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64le-unknown-gnu-linux < %s | FileCheck %s -check-prefix=PPC64LE |
| 3 | |
| 4 | ; This tests interaction between MergeICmp and ExpandMemCmp. |
| 5 | |
| 6 | %"struct.std::pair" = type { i32, i32 } |
| 7 | |
| 8 | define zeroext i1 @opeq1( |
| 9 | ; PPC64LE-LABEL: opeq1: |
| 10 | ; PPC64LE: # %bb.0: # %entry |
| 11 | ; PPC64LE-NEXT: lwz 5, 0(3) |
| 12 | ; PPC64LE-NEXT: lwz 6, 0(4) |
| 13 | ; PPC64LE-NEXT: cmplw 5, 6 |
| 14 | ; PPC64LE-NEXT: bne 0, .LBB0_2 |
| 15 | ; PPC64LE-NEXT: # %bb.1: # %land.rhs.i |
| 16 | ; PPC64LE-NEXT: lwz 3, 4(3) |
| 17 | ; PPC64LE-NEXT: lwz 4, 4(4) |
| 18 | ; PPC64LE-NEXT: cmpw 3, 4 |
| 19 | ; PPC64LE-NEXT: b .LBB0_3 |
| 20 | ; PPC64LE-NEXT: .LBB0_2: |
| 21 | ; PPC64LE-NEXT: crxor 2, 2, 2 |
| 22 | ; PPC64LE-NEXT: .LBB0_3: # %opeq1.exit |
| 23 | ; PPC64LE-NEXT: li 3, 0 |
| 24 | ; PPC64LE-NEXT: li 4, 1 |
| 25 | ; PPC64LE-NEXT: isel 3, 4, 3, 2 |
| 26 | ; PPC64LE-NEXT: blr |
| 27 | %"struct.std::pair"* nocapture readonly dereferenceable(8) %a, |
| 28 | %"struct.std::pair"* nocapture readonly dereferenceable(8) %b) local_unnamed_addr #0 { |
| 29 | entry: |
| 30 | %first.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %a, i64 0, i32 0 |
| 31 | %0 = load i32, i32* %first.i, align 4 |
| 32 | %first1.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %b, i64 0, i32 0 |
| 33 | %1 = load i32, i32* %first1.i, align 4 |
| 34 | %cmp.i = icmp eq i32 %0, %1 |
| 35 | br i1 %cmp.i, label %land.rhs.i, label %opeq1.exit |
| 36 | |
| 37 | land.rhs.i: |
| 38 | %second.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %a, i64 0, i32 1 |
| 39 | %2 = load i32, i32* %second.i, align 4 |
| 40 | %second2.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %b, i64 0, i32 1 |
| 41 | %3 = load i32, i32* %second2.i, align 4 |
| 42 | %cmp3.i = icmp eq i32 %2, %3 |
| 43 | br label %opeq1.exit |
| 44 | |
| 45 | opeq1.exit: |
| 46 | %4 = phi i1 [ false, %entry ], [ %cmp3.i, %land.rhs.i ] |
| 47 | ret i1 %4 |
| 48 | } |
| 49 | |
| 50 | |