[llvm] [Clang][Codegen] fix vector data by modifying VMVN (PR #105913)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 04:38:30 PDT 2024


https://github.com/Zhenhang1213 updated https://github.com/llvm/llvm-project/pull/105913

>From 07509273ce8aeb9dbeafa52b419036f8ee7ff5d2 Mon Sep 17 00:00:00 2001
From: Austin <zhenhangwang at huawei.com>
Date: Sat, 24 Aug 2024 09:48:20 +0800
Subject: [PATCH] [Clang][Codegen] fix vector data by modifying  VMVN

---
 llvm/lib/Target/ARM/ARMISelLowering.cpp  | 2 +-
 llvm/test/CodeGen/ARM/big-endian-vmov.ll | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 4ab0433069ae66..6e3ea4cb3984e0 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -7976,7 +7976,7 @@ SDValue ARMTargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
           VT, ST->hasMVEIntegerOps() ? MVEVMVNModImm : VMVNModImm);
       if (Val.getNode()) {
         SDValue Vmov = DAG.getNode(ARMISD::VMVNIMM, dl, VmovVT, Val);
-        return DAG.getNode(ISD::BITCAST, dl, VT, Vmov);
+        return DAG.getNode(ARMISD::VECTOR_REG_CAST, dl, VT, Vmov);
       }
 
       // Use vmov.f32 to materialize other v2f32 and v4f32 splats.
diff --git a/llvm/test/CodeGen/ARM/big-endian-vmov.ll b/llvm/test/CodeGen/ARM/big-endian-vmov.ll
index 1cb7a030d58c26..bce8dbea0e1c38 100644
--- a/llvm/test/CodeGen/ARM/big-endian-vmov.ll
+++ b/llvm/test/CodeGen/ARM/big-endian-vmov.ll
@@ -227,7 +227,6 @@ define arm_aapcs_vfpcc <8 x i16> @xor_v8i16_m1(<8 x i16> %a) {
 ; CHECK-BE:       @ %bb.0:
 ; CHECK-BE-NEXT:    vmvn.i32 q8, #0x10000
 ; CHECK-BE-NEXT:    vrev64.16 q9, q0
-; CHECK-BE-NEXT:    vrev32.16 q8, q8
 ; CHECK-BE-NEXT:    veor q8, q9, q8
 ; CHECK-BE-NEXT:    vrev64.16 q0, q8
 ; CHECK-BE-NEXT:    bx lr



More information about the llvm-commits mailing list