[PATCH] D80632: [CodeGen] Fix warning in visitShuffleVector
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 27 07:33:14 PDT 2020
david-arm created this revision.
david-arm added reviewers: sdesmalen, fpetrogalli, ctetreau.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
Make sure we only ask for the number of elements after we've
bailed out for scalable vectors.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80632
Files:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -3457,7 +3457,6 @@
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
EVT VT = TLI.getValueType(DAG.getDataLayout(), I.getType());
EVT SrcVT = Src1.getValueType();
- unsigned SrcNumElts = SrcVT.getVectorNumElements();
if (all_of(Mask, [](int Elem) { return Elem == 0; }) &&
VT.isScalableVector()) {
@@ -3474,6 +3473,7 @@
// for targets that support a SPLAT_VECTOR for non-scalable vector types.
assert(!VT.isScalableVector() && "Unsupported scalable vector shuffle");
+ unsigned SrcNumElts = SrcVT.getVectorNumElements();
unsigned MaskNumElts = Mask.size();
if (SrcNumElts == MaskNumElts) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80632.266528.patch
Type: text/x-patch
Size: 884 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200527/b058e74a/attachment.bin>
More information about the llvm-commits
mailing list