mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Do not promote null values because it may be unsafe to do so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42270 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -800,6 +800,10 @@ void LICM::FindPromotableValuesInLoop(
|
||||
break;
|
||||
}
|
||||
|
||||
// Do not promote null values because it may be unsafe to do so.
|
||||
if (isa<ConstantPointerNull>(V))
|
||||
PointerOk = false;
|
||||
|
||||
if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) {
|
||||
// If GEP base is NULL then the calculated address used by Store or
|
||||
// Load instruction is invalid. Do not promote this value because
|
||||
|
Reference in New Issue
Block a user