Skip to content

Commit 5176797

Browse files
committed
Avoid two lookups. Use using instead of typedef.
Signed-off-by: John Lu <[email protected]>
1 parent 1543488 commit 5176797

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Scalar/Sink.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,12 @@ static bool isSafeToMove(Instruction *Inst, AliasAnalysis &AA,
7575
return true;
7676
}
7777

78-
typedef SmallPtrSet<BasicBlock *, 8> BlocksSet;
78+
using BlocksSet = SmallPtrSet<BasicBlock *, 8>;
7979
static void findStores(SmallPtrSetImpl<Instruction *> &Stores,
8080
BasicBlock *LoadBB, BasicBlock *BB,
8181
BlocksSet &VisitedBlocksSet) {
82-
if (BB == LoadBB || VisitedBlocksSet.contains(BB))
82+
if (BB == LoadBB || !VisitedBlocksSet.insert(BB).second)
8383
return;
84-
VisitedBlocksSet.insert(BB);
8584

8685
for (Instruction &Inst : *BB)
8786
if (Inst.mayWriteToMemory())

0 commit comments

Comments
 (0)