[llvm] r254409 - Fixed a failure in getSpaltValue()

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 04:30:43 PST 2015


Author: delena
Date: Tue Dec  1 06:30:40 2015
New Revision: 254409

URL: http://llvm.org/viewvc/llvm-project?rev=254409&view=rev
Log:
Fixed a failure in getSpaltValue()


Modified:
    llvm/trunk/lib/Analysis/VectorUtils.cpp

Modified: llvm/trunk/lib/Analysis/VectorUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/VectorUtils.cpp?rev=254409&r1=254408&r2=254409&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/VectorUtils.cpp (original)
+++ llvm/trunk/lib/Analysis/VectorUtils.cpp Tue Dec  1 06:30:40 2015
@@ -420,7 +420,8 @@ Value *llvm::findScalarElement(Value *V,
 const llvm::Value *llvm::getSplatValue(const Value *V) {
 
   if (auto *C = dyn_cast<Constant>(V))
-    return C->getSplatValue();
+    if (isa<VectorType>(V->getType()))
+      return C->getSplatValue();
 
   auto *ShuffleInst = dyn_cast<ShuffleVectorInst>(V);
   if (!ShuffleInst)




More information about the llvm-commits mailing list