1 ; RUN: llc < %s -march=thumb -mattr=-thumb2 | not grep pld
2 ; RUN: llc < %s -march=thumb -mattr=+v7a,+mp | FileCheck %s -check-prefix=THUMB2
3 ; RUN: llc < %s -march=arm -mattr=+v7a,+mp | FileCheck %s -check-prefix=ARM
6 define void @t1(i8* %ptr) nounwind {
17 tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 1 )
18 tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 2 )
19 tail call void @llvm.prefetch( i8* %ptr, i32 0, i32 3 )
23 define void @t2(i8* %ptr) nounwind {
26 ; ARM: pld [r0, #1023]
29 ; THUMB2: pld [r0, #1023]
30 %tmp = getelementptr i8* %ptr, i32 1023
31 tail call void @llvm.prefetch( i8* %tmp, i32 0, i32 3 )
35 define void @t3(i32 %base, i32 %offset) nounwind {
38 ; ARM: pld [r0, r1, lsr #2]
41 ; THUMB2: lsrs r1, r1, #2
42 ; THUMB2: pld [r0, r1]
43 %tmp1 = lshr i32 %offset, 2
44 %tmp2 = add i32 %base, %tmp1
45 %tmp3 = inttoptr i32 %tmp2 to i8*
46 tail call void @llvm.prefetch( i8* %tmp3, i32 0, i32 3 )
50 define void @t4(i32 %base, i32 %offset) nounwind {
53 ; ARM: pld [r0, r1, lsl #2]
56 ; THUMB2: pld [r0, r1, lsl #2]
57 %tmp1 = shl i32 %offset, 2
58 %tmp2 = add i32 %base, %tmp1
59 %tmp3 = inttoptr i32 %tmp2 to i8*
60 tail call void @llvm.prefetch( i8* %tmp3, i32 0, i32 3 )
64 declare void @llvm.prefetch(i8*, i32, i32) nounwind