Skip to content

Commit 7b2cb0b

Browse files
committed
Add unknown comments
1 parent 0705143 commit 7b2cb0b

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
@@ -3362,10 +3362,14 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
33623362
Returns[0]->eraseFromParent();
33633363
ReturnBB->eraseFromParent();
33643364
} else if (!CB.use_empty()) {
3365-
// No returns, but something is using the return value of the call. Just
3366-
// nuke the result.
3365+
// In this case there are no returns to use, so there is no clear source
3366+
// location for the "return".
3367+
// FIXME: It may be correct to use the scope end line of the function here,
3368+
// since this likely means we are falling out of the function.
33673369
if (CreatedBranchToNormalDest)
33683370
CreatedBranchToNormalDest->setDebugLoc(DebugLoc::getUnknown());
3371+
// No returns, but something is using the return value of the call. Just
3372+
// nuke the result.
33693373
CB.replaceAllUsesWith(PoisonValue::get(CB.getType()));
33703374
}
33713375

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)