aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-09-19 10:25:38 +0000
committerDuncan Sands <baldrick@free.fr>2007-09-19 10:25:38 +0000
commite40a94a0e0bf1f92031706f57124a3f3c0249078 (patch)
treeca6b8fe194e69bf78707a3dc354ca1ab00990d38 /lib/Transforms
parentb276a33b8f5782aac328965a3ac0cbaaef1dee0b (diff)
downloadexternal_llvm-e40a94a0e0bf1f92031706f57124a3f3c0249078.zip
external_llvm-e40a94a0e0bf1f92031706f57124a3f3c0249078.tar.gz
external_llvm-e40a94a0e0bf1f92031706f57124a3f3c0249078.tar.bz2
Improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 07eb252..3a7d101 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -8939,8 +8939,9 @@ static bool isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom) {
// If it is an alloca it is always safe to load from.
if (isa<AllocaInst>(V)) return true;
- // Don't try to evaluate aliases. External weak GV can be null.
+ // If it is a global variable it is mostly safe to load from.
if (const GlobalValue *GV = dyn_cast<GlobalVariable>(V))
+ // Don't try to evaluate aliases. External weak GV can be null.
return !isa<GlobalAlias>(GV) && !GV->hasExternalWeakLinkage();
// Otherwise, be a little bit agressive by scanning the local block where we