Skip to content

Commit

Permalink
[AArch64] NFC: Fix broken test sve-fixed-ld2-alloca.ll
Browse files Browse the repository at this point in the history
There were several issues with this test, the most obvious being
that %strided.vec wasn't used and therefore could be deadcoded.

I've verified that the updated test still covers the code-changes
from its original patch.
  • Loading branch information
sdesmalen-arm committed Nov 16, 2022
1 parent 2d3d8c9 commit c260024
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions llvm/test/CodeGen/AArch64/sve-fixed-ld2-alloca.ll
Expand Up @@ -3,23 +3,27 @@

target triple = "aarch64-unknown-linux-gnu"

declare void @def(ptr)

define void @st1d_fixed(ptr %ptr) #0 {
; CHECK-LABEL: st1d_fixed:
; CHECK: // %bb.0:
; CHECK-NEXT: sub sp, sp, #16
; CHECK-NEXT: add x8, sp, #8
; CHECK-NEXT: sub sp, sp, #144
; CHECK-NEXT: stp x30, x19, [sp, #128] // 16-byte Folded Spill
; CHECK-NEXT: mov x19, x0
; CHECK-NEXT: mov x0, sp
; CHECK-NEXT: bl def
; CHECK-NEXT: ptrue p0.d
; CHECK-NEXT: ld2d { z0.d, z1.d }, p0/z, [x8]
; CHECK-NEXT: mov x8, #4
; CHECK-NEXT: mov z0.d, #0 // =0x0
; CHECK-NEXT: st1d { z0.d }, p0, [x0]
; CHECK-NEXT: st1d { z0.d }, p0, [x0, x8, lsl #3]
; CHECK-NEXT: add sp, sp, #16
; CHECK-NEXT: ld2d { z0.d, z1.d }, p0/z, [sp]
; CHECK-NEXT: st1d { z0.d }, p0, [x19]
; CHECK-NEXT: ldp x30, x19, [sp, #128] // 16-byte Folded Reload
; CHECK-NEXT: add sp, sp, #144
; CHECK-NEXT: ret
%alloc = alloca [16 x double], i32 0
%alloc = alloca [16 x double]
call void @def(ptr %alloc)
%load = load <8 x double>, ptr %alloc
%strided.vec = shufflevector <8 x double> %load, <8 x double> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
store <8 x double> zeroinitializer, ptr %ptr
store <4 x double> %strided.vec, ptr %ptr
ret void
}

Expand Down

0 comments on commit c260024

Please sign in to comment.