[PATCH] D71733: [NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 19 22:44:07 PST 2019


davidxl added a comment.

The SROA handling code should also be abstracted away and let the derived class handling cost accumulation.  In particular, the  common code pattern like:

if (lookupSROAArgAndCost(I.getPointerOperand(), SROAArg, CostIt)) {

    if (I.isSimple()) {
      accumulateSROACost(CostIt, InlineConstants::InstrCost);
      return true;
    }
  
    disableSROA(CostIt);
  }

Can be abtracted with interface CallAnalyzer::handleSROA(..), and the derived class implements this pattern.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71733





More information about the llvm-commits mailing list