Fixed a failure in cost calculation for vector GEP
Cost calculation for vector GEP failed with due to invalid cast to GEP index operand. The bug is fixed, added a test. http://reviews.llvm.org/D14976 llvm-svn: 254408
This commit is contained in:
@@ -417,9 +417,10 @@ Value *llvm::findScalarElement(Value *V, unsigned EltNo) {
|
||||
/// the input value is (1) a splat constants vector or (2) a sequence
|
||||
/// of instructions that broadcast a single value into a vector.
|
||||
///
|
||||
llvm::Value *llvm::getSplatValue(Value *V) {
|
||||
if (auto *CV = dyn_cast<ConstantDataVector>(V))
|
||||
return CV->getSplatValue();
|
||||
const llvm::Value *llvm::getSplatValue(const Value *V) {
|
||||
|
||||
if (auto *C = dyn_cast<Constant>(V))
|
||||
return C->getSplatValue();
|
||||
|
||||
auto *ShuffleInst = dyn_cast<ShuffleVectorInst>(V);
|
||||
if (!ShuffleInst)
|
||||
|
||||
Reference in New Issue
Block a user