This is an archive of the discontinued LLVM Phabricator instance.

[GVN] Execute performLoopLoadPRE ahead of PerformLoadPRE
ClosedPublic

Authored by jaykang10 on Aug 17 2021, 6:05 AM.

Details

Summary

There are cfgs which both of loop load pre and load pre can handle.

In this case, it could be better to perform loop load pre first because it can reduce the number of execution of load or it can help sccp pass propagate constant.

It fixes https://bugs.llvm.org/show_bug.cgi?id=51141

Diff Detail

Event Timeline

jaykang10 created this revision.Aug 17 2021, 6:05 AM
jaykang10 requested review of this revision.Aug 17 2021, 6:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2021, 6:05 AM
nikic added a subscriber: nikic.Aug 19 2021, 12:27 PM

Could you please pre-commit the test, so the difference becomes visible?

jaykang10 updated this revision to Diff 367736.Aug 20 2021, 1:56 AM

Updated test output with pre-committed test.

Could you please pre-commit the test, so the difference becomes visible?

Yep, done. Thanks for comment!

nikic accepted this revision.Aug 22 2021, 12:49 PM

LGTM

This revision is now accepted and ready to land.Aug 22 2021, 12:49 PM

@nikic Thanks for updating code. Let me push this change.

This revision was landed with ongoing or failed builds.Aug 24 2021, 1:51 AM
This revision was automatically updated to reflect the committed changes.
fhahn added a comment.Feb 4 2022, 10:07 AM

It looks like this may cause a regression where we fail to remove some dead code https://github.com/llvm/llvm-project/issues/53322

@jaykang10 it would be great if you could take a look