[PATCH] D76434: [SCEV] Query expanded immediate cost at minsize

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 14 03:02:17 PDT 2020


lebedev.ri added a comment.

In D76434#2217823 <https://reviews.llvm.org/D76434#2217823>, @samparker wrote:

> Yeah, that sounds better, I'll put together a separate patch.



> Are you happy with the operand index clamping though?

Looks about right i guess.



================
Comment at: llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:2195
   case scUnknown:
   case scConstant:
     return false; // Assume to be zero-cost.
----------------
Can we still get a constant here?


================
Comment at: llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:2279-2282
         // Note that we don't count the cost of RHS, because it is a constant,
         // and we consider those to be free. But if that changes, we would need
         // to log2() it first before calling isHighCostExpansionHelper().
         Worklist.emplace_back(UDivExpr->getLHS());
----------------
We are not taxing constants for right-shifts.


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

https://reviews.llvm.org/D76434



More information about the llvm-commits mailing list