This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] return the result of the GEP of PHI transformation early
ClosedPublic

Authored by danilaml on Dec 14 2022, 2:36 AM.

Details

Summary

Without this change this function could return nullptr if no further
transformation took place making InstCombine pass incorrectly report no
IR changes preventing analyses invalidation.

Diff Detail

Event Timeline

danilaml created this revision.Dec 14 2022, 2:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 2:36 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
danilaml requested review of this revision.Dec 14 2022, 2:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 2:36 AM
danilaml added a comment.EditedDec 14 2022, 2:42 AM

Discovered when some downstream analysis wasn't invalidated when this transformation was the only change instcombine made leading to a miscompile. Not sure how to write a good test for this. I remember there being a pass that verified that passes correctly reported changed IR but I think it only worked for legacy pm.

danilaml retitled this revision from [InstCombine] return the result of the GEP of PHI transformation early to [InstCombine] return the result of the GEP of PHI transformation early.Dec 14 2022, 2:46 AM
danilaml added reviewers: nikic, lgerbarg, spatel.
nikic accepted this revision.Dec 14 2022, 2:49 AM

LG, I don't think we need a test for this.

This revision is now accepted and ready to land.Dec 14 2022, 2:49 AM