[llvm-branch-commits] [llvm] fe301f4 - [LoopInfo] Fix a typo in compareLoops

Kazu Hirata via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jan 18 14:58:20 PST 2021


Author: Kazu Hirata
Date: 2021-01-18T14:53:22-08:00
New Revision: fe301f474977da0b82548652ef4bbd058542d076

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

LOG: [LoopInfo] Fix a typo in compareLoops

The code here is checking to see if two sets are identical.
OtherBlocksSet should point to OtherL->getBlocksSet() instead.

Differential Revision: https://reviews.llvm.org/D94926

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/LoopInfoImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/LoopInfoImpl.h b/llvm/include/llvm/Analysis/LoopInfoImpl.h
index 0730225c342f..426b349c6b8a 100644
--- a/llvm/include/llvm/Analysis/LoopInfoImpl.h
+++ b/llvm/include/llvm/Analysis/LoopInfoImpl.h
@@ -673,7 +673,8 @@ static void compareLoops(const LoopT *L, const LoopT *OtherL,
          "Mismatched basic blocks in the loops!");
 
   const SmallPtrSetImpl<const BlockT *> &BlocksSet = L->getBlocksSet();
-  const SmallPtrSetImpl<const BlockT *> &OtherBlocksSet = L->getBlocksSet();
+  const SmallPtrSetImpl<const BlockT *> &OtherBlocksSet =
+      OtherL->getBlocksSet();
   assert(BlocksSet.size() == OtherBlocksSet.size() &&
          llvm::all_of(BlocksSet,
                       [&OtherBlocksSet](const BlockT *BB) {


        


More information about the llvm-branch-commits mailing list