This is an archive of the discontinued LLVM Phabricator instance.

[SDAG] Fix Stale SDNode usage in visitAND
ClosedPublic

Authored by niravd on Mar 24 2017, 11:40 AM.

Details

Summary

Reorder CombineTo Calls to prevent potential use of deleted node.
Fixes PR32372.

Event Timeline

niravd created this revision.Mar 24 2017, 11:40 AM
RKSimon added inline comments.Mar 24 2017, 12:02 PM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
3538–3542

Duplicate SDValue(Load, 0) - change to:

SDValue NewLoad(Load, 0);
CombineTo(N, NewLoad);

??

test/CodeGen/SystemZ/pr32372.ll
5

Rename to pr32372 ? Any further cleanup possible?

niravd updated this revision to Diff 93136.Mar 27 2017, 8:02 AM
niravd marked an inline comment as done.

Minor cleanup

niravd added inline comments.Mar 27 2017, 8:03 AM
test/CodeGen/SystemZ/pr32372.ll
5

Spent a little time attempting to strip it down while preserving the bug and was unsuccessful.

RKSimon edited edge metadata.Mar 27 2017, 8:10 AM

LGTM @jnspaulsson do you have any comments?

uweigand edited edge metadata.Mar 28 2017, 6:10 AM

Test case LGTM. Thanks!

I think that's quorum. Will someone accept the revision?

jonpa accepted this revision.Mar 28 2017, 6:45 AM
jonpa added a subscriber: jonpa.

Thanks very much for fixing this - it looks like all parts are approved now.

This revision is now accepted and ready to land.Mar 28 2017, 6:45 AM
This revision was automatically updated to reflect the committed changes.