This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][Future] Remove "unskipableSimplifyCode()" in PPCMIPeephole.cpp
ClosedPublic

Authored by NeHuang on Apr 20 2020, 1:56 PM.

Details

Summary

unskipableSimplifyCode() was added to handle unsafe BL8_NOTOC instruction when TOC was not completely removed. The function is not needed after confirming no TOC usage with PC Relative addressing.

Diff Detail

Event Timeline

NeHuang created this revision.Apr 20 2020, 1:56 PM
anil9 added a subscriber: anil9.Apr 20 2020, 9:24 PM
anil9 added inline comments.
llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
128–132

nit : For both the comment and the message in the assert. Ending the sentences with just "PC Relative" seems incorrect, may be use PC Relative instructions/functionality/operations. I see many asserts ending with or without full stops and some with exclamation sign. Not sure which one is correct.

stefanp accepted this revision.Apr 24 2020, 12:53 PM

Minor wording as Anil pointed out.
LGTM.

llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
128–132

You could use PC Relative addressing because that's what it really is. It is a way to generate the address of something without using the TOC pointer in R2.

This revision is now accepted and ready to land.Apr 24 2020, 12:53 PM
nemanjai accepted this revision.Apr 24 2020, 2:58 PM

LGTM. Thanks for cleaning this up.

llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
128–132

I don't think we should be mentioning R2 as that doesn't really indicate what the problem is:
TOC pointer use in function that uses PC-Relative addressing

NeHuang retitled this revision from [PC Relative][Expolitation] Remove "unskipableSimplifyCode()" in PPCMIPeephole.cpp to [PowerPC][Future] Remove "unskipableSimplifyCode()" in PPCMIPeephole.cpp.Apr 27 2020, 12:14 PM
NeHuang updated this revision to Diff 260405.Apr 27 2020, 12:25 PM

Thanks all for the review comment.
Addressed review comment.

NeHuang marked 3 inline comments as done.Apr 27 2020, 12:26 PM
This revision was automatically updated to reflect the committed changes.