diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-30 20:06:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-30 20:06:40 +0000 |
commit | a3e620caba93746e47c7dd29b24f63fd6c96294e (patch) | |
tree | c7be4ab35a22b662e6e954961eb765b7e2ab7e13 /llvm/lib/Transforms/Scalar/SCCP.cpp | |
parent | c856539edf0ed83f5cd50dc856b92c272ce53940 (diff) | |
download | bcm5719-llvm-a3e620caba93746e47c7dd29b24f63fd6c96294e.tar.gz bcm5719-llvm-a3e620caba93746e47c7dd29b24f63fd6c96294e.zip |
add getPointerAddressSpace() to GEP instruction, use the method
in a few scalar xforms to simplify things.
llvm-svn: 80506
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
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<ConstantPointerNull>(Ptr) && - cast<PointerType>(Ptr->getType())->getAddressSpace() == 0) { + if (isa<ConstantPointerNull>(Ptr) && I.getPointerAddressSpace() == 0) { // load null -> null markConstant(IV, &I, Constant::getNullValue(I.getType())); return; |