Page MenuHomePhabricator

[TTI] NFC: Change getScalingFactorCost to return InstructionCost
ClosedPublic

Authored by sdesmalen on Thu, Apr 15, 7:19 AM.

Details

Summary

This patch migrates the TTI cost interfaces to return an InstructionCost.

See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html

Diff Detail

Event Timeline

sdesmalen created this revision.Thu, Apr 15, 7:19 AM
sdesmalen requested review of this revision.Thu, Apr 15, 7:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Apr 15, 7:19 AM
paulwalker-arm accepted this revision.Mon, Apr 19, 5:01 AM

One comment about preexisting possibly redundant code so the patch looks good to me.

llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
1782–1783

I can see that TargetTransformInfo::getScalingFactorCost already performs the >=0 test and so I'm wondering if at this point you only need to assert the costs are valid?

This revision is now accepted and ready to land.Mon, Apr 19, 5:01 AM
sdesmalen marked an inline comment as done.Thu, Apr 22, 5:49 AM
sdesmalen added inline comments.
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
1782–1783

You're right, those checks seem redundant. I'll remove them before submitting the patch.

This revision was automatically updated to reflect the committed changes.
sdesmalen marked an inline comment as done.