summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-21 06:21:31 +0000
committerChris Lattner <sabre@nondot.org>2011-07-21 06:21:31 +0000
commitc30a38f34bdfecb99ce49e3ffa479039c9bf0209 (patch)
treeb67b287ea26fb1e9ec63d50cfc1ad665ab506414 /lib/Transforms/Scalar/IndVarSimplify.cpp
parentdbd4fe2b0ada8014c2c8e042651de5799a1d4c5d (diff)
downloadllvm-c30a38f34bdfecb99ce49e3ffa479039c9bf0209.tar.gz
llvm-c30a38f34bdfecb99ce49e3ffa479039c9bf0209.tar.bz2
llvm-c30a38f34bdfecb99ce49e3ffa479039c9bf0209.tar.xz
move tier out of an anonymous namespace, it doesn't make sense
to for it to be an an anon namespace and be in a header. Eliminate some extraenous uses of tie. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 24d996c95a..3f810cdf5a 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1389,24 +1389,23 @@ void IndVarSimplify::SimplifyIVUsersNoRewrite(Loop *L, SCEVExpander &Rewriter) {
pushIVUsers(CurrIV, Simplified, SimpleIVUsers);
while (!SimpleIVUsers.empty()) {
- Instruction *UseInst, *Operand;
- tie(UseInst, Operand) = SimpleIVUsers.pop_back_val();
+ std::pair<Instruction*, Instruction*> Use =SimpleIVUsers.pop_back_val();
// Bypass back edges to avoid extra work.
- if (UseInst == CurrIV) continue;
+ if (Use.first == CurrIV) continue;
- if (EliminateIVUser(UseInst, Operand)) {
- pushIVUsers(Operand, Simplified, SimpleIVUsers);
+ if (EliminateIVUser(Use.first, Use.second)) {
+ pushIVUsers(Use.second, Simplified, SimpleIVUsers);
continue;
}
- if (CastInst *Cast = dyn_cast<CastInst>(UseInst)) {
+ if (CastInst *Cast = dyn_cast<CastInst>(Use.first)) {
bool IsSigned = Cast->getOpcode() == Instruction::SExt;
if (IsSigned || Cast->getOpcode() == Instruction::ZExt) {
CollectExtend(Cast, IsSigned, WI, SE, TD);
}
continue;
}
- if (isSimpleIVUser(UseInst, L, SE)) {
- pushIVUsers(UseInst, Simplified, SimpleIVUsers);
+ if (isSimpleIVUser(Use.first, L, SE)) {
+ pushIVUsers(Use.first, Simplified, SimpleIVUsers);
}
}
if (WI.WidestNativeType) {
@@ -1437,12 +1436,11 @@ void IndVarSimplify::SimplifyCongruentIVs(Loop *L) {
continue;
const SCEV *S = SE->getSCEV(Phi);
- DenseMap<const SCEV *, PHINode *>::const_iterator Pos;
- bool Inserted;
- tie(Pos, Inserted) = ExprToIVMap.insert(std::make_pair(S, Phi));
- if (Inserted)
+ std::pair<DenseMap<const SCEV *, PHINode *>::const_iterator, bool> Tmp =
+ ExprToIVMap.insert(std::make_pair(S, Phi));
+ if (Tmp.second)
continue;
- PHINode *OrigPhi = Pos->second;
+ PHINode *OrigPhi = Tmp.first->second;
// If one phi derives from the other via GEPs, types may differ.
if (OrigPhi->getType() != Phi->getType())