[llvm] [indvars] Missing variables at Og: (PR #69920)

Carlos Alberto Enciso via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 05:51:59 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) {
----------------
CarlosAlbertoEnciso wrote:

Reworked the code to take into account that point.

https://github.com/llvm/llvm-project/pull/69920


More information about the llvm-commits mailing list