[llvm] r220623 - LSR: Minor cleanup after Daniel's patch.
Andrew Trick
atrick at apple.com
Sat Oct 25 12:59:30 PDT 2014
Author: atrick
Date: Sat Oct 25 14:59:30 2014
New Revision: 220623
URL: http://llvm.org/viewvc/llvm-project?rev=220623&view=rev
Log:
LSR: Minor cleanup after Daniel's patch.
Combine the Inserted an Done sets into a Visited set.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=220623&r1=220622&r2=220623&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Sat Oct 25 14:59:30 2014
@@ -3116,14 +3116,13 @@ bool LSRInstance::InsertFormula(LSRUse &
void
LSRInstance::CollectLoopInvariantFixupsAndFormulae() {
SmallVector<const SCEV *, 8> Worklist(RegUses.begin(), RegUses.end());
- SmallPtrSet<const SCEV *, 8> Inserted;
- SmallPtrSet<const SCEV *, 32> Done;
+ SmallPtrSet<const SCEV *, 32> Visited;
while (!Worklist.empty()) {
const SCEV *S = Worklist.pop_back_val();
// Don't process the same SCEV twice
- if (!Done.insert(S))
+ if (!Visited.insert(S))
continue;
if (const SCEVNAryExpr *N = dyn_cast<SCEVNAryExpr>(S))
@@ -3134,7 +3133,6 @@ LSRInstance::CollectLoopInvariantFixupsA
Worklist.push_back(D->getLHS());
Worklist.push_back(D->getRHS());
} else if (const SCEVUnknown *US = dyn_cast<SCEVUnknown>(S)) {
- if (!Inserted.insert(US)) continue;
const Value *V = US->getValue();
if (const Instruction *Inst = dyn_cast<Instruction>(V)) {
// Look for instructions defined outside the loop.
More information about the llvm-commits
mailing list