Skip to content

Commit b187487

Browse files
committed
Add unknown comments
1 parent 241b3b5 commit b187487

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

llvm/lib/Transforms/Utils/InlineFunction.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3344,10 +3344,14 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
33443344
Returns[0]->eraseFromParent();
33453345
ReturnBB->eraseFromParent();
33463346
} else if (!CB.use_empty()) {
3347-
// No returns, but something is using the return value of the call. Just
3348-
// nuke the result.
3347+
// In this case there are no returns to use, so there is no clear source
3348+
// location for the "return".
3349+
// FIXME: It may be correct to use the scope end line of the function here,
3350+
// since this likely means we are falling out of the function.
33493351
if (CreatedBranchToNormalDest)
33503352
CreatedBranchToNormalDest->setDebugLoc(DebugLoc::getUnknown());
3353+
// No returns, but something is using the return value of the call. Just
3354+
// nuke the result.
33513355
CB.replaceAllUsesWith(PoisonValue::get(CB.getType()));
33523356
}
33533357

llvm/lib/Transforms/Utils/SSAUpdater.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ class SSAUpdaterTraits<SSAUpdater> {
318318
SSAUpdater *Updater) {
319319
PHINode *PHI =
320320
PHINode::Create(Updater->ProtoType, NumPreds, Updater->ProtoName);
321+
// FIXME: Ordinarily we don't care about or try to assign DebugLocs to PHI
322+
// nodes, but loop optimizations may try to use a PHI node as a DebugLoc
323+
// source (e.g. if this is an induction variable), and it's not clear what
324+
// location we could attach here, so mark this unknown for now.
321325
PHI->setDebugLoc(DebugLoc::getUnknown());
322326
PHI->insertBefore(BB->begin());
323327
return PHI;

0 commit comments

Comments
 (0)