mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
add getPointerAddressSpace() to GEP instruction, use the method
in a few scalar xforms to simplify things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80506 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user