@@ -12231,25 +12231,24 @@ InstructionCost BoUpSLP::getSpillCost() const {
12231
12231
}
12232
12232
12233
12233
auto NoCallIntrinsic = [this](Instruction *I) {
12234
- if (auto *II = dyn_cast<IntrinsicInst>(I)) {
12235
- if (II->isAssumeLikeIntrinsic())
12236
- return true;
12237
- FastMathFlags FMF;
12238
- SmallVector<Type *, 4> Tys;
12239
- for (auto &ArgOp : II->args())
12240
- Tys.push_back(ArgOp->getType());
12241
- if (auto *FPMO = dyn_cast<FPMathOperator>(II))
12242
- FMF = FPMO->getFastMathFlags();
12243
- IntrinsicCostAttributes ICA(II->getIntrinsicID(), II->getType(), Tys,
12244
- FMF);
12245
- InstructionCost IntrCost =
12246
- TTI->getIntrinsicInstrCost(ICA, TTI::TCK_RecipThroughput);
12247
- InstructionCost CallCost = TTI->getCallInstrCost(
12248
- nullptr, II->getType(), Tys, TTI::TCK_RecipThroughput);
12249
- if (IntrCost < CallCost)
12250
- return true;
12251
- }
12252
- return false;
12234
+ auto *II = dyn_cast<IntrinsicInst>(I);
12235
+ if (!II)
12236
+ return false;
12237
+ if (II->isAssumeLikeIntrinsic())
12238
+ return true;
12239
+ FastMathFlags FMF;
12240
+ SmallVector<Type *, 4> Tys;
12241
+ for (auto &ArgOp : II->args())
12242
+ Tys.push_back(ArgOp->getType());
12243
+ if (auto *FPMO = dyn_cast<FPMathOperator>(II))
12244
+ FMF = FPMO->getFastMathFlags();
12245
+ IntrinsicCostAttributes ICA(II->getIntrinsicID(), II->getType(), Tys,
12246
+ FMF);
12247
+ InstructionCost IntrCost =
12248
+ TTI->getIntrinsicInstrCost(ICA, TTI::TCK_RecipThroughput);
12249
+ InstructionCost CallCost = TTI->getCallInstrCost(
12250
+ nullptr, II->getType(), Tys, TTI::TCK_RecipThroughput);
12251
+ return IntrCost < CallCost;
12253
12252
};
12254
12253
12255
12254
// Debug information does not impact spill cost.
0 commit comments