This is an archive of the discontinued LLVM Phabricator instance.

[CodeGenPrepare] avoid crashing from replacing a phi twice
ClosedPublic

Authored by JesperAntonsson on Mar 14 2019, 5:26 AM.

Details

Summary

This is a fix to bug 41052:
https://bugs.llvm.org/show_bug.cgi?id=41052

While trying to optimize a memory instruction in a dead basic block, we end up registering the same phi for replacement twice. This patch avoids registering more than the first replacement candidate for a phi.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2019, 5:26 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript
aprantl accepted this revision.Mar 14 2019, 9:30 AM
This revision is now accepted and ready to land.Mar 14 2019, 9:30 AM

I'll push this for JesperAntonsson in a bit since he's having some environment issues.

This revision was automatically updated to reflect the committed changes.