diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2020-08-08 16:46:31 +0300 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2020-08-08 20:00:27 +0300 |
commit | a587bf3eb074340710a36c0c00c16dadcf5adb79 (patch) | |
tree | 515ed75c9af066a2ed44ad16fc0a8a5305d66282 /llvm | |
parent | 99cd56906a4dd00db25b045eccddcb6802d39f8d (diff) | |
download | llvm-a587bf3eb074340710a36c0c00c16dadcf5adb79.zip llvm-a587bf3eb074340710a36c0c00c16dadcf5adb79.tar.gz llvm-a587bf3eb074340710a36c0c00c16dadcf5adb79.tar.bz2 |
[NFC][SimplifyCFG] Count the number of invokes turned into calls due to empty cleanup blocks
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index a578bbd..a0e5658 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -162,6 +162,8 @@ STATISTIC(NumSinkCommonCode, STATISTIC(NumSinkCommonInstrs, "Number of common instructions sunk down to the end block"); STATISTIC(NumSpeculations, "Number of speculative executed instructions"); +STATISTIC(NumInvokes, + "Number of invokes with empty resume blocks simplified into calls"); namespace { @@ -4017,6 +4019,7 @@ bool SimplifyCFGOpt::simplifyCommonResume(ResumeInst *RI) { PI != PE;) { BasicBlock *Pred = *PI++; removeUnwindEdge(Pred); + ++NumInvokes; } // In each SimplifyCFG run, only the current processed block can be erased. @@ -4072,6 +4075,7 @@ bool SimplifyCFGOpt::simplifySingleResume(ResumeInst *RI) { for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE;) { BasicBlock *Pred = *PI++; removeUnwindEdge(Pred); + ++NumInvokes; } // The landingpad is now unreachable. Zap it. @@ -4192,6 +4196,7 @@ static bool removeEmptyCleanup(CleanupReturnInst *RI) { BasicBlock *PredBB = *PI++; if (UnwindDest == nullptr) { removeUnwindEdge(PredBB); + ++NumInvokes; } else { Instruction *TI = PredBB->getTerminator(); TI->replaceUsesOfWith(BB, UnwindDest); |