[llvm] 5ef64bb - [globalisel][legalizer] Include newly-dead code in artifact combine checks for DebugLoc loss

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 13:46:02 PDT 2020


Author: Daniel Sanders
Date: 2020-04-17T13:45:44-07:00
New Revision: 5ef64bbf7ac47028d80f0ee71b7636e80b6b419b

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

LOG: [globalisel][legalizer] Include newly-dead code in artifact combine checks for DebugLoc loss

This dead code deletion is part of the combine and the combine
results should account for their locations.

Added: 
    

Modified: 
    llvm/lib/CodeGen/GlobalISel/Legalizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
index 823dceeae288..e00d4fb7428a 100644
--- a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
@@ -283,15 +283,14 @@ Legalizer::legalizeMachineFunction(MachineFunction &MF, const LegalizerInfo &LI,
       if (ArtCombiner.tryCombineInstruction(MI, DeadInstructions,
                                             WrapperObserver)) {
         WorkListObserver.printNewInstrs();
-        LocObserver.checkpoint(
-            VerifyDebugLocs ==
-            DebugLocVerifyLevel::LegalizationsAndArtifactCombiners);
         for (auto *DeadMI : DeadInstructions) {
           LLVM_DEBUG(dbgs() << *DeadMI << "Is dead\n");
           RemoveDeadInstFromLists(DeadMI);
           DeadMI->eraseFromParentAndMarkDBGValuesForRemoval();
         }
-        LocObserver.checkpoint();
+        LocObserver.checkpoint(
+            VerifyDebugLocs ==
+            DebugLocVerifyLevel::LegalizationsAndArtifactCombiners);
         Changed = true;
         continue;
       }


        


More information about the llvm-commits mailing list