From: Nick Lewycky Date: Wed, 26 Jan 2011 09:13:58 +0000 (+0000) Subject: Teach mergefunc that intptr_t is the same width as a pointer. We still can't X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=207c193e7e9cc177115101333079e952a7676689;p=oota-llvm.git Teach mergefunc that intptr_t is the same width as a pointer. We still can't merge vector::push_back() and vector::push_back() because Enumerate() doesn't realize that "i64* null" and "i8** null" are equivalent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124285 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/MergeFunctions.cpp b/lib/Transforms/IPO/MergeFunctions.cpp index 8aa7cb24b95..49679baaeb7 100644 --- a/lib/Transforms/IPO/MergeFunctions.cpp +++ b/lib/Transforms/IPO/MergeFunctions.cpp @@ -286,8 +286,14 @@ bool FunctionComparator::isEquivalentType(const Type *Ty1, const Type *Ty2) const { if (Ty1 == Ty2) return true; - if (Ty1->getTypeID() != Ty2->getTypeID()) + if (Ty1->getTypeID() != Ty2->getTypeID()) { + if (TD) { + LLVMContext &Ctx = Ty1->getContext(); + if (isa(Ty1) && Ty2 == TD->getIntPtrType(Ctx)) return true; + if (isa(Ty2) && Ty1 == TD->getIntPtrType(Ctx)) return true; + } return false; + } switch(Ty1->getTypeID()) { default: