1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Calculate getTerminator only when necessary

Differential Revision: https://reviews.llvm.org/D104202
This commit is contained in:
Aditya Kumar 2021-06-13 11:32:28 -07:00
parent 2f184e9475
commit d436515539

View File

@ -150,9 +150,10 @@ static bool mayExtractBlock(const BasicBlock &BB) {
//
// Resumes that are not reachable from a cleanup landing pad are considered to
// be unreachable. Its not safe to split them out either.
if (BB.hasAddressTaken() || BB.isEHPad())
return false;
auto Term = BB.getTerminator();
return !BB.hasAddressTaken() && !BB.isEHPad() && !isa<InvokeInst>(Term) &&
!isa<ResumeInst>(Term);
return !isa<InvokeInst>(Term) && !isa<ResumeInst>(Term);
}
/// Mark \p F cold. Based on this assumption, also optimize it for minimum size.