brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 17d11a8 Raw
67 lines · plain
1; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s2 3; This code causes an assertion failure if dereferenceable flag is not properly set in the load generated for memcpy4 5; CHECK-LABEL: @func6; CHECK: lxvd2x [[VREG:[0-9]+]], {{[0-9]+}}, {{[0-9]+}}7; CHECK-NOT: lxvd2x8; CHECK: stxvd2x [[VREG:[0-9]+]], {{[0-9]+}}, {{[0-9]+}}9; CHECK: stxvd2x [[VREG:[0-9]+]], {{[0-9]+}}, {{[0-9]+}}10; CHECK: blr11 12define void @func(i1 %flag) {13entry:14  %pairs = alloca [4 x <2 x i64>], align 815  %pair1 = getelementptr inbounds [4 x <2 x i64>], ptr %pairs, i64 0, i64 116  %pair2 = getelementptr inbounds [4 x <2 x i64>], ptr %pairs, i64 0, i64 217  br i1 %flag, label %end, label %dummy18 19end:20  ; copy third element into first element by memcpy21  call void @llvm.memcpy.p0.p0.i64(ptr align 8 nonnull %pairs, ptr align 8 %pair2, i64 16, i1 false)22  ; copy third element into second element by LD/ST23  %vec2 = load <2 x i64>, ptr %pair2, align 824  store <2 x i64> %vec2, ptr %pair1, align 825  ret void26 27dummy:28  ; to make use of %pair2 in another BB29  call void @llvm.memcpy.p0.p0.i64(ptr %pair2, ptr %pair2, i64 0, i1 false)30  br label %end31}32 33 34; CHECK-LABEL: @func235; CHECK: lxvd2x [[VREG:[0-9]+]], {{[0-9]+}}, {{[0-9]+}}36; CHECK-NOT: lxvd2x37; CHECK: stxvd2x [[VREG:[0-9]+]], {{[0-9]+}}, {{[0-9]+}}38; CHECK: stxvd2x [[VREG:[0-9]+]], {{[0-9]+}}, {{[0-9]+}}39; CHECK: blr40 41define void @func2(i1 %flag) {42entry:43  %pairs = alloca [4 x <2 x i64>], align 844  %pair1 = getelementptr inbounds [4 x <2 x i64>], ptr %pairs, i64 0, i64 145  %pair2 = getelementptr inbounds [4 x <2 x i64>], ptr %pairs, i64 0, i64 246  br i1 %flag, label %end, label %dummy47 48end:49  ; copy third element into first element by memcpy50  call void @llvm.memmove.p0.p0.i64(ptr align 8 nonnull %pairs, ptr align 8 %pair2, i64 16, i1 false)51  ; copy third element into second element by LD/ST52  %vec2 = load <2 x i64>, ptr %pair2, align 853  store <2 x i64> %vec2, ptr %pair1, align 854  ret void55 56dummy:57  ; to make use of %pair2 in another BB58  call void @llvm.memcpy.p0.p0.i64(ptr %pair2, ptr %pair2, i64 0, i1 false)59  br label %end60}61 62; Function Attrs: argmemonly nounwind63declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #164declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #165 66attributes #1 = { argmemonly nounwind }67