mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-26 20:57:15 +00:00
second half of fix for PR4366: don't zap store to null of
non-default addrspaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73253 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cd799b99cb
commit
69074a51f9
@ -125,13 +125,17 @@ static bool MarkAliveBlocks(BasicBlock *BB,
|
||||
}
|
||||
}
|
||||
|
||||
if (StoreInst *SI = dyn_cast<StoreInst>(BBI))
|
||||
if (isa<ConstantPointerNull>(SI->getOperand(1)) ||
|
||||
isa<UndefValue>(SI->getOperand(1))) {
|
||||
if (StoreInst *SI = dyn_cast<StoreInst>(BBI)) {
|
||||
Value *Ptr = SI->getOperand(1);
|
||||
|
||||
if (isa<UndefValue>(Ptr) ||
|
||||
(isa<ConstantPointerNull>(Ptr) &&
|
||||
cast<PointerType>(Ptr->getType())->getAddressSpace() == 0)) {
|
||||
ChangeToUnreachable(SI);
|
||||
Changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Turn invokes that call 'nounwind' functions into ordinary calls.
|
||||
|
Loading…
x
Reference in New Issue
Block a user