summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-01-04 18:38:39 +0000
committerDan Gohman <gohman@apple.com>2010-01-04 18:38:39 +0000
commitfc76441623cbd6f5df40800d7b33bb29bcc48c67 (patch)
treee45783cf4a3d01553f862bfdbf55b0bfbba998e7 /llvm/lib/VMCore/Instruction.cpp
parent5b9019515a371758801e40b7fbba547c6ea135cc (diff)
downloadbcm5719-llvm-fc76441623cbd6f5df40800d7b33bb29bcc48c67.tar.gz
bcm5719-llvm-fc76441623cbd6f5df40800d7b33bb29bcc48c67.zip
Add a comment.
llvm-svn: 92492
Diffstat (limited to 'llvm/lib/VMCore/Instruction.cpp')
-rw-r--r--llvm/lib/VMCore/Instruction.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp
index 170a15f216f..3fabfd07b31 100644
--- a/llvm/lib/VMCore/Instruction.cpp
+++ b/llvm/lib/VMCore/Instruction.cpp
@@ -399,6 +399,8 @@ bool Instruction::isSafeToSpeculativelyExecute() const {
case Load: {
if (cast<LoadInst>(this)->isVolatile())
return false;
+ // Note that it is not safe to speculate into a malloc'd region because
+ // malloc may return null.
if (isa<AllocaInst>(getOperand(0)))
return true;
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(getOperand(0)))
OpenPOWER on IntegriCloud