[PATCH] D79162: [Analysis] TTI: Add CastContextHint for getCastInstrCost
Pierre van Houtryve via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 30 06:12:47 PDT 2020
Pierre-vh added a comment.
In D79162#2012504 <https://reviews.llvm.org/D79162#2012504>, @samparker wrote:
> > What do you mean by "doing it at a higher level"?
>
> I mean that trying to attach extra bits of information to //individual// instruction costs hooks doesn't scale. Also, if we want to add in-depth information, such as the legalization object, then we'd probably have to create a whole new API for the vectorizer to use too. Instead, we could enable TTI to calculate the cost of the loop, not just each instruction. This would give us the freedom to evaluate all the memory operations, evaluating their extends/truncs together, and enable us to make a good decision.
This sounds like a much better solution than what I proposed, but wouldn't that "getLoopCost" method also need to access the legalization object? How would it know which load/stores will be masked? Would it guess it by looking at the loop as a whole?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79162/new/
https://reviews.llvm.org/D79162
More information about the llvm-commits
mailing list