This is an archive of the discontinued LLVM Phabricator instance.

[CGP] Fix UB when removing trivial PHINode
ClosedPublic

Authored by evgeny777 on Mar 8 2019, 9:52 AM.

Details

Summary

When one of GEP operands is a trivial PHI, it's possible that we do RAUW leaving asserting value handle in the map.
This causes assertion in build with enabled assertions and UB in splitLargeGEPOffsets when assertions are disabled.

Diff Detail

Repository
rL LLVM

Event Timeline

evgeny777 created this revision.Mar 8 2019, 9:52 AM
efriedma accepted this revision.Mar 8 2019, 11:37 AM

LGTM with one nit.

test/CodeGen/AArch64/cgp-trivial-phi-node.ll
3 ↗(On Diff #189875)

Don't need REQUIRES: asserts; presumably the test should still behave the same way even without assertions. :)

This revision is now accepted and ready to land.Mar 8 2019, 11:37 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2019, 3:10 AM