This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Change return type for 'shouldOptimizeForSize'
AbandonedPublic

Authored by ebrevnov on Nov 20 2019, 2:29 AM.

Details

Reviewers
reames
tellenbach
Summary

Currently 'shouldOptimizeForSize' returns bool to indicate if function should be optimized for size or not. When 'false' is returned it could mean two things. Either we don't need to optimize for size or there is no information. For upcoming changes in LoopVectorizer I need to distinguish between these two cases.

Event Timeline

ebrevnov created this revision.Nov 20 2019, 2:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 20 2019, 2:29 AM
Harbormaster completed remote builds in B41231: Diff 230226.

Hi,

this looks good beside some minor inline comments.

Could you also add a test for the case of no profile being available? shouldOptimizeForSize should then be tested for None instead of false.

Thanks!

llvm/include/llvm/CodeGen/MachineSizeOpts.h
27

Some word ist missing here: "if there is no info ? the profile"

33

Same here: Missing word in comment.

llvm/include/llvm/Transforms/Utils/SizeOpts.h
39

Please clang-format the whole signature. I think this would move BFIT *BFI) { one line up.

78–80

Same as above: Missing word in comment.

83–86

Same as above: Missing word in comment.

86

Please clang-format the whole signature.

ebrevnov abandoned this revision.Dec 5 2019, 12:46 AM

It turned out that I should change an approach for D67805 and this change is not needed anymore. Thanks for your time anyway. Abandoning.