This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Don't map a TableId to itself in the ReplacedValues map
ClosedPublic

Authored by bjope on Jun 20 2018, 6:27 AM.

Details

Summary

Found some regressions (infinite loop in DAGTypeLegalizer::RemapId)
after r334880. This patch makes sure that we do map a TableId to
itself.

Diff Detail

Repository
rL LLVM

Event Timeline

bjope created this revision.Jun 20 2018, 6:27 AM
bjope added inline comments.Jun 20 2018, 6:39 AM
lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
578 ↗(On Diff #152074)

Maybe an alternative solution could be to allow mapping of a value to itself in ReplacedValues, and then we could simply return Id here when Id==I->second.

658 ↗(On Diff #152074)

I think we still need to do this replacement even if FromId == ToId, since From.getNode() != To.getNode(), right?

niravd accepted this revision.Jun 20 2018, 8:27 AM

LGTM. Thanks!

lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
658 ↗(On Diff #152074)

Yes.

This revision is now accepted and ready to land.Jun 20 2018, 8:27 AM
This revision was automatically updated to reflect the committed changes.