From: Matt Arsenault Date: Sun, 7 Jun 2015 20:17:42 +0000 (+0000) Subject: Make NaryReassociate pass the address space to isLegalAddressingMode X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4d1a5272ecffb4611eb0f20cfca718cee2170277;p=oota-llvm.git Make NaryReassociate pass the address space to isLegalAddressingMode No test since the kinds of transforms this prevents seem to not really be relevant for SI's different addressing modes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239261 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/NaryReassociate.cpp b/lib/Transforms/Scalar/NaryReassociate.cpp index 6ac5ff85e32..4cf68b00da0 100644 --- a/lib/Transforms/Scalar/NaryReassociate.cpp +++ b/lib/Transforms/Scalar/NaryReassociate.cpp @@ -317,8 +317,10 @@ static bool isGEPFoldable(GetElementPtrInst *GEP, BaseOffset += DL->getStructLayout(STy)->getElementOffset(Field); } } + + unsigned AddrSpace = GEP->getPointerAddressSpace(); return TTI->isLegalAddressingMode(GEP->getType()->getElementType(), BaseGV, - BaseOffset, HasBaseReg, Scale); + BaseOffset, HasBaseReg, Scale, AddrSpace); } Instruction *NaryReassociate::tryReassociateGEP(GetElementPtrInst *GEP) {