aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/LICM.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-09 05:11:09 +0000
committerChris Lattner <sabre@nondot.org>2009-03-09 05:11:09 +0000
commitd7168ddb116c2e9aa1f8325ae887eb63d6003037 (patch)
tree9f5d0b667152efb7236d315dd62e32f628d51cfb /lib/Transforms/Scalar/LICM.cpp
parentf9f7da830e999e34612edd3ea02e98f7fd3dc145 (diff)
downloadexternal_llvm-d7168ddb116c2e9aa1f8325ae887eb63d6003037.zip
external_llvm-d7168ddb116c2e9aa1f8325ae887eb63d6003037.tar.gz
external_llvm-d7168ddb116c2e9aa1f8325ae887eb63d6003037.tar.bz2
reimplement AliasSetTracker in terms of DenseMap instead of hash_map,
hopefully no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LICM.cpp')
-rw-r--r--lib/Transforms/Scalar/LICM.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index b2c895f..1021469 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -62,9 +62,9 @@ static cl::opt<bool>
DisablePromotion("disable-licm-promotion", cl::Hidden,
cl::desc("Disable memory promotion in LICM pass"));
-// This feature is currently disabled by default because CodeGen is not yet capable
-// of rematerializing these constants in PIC mode, so it can lead to degraded
-// performance. Compile test/CodeGen/X86/remat-constant.ll with
+// This feature is currently disabled by default because CodeGen is not yet
+// capable of rematerializing these constants in PIC mode, so it can lead to
+// degraded performance. Compile test/CodeGen/X86/remat-constant.ll with
// -relocation-model=pic to see an example of this.
static cl::opt<bool>
EnableLICMConstantMotion("enable-licm-constant-variables", cl::Hidden,
@@ -793,12 +793,12 @@ void LICM::FindPromotableValuesInLoop(
// set, if the pointer is loop invariant, and if we are not eliminating any
// volatile loads or stores.
if (AS.isForwardingAliasSet() || !AS.isMod() || !AS.isMustAlias() ||
- AS.isVolatile() || !CurLoop->isLoopInvariant(AS.begin()->first))
+ AS.isVolatile() || !CurLoop->isLoopInvariant(AS.begin()->getValue()))
continue;
assert(!AS.empty() &&
"Must alias set should have at least one pointer element in it!");
- Value *V = AS.begin()->first;
+ Value *V = AS.begin()->getValue();
// Check that all of the pointers in the alias set have the same type. We
// cannot (yet) promote a memory location that is loaded and stored in
@@ -806,7 +806,7 @@ void LICM::FindPromotableValuesInLoop(
{
bool PointerOk = true;
for (AliasSet::iterator I = AS.begin(), E = AS.end(); I != E; ++I)
- if (V->getType() != I->first->getType()) {
+ if (V->getType() != I->getValue()->getType()) {
PointerOk = false;
break;
}
@@ -859,7 +859,7 @@ void LICM::FindPromotableValuesInLoop(
CurAST->copyValue(V, AI);
for (AliasSet::iterator I = AS.begin(), E = AS.end(); I != E; ++I)
- ValueToAllocaMap.insert(std::make_pair(I->first, AI));
+ ValueToAllocaMap.insert(std::make_pair(I->getValue(), AI));
DOUT << "LICM: Promoting value: " << *V << "\n";
}