LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 35338 - Clients of SelectionDAG::ReplaceAllUsesWith drop debug info, & are inconsistent
Summary: Clients of SelectionDAG::ReplaceAllUsesWith drop debug info, & are inconsistent
Status: NEW
Alias: None
Product: libraries
Classification: Unclassified
Component: Common Code Generator Code (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Vedant Kumar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-16 16:29 PST by Vedant Kumar
Modified: 2018-11-08 09:37 PST (History)
10 users (show)

See Also:
Fixed By Commit(s):


Attachments
Rough patch to enforce "don't drop debug info" in CombineTo(). (1.32 KB, patch)
2017-11-17 13:49 PST, Vedant Kumar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vedant Kumar 2017-11-16 16:29:55 PST
There are a few issues here:

- CombineTo() calls ReplaceAllUsesWith(), which calls transferDbgValues(). If we assert that debug line/value information is preserved after the RAUW in CombineTo(), a bunch of tests fail.

- Clients of transferDbgValues() pass it SDValues which are attached to SDNodes with invalidated debug info. It seems unfortunate that we'd even try to propagate invalid debug info.

- One overload of ReplaceAllUsesWith(From, To) requires From != To, but another doesn't. This is partly annoying, but may also be masking correctness issues.
Comment 1 Vedant Kumar 2017-11-17 13:49:29 PST
Created attachment 19445 [details]
Rough patch to enforce "don't drop debug info" in CombineTo().

I've attached a rough patch which should enforce "don't drop debug info" in CombineTo(), in case anyone wants to poke around with it. I probably won't get to this until after Thanksgiving.