[PATCH] D134429: [DebugInfo][LICM] Drop DebugLoc from IntrinsicInst when hoisting
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 26 14:33:58 PDT 2022
rnk added a comment.
In D134429#3815692 <https://reviews.llvm.org/D134429#3815692>, @probinson wrote:
> Offhand, handling non-call intrinsic functions the same way as hoisting any other instruction seems like the way to go.
+1,
> The test case looks like it could be more focused, it doesn't look complicated enough to need to be generated from C source.
================
Comment at: llvm/lib/IR/DebugInfo.cpp:827
if (!isa<CallBase>(this)) {
setDebugLoc(DebugLoc());
return;
----------------
We now have three instances of `setDebugLoc(DebugLoc())` in this function. I think the "early return" guidance is leading us to code duplication.
Can you please refactor this so that we calculate the conditions under which we want to apply a line zero location, and have that be the early return case? It is, if this is an intrinsic which may lower to a call, or a non-intrinsic function call.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134429/new/
https://reviews.llvm.org/D134429
More information about the llvm-commits
mailing list