aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorChristopher Tetreault <ctetreau@quicinc.com>2020-02-03 12:46:42 -0800
committerChristopher Tetreault <ctetreau@quicinc.com>2020-02-05 10:00:09 -0800
commitb03f3fbd6a6b8843469865b16c9eb3af8adc2d3a (patch)
tree710d322006b15e4df1b21bf04924f0484d68349f /llvm/lib/Analysis/ValueTracking.cpp
parent9986b88e64f30f5d958eef113bae4c8a098eea93 (diff)
downloadllvm-b03f3fbd6a6b8843469865b16c9eb3af8adc2d3a.zip
llvm-b03f3fbd6a6b8843469865b16c9eb3af8adc2d3a.tar.gz
llvm-b03f3fbd6a6b8843469865b16c9eb3af8adc2d3a.tar.bz2
Reapply: [SVE] Fix bug in simplification of scalable vector instructions
This reverts commit a05441038a3a4a011b9421751367c5c797d57137, reapplying commit 31574d38ac5fa4646cf01dd252a23e682402134f
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 5b4c810..1761cb6 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -166,6 +166,11 @@ static const Instruction *safeCxtI(const Value *V, const Instruction *CxtI) {
static bool getShuffleDemandedElts(const ShuffleVectorInst *Shuf,
const APInt &DemandedElts,
APInt &DemandedLHS, APInt &DemandedRHS) {
+ // The length of scalable vectors is unknown at compile time, thus we
+ // cannot check their values
+ if (Shuf->getMask()->getType()->getVectorElementCount().Scalable)
+ return false;
+
int NumElts = Shuf->getOperand(0)->getType()->getVectorNumElements();
int NumMaskElts = Shuf->getMask()->getType()->getVectorNumElements();
DemandedLHS = DemandedRHS = APInt::getNullValue(NumElts);