forked from OSchip/llvm-project
Eliminate a redundant FoldingSet lookup.
llvm-svn: 106872
This commit is contained in:
parent
ba3ece6f27
commit
89dd42af31
|
@ -845,9 +845,9 @@ const SCEV *ScalarEvolution::getTruncateExpr(const SCEV *Op,
|
|||
return getAddRecExpr(Operands, AddRec->getLoop());
|
||||
}
|
||||
|
||||
// The cast wasn't folded; create an explicit cast node.
|
||||
// Recompute the insert position, as it may have been invalidated.
|
||||
if (const SCEV *S = UniqueSCEVs.FindNodeOrInsertPos(ID, IP)) return S;
|
||||
// The cast wasn't folded; create an explicit cast node. We can reuse
|
||||
// the existing insert position since if we get here, we won't have
|
||||
// made any changes which would invalidate it.
|
||||
SCEV *S = new (SCEVAllocator) SCEVTruncateExpr(ID.Intern(SCEVAllocator),
|
||||
Op, Ty);
|
||||
UniqueSCEVs.InsertNode(S, IP);
|
||||
|
|
Loading…
Reference in New Issue