1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
4 define i32 @test_scalar(i32 %x) {
5 ; CHECK-LABEL: test_scalar:
7 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
8 ; CHECK-NEXT: leal (,%rdi,4), %eax
11 %add = add i32 %mul, %x
15 define i32 @test_scalar_commuted(i32 %x) {
16 ; CHECK-LABEL: test_scalar_commuted:
18 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
19 ; CHECK-NEXT: leal (,%rdi,4), %eax
22 %add = add i32 %x, %mul
26 define <4 x i32> @test_vector(<4 x i32> %x) {
27 ; CHECK-LABEL: test_vector:
29 ; CHECK-NEXT: pslld $2, %xmm0
31 %mul = mul <4 x i32> %x, <i32 3, i32 3, i32 3, i32 3>
32 %add = add <4 x i32> %mul, %x
36 define ptr @test_ptr(ptr %p) {
37 ; CHECK-LABEL: test_ptr:
39 ; CHECK-NEXT: leaq (,%rdi,4), %rax
41 %addr = ptrtoint ptr %p to i64
42 %mul = mul i64 %addr, 3
43 %res = getelementptr i8, ptr %p, i64 %mul
47 define i32 @test_extra_use(i32 %x, ptr %p) {
48 ; CHECK-LABEL: test_extra_use:
50 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
51 ; CHECK-NEXT: leal (%rdi,%rdi,2), %eax
52 ; CHECK-NEXT: movl %eax, (%rsi)
53 ; CHECK-NEXT: addl %edi, %eax
56 store i32 %mul, ptr %p
57 %add = add i32 %mul, %x
61 define i32 @test_different_operand(i32 %x, i32 %y) {
62 ; CHECK-LABEL: test_different_operand:
64 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
65 ; CHECK-NEXT: leal (%rdi,%rdi,2), %eax
66 ; CHECK-NEXT: addl %esi, %eax
69 %add = add i32 %mul, %y