Skip to content

Commit 47fa271

Browse files
author
Elena Demikhovsky
committed
Fixed a failure in getSpaltValue()
llvm-svn: 254409
1 parent 0781d7b commit 47fa271

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Analysis/VectorUtils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,8 @@ Value *llvm::findScalarElement(Value *V, unsigned EltNo) {
420420
const llvm::Value *llvm::getSplatValue(const Value *V) {
421421

422422
if (auto *C = dyn_cast<Constant>(V))
423-
return C->getSplatValue();
423+
if (isa<VectorType>(V->getType()))
424+
return C->getSplatValue();
424425

425426
auto *ShuffleInst = dyn_cast<ShuffleVectorInst>(V);
426427
if (!ShuffleInst)

0 commit comments

Comments
 (0)