Try to unbreak selfhost.

llvm-svn: 123537
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 07fe1b8..c1f66b7 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -2169,6 +2169,7 @@
     // and we know how to evaluate it by moving the bitcast from the pointer
     // operand to the value operand.
     } else if (CE->getOpcode() == Instruction::BitCast &&
+               isa<GlobalVariable>(CE->getOperand(0)) &&
                CE->getType()->isPointerTy() &&
                CE->getOperand(0)->getType()->isPointerTy()) {
       GlobalVariable *GV = cast<GlobalVariable>(CE->getOperand(0));