mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Eliminate a redundant FoldingSet lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106872 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -845,9 +845,9 @@ const SCEV *ScalarEvolution::getTruncateExpr(const SCEV *Op,
|
|||||||
return getAddRecExpr(Operands, AddRec->getLoop());
|
return getAddRecExpr(Operands, AddRec->getLoop());
|
||||||
}
|
}
|
||||||
|
|
||||||
// The cast wasn't folded; create an explicit cast node.
|
// The cast wasn't folded; create an explicit cast node. We can reuse
|
||||||
// Recompute the insert position, as it may have been invalidated.
|
// the existing insert position since if we get here, we won't have
|
||||||
if (const SCEV *S = UniqueSCEVs.FindNodeOrInsertPos(ID, IP)) return S;
|
// made any changes which would invalidate it.
|
||||||
SCEV *S = new (SCEVAllocator) SCEVTruncateExpr(ID.Intern(SCEVAllocator),
|
SCEV *S = new (SCEVAllocator) SCEVTruncateExpr(ID.Intern(SCEVAllocator),
|
||||||
Op, Ty);
|
Op, Ty);
|
||||||
UniqueSCEVs.InsertNode(S, IP);
|
UniqueSCEVs.InsertNode(S, IP);
|
||||||
|
Reference in New Issue
Block a user