1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64
5 ; This tests interaction between MergeICmp and ExpandMemCmp.
7 %"struct.std::pair" = type { i32, i32 }
9 define zeroext i1 @opeq1(
11 ; X86: # %bb.0: # %"entry+land.rhs.i"
12 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
13 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
14 ; X86-NEXT: movl (%ecx), %edx
15 ; X86-NEXT: movl 4(%ecx), %ecx
16 ; X86-NEXT: xorl (%eax), %edx
17 ; X86-NEXT: xorl 4(%eax), %ecx
18 ; X86-NEXT: orl %edx, %ecx
23 ; X64: # %bb.0: # %"entry+land.rhs.i"
24 ; X64-NEXT: movq (%rdi), %rax
25 ; X64-NEXT: cmpq (%rsi), %rax
28 %"struct.std::pair"* nocapture readonly dereferenceable(8) %a,
29 %"struct.std::pair"* nocapture readonly dereferenceable(8) %b) local_unnamed_addr #0 {
31 %first.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %a, i64 0, i32 0
32 %0 = load i32, i32* %first.i, align 4
33 %first1.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %b, i64 0, i32 0
34 %1 = load i32, i32* %first1.i, align 4
35 %cmp.i = icmp eq i32 %0, %1
36 br i1 %cmp.i, label %land.rhs.i, label %opeq1.exit
39 %second.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %a, i64 0, i32 1
40 %2 = load i32, i32* %second.i, align 4
41 %second2.i = getelementptr inbounds %"struct.std::pair", %"struct.std::pair"* %b, i64 0, i32 1
42 %3 = load i32, i32* %second2.i, align 4
43 %cmp3.i = icmp eq i32 %2, %3
47 %4 = phi i1 [ false, %entry ], [ %cmp3.i, %land.rhs.i ]