[llvm] [indvars] Missing variables at Og: (PR #69920)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 3 05:46:13 PST 2024
================
@@ -1341,6 +1342,36 @@ static bool checkIsIndPhi(PHINode *Phi, Loop *L, ScalarEvolution *SE,
return InductionDescriptor::isInductionPHI(Phi, L, SE, ID);
}
+void llvm::addDebugValuesToLoopVariable(Loop *L, Value *ExitValue,
+ PHINode *PN) {
+ SmallVector<BasicBlock *> ExitBlocks;
+ L->getExitBlocks(ExitBlocks);
+ SmallVector<DbgVariableIntrinsic *> DbgUsers;
+ findDbgUsers(DbgUsers, PN);
+ for (auto *DebugUser : DbgUsers) {
+ // Skip debug-users with variadic variable locations; they will not,
+ // get updated, which is fine as that is the existing behaviour.
+ if (DebugUser->hasArgList())
+ continue;
+ for (BasicBlock *Exit : ExitBlocks) {
----------------
nikic wrote:
The ExitValue is specific to one exit block. Why are you updating all of them here?
https://github.com/llvm/llvm-project/pull/69920
More information about the llvm-commits
mailing list