[PATCH] D92094: [CostModel]Replace FixedVectorType by VectorType in costgetIntrinsicInstrCost

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 07:18:33 PST 2020


ctetreau added a comment.

> I'd prefer if we didn't knowingly create broken paths here

It is unfortunate, but this is all fallout from the VectorType refactor. All of this code was calling `getNumElements()` without checking `isScalable()`. The general approach for doing the VectorType refactor was "if it unconditionally calls `getNumElements`, make it unconditionally cast to `FixedVectorType`. If it was broken before, it will still be broken now, but at least we'll get an assertion failure instead of it just silently miscompiling"

Unfortunately, that means that a great deal of this TTI stuff is broken for scalable vectors, since it just wasn't being exercised.

Once D91174 <https://reviews.llvm.org/D91174> is merged, I think it would be useful if somebody went through and updated the default TTI stuff to just return an invalid cost before any unconditional cast to `FixedVectorType`. At this point, we can get the stub of the comprehensive scalable vector TTI test, that initially just checks that most things return an invalid cost. (A few things do currently work)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92094



More information about the llvm-commits mailing list