; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+sve -mattr=+bf16 < %s | FileCheck %s ; This file checks that unpredicated load/store instructions to locals ; use the right instructions and offsets. ; Data fills define void @fill_nxv16i8() { ; CHECK-LABEL: fill_nxv16i8 ; CHECK-DAG: ld1b { z{{[01]}}.b }, p0/z, [sp] ; CHECK-DAG: ld1b { z{{[01]}}.b }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define void @fill_nxv8i8() { ; CHECK-LABEL: fill_nxv8i8 ; CHECK-DAG: ld1b { z{{[01]}}.h }, p0/z, [sp] ; CHECK-DAG: ld1b { z{{[01]}}.h }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define @fill_signed_nxv8i8() { ; CHECK-LABEL: fill_signed_nxv8i8 ; CHECK-DAG: ld1sb { z{{[01]}}.h }, p0/z, [sp] ; CHECK-DAG: ld1sb { z{{[01]}}.h }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca %a = load volatile , * %local0 %a_ext = sext %a to %b = load volatile , * %local1 %b_ext = sext %b to %sum = add %a_ext, %b_ext ret %sum } define void @fill_nxv4i8() { ; CHECK-LABEL: fill_nxv4i8 ; CHECK-DAG: ld1b { z{{[01]}}.s }, p0/z, [sp, #3, mul vl] ; CHECK-DAG: ld1b { z{{[01]}}.s }, p0/z, [sp, #2, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define @fill_signed_nxv4i8() { ; CHECK-LABEL: fill_signed_nxv4i8 ; CHECK-DAG: ld1sb { z{{[01]}}.s }, p0/z, [sp, #3, mul vl] ; CHECK-DAG: ld1sb { z{{[01]}}.s }, p0/z, [sp, #2, mul vl] %local0 = alloca %local1 = alloca %a = load volatile , * %local0 %a_ext = sext %a to %b = load volatile , * %local1 %b_ext = sext %b to %sum = add %a_ext, %b_ext ret %sum } define void @fill_nxv2i8() { ; CHECK-LABEL: fill_nxv2i8 ; CHECK-DAG: ld1b { z{{[01]}}.d }, p0/z, [sp, #7, mul vl] ; CHECK-DAG: ld1b { z{{[01]}}.d }, p0/z, [sp, #6, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define @fill_signed_nxv2i8() { ; CHECK-LABEL: fill_signed_nxv2i8 ; CHECK-DAG: ld1sb { z{{[01]}}.d }, p0/z, [sp, #7, mul vl] ; CHECK-DAG: ld1sb { z{{[01]}}.d }, p0/z, [sp, #6, mul vl] %local0 = alloca %local1 = alloca %a = load volatile , * %local0 %a_ext = sext %a to %b = load volatile , * %local1 %b_ext = sext %b to %sum = add %a_ext, %b_ext ret %sum } define void @fill_nxv8i16() { ; CHECK-LABEL: fill_nxv8i16 ; CHECK-DAG: ld1h { z{{[01]}}.h }, p0/z, [sp] ; CHECK-DAG: ld1h { z{{[01]}}.h }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define void @fill_nxv4i16() { ; CHECK-LABEL: fill_nxv4i16 ; CHECK-DAG: ld1h { z{{[01]}}.s }, p0/z, [sp] ; CHECK-DAG: ld1h { z{{[01]}}.s }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define @fill_signed_nxv4i16() { ; CHECK-LABEL: fill_signed_nxv4i16 ; CHECK-DAG: ld1sh { z{{[01]}}.s }, p0/z, [sp] ; CHECK-DAG: ld1sh { z{{[01]}}.s }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca %a = load volatile , * %local0 %a_ext = sext %a to %b = load volatile , * %local1 %b_ext = sext %b to %sum = add %a_ext, %b_ext ret %sum } define void @fill_nxv2i16() { ; CHECK-LABEL: fill_nxv2i16 ; CHECK-DAG: ld1h { z{{[01]}}.d }, p0/z, [sp, #3, mul vl] ; CHECK-DAG: ld1h { z{{[01]}}.d }, p0/z, [sp, #2, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define @fill_signed_nxv2i16() { ; CHECK-LABEL: fill_signed_nxv2i16 ; CHECK-DAG: ld1sh { z{{[01]}}.d }, p0/z, [sp, #3, mul vl] ; CHECK-DAG: ld1sh { z{{[01]}}.d }, p0/z, [sp, #2, mul vl] %local0 = alloca %local1 = alloca %a = load volatile , * %local0 %a_ext = sext %a to %b = load volatile , * %local1 %b_ext = sext %b to %sum = add %a_ext, %b_ext ret %sum } define void @fill_nxv4i32() { ; CHECK-LABEL: fill_nxv4i32 ; CHECK-DAG: ld1w { z{{[01]}}.s }, p0/z, [sp] ; CHECK-DAG: ld1w { z{{[01]}}.s }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define void @fill_nxv2i32() { ; CHECK-LABEL: fill_nxv2i32 ; CHECK-DAG: ld1w { z{{[01]}}.d }, p0/z, [sp] ; CHECK-DAG: ld1w { z{{[01]}}.d }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define @fill_signed_nxv2i32() { ; CHECK-LABEL: fill_signed_nxv2i32 ; CHECK-DAG: ld1sw { z{{[01]}}.d }, p0/z, [sp] ; CHECK-DAG: ld1sw { z{{[01]}}.d }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca %a = load volatile , * %local0 %a_ext = sext %a to %b = load volatile , * %local1 %b_ext = sext %b to %sum = add %a_ext, %b_ext ret %sum } define void @fill_nxv2i64() { ; CHECK-LABEL: fill_nxv2i64 ; CHECK-DAG: ld1d { z{{[01]}}.d }, p0/z, [sp] ; CHECK-DAG: ld1d { z{{[01]}}.d }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define void @fill_nxv8bf16() { ; CHECK-LABEL: fill_nxv8bf16 ; CHECK-DAG: ld1h { z{{[01]}}.h }, p0/z, [sp] ; CHECK-DAG: ld1h { z{{[01]}}.h }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define void @fill_nxv8f16() { ; CHECK-LABEL: fill_nxv8f16 ; CHECK-DAG: ld1h { z{{[01]}}.h }, p0/z, [sp] ; CHECK-DAG: ld1h { z{{[01]}}.h }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define void @fill_nxv4f32() { ; CHECK-LABEL: fill_nxv4f32 ; CHECK-DAG: ld1w { z{{[01]}}.s }, p0/z, [sp] ; CHECK-DAG: ld1w { z{{[01]}}.s }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define void @fill_nxv2f64() { ; CHECK-LABEL: fill_nxv2f64 ; CHECK-DAG: ld1d { z{{[01]}}.d }, p0/z, [sp] ; CHECK-DAG: ld1d { z{{[01]}}.d }, p0/z, [sp, #1, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } ; Data spills define void @spill_nxv16i8( %v0, %v1) { ; CHECK-LABEL: spill_nxv16i8 ; CHECK-DAG: st1b { z{{[01]}}.b }, p0, [sp] ; CHECK-DAG: st1b { z{{[01]}}.b }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv8i8( %v0, %v1) { ; CHECK-LABEL: spill_nxv8i8 ; CHECK-DAG: st1b { z{{[01]}}.h }, p0, [sp] ; CHECK-DAG: st1b { z{{[01]}}.h }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv4i8( %v0, %v1) { ; CHECK-LABEL: spill_nxv4i8 ; CHECK-DAG: st1b { z{{[01]}}.s }, p0, [sp, #3, mul vl] ; CHECK-DAG: st1b { z{{[01]}}.s }, p0, [sp, #2, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv2i8( %v0, %v1) { ; CHECK-LABEL: spill_nxv2i8 ; CHECK-DAG: st1b { z{{[01]}}.d }, p0, [sp, #7, mul vl] ; CHECK-DAG: st1b { z{{[01]}}.d }, p0, [sp, #6, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv8i16( %v0, %v1) { ; CHECK-LABEL: spill_nxv8i16 ; CHECK-DAG: st1h { z{{[01]}}.h }, p0, [sp] ; CHECK-DAG: st1h { z{{[01]}}.h }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv4i16( %v0, %v1) { ; CHECK-LABEL: spill_nxv4i16 ; CHECK-DAG: st1h { z{{[01]}}.s }, p0, [sp] ; CHECK-DAG: st1h { z{{[01]}}.s }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv2i16( %v0, %v1) { ; CHECK-LABEL: spill_nxv2i16 ; CHECK-DAG: st1h { z{{[01]}}.d }, p0, [sp, #3, mul vl] ; CHECK-DAG: st1h { z{{[01]}}.d }, p0, [sp, #2, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv4i32( %v0, %v1) { ; CHECK-LABEL: spill_nxv4i32 ; CHECK-DAG: st1w { z{{[01]}}.s }, p0, [sp] ; CHECK-DAG: st1w { z{{[01]}}.s }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv2i32( %v0, %v1) { ; CHECK-LABEL: spill_nxv2i32 ; CHECK-DAG: st1w { z{{[01]}}.d }, p0, [sp] ; CHECK-DAG: st1w { z{{[01]}}.d }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv2i64( %v0, %v1) { ; CHECK-LABEL: spill_nxv2i64 ; CHECK-DAG: st1d { z{{[01]}}.d }, p0, [sp] ; CHECK-DAG: st1d { z{{[01]}}.d }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv8f16( %v0, %v1) { ; CHECK-LABEL: spill_nxv8f16 ; CHECK-DAG: st1h { z{{[01]}}.h }, p0, [sp] ; CHECK-DAG: st1h { z{{[01]}}.h }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv8bf16( %v0, %v1) { ; CHECK-LABEL: spill_nxv8bf16 ; CHECK-DAG: st1h { z{{[01]}}.h }, p0, [sp] ; CHECK-DAG: st1h { z{{[01]}}.h }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv4f32( %v0, %v1) { ; CHECK-LABEL: spill_nxv4f32 ; CHECK-DAG: st1w { z{{[01]}}.s }, p0, [sp] ; CHECK-DAG: st1w { z{{[01]}}.s }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv2f64( %v0, %v1) { ; CHECK-LABEL: spill_nxv2f64 ; CHECK-DAG: st1d { z{{[01]}}.d }, p0, [sp] ; CHECK-DAG: st1d { z{{[01]}}.d }, p0, [sp, #1, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } ; Predicate fills define void @fill_nxv16i1() { ; CHECK-LABEL: fill_nxv16i1 ; CHECK-DAG: ldr p{{[01]}}, [sp, #8, mul vl] ; CHECK-DAG: ldr p{{[01]}}, [sp] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define void @fill_nxv8i1() { ; CHECK-LABEL: fill_nxv8i1 ; CHECK-DAG: ldr p{{[01]}}, [sp, #4, mul vl] ; CHECK-DAG: ldr p{{[01]}}, [sp] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define void @fill_nxv4i1() { ; CHECK-LABEL: fill_nxv4i1 ; CHECK-DAG: ldr p{{[01]}}, [sp, #6, mul vl] ; CHECK-DAG: ldr p{{[01]}}, [sp, #4, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } define void @fill_nxv2i1() { ; CHECK-LABEL: fill_nxv2i1 ; CHECK-DAG: ldr p{{[01]}}, [sp, #7, mul vl] ; CHECK-DAG: ldr p{{[01]}}, [sp, #6, mul vl] %local0 = alloca %local1 = alloca load volatile , * %local0 load volatile , * %local1 ret void } ; Predicate spills define void @spill_nxv16i1( %v0, %v1) { ; CHECK-LABEL: spill_nxv16i1 ; CHECK-DAG: str p{{[01]}}, [sp, #8, mul vl] ; CHECK-DAG: str p{{[01]}}, [sp] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv8i1( %v0, %v1) { ; CHECK-LABEL: spill_nxv8i1 ; CHECK-DAG: str p{{[01]}}, [sp, #4, mul vl] ; CHECK-DAG: str p{{[01]}}, [sp] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv4i1( %v0, %v1) { ; CHECK-LABEL: spill_nxv4i1 ; CHECK-DAG: str p{{[01]}}, [sp, #6, mul vl] ; CHECK-DAG: str p{{[01]}}, [sp, #4, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void } define void @spill_nxv2i1( %v0, %v1) { ; CHECK-LABEL: spill_nxv2i1 ; CHECK-DAG: str p{{[01]}}, [sp, #7, mul vl] ; CHECK-DAG: str p{{[01]}}, [sp, #6, mul vl] %local0 = alloca %local1 = alloca store volatile %v0, * %local0 store volatile %v1, * %local1 ret void }