This is an archive of the discontinued LLVM Phabricator instance.

[CostModel] Unify Shuffle and InsertElement Costs
ClosedPublic

Authored by samparker on Jun 9 2020, 1:07 AM.

Details

Summary

Extract the existing code from getInstructionThroughput into TTImpl::getUserCost. The duplicated code in the AMDGPU backend has also been removed.

Diff Detail

Event Timeline

samparker created this revision.Jun 9 2020, 1:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2020, 1:07 AM
dfukalov accepted this revision.Jun 9 2020, 5:52 PM
dfukalov added inline comments.
llvm/test/CodeGen/SystemZ/splitMove_undefReg_mverifier.ll
213

If the change is refactoring, why it affects codegen test?

This revision is now accepted and ready to land.Jun 9 2020, 5:52 PM
samparker marked an inline comment as done.Jun 10 2020, 1:07 AM
samparker added inline comments.
llvm/test/CodeGen/SystemZ/splitMove_undefReg_mverifier.ll
213

I think this instruction was just broken, the ShuffleVectorInst class hit an assert on it.

This revision was automatically updated to reflect the committed changes.
dfukalov added inline comments.Jun 10 2020, 4:15 AM
llvm/test/CodeGen/SystemZ/splitMove_undefReg_mverifier.ll
213

But how it was not asserted before the change? Why change in cost model can change ShuffleVectorInst behavior in codegen test?

samparker marked an inline comment as done.Jun 10 2020, 4:35 AM
samparker added inline comments.
llvm/test/CodeGen/SystemZ/splitMove_undefReg_mverifier.ll
213

Well the program flow has now completely changed. I would expect a pass run by llc has queried getUserCost which now queries the ShuffleCost where it wouldn't have before. It was only accessible when called directly or when a client queried getInstructionThroughput, which are really only things that the vectorizer does, and the vectorizer wouldn't have been running on this test.