[PATCH] D152593: [NVPTX] Lower v2f16 and v2bf16 stores as 32-bit scalars.
Artem Belevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 9 16:01:22 PDT 2023
tra created this revision.
Herald added subscribers: mattd, gchakrabarti, asavonic, bixia, hiraditya.
Herald added a project: All.
tra published this revision for review.
tra added reviewers: jlebar, kushanam.
Herald added subscribers: llvm-commits, jholewinski.
Herald added a project: LLVM.
This avoids unnecessary vector splitting that was needed for vectorized store
instruction.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D152593
Files:
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
llvm/test/CodeGen/NVPTX/f16x2-instructions.ll
Index: llvm/test/CodeGen/NVPTX/f16x2-instructions.ll
===================================================================
--- llvm/test/CodeGen/NVPTX/f16x2-instructions.ll
+++ llvm/test/CodeGen/NVPTX/f16x2-instructions.ll
@@ -276,8 +276,7 @@
; CHECK-DAG: ld.param.u64 %[[A:rd[0-9]+]], [test_ldst_v2f16_param_0];
; CHECK-DAG: ld.param.u64 %[[B:rd[0-9]+]], [test_ldst_v2f16_param_1];
; CHECK-DAG: ld.b32 [[E:%r[0-9]+]], [%[[A]]]
-; CHECK: mov.b32 {[[E0:%rs[0-9]+]], [[E1:%rs[0-9]+]]}, [[E]];
-; CHECK-DAG: st.v2.b16 [%[[B]]], {[[E0]], [[E1]]};
+; CHECK-DAG: st.b32 [%[[B]]], [[E]];
; CHECK: ret;
define void @test_ldst_v2f16(ptr %a, ptr %b) {
%t1 = load <2 x half>, ptr %a
Index: llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
===================================================================
--- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -2465,6 +2465,10 @@
VT, *Store->getMemOperand()))
return expandUnalignedStore(Store, DAG);
+ // v2f16 and v2bf16 don't need special handling.
+ if (VT == MVT::v2f16 || VT == MVT::v2bf16)
+ return SDValue();
+
if (VT.isVector())
return LowerSTOREVector(Op, DAG);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152593.530108.patch
Type: text/x-patch
Size: 1286 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230609/f4f9c7b6/attachment.bin>
More information about the llvm-commits
mailing list