This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][Future] Branch Distance Estimation For Prefixed Instructions
ClosedPublic

Authored by stefanp on Jan 12 2020, 8:53 AM.

Details

Summary

By adding the prefixed instructions the branch distances are no longer computed correctly. Since prefixed instructions cannot cross a 64 byte boundary we have to assume that a prefixed instruction may have a nop prepended to it. This patch tries to take that nop into consideration when computing the size of basic blocks.

Diff Detail

Event Timeline

stefanp created this revision.Jan 12 2020, 8:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2020, 8:53 AM
stefanp updated this revision to Diff 237549.Jan 12 2020, 10:07 AM

Added full context.

nemanjai accepted this revision.Jan 13 2020, 7:13 AM

Aside from a couple of minor nits, LGTM.

llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
161

s/You cannot have/It is not possible for

llvm/test/CodeGen/PowerPC/alignlongjumptest.mir
2

Minor nit: since you are splitting the run directives across multiple lines, might as well keep them to 80 columns. It appears that this is a bit wider.

This revision is now accepted and ready to land.Jan 13 2020, 7:13 AM
jsji added a reviewer: Restricted Project.Jan 13 2020, 7:29 AM
jsji added a project: Restricted Project.
stefanp updated this revision to Diff 237780.Jan 13 2020, 2:16 PM

Addressed review comments.

amyk added a subscriber: amyk.Jan 13 2020, 6:42 PM
amyk added inline comments.
llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
151

s/iteself/itself

This revision was automatically updated to reflect the committed changes.