]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/X86/memcmp-mergeexpand.ll
Vendor import of llvm trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / CodeGen / X86 / memcmp-mergeexpand.ll
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
4
5 ; This tests interaction between MergeICmp and ExpandMemCmp.
6
7 %"struct.std::pair" = type { i32, i32 }
8
9 define zeroext i1 @opeq1(
10 ; X86-LABEL: opeq1:
11 ; X86:       # %bb.0: # %entry
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
19 ; X86-NEXT:    sete %al
20 ; X86-NEXT:    retl
21 ;
22 ; X64-LABEL: opeq1:
23 ; X64:       # %bb.0: # %entry
24 ; X64-NEXT:    movq (%rdi), %rax
25 ; X64-NEXT:    cmpq (%rsi), %rax
26 ; X64-NEXT:    sete %al
27 ; X64-NEXT:    retq
28   %"struct.std::pair"* nocapture readonly dereferenceable(8) %a,
29   %"struct.std::pair"* nocapture readonly dereferenceable(8) %b) local_unnamed_addr #0 {
30 entry:
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
37
38 land.rhs.i:
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
44   br label %opeq1.exit
45
46 opeq1.exit:
47   %4 = phi i1 [ false, %entry ], [ %cmp3.i, %land.rhs.i ]
48   ret i1 %4
49 }
50
51