This is an archive of the discontinued LLVM Phabricator instance.

[BPI][NFC] Consolidate code to deal with SCCs under a dedicated data structure.
ClosedPublic

Authored by ebrevnov on Jul 24 2020, 4:57 AM.

Details

Summary

In order to facilitate review of D79485 here is a small NFC change which restructures code around handling of SCCs in BPI.

Diff Detail

Event Timeline

ebrevnov created this revision.Jul 24 2020, 4:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2020, 4:57 AM
davidxl added inline comments.Jul 24 2020, 10:07 AM
llvm/include/llvm/Analysis/BranchProbabilityInfo.h
194

Prefer the original name here. Also why changing bool to uint32_t?

197

keep original name

199

Prefer original name SccNums (at least for this patch).

200

original name

205

Document the interfaces -- what return is expected.

ebrevnov marked 3 inline comments as done.Jul 27 2020, 4:56 AM
ebrevnov added inline comments.
llvm/include/llvm/Analysis/BranchProbabilityInfo.h
194

Old code accounted for header blocks only by keeping a map between basic block to a boolean value. New code associates basic blocks with one or several values from SccBlockType. That's why 'bool' was replaced with 'uint32_t'.

In other words we are able to classify basic blocks as either Inner or Header and/or Exiting. That's why keeping "Header" in the type name has now sense now.

197

"Header" has no sense now. It should be changed to something. Please suggest alternatives.

ebrevnov updated this revision to Diff 280857.Jul 27 2020, 5:06 AM

Updated as requested.

This revision is now accepted and ready to land.Jul 27 2020, 10:58 AM