This is an archive of the discontinued LLVM Phabricator instance.

[llvm][nfc] InstructionCostDetail encapsulation
ClosedPublic

Authored by mtrofin on Apr 8 2020, 3:35 PM.

Details

Summary

Ensured initialized fields; encapsulad delta calulations and evaluation of threshold having had changed; assertion for CostThresholdMap dereference, to capture design intent.

Diff Detail

Event Timeline

mtrofin created this revision.Apr 8 2020, 3:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2020, 3:35 PM
knaumov accepted this revision.Apr 9 2020, 7:53 AM

LGTM

This revision is now accepted and ready to land.Apr 9 2020, 7:53 AM
davidxl accepted this revision.Apr 9 2020, 9:16 AM

lgtm

apilipenko added inline comments.
llvm/lib/Analysis/InlineCost.cpp
731–732

It's possible that we don't analyze all instructions. The analysis can stop early if we exceed the threshold. The original code had a problem with this scenario as well.

We just need to have an early exit.

mtrofin marked an inline comment as done.Apr 16 2020, 10:39 AM
mtrofin added inline comments.
llvm/lib/Analysis/InlineCost.cpp
731–732

Can you share the repro, so we can add a regression test as well?