Subzero: Simplify the constant pools. Internally, create a separate constant pool for each integer type, instead of a single i64 pool that uses the Ice::Type value as part of the key. This means each constant pool key can be a simple primitive value, rather than a tuple. Represent the pools using std::unordered_map instead of std::map since we're using C++11 now. Use signed integers instead of unsigned integers for the integer constant pools, to benefit from sign extension and to be more consistent. Remove the SuppressMangling field from hash and comparison functions on RelocatableTuple, since we'll never have two symbols with the same name but different values of SuppressMangling. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/737513008
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp index 3c46496..4eb0343 100644 --- a/src/IceConverter.cpp +++ b/src/IceConverter.cpp
@@ -116,16 +116,11 @@ if (const auto GV = dyn_cast<GlobalValue>(Const)) { Ice::GlobalDeclaration *Decl = getConverter().getGlobalDeclaration(GV); const Ice::RelocOffsetT Offset = 0; - return Ctx->getConstantSym(TypeConverter.getIcePointerType(), - Offset, Decl->getName(), + return Ctx->getConstantSym(Offset, Decl->getName(), Decl->getSuppressMangling()); } else if (const auto CI = dyn_cast<ConstantInt>(Const)) { Ice::Type Ty = convertToIceType(CI->getType()); - if (Ty == Ice::IceType_i64) { - return Ctx->getConstantInt64(Ty, CI->getSExtValue()); - } else { - return Ctx->getConstantInt32(Ty, CI->getSExtValue()); - } + return Ctx->getConstantInt(Ty, CI->getSExtValue()); } else if (const auto CFP = dyn_cast<ConstantFP>(Const)) { Ice::Type Type = convertToIceType(CFP->getType()); if (Type == Ice::IceType_f32)