This is an archive of the discontinued LLVM Phabricator instance.

[MachineTraceMetrics] Add computeDepth function (NFCI).
ClosedPublic

Authored by fhahn on Aug 14 2017, 9:51 AM.

Diff Detail

Event Timeline

fhahn created this revision.Aug 14 2017, 9:51 AM
Gerolf edited edge metadata.Sep 6 2017, 4:06 PM

LGTM. Just some food for thought for possible follow up commits.

lib/CodeGen/MachineTraceMetrics.cpp
782

It would make the side effects of this procedure more explicit if a reference to TBI rather than MBB is passed as the first parameter. Within MachineTraceMetrics this would also reduce the #accesss to BlockInfo.

812

You could simplify and update the CP when HasValidInstrHeights is true.

fhahn updated this revision to Diff 114143.Sep 7 2017, 3:51 AM

Thanks for the comments, I added a updateDepth function that accepts a reference to TBI. I kept the version with MBB as well, as I think there's no way to get TBI for a basic block from outside MachineTraceMetrics (which we should not change IMO). I've also moved the code to set the CP, it should be slightly clearer now.

fhahn accepted this revision.Sep 7 2017, 4:50 AM
fhahn retitled this revision from [MachineTraceMetrics] Add computeDepth function. to [MachineTraceMetrics] Add computeDepth function (NFCI)..
fhahn edited the summary of this revision. (Show Details)

Accepted in Phabricator to make arc happy.

This revision is now accepted and ready to land.Sep 7 2017, 4:52 AM
fhahn closed this revision.Sep 7 2017, 4:52 AM