[llvm] c604a2c - Fix buildbots after D140901

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 02:26:54 PDT 2023


Author: OCHyams
Date: 2023-04-26T10:26:14+01:00
New Revision: c604a2c2c0760c3ace9452f764aefef3299b424f

URL: https://github.com/llvm/llvm-project/commit/c604a2c2c0760c3ace9452f764aefef3299b424f
DIFF: https://github.com/llvm/llvm-project/commit/c604a2c2c0760c3ace9452f764aefef3299b424f.diff

LOG: Fix buildbots after D140901

Commit 3feea34d77f65f0b68520bb7bf372580a72794ad (D140901) should not have
removed the debug label handling code.

Buildbot: https://lab.llvm.org/buildbot/#/builders/139/builds/39813

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/Local.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 1a714998c528..53d1f8b62d1b 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -428,6 +428,12 @@ bool llvm::wouldInstructionBeTriviallyDead(Instruction *I,
   if (isa<DbgVariableIntrinsic>(I))
     return false;
 
+  if (DbgLabelInst *DLI = dyn_cast<DbgLabelInst>(I)) {
+    if (DLI->getLabel())
+      return false;
+    return true;
+  }
+
   if (auto *CB = dyn_cast<CallBase>(I))
     if (isRemovableAlloc(CB, TLI))
       return true;


        


More information about the llvm-commits mailing list