AMDGPU: Remove pointless dyn_cast_or_null

This is already casted above so non-null

llvm-svn: 275881
This commit is contained in:
Matt Arsenault 2016-07-18 19:00:07 +00:00
parent d2387432bb
commit 210b7cf3e2
1 changed files with 3 additions and 4 deletions

View File

@ -550,7 +550,7 @@ bool AMDGPUPromoteAlloca::collectUsesWithPtrTypes(
if (UseInst->getOpcode() == Instruction::PtrToInt)
return false;
if (LoadInst *LI = dyn_cast_or_null<LoadInst>(UseInst)) {
if (LoadInst *LI = dyn_cast<LoadInst>(UseInst)) {
if (LI->isVolatile())
return false;
@ -564,11 +564,10 @@ bool AMDGPUPromoteAlloca::collectUsesWithPtrTypes(
// Reject if the stored value is not the pointer operand.
if (SI->getPointerOperand() != Val)
return false;
} else if (AtomicRMWInst *RMW = dyn_cast_or_null<AtomicRMWInst>(UseInst)) {
} else if (AtomicRMWInst *RMW = dyn_cast<AtomicRMWInst>(UseInst)) {
if (RMW->isVolatile())
return false;
} else if (AtomicCmpXchgInst *CAS
= dyn_cast_or_null<AtomicCmpXchgInst>(UseInst)) {
} else if (AtomicCmpXchgInst *CAS = dyn_cast<AtomicCmpXchgInst>(UseInst)) {
if (CAS->isVolatile())
return false;
}