Index: src/IceConverter.cpp |
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp |
index 271d25cdaf090ca7614a9eaae82624eafef94af8..2db34e92793caf5c3a76e4e8de53199be9ab6d82 100644 |
--- a/src/IceConverter.cpp |
+++ b/src/IceConverter.cpp |
@@ -102,8 +102,12 @@ public: |
return Ctx->getConstantSym(convertToIceType(GV->getType()), 0, |
GV->getName()); |
} else if (const ConstantInt *CI = dyn_cast<ConstantInt>(Const)) { |
- return Ctx->getConstantInt(convertToIceType(CI->getType()), |
- CI->getSExtValue()); |
+ Ice::Type Ty = convertToIceType(CI->getType()); |
+ if (Ty == Ice::IceType_i64) { |
+ return Ctx->getConstantInt64(Ty, CI->getSExtValue()); |
+ } else { |
+ return Ctx->getConstantInt32(Ty, CI->getSExtValue()); |
+ } |
} else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(Const)) { |
Ice::Type Type = convertToIceType(CFP->getType()); |
if (Type == Ice::IceType_f32) |