[PATCH] D119618: [RISCV] Fix incorrect extend type in vwmulsu combine.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 12 12:48:34 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG478c237e21b2: [RISCV] Fix incorrect extend type in vwmulsu combine. (authored by craig.topper).
Changed prior to commit:
https://reviews.llvm.org/D119618?vs=408151&id=408211#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119618/new/
https://reviews.llvm.org/D119618
Files:
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmulsu.ll
Index: llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmulsu.ll
===================================================================
--- llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmulsu.ll
+++ llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmulsu.ll
@@ -375,7 +375,7 @@
; CHECK-NEXT: vle8.v v8, (a0)
; CHECK-NEXT: vle8.v v9, (a1)
; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
-; CHECK-NEXT: vsext.vf2 v10, v8
+; CHECK-NEXT: vzext.vf2 v10, v8
; CHECK-NEXT: vsext.vf2 v11, v9
; CHECK-NEXT: vwmulsu.vv v8, v11, v10
; CHECK-NEXT: ret
@@ -394,7 +394,7 @@
; CHECK-NEXT: vle8.v v8, (a0)
; CHECK-NEXT: vle16.v v9, (a1)
; CHECK-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
-; CHECK-NEXT: vsext.vf2 v10, v8
+; CHECK-NEXT: vzext.vf2 v10, v8
; CHECK-NEXT: vwmulsu.vv v8, v9, v10
; CHECK-NEXT: ret
%a = load <4 x i8>, <4 x i8>* %x
Index: llvm/lib/Target/RISCV/RISCVISelLowering.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -7805,6 +7805,8 @@
unsigned ExtOpc = IsSignExt ? RISCVISD::VSEXT_VL : RISCVISD::VZEXT_VL;
if (Op0.getValueType() != NarrowVT)
Op0 = DAG.getNode(ExtOpc, DL, NarrowVT, Op0, Mask, VL);
+ // vwmulsu requires second operand to be zero extended.
+ ExtOpc = IsVWMULSU ? RISCVISD::VZEXT_VL : ExtOpc;
if (Op1.getValueType() != NarrowVT)
Op1 = DAG.getNode(ExtOpc, DL, NarrowVT, Op1, Mask, VL);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119618.408211.patch
Type: text/x-patch
Size: 1497 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220212/036a0a2b/attachment.bin>
More information about the llvm-commits
mailing list