[PATCH] D13363: [DeadStoreElimination] Add support for non-local DSE
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 9 18:39:39 PST 2015
majnemer added inline comments.
================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:678
@@ +677,3 @@
+findSafePreds(SmallVectorImpl<BasicBlock *> &PredBlocks,
+ SmallSetVector<BasicBlock*, 8> &SafeBlocks,
+ BasicBlock *BB, DominatorTree *DT) {
----------------
Pointers lean right.
================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:680
@@ +679,3 @@
+ BasicBlock *BB, DominatorTree *DT) {
+ for (auto I = pred_begin(BB), E = pred_end(BB); I != E; ++I) {
+ BasicBlock *Pred = *I;
----------------
Can a range-based for loop be used here? Something like: `for (const BasicBlock *Pred : *BB)`
================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:712
@@ +711,3 @@
+
+ for (auto I = Pointers.begin(), E = Pointers.end(); I != E; ++I) {
+ Value *BObj = *I;
----------------
Likewise, can you use one here?
================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:741
@@ +740,3 @@
+ // Keep track of all predecessor blocks that are safe to search through
+ SmallSetVector<BasicBlock*, 8> SafeBlocks;
+ SafeBlocks.insert(BB);
----------------
Pointers lean right.
Repository:
rL LLVM
http://reviews.llvm.org/D13363
More information about the llvm-commits
mailing list