mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Disable null pointer folding transforms for non-generic address spaces. This should probably be a target-specific predicate based on address space. That way for targets where this isn't applicable the predicate can be optimized away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45403 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1015,7 +1015,9 @@ void SCCPSolver::visitLoadInst(LoadInst &I) {
|
||||
if (PtrVal.isUndefined()) return; // The pointer is not resolved yet!
|
||||
if (PtrVal.isConstant() && !I.isVolatile()) {
|
||||
Value *Ptr = PtrVal.getConstant();
|
||||
if (isa<ConstantPointerNull>(Ptr)) {
|
||||
// TODO: Consider a target hook for valid address spaces for this xform.
|
||||
if (isa<ConstantPointerNull>(Ptr) &&
|
||||
cast<PointerType>(Ptr->getType())->getAddressSpace() == 0) {
|
||||
// load null -> null
|
||||
markConstant(IV, &I, Constant::getNullValue(I.getType()));
|
||||
return;
|
||||
|
Reference in New Issue
Block a user