This is an archive of the discontinued LLVM Phabricator instance.

NFC: Migrate SimpleLoopUnswitch to work on InstructionCost
ClosedPublic

Authored by sdesmalen on Jan 25 2021, 5:51 AM.

Details

Summary

This patch migrates cost values and arithmetic to work on InstructionCost.
When the interfaces to TargetTransformInfo are changed, any InstructionCost
state will propagate naturally.

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.Jan 25 2021, 5:51 AM
sdesmalen requested review of this revision.Jan 25 2021, 5:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 25 2021, 5:51 AM
ctetreau added inline comments.Jan 25 2021, 10:00 AM
llvm/include/llvm/Support/InstructionCost.h
254 ↗(On Diff #318977)

This is exactly the soft of thing I'm concerned about in my comment on D92238.

Aside from the question of InstructionBudget this looks good to me.

sdesmalen updated this revision to Diff 320155.Jan 29 2021, 9:42 AM

Replaced decrementing InstructionBudget by incrementing Cost variable.

david-arm accepted this revision.Feb 1 2021, 1:09 AM

LGTM!

This revision is now accepted and ready to land.Feb 1 2021, 1:09 AM