This is an archive of the discontinued LLVM Phabricator instance.

[NFC][LoopUtils] Use RewritePhi::ExpansionPoint for Inst to be replaced.
AbandonedPublic

Authored by HsiangKai on Jul 18 2021, 9:27 PM.

Details

Summary

The instruction to be replaced is recorded in RewritePhi::ExpansionPoint
when collecting RewritePhiSet. We could use the field directly. Besides
this, move Inst closer to its usage.

Diff Detail

Event Timeline

HsiangKai created this revision.Jul 18 2021, 9:27 PM
HsiangKai requested review of this revision.Jul 18 2021, 9:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2021, 9:27 PM

Any tests showing the difference?

Any tests showing the difference?

There should be no difference for the modification.
In LoopUtils.cpp:1337, the structure RewritePhi is initialized. PN->getIncomingValue(Phi.Ith) should be equal to Phi.ExpansionPoint.

reames requested changes to this revision.Aug 17 2021, 9:24 AM

Personally, I find the existing code much easier to read than the new code. Patch rejected, unless you can justify why this is useful.

This revision now requires changes to proceed.Aug 17 2021, 9:24 AM
HsiangKai abandoned this revision.Aug 27 2021, 8:40 AM