-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[DLCov][NFC] Annotate intentionally-blank DebugLocs in existing code #136192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1527,6 +1527,7 @@ bool IndVarSimplify::canonicalizeExitCondition(Loop *L) { | |
auto *NewRHS = CastInst::Create( | ||
Instruction::Trunc, RHS, LHSOp->getType(), "", | ||
L->getLoopPreheader()->getTerminator()->getIterator()); | ||
NewRHS->setDebugLoc(DebugLoc::getDropped()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is dropped right here, why not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are docs on the "How to update debug info" page and in lighter detail in DebugLoc.h, added by the previous patch in the stack. In this particular case, I didn't immediately recall the rationale - meaning this should have a comment. I believe in this case though, |
||
ICmp->setOperand(Swapped ? 1 : 0, LHSOp); | ||
ICmp->setOperand(Swapped ? 0 : 1, NewRHS); | ||
// Samesign flag cannot be preserved after narrowing the compare. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1724,7 +1724,7 @@ static bool sink(Instruction &I, LoopInfo *LI, DominatorTree *DT, | |
Instruction *New = sinkThroughTriviallyReplaceablePHI( | ||
PN, &I, LI, SunkCopies, SafetyInfo, CurLoop, MSSAU); | ||
// As we sink the instruction out of the BB, drop its debug location. | ||
New->dropLocation(); | ||
New->setDebugLoc(DebugLoc::getDropped()); | ||
PN->replaceAllUsesWith(New); | ||
eraseInstruction(*PN, *SafetyInfo, MSSAU); | ||
Changed = true; | ||
|
@@ -2249,7 +2249,7 @@ bool llvm::promoteLoopAccessesToScalars( | |
if (SawUnorderedAtomic) | ||
PreheaderLoad->setOrdering(AtomicOrdering::Unordered); | ||
PreheaderLoad->setAlignment(Alignment); | ||
PreheaderLoad->setDebugLoc(DebugLoc()); | ||
PreheaderLoad->dropLocation(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the change to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a mistake on my part, along with replacing |
||
if (AATags && LoadIsGuaranteedToExecute) | ||
PreheaderLoad->setAAMetadata(AATags); | ||
|
||
|
@@ -2802,6 +2802,7 @@ static bool hoistMulAddAssociation(Instruction &I, Loop &L, | |
auto *NewBO = | ||
BinaryOperator::Create(Ins->getOpcode(), LHS, RHS, | ||
Ins->getName() + ".reass", Ins->getIterator()); | ||
NewBO->setDebugLoc(DebugLoc::getDropped()); | ||
NewBO->copyIRFlags(Ins); | ||
if (VariantOp == Ins) | ||
VariantOp = NewBO; | ||
|
@@ -2858,6 +2859,7 @@ static bool hoistBOAssociation(Instruction &I, Loop &L, | |
|
||
auto *NewBO = BinaryOperator::Create( | ||
Opcode, LV, Inv, BO->getName() + ".reass", BO->getIterator()); | ||
NewBO->setDebugLoc(DebugLoc::getDropped()); | ||
|
||
// Copy NUW for ADDs if both instructions have it. | ||
if (Opcode == Instruction::Add && BO->hasNoUnsignedWrap() && | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why temporary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Temporary" is used for instructions that won't have generated machine code, i.e. when we finish compilation, we wouldn't expect to see any line table entry for that instruction.
UnreachableInst
s are the most typical case of this, though there may be exceptions (off the top of my head there might be a case in the LoopVectorizer where we assign a meaningful DebugLoc to an unreachable).