This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyCFG] Teach SinkCommonCodeFromPredecessors not to replace foldable GEPs with phi-nodes for sinking load/store.
Needs ReviewPublic

Authored by fakepaper56 on Apr 3 2023, 8:36 AM.

Details

Summary

Currently, SinkCommonCodeFromPredecessors may sink load/store instructions whose
pointer operands are foldable GEPs and replacing those GEPs to phi-nodes if
needed. It's ineffecient if those GEPs could be folded to load/store for target.

Diff Detail

Event Timeline

fakepaper56 created this revision.Apr 3 2023, 8:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2023, 8:36 AM
fakepaper56 requested review of this revision.Apr 3 2023, 8:36 AM

The change influences some X86 test cases. Should I also change those tests to fit their original test purpose?

Make LoadStoreUseFoldableGEP consider whether OI is pointer operand index or not.
It's needed since store value may be a GEP instruction.

Rebase and ping.

I guess maybe people are too busy to notice. Perhaps you could create a new PR.

Sure. I will do it.