diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -880,7 +880,7 @@ unsigned Op, RecurrenceDescriptor::MinMaxRecurrenceKind MinMaxKind, ArrayRef RedOps) { - unsigned VF = Src->getType()->getVectorNumElements(); + unsigned VF = cast(Src->getType())->getNumElements(); // Extract and apply reduction ops in ascending order: // e.g. ((((Acc + Scl[0]) + Scl[1]) + Scl[2]) + ) ... + Scl[VF-1] @@ -910,7 +910,7 @@ llvm::getShuffleReduction(IRBuilderBase &Builder, Value *Src, unsigned Op, RecurrenceDescriptor::MinMaxRecurrenceKind MinMaxKind, ArrayRef RedOps) { - unsigned VF = Src->getType()->getVectorNumElements(); + unsigned VF = cast(Src->getType())->getNumElements(); // VF is a power of 2 so we can emit the reduction using log2(VF) shuffles // and vector ops, reducing the set of values being computed by half each // round. @@ -983,13 +983,15 @@ case Instruction::FAdd: BuildFunc = [&]() { auto Rdx = Builder.CreateFAddReduce( - Constant::getNullValue(Src->getType()->getVectorElementType()), Src); + Constant::getNullValue( + cast(Src->getType())->getElementType()), + Src); return Rdx; }; break; case Instruction::FMul: BuildFunc = [&]() { - Type *Ty = Src->getType()->getVectorElementType(); + Type *Ty = cast(Src->getType())->getElementType(); auto Rdx = Builder.CreateFMulReduce(ConstantFP::get(Ty, 1.0), Src); return Rdx; };