[LoopInfo] Fix a typo in compareLoops
authorKazu Hirata <kazu@google.com>
Mon, 18 Jan 2021 22:53:21 +0000 (14:53 -0800)
committerKazu Hirata <kazu@google.com>
Mon, 18 Jan 2021 22:53:22 +0000 (14:53 -0800)
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

llvm/include/llvm/Analysis/LoopInfoImpl.h

index 0730225..426b349 100644 (file)
@@ -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) {