From 4d1a5272ecffb4611eb0f20cfca718cee2170277 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sun, 7 Jun 2015 20:17:42 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/NaryReassociate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.34.1