; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s 2>%t | FileCheck %s ; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t ; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it. ; WARN-NOT: warning ; Verify that DAG combine rules for LD1 + sext/zext don't apply when the ; result of LD1 has multiple uses define @no_dag_combine_zext_sext( %pg, %base, * %res_out, %pred) { ; CHECK-LABEL: no_dag_combine_zext_sext ; CHECK: ld1b { z0.d }, p0/z, [z0.d, #16] ; CHECK-NEXT: st1b { z0.d }, p1, [x0] ; CHECK-NEXT: and z0.d, z0.d, #0xff ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.gather.scalar.offset.nxv2i8.nxv2i64( %pg, %base, i64 16) %res1 = zext %load to %res2 = sext %load to call void @llvm.masked.store.nxv2i8( %load, *%res_out, i32 8, %pred) ret %res1 } define @no_dag_combine_sext( %pg, %base, * %res_out, %pred) { ; CHECK-LABEL: no_dag_combine_sext ; CHECK: ld1b { z1.d }, p0/z, [z0.d, #16] ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: sxtb z0.d, p0/m, z1.d ; CHECK-NEXT: st1b { z1.d }, p1, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.gather.scalar.offset.nxv2i8.nxv2i64( %pg, %base, i64 16) %res = sext %load to call void @llvm.masked.store.nxv2i8( %load, *%res_out, i32 8, %pred) ret %res } define @no_dag_combine_zext( %pg, %base, * %res_out, %pred) { ; CHECK-LABEL: no_dag_combine_zext ; CHECK: ld1b { z0.d }, p0/z, [z0.d, #16] ; CHECK-NEXT: st1b { z0.d }, p1, [x0] ; CHECK-NEXT: and z0.d, z0.d, #0xff ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.gather.scalar.offset.nxv2i8.nxv2i64( %pg, %base, i64 16) %res = zext %load to call void @llvm.masked.store.nxv2i8( %load, *%res_out, i32 8, %pred) ret %res } declare @llvm.aarch64.sve.ld1.gather.scalar.offset.nxv2i8.nxv2i64(, , i64) declare void @llvm.masked.store.nxv2i8(, *, i32, )