[PATCH] D76124: [TTI] Remove getOperationCost

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 07:03:17 PDT 2020


spatel added a comment.

Thought about this a bit more...

The SystemZ test shows a result that seems unlikely to be intended. The most obvious place where that will have an impact is SimplifyCFG.
I suspect we'll end up causing regressions and be on an endless revert/fix cycle as those get noticed.

Can we limit this patch to an NFC cleanup of the API (even if that means propagating a known wrong answer)?

After that, I'd look at correcting SimplifyCFG. That pass is using what is now defined as the cost size model, but that's not what it was intended to be as SimplifyCFG evolved:

  /// Compute an abstract "cost" of speculating the given instruction,
  /// which is assumed to be safe to speculate. TCC_Free means cheap,
  /// TCC_Basic means less cheap, and TCC_Expensive means prohibitively
  /// expensive.
  static unsigned ComputeSpeculationCost(const User *I,
                                         const TargetTransformInfo &TTI) {
    assert(isSafeToSpeculativelyExecute(I) &&
           "Instruction is not safe to speculatively execute!");
    return TTI.getUserCost(I);
  }

This should be the throughput cost and possibly a size cost add-on to limit damage?


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

https://reviews.llvm.org/D76124





More information about the llvm-commits mailing list