[PATCH] D127134: [llvm] Add DW_CC_nocall to function debug metadata when either return values or arguments are removed

Venkata Ramanaiah Nalamothu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 01:16:58 PDT 2022


RamNalamothu marked 2 inline comments as done.
RamNalamothu added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1090-1091
+  // interpret the return value.
+  // FIXME: Should we add DW_CC_nocall simply when NFTy != FTy i.e. whenever
+  // an unused return value or an argument is removed?
+  if (!RetTy->isVoidTy() && NRetTy->isVoidTy() && NF->getSubprogram())
----------------
dblaikie wrote:
> I think this FIXME is correct, and we should probably just check if the type matches or not. Happy for that to go into this change rather than being a separate one - and if someone figures out some needle-threading nuance where the types might mismatch but still be call-compatible, they can add that back in later.
Done.


================
Comment at: llvm/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll:4-6
+; Test whether DW_CC_nocall calling convention is added when return values are removed and return type changed to void.
+; RUN: cat %t | grep "define internal fastcc void \@add_name_internal"
+; RUN: cat %t | grep DW_CC_nocall
----------------
dblaikie wrote:
> Generally we don't use 'grep' for tests in LLVM (very old pre-FileCheck tests use this sometimes, but we try to avoid doing it in new tests)
> 
> Please update these to use FileCheck (& you can probably leave the RUN line as-is, I think - without needing to introduce the %t and cat usage)
Fixed.

I didn't knew about that. Thanks for sharing it with me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127134/new/

https://reviews.llvm.org/D127134



More information about the llvm-commits mailing list