[PATCH] D42541: [DeadArgumentElimination] Preserve llvm.dbg.values's first argument

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 11:51:31 PST 2018


mattd added a comment.

Hi @djtodoro, thanks for looking into this.  I have a few comments/suggestions noted inline.



================
Comment at: lib/IR/Value.cpp:420
+    if (PreserveDbg)
+	  ValueAsMetadata::handleRAUWPreserveDbg(this, New);
+	else
----------------
Just a suggestion, can we keep the name as handleRAWU, and call this  directly with the bool PreserveDbg here? I think that would allow us to get rid of the  handlers on line 442 in Metadata.cpp.



================
Comment at: lib/Transforms/IPO/DeadArgumentElimination.cpp:968
       // version.
-      I->replaceAllUsesWith(&*I2);
+      I->replaceMetadataUsesWithPDBG(&*I2);
       I2->takeName(&*I);
----------------
The term 'PDBG' in replaceMetadataUsesWithPDBG makes me  think of PDB (program database), this change is about DI so the term might be misleading to some. Perhaps we just spell-out Preserve here,  or use PDbg, or remove the handler and add a default bool to replaceAllUsesWith().


https://reviews.llvm.org/D42541





More information about the llvm-commits mailing list