[PATCH] D37076: [LICM] Allow sinking when foldable in loop

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 18:04:42 PDT 2017


hfinkel added inline comments.


================
Comment at: include/llvm/Analysis/TargetTransformInfoImpl.h:782
 
   unsigned getUserCost(const User *U, ArrayRef<const Value *> Operands) {
     if (isa<PHINode>(U))
----------------
I see no reason to bifurcate the API by adding the Users parameter only to getGEPCost. getGEPCost may be the only case where we currently check users, but there's no reason that might not change in the future. Regardless, there's no reason to expose this distinction to users of the API. Please add the Users parameter to getUserCost here, and then pass it through to getGEPCost below. Then, in LICM, you can just call getUserCost for everything.


https://reviews.llvm.org/D37076





More information about the llvm-commits mailing list