1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
5 define i32 @test1(i32 %x) nounwind ssp {
8 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
9 ; CHECK-NEXT: shll $5, %edi
10 ; CHECK-NEXT: leal 3(%rdi), %eax
17 ; This test no longer requires or to be converted to 3 addr form because we are
18 ; are able to use a zero extend instead of an 'and' which gives the register
20 define i64 @test2(i8 %A, i8 %B) nounwind {
23 ; CHECK-NEXT: shll $4, %edi
24 ; CHECK-NEXT: andl $48, %edi
25 ; CHECK-NEXT: movzbl %sil, %eax
26 ; CHECK-NEXT: shrl $4, %eax
27 ; CHECK-NEXT: orl %edi, %eax
29 %C = zext i8 %A to i64
32 %F = zext i8 %B to i64
38 ;; Test that OR is only emitted as LEA, not as ADD.
40 ; No reason to emit an add here, should be an or.
41 define void @test3(i32 %x, ptr %P) nounwind readnone ssp {
44 ; CHECK-NEXT: shll $5, %edi
45 ; CHECK-NEXT: orl $3, %edi
46 ; CHECK-NEXT: movl %edi, (%rsi)
54 define i32 @test4(i32 %a, i32 %b) nounwind readnone ssp {
57 ; CHECK-NEXT: # kill: def $esi killed $esi def $rsi
58 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
59 ; CHECK-NEXT: andl $6, %edi
60 ; CHECK-NEXT: andl $16, %esi
61 ; CHECK-NEXT: leal (%rsi,%rdi), %eax
64 %and2 = and i32 %b, 16
65 %or = or i32 %and2, %and
69 define void @test5(i32 %a, i32 %b, ptr nocapture %P) nounwind ssp {
72 ; CHECK-NEXT: andl $6, %edi
73 ; CHECK-NEXT: andl $16, %esi
74 ; CHECK-NEXT: orl %edi, %esi
75 ; CHECK-NEXT: movl %esi, (%rdx)
78 %and2 = and i32 %b, 16
79 %or = or i32 %and2, %and
80 store i32 %or, ptr %P, align 4