[llvm] [IPSCCP] Variable not visible at Og: (PR #66745)

Felipe de Azevedo Piovezan via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 08:35:35 PDT 2023


================
@@ -371,6 +372,52 @@ static bool runIPSCCP(
       StoreInst *SI = cast<StoreInst>(GV->user_back());
       SI->eraseFromParent();
     }
+
+    // Try to create a debug constant expression for the glbal variable
+    // initializer value.
+    SmallVector<DIGlobalVariableExpression *, 1> GVEs;
+    GV->getDebugInfo(GVEs);
+    if (GVEs.size() == 1) {
----------------
felipepiovezan wrote:

Let's favour an early exit instead of big nested blocks (this will be possible with the helper function idea I mentioned above)
https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code

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


More information about the llvm-commits mailing list