From 91f90e694f7e1da3a5fb9c2f06ab6d20fac6b08b Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 11 Jun 2015 16:13:39 +0000 Subject: SLSR: Pass address space to isLegalAddressingMode This only updates one of the uses. The other is used in cases that may never touch memory, so I'm not sure why this is even calling it. Perhaps there should be a new, similar hook for such cases or pass -1 for unknown address space. llvm-svn: 239540 --- llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp index 453503ab61d..8e5cf46263e 100644 --- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp @@ -265,8 +265,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); } // Returns whether (Base + Index * Stride) can be folded to an addressing mode. -- cgit v1.2.3