[PATCH] D127134: [llvm][DeadArgumentElimination] Add DW_CC_nocall to function metadata when all return values are removed
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 16:47:48 PDT 2022
dblaikie 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())
----------------
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.
================
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
----------------
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)
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