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 define i32 @PR22970_i32(ptr nocapture readonly, i32) {
6 ; X86-LABEL: PR22970_i32:
8 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
9 ; X86-NEXT: movl $4095, %ecx # imm = 0xFFF
10 ; X86-NEXT: andl {{[0-9]+}}(%esp), %ecx
11 ; X86-NEXT: movl 32(%eax,%ecx,4), %eax
14 ; X64-LABEL: PR22970_i32:
16 ; X64-NEXT: # kill: def $esi killed $esi def $rsi
17 ; X64-NEXT: andl $4095, %esi # imm = 0xFFF
18 ; X64-NEXT: movl 32(%rdi,%rsi,4), %eax
21 %4 = add nuw nsw i32 %3, 8
22 %5 = zext i32 %4 to i64
23 %6 = getelementptr inbounds i32, ptr %0, i64 %5
24 %7 = load i32, ptr %6, align 4
28 define i32 @PR22970_i64(ptr nocapture readonly, i64) {
29 ; X86-LABEL: PR22970_i64:
31 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
32 ; X86-NEXT: movl $4095, %ecx # imm = 0xFFF
33 ; X86-NEXT: andl {{[0-9]+}}(%esp), %ecx
34 ; X86-NEXT: movl 32(%eax,%ecx,4), %eax
37 ; X64-LABEL: PR22970_i64:
39 ; X64-NEXT: andl $4095, %esi # imm = 0xFFF
40 ; X64-NEXT: movl 32(%rdi,%rsi,4), %eax
43 %4 = add nuw nsw i64 %3, 8
44 %5 = getelementptr inbounds i32, ptr %0, i64 %4
45 %6 = load i32, ptr %5, align 4