• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefix=LNX1
3; RUN: llc < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s --check-prefix=LNX2
4; RUN: llc < %s -mtriple=x86_64-nacl | FileCheck %s --check-prefix=NACL
5; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s --check-prefix=WIN
6
7define i64 @test2(i64 %a) {
8; LNX1-LABEL: test2:
9; LNX1:       # %bb.0:
10; LNX1-NEXT:    leaq (,%rdi,4), %rax
11; LNX1-NEXT:    orq %rdi, %rax
12; LNX1-NEXT:    retq
13;
14; LNX2-LABEL: test2:
15; LNX2:       # %bb.0:
16; LNX2-NEXT:    leaq (,%rdi,4), %rax
17; LNX2-NEXT:    orq %rdi, %rax
18; LNX2-NEXT:    retq
19;
20; NACL-LABEL: test2:
21; NACL:       # %bb.0:
22; NACL-NEXT:    leaq (,%rdi,4), %rax
23; NACL-NEXT:    orq %rdi, %rax
24; NACL-NEXT:    retq
25;
26; WIN-LABEL: test2:
27; WIN:       # %bb.0:
28; WIN-NEXT:    leaq (,%rcx,4), %rax
29; WIN-NEXT:    orq %rcx, %rax
30; WIN-NEXT:    retq
31  %tmp2 = shl i64 %a, 2
32	%tmp3 = or i64 %tmp2, %a
33  ret i64 %tmp3
34}
35
36define i32 @test(i32 %a) {
37; LNX1-LABEL: test:
38; LNX1:       # %bb.0:
39; LNX1-NEXT:    # kill: def $edi killed $edi def $rdi
40; LNX1-NEXT:    leal (%rdi,%rdi,2), %eax
41; LNX1-NEXT:    retq
42;
43; LNX2-LABEL: test:
44; LNX2:       # %bb.0:
45; LNX2-NEXT:    # kill: def $edi killed $edi def $rdi
46; LNX2-NEXT:    leal (%rdi,%rdi,2), %eax
47; LNX2-NEXT:    retq
48;
49; NACL-LABEL: test:
50; NACL:       # %bb.0:
51; NACL-NEXT:    # kill: def $edi killed $edi def $rdi
52; NACL-NEXT:    leal (%rdi,%rdi,2), %eax
53; NACL-NEXT:    retq
54;
55; WIN-LABEL: test:
56; WIN:       # %bb.0:
57; WIN-NEXT:    # kill: def $ecx killed $ecx def $rcx
58; WIN-NEXT:    leal (%rcx,%rcx,2), %eax
59; WIN-NEXT:    retq
60  %tmp2 = mul i32 %a, 3
61  ret i32 %tmp2
62}
63
64define i64 @test3(i64 %a) {
65; LNX1-LABEL: test3:
66; LNX1:       # %bb.0:
67; LNX1-NEXT:    leaq (,%rdi,8), %rax
68; LNX1-NEXT:    retq
69;
70; LNX2-LABEL: test3:
71; LNX2:       # %bb.0:
72; LNX2-NEXT:    leaq (,%rdi,8), %rax
73; LNX2-NEXT:    retq
74;
75; NACL-LABEL: test3:
76; NACL:       # %bb.0:
77; NACL-NEXT:    leaq (,%rdi,8), %rax
78; NACL-NEXT:    retq
79;
80; WIN-LABEL: test3:
81; WIN:       # %bb.0:
82; WIN-NEXT:    leaq (,%rcx,8), %rax
83; WIN-NEXT:    retq
84  %tmp2 = shl i64 %a, 3
85  ret i64 %tmp2
86}
87
88