Add a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-01-04 18:38:39 +00:00
parent 89d6a24262
commit 7ba4e17285

View File

@ -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)))