This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Properly copy ExtraInfo on RAUW
ClosedPublic

Authored by melver on Aug 1 2022, 1:57 AM.

Details

Summary

During SelectionDAG legalization SDNodes with associated extra info may
be replaced with a new SDNode. Preserve associated extra info on
ReplaceAllUsesWith and remove entries in DeallocateNode.

Depends on D130880

Diff Detail

Event Timeline

melver created this revision.Aug 1 2022, 1:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 1:57 AM
melver requested review of this revision.Aug 1 2022, 1:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 1:57 AM
melver updated this revision to Diff 450026.Aug 4 2022, 9:57 AM

Rebase.

Would you be able to reproduce the issue as a new test in TEST_F(SelectionDAGAddressAnalysisTest ?

melver updated this revision to Diff 451407.Aug 10 2022, 3:17 AM

Add unit test for RAUW.
Note: Since SelectionDAG construction needs a target, the AArch64 test is used here (as done for several other test cases that are arch-independent).

Would you be able to reproduce the issue as a new test in TEST_F(SelectionDAGAddressAnalysisTest ?

That test seems only related to BaseIndexOffset::computeAliasing(). Added to a different test that seems to be used for that (needs a target, so there's an AArch64 one).

vitalybuka accepted this revision.Aug 10 2022, 11:05 AM
vitalybuka added inline comments.
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
11819

this assert is inconsistent with the rest of the code

This revision is now accepted and ready to land.Aug 10 2022, 11:05 AM
melver updated this revision to Diff 451648.Aug 10 2022, 3:11 PM
  • Assert message.
melver marked an inline comment as done.Aug 10 2022, 3:14 PM
melver added inline comments.
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
11819

It's similar to the one in transferDbgValues(). Only that copyExtraInfo already takes the unwrapped pointers as it makes usage a bit easier where we don't have the source SDValue. I'd like to keep it to prevent easily avoidable mistakes.

melver updated this revision to Diff 456599.Aug 30 2022, 3:42 AM
melver marked an inline comment as done.

Rebase.

This revision was automatically updated to reflect the committed changes.