[llvm-branch-commits] [llvm] c22bc5f - [SimplifyCFG] SwitchToLookupTable(): don't insert a DomTree edge that already exists

Roman Lebedev via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jan 11 15:14:47 PST 2021


Author: Roman Lebedev
Date: 2021-01-12T02:09:46+03:00
New Revision: c22bc5f1f8b295674aa3a62dced8a39ad3d2aa02

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

LOG: [SimplifyCFG] SwitchToLookupTable(): don't insert a DomTree edge that already exists

SI is the terminator of BB, so the edge we are adding obviously already existed.

Indeed, this change does not have a test coverage change.
This failure has been exposed in an existing test coverage
by a follow-up patch that switches to lazy domtreeupdater mode,
and removes domtree verification from
SimplifyCFGOpt::simplifyOnce()/SimplifyCFGOpt::run(),
IOW it does not appear feasible to add dedicated test coverage here.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 62cab573a819..747eb522df11 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -5973,7 +5973,6 @@ static bool SwitchToLookupTable(SwitchInst *SI, IRBuilder<> &Builder,
     RangeCheckBranch =
         Builder.CreateCondBr(Cmp, LookupBB, SI->getDefaultDest());
     Updates.push_back({DominatorTree::Insert, BB, LookupBB});
-    Updates.push_back({DominatorTree::Insert, BB, SI->getDefaultDest()});
   }
 
   // Populate the BB that does the lookups.


        


More information about the llvm-branch-commits mailing list