[PATCH] D134428: [DebugInfo][InferAddressSpaces] Propagate DebugLoc when cloning an instruction in InferAddressSpaces
Juan Manuel Martinez CaamaƱo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 27 02:02:11 PDT 2022
jmmartinez added a comment.
In D134428#3816048 <https://reviews.llvm.org/D134428#3816048>, @dblaikie wrote:
> & also, I assume/but would like confirmed that this new instruction will for sure be going into the same BB as the old instruciton?(so there are no hoisting/profile problem concerns)
Good question!
Yes it's going exactly in the same place. The code surrounding the `setDebugLoc` is the following:
if (Instruction *I = dyn_cast<Instruction>(V)) {
Value *NewV = cloneInstructionWithNewAddressSpace(
I, NewAddrSpace, ValueWithNewAddrSpace, PredicatedAS, UndefUsesToFix);
if (Instruction *NewI = dyn_cast_or_null<Instruction>(NewV)) {
if (NewI->getParent() == nullptr) {
NewI->insertBefore(I);
NewI->takeName(I);
NewI->setDebugLoc(I->getDebugLoc());
}
}
}
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134428/new/
https://reviews.llvm.org/D134428
More information about the llvm-commits
mailing list