This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Use HandleSDNode to keep node alive across call to getNegatedExpression.
ClosedPublic

Authored by craig.topper on Sep 9 2022, 12:29 PM.

Details

Summary

getNegatedExpression can delete nodes. If the first call to
getNegatedExpression produced a node that the second call also
manages to create, it might get deleted. Use a HandleSDNode to
ensure it has a use to prevent it from being deleted.

Fixes PR57658.

Diff Detail

Event Timeline

craig.topper created this revision.Sep 9 2022, 12:29 PM
craig.topper requested review of this revision.Sep 9 2022, 12:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 12:29 PM

clang-format

RKSimon accepted this revision.Sep 9 2022, 12:50 PM

LGTM

This revision is now accepted and ready to land.Sep 9 2022, 12:50 PM