[PATCH] D142303: [SVE] Fix invalid INSERT_SUBVECTOR creation when lowering fixed length fp-int conversions.
Paul Walker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 24 04:31:14 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3f94a38388fd: [SVE] Fix invalid INSERT_SUBVECTOR creation when lowering fixed length fp-int… (authored by paulwalker-arm).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142303/new/
https://reviews.llvm.org/D142303
Files:
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-int-to-fp.ll
Index: llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-int-to-fp.ll
===================================================================
--- llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-int-to-fp.ll
+++ llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-int-to-fp.ll
@@ -182,8 +182,8 @@
; CHECK-NEXT: uunpklo z3.d, z0.s
; CHECK-NEXT: ext z0.b, z0.b, z0.b, #8
; CHECK-NEXT: uunpklo z0.d, z0.s
-; CHECK-NEXT: ucvtf z3.d, p0/m, z3.d
; CHECK-NEXT: ext z1.b, z1.b, z1.b, #8
+; CHECK-NEXT: ucvtf z3.d, p0/m, z3.d
; CHECK-NEXT: ucvtf z0.d, p0/m, z0.d
; CHECK-NEXT: ucvtf z2.d, p0/m, z2.d
; CHECK-NEXT: uunpklo z1.d, z1.s
@@ -758,8 +758,8 @@
; CHECK-NEXT: sunpklo z3.d, z0.s
; CHECK-NEXT: ext z0.b, z0.b, z0.b, #8
; CHECK-NEXT: sunpklo z0.d, z0.s
-; CHECK-NEXT: scvtf z3.d, p0/m, z3.d
; CHECK-NEXT: ext z1.b, z1.b, z1.b, #8
+; CHECK-NEXT: scvtf z3.d, p0/m, z3.d
; CHECK-NEXT: scvtf z0.d, p0/m, z0.d
; CHECK-NEXT: scvtf z2.d, p0/m, z2.d
; CHECK-NEXT: sunpklo z1.d, z1.s
Index: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -23619,10 +23619,10 @@
Val = DAG.getNode(IsSigned ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND, DL,
VT.changeTypeToInteger(), Val);
- Val = convertToScalableVector(DAG, ContainerSrcVT, Val);
- Val = getSVESafeBitCast(ContainerDstVT.changeTypeToInteger(), Val, DAG);
- // Safe to use a larger than specified operand since we just unpacked the
- // data, hence the upper bits are zero.
+ // Safe to use a larger than specified operand because by promoting the
+ // value nothing has changed from an arithmetic point of view.
+ Val =
+ convertToScalableVector(DAG, ContainerDstVT.changeTypeToInteger(), Val);
Val = DAG.getNode(Opcode, DL, ContainerDstVT, Pg, Val,
DAG.getUNDEF(ContainerDstVT));
return convertFromScalableVector(DAG, VT, Val);
@@ -23665,7 +23665,7 @@
Val = DAG.getNode(ISD::BITCAST, DL, SrcVT.changeTypeToInteger(), Val);
Val = DAG.getNode(ISD::ANY_EXTEND, DL, VT, Val);
- Val = convertToScalableVector(DAG, ContainerSrcVT, Val);
+ Val = convertToScalableVector(DAG, ContainerDstVT, Val);
Val = getSVESafeBitCast(CvtVT, Val, DAG);
Val = DAG.getNode(Opcode, DL, ContainerDstVT, Pg, Val,
DAG.getUNDEF(ContainerDstVT));
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -6711,6 +6711,8 @@
"Dest and insert subvector source types must match!");
assert(VT.isVector() && N2VT.isVector() &&
"Insert subvector VTs must be vectors!");
+ assert(VT.getVectorElementType() == N2VT.getVectorElementType() &&
+ "Insert subvector VTs must have the same element type!");
assert((VT.isScalableVector() || N2VT.isFixedLengthVector()) &&
"Cannot insert a scalable vector into a fixed length vector!");
assert((VT.isScalableVector() != N2VT.isScalableVector() ||
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142303.491715.patch
Type: text/x-patch
Size: 3320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230124/7195753d/attachment.bin>
More information about the llvm-commits
mailing list