Answer to Philip Reames comments
[oota-llvm.git] / lib / Analysis / ConstantFolding.cpp
index eb3e2c6369095b9e243d24690b4a6d838479428f..8dc94219027ffd965d664ef7d8546b76803defd0 100644 (file)
@@ -240,7 +240,8 @@ static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV,
 
   // Look through ptr->int and ptr->ptr casts.
   if (CE->getOpcode() == Instruction::PtrToInt ||
-      CE->getOpcode() == Instruction::BitCast)
+      CE->getOpcode() == Instruction::BitCast ||
+      CE->getOpcode() == Instruction::AddrSpaceCast)
     return IsConstantOffsetFromGlobal(CE->getOperand(0), GV, Offset, TD);
 
   // i32* getelementptr ([5 x i32]* @a, i32 0, i32 5)