mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-13 23:18:58 +00:00
[SimplifyCFG] Use auto * when the type is obvious. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317923 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0f47b426bf
commit
4013502618
@ -6012,12 +6012,12 @@ bool SimplifyCFGOpt::run(BasicBlock *BB) {
|
||||
|
||||
// If there is a trivial two-entry PHI node in this basic block, and we can
|
||||
// eliminate it, do so now.
|
||||
if (PHINode *PN = dyn_cast<PHINode>(BB->begin()))
|
||||
if (auto *PN = dyn_cast<PHINode>(BB->begin()))
|
||||
if (PN->getNumIncomingValues() == 2)
|
||||
Changed |= FoldTwoEntryPHINode(PN, TTI, DL);
|
||||
|
||||
Builder.SetInsertPoint(BB->getTerminator());
|
||||
if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
|
||||
if (auto *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
|
||||
if (BI->isUnconditional()) {
|
||||
if (SimplifyUncondBranch(BI, Builder))
|
||||
return true;
|
||||
@ -6025,25 +6025,22 @@ bool SimplifyCFGOpt::run(BasicBlock *BB) {
|
||||
if (SimplifyCondBranch(BI, Builder))
|
||||
return true;
|
||||
}
|
||||
} else if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
|
||||
} else if (auto *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
|
||||
if (SimplifyReturn(RI, Builder))
|
||||
return true;
|
||||
} else if (ResumeInst *RI = dyn_cast<ResumeInst>(BB->getTerminator())) {
|
||||
} else if (auto *RI = dyn_cast<ResumeInst>(BB->getTerminator())) {
|
||||
if (SimplifyResume(RI, Builder))
|
||||
return true;
|
||||
} else if (CleanupReturnInst *RI =
|
||||
dyn_cast<CleanupReturnInst>(BB->getTerminator())) {
|
||||
} else if (auto *RI = dyn_cast<CleanupReturnInst>(BB->getTerminator())) {
|
||||
if (SimplifyCleanupReturn(RI))
|
||||
return true;
|
||||
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(BB->getTerminator())) {
|
||||
} else if (auto *SI = dyn_cast<SwitchInst>(BB->getTerminator())) {
|
||||
if (SimplifySwitch(SI, Builder))
|
||||
return true;
|
||||
} else if (UnreachableInst *UI =
|
||||
dyn_cast<UnreachableInst>(BB->getTerminator())) {
|
||||
} else if (auto *UI = dyn_cast<UnreachableInst>(BB->getTerminator())) {
|
||||
if (SimplifyUnreachable(UI))
|
||||
return true;
|
||||
} else if (IndirectBrInst *IBI =
|
||||
dyn_cast<IndirectBrInst>(BB->getTerminator())) {
|
||||
} else if (auto *IBI = dyn_cast<IndirectBrInst>(BB->getTerminator())) {
|
||||
if (SimplifyIndirectBr(IBI))
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user