summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commitd31649bc59bc08c21f2062bbf05573e8611df7af (patch)
tree23ad2431471ec24575dcc5b68bad1ddbc6c054b2 /llvm/lib
parenta38e527523f1981f644cb53ba72fe38186401b9c (diff)
downloadbcm5719-llvm-d31649bc59bc08c21f2062bbf05573e8611df7af.tar.gz
bcm5719-llvm-d31649bc59bc08c21f2062bbf05573e8611df7af.zip
Improve comment.
llvm-svn: 42132
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 07eb2528c45..3a7d1018c40 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud