This is an archive of the discontinued LLVM Phabricator instance.

[Scalarizer] Treat values from unreachable blocks as undef
ClosedPublic

Authored by uabelho on Nov 13 2019, 4:27 AM.

Details

Summary

When scalarizing PHI nodes we might try to examine/rewrite
InsertElement nodes in predecessors. If those predecessors
are unreachable from entry, then the IR in those blocks could
have unexpected properties resulting in infinite loops in
Scatterer::operator[].
By simply treating values originating from instructions in
unreachable blocks as undef we do not need to analyse them
further.

This fixes PR41723.

Diff Detail

Event Timeline

uabelho created this revision.Nov 13 2019, 4:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 13 2019, 4:27 AM
bjope added a subscriber: bjope.Nov 13 2019, 11:26 AM
bjope accepted this revision.Nov 14 2019, 10:46 PM

LGTM!

This revision is now accepted and ready to land.Nov 14 2019, 10:46 PM
This revision was automatically updated to reflect the committed changes.