[PATCH] D38085: Use the basic cost if a GEP is not used as addressing mode

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 12:12:54 PDT 2017


hfinkel added inline comments.


================
Comment at: include/llvm/Analysis/TargetTransformInfo.h:255
   /// lowered. It has two primary advantages over the \c getOperationCost and
   /// \c getGEPCost above, and one significant disadvantage: it can only be
   /// used when the IR construct has already been formed.
----------------
This comment would need to be updated.


================
Comment at: include/llvm/Analysis/TargetTransformInfoImpl.h:55
     case Instruction::GetElementPtr:
       llvm_unreachable("Use getGEPCost for GEP operations!");
 
----------------
This needs to be updated, or...

At a high level, I'm not sure what we want to completely remove the version of the function that can be used without an existing function. Instead, we should add an overload, and then fall back to the existing code where relevant.



https://reviews.llvm.org/D38085





More information about the llvm-commits mailing list