unsigned getInstructionCost(const Instruction *I) const;
private:
- virtual void getAnalysisUsage(AnalysisUsage &AU) const;
- virtual bool runOnFunction(Function &F);
- virtual void print(raw_ostream &OS, const Module*) const;
+ void getAnalysisUsage(AnalysisUsage &AU) const override;
+ bool runOnFunction(Function &F) override;
+ void print(raw_ostream &OS, const Module*) const override;
/// The function that we analyze.
Function *F;
TargetTransformInfo::OK_AnyValue;
// Check for a splat of a constant or for a non uniform vector of constants.
- ConstantDataVector *CDV = 0;
- if ((CDV = dyn_cast<ConstantDataVector>(V))) {
+ if (isa<ConstantVector>(V) || isa<ConstantDataVector>(V)) {
OpInfo = TargetTransformInfo::OK_NonUniformConstantValue;
- if (CDV->getSplatValue() != NULL)
- OpInfo = TargetTransformInfo::OK_UniformConstantValue;
- }
-
- ConstantVector *CV = 0;
- if ((CV = dyn_cast<ConstantVector>(V))) {
- OpInfo = TargetTransformInfo::OK_NonUniformConstantValue;
- if (CV->getSplatValue() != NULL)
+ if (cast<Constant>(V)->getSplatValue() != NULL)
OpInfo = TargetTransformInfo::OK_UniformConstantValue;
}
Value *NextRdxOp;
ShuffleVectorInst *Shuffle;
- tie(NextRdxOp, Shuffle) = getShuffleAndOtherOprd(BinOp);
+ std::tie(NextRdxOp, Shuffle) = getShuffleAndOtherOprd(BinOp);
// Check the current reduction operation and the shuffle use the same value.
if (Shuffle == 0)