This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Avoid Node Update assertion due to AND simplification
ClosedPublic

Authored by niravd on Jul 17 2018, 12:04 PM.

Details

Summary

Check for construction-time folding for incomplete AND nodes in BackwardsPropagateMask. Fixes PR38185.

Diff Detail

Repository
rL LLVM

Event Timeline

niravd created this revision.Jul 17 2018, 12:04 PM

This looks like an odd solution to me, I haven't seen TokenFactors used like that before. Isn't it okay for the AND to be folded? Why not just check that the AND hasn't be folded into a constant before trying to update its, now non-existent, operands?

niravd updated this revision to Diff 156098.Jul 18 2018, 9:43 AM
niravd retitled this revision from [DAG] Use temporary to prevent construction-time optimziation of AND. to [DAG] Avoid Node Update assertion due to AND simplification.
niravd edited the summary of this revision. (Show Details)

Using a temporary node avoids the intermediate loop issue, though a better temp node structure would be preferable.
But you're correct that any simplification to the AND obviates the need for fixup so let's us that.

samparker accepted this revision.Jul 19 2018, 12:49 AM

LGTM, thanks!

This revision is now accepted and ready to land.Jul 19 2018, 12:49 AM
This revision was automatically updated to reflect the committed changes.