45 lines · plain
1; RUN: llc -O3 -ppc-late-peephole=false -ppc-convert-rr-to-ri=false -o - %s | FileCheck %s2target datalayout = "e-m:e-i64:64-n32:64"3target triple = "powerpc64le-unknown-linux-gnu"4 5%class1 = type { %union1 }6%union1 = type { i64, [24 x i8] }7%class2 = type { %class3 }8%class3 = type { %class4 }9%class4 = type { %class5, i64, %union.anon }10%class5 = type { ptr }11%union.anon = type { i64, [8 x i8] }12 13@ext = external global %"class1", align 814 15; We can't select lxv for this because even though we're accessing an offset of16; 16 from the stack slot, the stack slot is only guaranteed to be 8-byte17; aligned. When the frame is finalized it is converted to lxv (frame-reg) +18; (offset + 16). Because offset isn't guaranteed to be 16-byte aligned, we may19; end up needing to translate the lxv instruction to lxvx20; CHECK-LABEL: unaligned_slot:21; CHECK-NOT: lxv {{[0-9]+}}, {{[-0-9]+}}({{[0-9]+}})22; CHECK: blr23define void @unaligned_slot() #0 {24 %1 = alloca %class2, align 825 %2 = getelementptr inbounds %class2, ptr %1, i64 0, i32 0, i32 0, i32 226 call void @llvm.memcpy.p0.p0.i64(ptr align 8 nonnull getelementptr inbounds (%class1, ptr @ext, i64 0, i32 0, i32 1, i64 8), ptr align 8 nonnull %2, i64 16, i1 false) #227 ret void28}29; CHECK-LABEL: aligned_slot:30; CHECK: lxv {{[0-9]+}}, {{[-0-9]+}}({{[0-9]+}})31; CHECK: blr32define void @aligned_slot() #0 {33 %1 = alloca %class2, align 1634 %2 = getelementptr inbounds %class2, ptr %1, i64 0, i32 0, i32 0, i32 235 call void @llvm.memcpy.p0.p0.i64(ptr align 8 nonnull getelementptr inbounds (%class1, ptr @ext, i64 0, i32 0, i32 1, i64 8), ptr align 8 nonnull %2, i64 16, i1 false) #236 ret void37}38 39; Function Attrs: argmemonly nounwind40declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #141 42attributes #0 = { nounwind "target-cpu"="pwr9" "target-features"="+altivec,+bpermd,+crypto,+direct-move,+extdiv,+htm,+power8-vector,+power9-vector,+vsx" "use-soft-float"="false" }43attributes #1 = { argmemonly nounwind }44attributes #2 = { nounwind }45