From a3e620caba93746e47c7dd29b24f63fd6c96294e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 30 Aug 2009 20:06:40 +0000 Subject: add getPointerAddressSpace() to GEP instruction, use the method in a few scalar xforms to simplify things. llvm-svn: 80506 --- llvm/lib/Transforms/Scalar/SCCP.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Scalar/SCCP.cpp') diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index 3c6dcadaa76..155e91ec7b4 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -1131,8 +1131,7 @@ void SCCPSolver::visitLoadInst(LoadInst &I) { if (PtrVal.isConstant() && !I.isVolatile()) { Value *Ptr = PtrVal.getConstant(); // TODO: Consider a target hook for valid address spaces for this xform. - if (isa(Ptr) && - cast(Ptr->getType())->getAddressSpace() == 0) { + if (isa(Ptr) && I.getPointerAddressSpace() == 0) { // load null -> null markConstant(IV, &I, Constant::getNullValue(I.getType())); return; -- cgit v1.2.3