brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 82d5827 Raw
29 lines · plain
1; RUN: llc -mtriple=hexagon < %s | FileCheck %s2; Check for the immediate offset.  It must be a multiple of 8.3; CHECK: dcfetch({{.*}}+#8)4; In 6.2 (which supports v4+ only), we generate indexed dcfetch in all cases5; (unlike in 6.1, which supported v2, where dcfetch did not allow an immediate6; offset).7; For expression %2, where the offset is +9, the offset on dcfetch should be8; a multiple of 8, and the offset of 0 is most likely (although not the only9; possible one).  Check for #0 anyways, if the test fails with a false10; positive, the second check can be eliminated, or rewritten, and in the11; meantime it can help catch real problems.12; CHECK: dcfetch({{.*}}+#0)13target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"14target triple = "hexagon"15 16define void @foo(ptr %addr) nounwind {17entry:18  %addr.addr = alloca ptr, align 419  store ptr %addr, ptr %addr.addr, align 420  %0 = load ptr, ptr %addr.addr, align 421  %1 = getelementptr i8, ptr %0, i32 822  call void @llvm.prefetch(ptr %1, i32 0, i32 3, i32 1)23  %2 = getelementptr i8, ptr %0, i32 924  call void @llvm.prefetch(ptr %2, i32 0, i32 3, i32 1)25  ret void26}27 28declare void @llvm.prefetch(ptr nocapture, i32, i32, i32) nounwind29