[PATCH] D76434: [SCEV] Query for immediate cost in Expander

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 13:09:22 PDT 2020


lebedev.ri added a comment.
Herald added a subscriber: wuzish.

Hmm, i'm not a ventillator. Some initial thoughts.

1. This is rather pessimistic. If we really want to do this, we need to use `TargetTransformInfo::getIntImmCostInst()`.
2. What cost does that model? I'm under impression that `TargetTransformInfo::getIntImmCost*()` model `TargetCostKind::TCK_CodeSize`, since it is mainly used in `ConstantHoistingPass`. Here we model `TargetCostKind::TCK_RecipThroughput`.
3. Assuming that `TargetTransformInfo::getIntImmCost*()` actually models `TargetCostKind::TCK_RecipThroughput`, i believe, all X86 changes should not be here. Either most of them will get fixed via using `TargetTransformInfo::getIntImmCostInst()`, or the `llvm::SCEVCheapExpansionBudget` will need to be bumped.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76434/new/

https://reviews.llvm.org/D76434





More information about the llvm-commits mailing list