[llvm] [DebugInfo] Set all dbg.value intrinsics to be tail-calls (PR #73661)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 02:47:48 PST 2023


================
@@ -988,9 +988,11 @@ Instruction *DIBuilder::insertDbgValueIntrinsic(Value *V,
                                                 DIExpression *Expr,
                                                 const DILocation *DL,
                                                 Instruction *InsertBefore) {
-  return insertDbgValueIntrinsic(
+  Instruction *DVI = insertDbgValueIntrinsic(
       V, VarInfo, Expr, DL, InsertBefore ? InsertBefore->getParent() : nullptr,
       InsertBefore);
+  cast<CallInst>(DVI)->setTailCall();
----------------
OCHyams wrote:

Would it be better to put this change in `DIBuilder::insertDbgIntrinsic`, which seems to be the common leaf between all the `insertDbgXIntrinsic` functions (that's where the `IRBuilder::CreateCall` call is)?

https://github.com/llvm/llvm-project/pull/73661


More information about the llvm-commits mailing list