Page MenuHomePhabricator

[loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function
ClosedPublic

Authored by zhuhan0 on Apr 21 2021, 10:25 AM.

Details

Summary

Extract the meat of processLoopStoreOfLoopLoad into a helper function, so that it can be re-used. In https://reviews.llvm.org/D97667 the helper function will be called when we hoise a memcpy instruction from the loop body into loop preheader.

Diff Detail

Event Timeline

zhuhan0 created this revision.Apr 21 2021, 10:25 AM
zhuhan0 requested review of this revision.Apr 21 2021, 10:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2021, 10:25 AM
zhuhan0 updated this revision to Diff 339317.Apr 21 2021, 10:41 AM

Add back comments.

zhuhan0 edited the summary of this revision. (Show Details)Apr 21 2021, 10:43 AM
zhuhan0 added reviewers: lebedev.ri, zino, wenlei, hoy.
hoy added inline comments.Apr 21 2021, 3:27 PM
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
1087–1092

Nit: reuse LoadPtr below?

zhuhan0 added inline comments.Apr 22 2021, 1:49 PM
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
1087–1092

Could you clarify? Where should I reuse LoadPtr?

hoy added inline comments.Apr 22 2021, 2:00 PM
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
1087–1092

There is a use of LI->getPointerOperand() at line 1088 that can be replaced by LoadPtr. Sorry for the confusion.

zhuhan0 added inline comments.Apr 22 2021, 2:04 PM
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
1087–1092

Ah got it. Will do.

zhuhan0 updated this revision to Diff 339795.Apr 22 2021, 3:24 PM

Address comment.

zhuhan0 marked 2 inline comments as done.Apr 22 2021, 3:25 PM
hoy accepted this revision.Apr 22 2021, 3:27 PM

LGTM, thanks.

This revision is now accepted and ready to land.Apr 22 2021, 3:27 PM
This revision was landed with ongoing or failed builds.Apr 27 2021, 1:43 PM
This revision was automatically updated to reflect the committed changes.