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

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 06:07:24 PST 2018


djtodoro added inline comments.


================
Comment at: lib/IR/Metadata.cpp:419
     }
-    if (getLocalFunction(From) && getLocalFunction(To) &&
-        getLocalFunction(From) != getLocalFunction(To)) {
+    if (getLocalFunctionMetadata(From) && getLocalFunctionMetadata(To) &&
+        getLocalFunctionMetadata(From) != getLocalFunctionMetadata(To)) {
----------------
aprantl wrote:
> One of these checks is redundant. How about:
> 
> ```
> if (DISubprogram *FromSP = getLocalFunctionMetadata(From))
>   if (getLocalFunctionMetadata(To) == FromSP)
> 
> ```
@aprantl Thanks for your comments! Maybe it's better for this to go as separate NFC commit?


https://reviews.llvm.org/D42541





More information about the llvm-commits mailing list