From 202b611f00a7ec2d34023d3dd55f442c94612797 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Thu, 6 Feb 2025 21:49:05 +0100 Subject: [PATCH 1/3] [CIR][CIRGen][Builtin][Neon] Lower neon_vuzp_v and neon_vuzpq_v --- .../lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp | 21 ++- clang/test/CIR/CodeGen/AArch64/neon-misc.c | 171 ++++++++++++++++++ 2 files changed, 191 insertions(+), 1 deletion(-) diff --git a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp index 6dfda0068530..c76ca37a5425 100644 --- a/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp @@ -4571,7 +4571,26 @@ CIRGenFunction::emitAArch64BuiltinExpr(unsigned BuiltinID, const CallExpr *E, } case NEON::BI__builtin_neon_vuzp_v: case NEON::BI__builtin_neon_vuzpq_v: { - llvm_unreachable("NEON::BI__builtin_neon_vuzpq_v NYI"); + Ops[1] = builder.createBitcast(Ops[1], ty); + Ops[2] = builder.createBitcast(Ops[2], ty); + // Adding a bitcast here as Ops[0] might be a void pointer. + mlir::Value baseAddr = + builder.createBitcast(Ops[0], builder.getPointerTo(ty)); + mlir::Value sv; + mlir::Location loc = getLoc(E->getExprLoc()); + + for (unsigned vi = 0; vi != 2; ++vi) { + llvm::SmallVector indices; + for (unsigned i = 0, e = vTy.getSize(); i != e; ++i) { + indices.push_back(2 * i + vi); + } + cir::ConstantOp idx = builder.getConstInt(loc, SInt32Ty, vi); + mlir::Value addr = builder.create( + loc, baseAddr.getType(), baseAddr, idx); + sv = builder.createVecShuffle(loc, Ops[1], Ops[2], indices); + (void)builder.CIRBaseBuilderTy::createStore(loc, sv, addr); + } + return sv; } case NEON::BI__builtin_neon_vzip_v: case NEON::BI__builtin_neon_vzipq_v: { diff --git a/clang/test/CIR/CodeGen/AArch64/neon-misc.c b/clang/test/CIR/CodeGen/AArch64/neon-misc.c index fc01ad8b8d44..8062c695cbeb 100644 --- a/clang/test/CIR/CodeGen/AArch64/neon-misc.c +++ b/clang/test/CIR/CodeGen/AArch64/neon-misc.c @@ -476,6 +476,177 @@ uint32x4x2_t test_vtrnq_u32(uint32x4_t a, uint32x4_t b) { // LLVM: ret %struct.uint32x4x2_t {{.*}} } +uint8x8x2_t test_vuzp_u8(uint8x8_t a, uint8x8_t b) { + return vuzp_u8(a, b); + + // CIR-LABEL:vuzp_u8 + // CIR: [[PTR:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.ptr), !cir.ptr> + // CIR: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i + // CIR: [[ADDR:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ZERO]] : !s32i), !cir.ptr> + // CIR: [[RES:%.*]] = cir.vec.shuffle([[INP1:%.*]], [[INP2:%.*]] : !cir.vector) + // CIR-SAME: [#cir.int<0> : !s32i, #cir.int<2> : !s32i, #cir.int<4> : !s32i, #cir.int<6> : !s32i, + // CIR-SAME: #cir.int<8> : !s32i, #cir.int<10> : !s32i, #cir.int<12> : !s32i, + // CIR-SAME: #cir.int<14> : !s32i] : !cir.vector + // CIR: cir.store [[RES]], [[ADDR]] : !cir.vector, !cir.ptr> + // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i + // CIR: [[ADDR1:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ONE]] : !s32i), !cir.ptr> + // CIR: [[RES1:%.*]] = cir.vec.shuffle([[INP1]], [[INP2]] : !cir.vector) + // CIR-SAME: [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i, + // CIR-SAME: #cir.int<9> : !s32i, #cir.int<11> : !s32i, #cir.int<13> : !s32i, #cir.int<15> : !s32i] : + // CIR-SAME: !cir.vector + // CIR: cir.store [[RES1]], [[ADDR1]] : !cir.vector, !cir.ptr> + + // LLVM: {{.*}}test_vuzp_u8(<8 x i8>{{.*}}[[A:%.*]], <8 x i8>{{.*}}[[B:%.*]]) + // LLVM: [[VTRN:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], + // LLVM-SAME: <8 x i32> + // LLVM: store <8 x i8> [[VTRN]], ptr [[RES:%.*]], align 8 + // LLVM: [[RES1:%.*]] = getelementptr {{.*}}<8 x i8>, ptr [[RES]], i64 1 + // LLVM: [[VTRN1:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> + // LLVM: store <8 x i8> [[VTRN1]], ptr [[RES1]], align 8 + // LLVM: ret %struct.uint8x8x2_t {{.*}} +} + +uint16x4x2_t test_vuzp_u16(uint16x4_t a, uint16x4_t b) { + return vuzp_u16(a, b); + + // CIR-LABEL: vuzp_u16 + // CIR: [[PTR:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.ptr), !cir.ptr> + // CIR: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i + // CIR: [[ADDR:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ZERO]] : !s32i), !cir.ptr> + // CIR: [[RES:%.*]] = cir.vec.shuffle([[INP1:%.*]], [[INP2:%.*]] : !cir.vector) + // CIR-SAME: [#cir.int<0> : !s32i, #cir.int<2> : !s32i, #cir.int<4> : !s32i, #cir.int<6> : !s32i] : !cir.vector + // CIR: cir.store [[RES]], [[ADDR]] : !cir.vector, !cir.ptr> + // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i + // CIR: [[ADDR1:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ONE]] : !s32i), !cir.ptr> + // CIR: [[RES1:%.*]] = cir.vec.shuffle([[INP1]], [[INP2]] : !cir.vector) + // CIR-SAME: [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i] : + // CIR-SAME: !cir.vector + // CIR: cir.store [[RES1]], [[ADDR1]] : !cir.vector, !cir.ptr> + + // LLVM: {{.*}}test_vuzp_u16(<4 x i16>{{.*}}[[A:%.*]], <4 x i16>{{.*}}[[B:%.*]]) + // LLVM: [[vuzp:%.*]] = shufflevector <4 x i16> [[A]], <4 x i16> [[B]], + // LLVM-SAME: <4 x i32> + // LLVM: store <4 x i16> [[vuzp]], ptr [[RES:%.*]], align 8 + // LLVM: [[RES1:%.*]] = getelementptr {{.*}}<4 x i16>, ptr [[RES]], i64 1 + // LLVM: [[vuzp1:%.*]] = shufflevector <4 x i16> [[A]], <4 x i16> [[B]], + // LLVM-SAME: <4 x i32> + // LLVM: store <4 x i16> [[vuzp1]], ptr [[RES1]], align 8 + // LLVM: ret %struct.uint16x4x2_t {{.*}} +} + +int32x2x2_t test_vuzp_s32(int32x2_t a, int32x2_t b) { + return vuzp_s32(a, b); + + // CIR-LABEL: vuzp_s32 + // CIR: [[PTR:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.ptr), !cir.ptr> + // CIR: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i + // CIR: [[ADDR:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ZERO]] : !s32i), !cir.ptr> + // CIR: [[RES:%.*]] = cir.vec.shuffle([[INP1:%.*]], [[INP2:%.*]] : !cir.vector) + // CIR-SAME: [#cir.int<0> : !s32i, #cir.int<2> : !s32i] : !cir.vector + // CIR: cir.store [[RES]], [[ADDR]] : !cir.vector, !cir.ptr> + // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i + // CIR: [[ADDR1:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ONE]] : !s32i), !cir.ptr> + // CIR: [[RES1:%.*]] = cir.vec.shuffle([[INP1]], [[INP2]] : !cir.vector) + // CIR-SAME: [#cir.int<1> : !s32i, #cir.int<3> : !s32i] : + // CIR-SAME: !cir.vector + // CIR: cir.store [[RES1]], [[ADDR1]] : !cir.vector, !cir.ptr> + + // LLVM: {{.*}}test_vuzp_s32(<2 x i32>{{.*}}[[A:%.*]], <2 x i32>{{.*}}[[B:%.*]]) + // LLVM: [[vuzp:%.*]] = shufflevector <2 x i32> [[A]], <2 x i32> [[B]], + // LLVM-SAME: <2 x i32> + // LLVM: store <2 x i32> [[vuzp]], ptr [[RES:%.*]], align 8 + // LLVM: [[RES1:%.*]] = getelementptr {{.*}}<2 x i32>, ptr [[RES]], i64 1 + // LLVM: [[vuzp1:%.*]] = shufflevector <2 x i32> [[A]], <2 x i32> [[B]], + // LLVM-SAME: <2 x i32> + // LLVM: store <2 x i32> [[vuzp1]], ptr [[RES1]], align 8 + // LLVM: ret %struct.int32x2x2_t {{.*}} +} + +uint8x16x2_t test_vuzpq_u8(uint8x16_t a, uint8x16_t b) { + return vuzpq_u8(a, b); + + // CIR-LABEL: vuzpq_u8 + // CIR: [[PTR:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.ptr), !cir.ptr> + // CIR: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i + // CIR: [[ADDR:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ZERO]] : !s32i), !cir.ptr> + // CIR: [[RES:%.*]] = cir.vec.shuffle([[INP1:%.*]], [[INP2:%.*]] : !cir.vector) + // CIR-SAME: [#cir.int<0> : !s32i, #cir.int<2> : !s32i, #cir.int<4> : !s32i, #cir.int<6> : !s32i, + // CIR-SAME: #cir.int<8> : !s32i, #cir.int<10> : !s32i, #cir.int<12> : !s32i, #cir.int<14> : !s32i, + // CIR-SAME: #cir.int<16> : !s32i, #cir.int<18> : !s32i, #cir.int<20> : !s32i, #cir.int<22> : !s32i, + // CIR-SAME: #cir.int<24> : !s32i, #cir.int<26> : !s32i, #cir.int<28> : !s32i, #cir.int<30> : !s32i] : !cir.vector + // CIR: cir.store [[RES]], [[ADDR]] : !cir.vector, !cir.ptr> + // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i + // CIR: [[ADDR1:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ONE]] : !s32i), !cir.ptr> + // CIR: [[RES1:%.*]] = cir.vec.shuffle([[INP1]], [[INP2]] : !cir.vector) + // CIR-SAME: [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i, + // CIR-SAME: #cir.int<9> : !s32i, #cir.int<11> : !s32i, #cir.int<13> : !s32i, #cir.int<15> : !s32i, + // CIR-SAME: #cir.int<17> : !s32i, #cir.int<19> : !s32i, #cir.int<21> : !s32i, #cir.int<23> : !s32i, + // CIR-SAME: #cir.int<25> : !s32i, #cir.int<27> : !s32i, #cir.int<29> : !s32i, #cir.int<31> : !s32i] : !cir.vector + // CIR: cir.store [[RES1]], [[ADDR1]] : !cir.vector, !cir.ptr> + + // LLVM: {{.*}}test_vuzpq_u8(<16 x i8>{{.*}}[[A:%.*]], <16 x i8>{{.*}}[[B:%.*]]) + // LLVM: [[vuzp:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], + // LLVM-SAME: <16 x i32> + // LLVM: store <16 x i8> [[vuzp]], ptr [[RES:%.*]], align 16 + // LLVM: [[RES1:%.*]] = getelementptr {{.*}}<16 x i8>, ptr [[RES]], i64 1 + // LLVM: [[vuzp1:%.*]] = shufflevector <16 x i8> [[A]], <16 x i8> [[B]], + // LLVM-SAME: <16 x i32> + // LLVM: store <16 x i8> [[vuzp1]], ptr [[RES1]], align 16 + // LLVM: ret %struct.uint8x16x2_t {{.*}} +} + +int16x8x2_t test_vuzpq_s16(int16x8_t a, int16x8_t b) { + return vuzpq_s16(a, b); + + // CIR-LABEL: vuzpq_s16 + // CIR: [[PTR:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.ptr), !cir.ptr> + // CIR: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i + // CIR: [[ADDR:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ZERO]] : !s32i), !cir.ptr> + // CIR: [[RES:%.*]] = cir.vec.shuffle([[INP1:%.*]], [[INP2:%.*]] : !cir.vector) + // CIR-SAME: [#cir.int<0> : !s32i, #cir.int<2> : !s32i, #cir.int<4> : !s32i, #cir.int<6> : !s32i, + // CIR-SAME: #cir.int<8> : !s32i, #cir.int<10> : !s32i, #cir.int<12> : !s32i, + // CIR-SAME: #cir.int<14> : !s32i] : !cir.vector + // CIR: cir.store [[RES]], [[ADDR]] : !cir.vector, !cir.ptr> + // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i + // CIR: [[ADDR1:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ONE]] : !s32i), !cir.ptr> + // CIR: [[RES1:%.*]] = cir.vec.shuffle([[INP1]], [[INP2]] : !cir.vector) + // CIR-SAME: [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i, + // CIR-SAME: #cir.int<9> : !s32i, #cir.int<11> : !s32i, #cir.int<13> : !s32i, + // CIR-SAME: #cir.int<15> : !s32i] : !cir.vector + // CIR: cir.store [[RES1]], [[ADDR1]] : !cir.vector, !cir.ptr> + + // LLVM: {{.*}}test_vuzpq_s16(<8 x i16>{{.*}}[[A:%.*]], <8 x i16>{{.*}}[[B:%.*]]) + // LLVM: [[vuzp:%.*]] = shufflevector <8 x i16> [[A]], <8 x i16> [[B]], + // LLVM-SAME: <8 x i32> + // LLVM: store <8 x i16> [[vuzp]], ptr [[RES:%.*]], align 16 + // LLVM: [[RES1:%.*]] = getelementptr {{.*}}<8 x i16>, ptr [[RES]], i64 1 + // LLVM: [[vuzp1:%.*]] = shufflevector <8 x i16> [[A]], <8 x i16> [[B]], <8 x i32> + // LLVM: store <8 x i16> [[vuzp1]], ptr [[RES1]], align 16 + // LLVM: ret %struct.int16x8x2_t {{.*}} +} + +uint32x4x2_t test_vuzpq_u32(uint32x4_t a, uint32x4_t b) { + return vuzpq_u32(a, b); + + // CIR-LABEL: vuzpq_u32 + // CIR: [[PTR:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.ptr), !cir.ptr> + // CIR: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i + // CIR: [[ADDR:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ZERO]] : !s32i), !cir.ptr> + // CIR: [[RES:%.*]] = cir.vec.shuffle([[INP1:%.*]], [[INP2:%.*]] : !cir.vector) + // CIR-SAME: [#cir.int<0> : !s32i, #cir.int<2> : !s32i, #cir.int<4> : !s32i, #cir.int<6> : !s32i] : + // CIR-SAME: !cir.vector + // CIR: cir.store [[RES]], [[ADDR]] : !cir.vector, !cir.ptr> + // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i + // CIR: [[ADDR1:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ONE]] : !s32i), !cir.ptr> + // CIR: [[RES1:%.*]] = cir.vec.shuffle([[INP1]], [[INP2]] : !cir.vector) + // CIR-SAME: [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i] : + // CIR-SAME: !cir.vector + // CIR: cir.store [[RES1]], [[ADDR1]] : !cir.vector, !cir.ptr> + // LLVM: ret %struct.uint32x4x2_t {{.*}} +} + uint8x8_t test_vqmovun_s16(int16x8_t a) { return vqmovun_s16(a); From a0862529f957997f6025de2cf92609515a8f3b41 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Fri, 7 Feb 2025 20:00:04 +0100 Subject: [PATCH 2/3] Add test for floating type --- clang/test/CIR/CodeGen/AArch64/neon-misc.c | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/clang/test/CIR/CodeGen/AArch64/neon-misc.c b/clang/test/CIR/CodeGen/AArch64/neon-misc.c index 8062c695cbeb..027d53d4cb98 100644 --- a/clang/test/CIR/CodeGen/AArch64/neon-misc.c +++ b/clang/test/CIR/CodeGen/AArch64/neon-misc.c @@ -562,6 +562,34 @@ int32x2x2_t test_vuzp_s32(int32x2_t a, int32x2_t b) { // LLVM: ret %struct.int32x2x2_t {{.*}} } +float32x2x2_t test_vuzp_f32(float32x2_t a, float32x2_t b) { + return vuzp_f32(a, b); + + // CIR-LABEL: vuzp_f32 + // CIR: [[PTR:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.ptr), !cir.ptr> + // CIR: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i + // CIR: [[ADDR:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ZERO]] : !s32i), !cir.ptr> + // CIR: [[RES:%.*]] = cir.vec.shuffle([[INP1:%.*]], [[INP2:%.*]] : !cir.vector) + // CIR-SAME: [#cir.int<0> : !s32i, #cir.int<2> : !s32i] : !cir.vector + // CIR: cir.store [[RES]], [[ADDR]] : !cir.vector, !cir.ptr> + // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i + // CIR: [[ADDR1:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ONE]] : !s32i), !cir.ptr> + // CIR: [[RES1:%.*]] = cir.vec.shuffle([[INP1]], [[INP2]] : !cir.vector) + // CIR-SAME: [#cir.int<1> : !s32i, #cir.int<3> : !s32i] : + // CIR-SAME: !cir.vector + // CIR: cir.store [[RES1]], [[ADDR1]] : !cir.vector, !cir.ptr> + + // LLVM: {{.*}}test_vuzp_f32(<2 x float>{{.*}}[[A:%.*]], <2 x float>{{.*}}[[B:%.*]]) + // LLVM: [[vuzp:%.*]] = shufflevector <2 x float> [[A]], <2 x float> [[B]], + // LLVM-SAME: <2 x i32> + // LLVM: store <2 x float> [[vuzp]], ptr [[RES:%.*]], align 8 + // LLVM: [[RES1:%.*]] = getelementptr {{.*}}<2 x float>, ptr [[RES]], i64 1 + // LLVM: [[vuzp1:%.*]] = shufflevector <2 x float> [[A]], <2 x float> [[B]], + // LLVM-SAME: <2 x i32> + // LLVM: store <2 x float> [[vuzp1]], ptr [[RES1]], align 8 + // LLVM: ret %struct.float32x2x2_t {{.*}} +} + uint8x16x2_t test_vuzpq_u8(uint8x16_t a, uint8x16_t b) { return vuzpq_u8(a, b); @@ -647,6 +675,26 @@ uint32x4x2_t test_vuzpq_u32(uint32x4_t a, uint32x4_t b) { // LLVM: ret %struct.uint32x4x2_t {{.*}} } +float32x4x2_t test_vuzpq_f32(float32x4_t a, float32x4_t b) { + return vuzpq_f32(a, b); + + // CIR-LABEL: vuzpq_f32 + // CIR: [[PTR:%.*]] = cir.cast(bitcast, {{%.*}} : !cir.ptr), !cir.ptr> + // CIR: [[ZERO:%.*]] = cir.const #cir.int<0> : !s32i + // CIR: [[ADDR:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ZERO]] : !s32i), !cir.ptr> + // CIR: [[RES:%.*]] = cir.vec.shuffle([[INP1:%.*]], [[INP2:%.*]] : !cir.vector) + // CIR-SAME: [#cir.int<0> : !s32i, #cir.int<2> : !s32i, #cir.int<4> : !s32i, #cir.int<6> : !s32i] : + // CIR-SAME: !cir.vector + // CIR: cir.store [[RES]], [[ADDR]] : !cir.vector, !cir.ptr> + // CIR: [[ONE:%.*]] = cir.const #cir.int<1> : !s32i + // CIR: [[ADDR1:%.*]] = cir.ptr_stride([[PTR]] : !cir.ptr>, [[ONE]] : !s32i), !cir.ptr> + // CIR: [[RES1:%.*]] = cir.vec.shuffle([[INP1]], [[INP2]] : !cir.vector) + // CIR-SAME: [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i] : + // CIR-SAME: !cir.vector + // CIR: cir.store [[RES1]], [[ADDR1]] : !cir.vector, !cir.ptr> + // LLVM: ret %struct.float32x4x2_t {{.*}} +} + uint8x8_t test_vqmovun_s16(int16x8_t a) { return vqmovun_s16(a); From 0185e80ddb83c4deb7fdb616c73ff690ef249d20 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sat, 8 Feb 2025 13:50:31 +0100 Subject: [PATCH 3/3] Add test for instructions from store to ret --- clang/test/CIR/CodeGen/AArch64/neon-misc.c | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/clang/test/CIR/CodeGen/AArch64/neon-misc.c b/clang/test/CIR/CodeGen/AArch64/neon-misc.c index 027d53d4cb98..18cd9298be12 100644 --- a/clang/test/CIR/CodeGen/AArch64/neon-misc.c +++ b/clang/test/CIR/CodeGen/AArch64/neon-misc.c @@ -503,7 +503,8 @@ uint8x8x2_t test_vuzp_u8(uint8x8_t a, uint8x8_t b) { // LLVM: [[RES1:%.*]] = getelementptr {{.*}}<8 x i8>, ptr [[RES]], i64 1 // LLVM: [[VTRN1:%.*]] = shufflevector <8 x i8> [[A]], <8 x i8> [[B]], <8 x i32> // LLVM: store <8 x i8> [[VTRN1]], ptr [[RES1]], align 8 - // LLVM: ret %struct.uint8x8x2_t {{.*}} + // LLVM-NEXT: [[RET:%.*]] = load %struct.uint8x8x2_t, ptr {{.*}} + // LLVM-NEXT: ret %struct.uint8x8x2_t [[RET]] } uint16x4x2_t test_vuzp_u16(uint16x4_t a, uint16x4_t b) { @@ -531,7 +532,8 @@ uint16x4x2_t test_vuzp_u16(uint16x4_t a, uint16x4_t b) { // LLVM: [[vuzp1:%.*]] = shufflevector <4 x i16> [[A]], <4 x i16> [[B]], // LLVM-SAME: <4 x i32> // LLVM: store <4 x i16> [[vuzp1]], ptr [[RES1]], align 8 - // LLVM: ret %struct.uint16x4x2_t {{.*}} + // LLVM-NEXT: [[RET:%.*]] = load %struct.uint16x4x2_t, ptr {{.*}} + // LLVM-NEXT: ret %struct.uint16x4x2_t [[RET]] } int32x2x2_t test_vuzp_s32(int32x2_t a, int32x2_t b) { @@ -559,7 +561,8 @@ int32x2x2_t test_vuzp_s32(int32x2_t a, int32x2_t b) { // LLVM: [[vuzp1:%.*]] = shufflevector <2 x i32> [[A]], <2 x i32> [[B]], // LLVM-SAME: <2 x i32> // LLVM: store <2 x i32> [[vuzp1]], ptr [[RES1]], align 8 - // LLVM: ret %struct.int32x2x2_t {{.*}} + // LLVM-NEXT: [[RET:%.*]] = load %struct.int32x2x2_t, ptr {{.*}} + // LLVM-NEXT: ret %struct.int32x2x2_t [[RET]] } float32x2x2_t test_vuzp_f32(float32x2_t a, float32x2_t b) { @@ -587,7 +590,8 @@ float32x2x2_t test_vuzp_f32(float32x2_t a, float32x2_t b) { // LLVM: [[vuzp1:%.*]] = shufflevector <2 x float> [[A]], <2 x float> [[B]], // LLVM-SAME: <2 x i32> // LLVM: store <2 x float> [[vuzp1]], ptr [[RES1]], align 8 - // LLVM: ret %struct.float32x2x2_t {{.*}} + // LLVM-NEXT: [[RET:%.*]] = load %struct.float32x2x2_t, ptr {{.*}} + // LLVM-NEXT: ret %struct.float32x2x2_t [[RET]] } uint8x16x2_t test_vuzpq_u8(uint8x16_t a, uint8x16_t b) { @@ -622,7 +626,8 @@ uint8x16x2_t test_vuzpq_u8(uint8x16_t a, uint8x16_t b) { // LLVM-SAME: <16 x i32> // LLVM: store <16 x i8> [[vuzp1]], ptr [[RES1]], align 16 - // LLVM: ret %struct.uint8x16x2_t {{.*}} + // LLVM-NEXT: [[RET:%.*]] = load %struct.uint8x16x2_t, ptr {{.*}} + // LLVM-NEXT: ret %struct.uint8x16x2_t [[RET]] } int16x8x2_t test_vuzpq_s16(int16x8_t a, int16x8_t b) { @@ -652,7 +657,8 @@ int16x8x2_t test_vuzpq_s16(int16x8_t a, int16x8_t b) { // LLVM: [[RES1:%.*]] = getelementptr {{.*}}<8 x i16>, ptr [[RES]], i64 1 // LLVM: [[vuzp1:%.*]] = shufflevector <8 x i16> [[A]], <8 x i16> [[B]], <8 x i32> // LLVM: store <8 x i16> [[vuzp1]], ptr [[RES1]], align 16 - // LLVM: ret %struct.int16x8x2_t {{.*}} + // LLVM: [[RET:%.*]] = load %struct.int16x8x2_t, ptr {{.*}} + // LLVM-NEXT: ret %struct.int16x8x2_t [[RET]] } uint32x4x2_t test_vuzpq_u32(uint32x4_t a, uint32x4_t b) { @@ -672,7 +678,8 @@ uint32x4x2_t test_vuzpq_u32(uint32x4_t a, uint32x4_t b) { // CIR-SAME: [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i] : // CIR-SAME: !cir.vector // CIR: cir.store [[RES1]], [[ADDR1]] : !cir.vector, !cir.ptr> - // LLVM: ret %struct.uint32x4x2_t {{.*}} + // LLVM: [[RET:%.*]] = load %struct.uint32x4x2_t, ptr {{.*}} + // LLVM-NEXT: ret %struct.uint32x4x2_t [[RET]] } float32x4x2_t test_vuzpq_f32(float32x4_t a, float32x4_t b) { @@ -692,7 +699,8 @@ float32x4x2_t test_vuzpq_f32(float32x4_t a, float32x4_t b) { // CIR-SAME: [#cir.int<1> : !s32i, #cir.int<3> : !s32i, #cir.int<5> : !s32i, #cir.int<7> : !s32i] : // CIR-SAME: !cir.vector // CIR: cir.store [[RES1]], [[ADDR1]] : !cir.vector, !cir.ptr> - // LLVM: ret %struct.float32x4x2_t {{.*}} + // LLVM: [[RET:%.*]] = load %struct.float32x4x2_t, ptr {{.*}} + // LLVM-NEXT: ret %struct.float32x4x2_t [[RET]] } uint8x8_t test_vqmovun_s16(int16x8_t a) {