Skip to content

Commit bfc1217

Browse files
committed
[NFC] Introduce option to switch off compatible invokes merge
Does not affect default behavior (transform is on).
1 parent ac5a5a9 commit bfc1217

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ static cl::opt<unsigned> BranchFoldToCommonDestVectorMultiplier(
167167
"to fold branch to common destination when vector operations are "
168168
"present"));
169169

170+
static cl::opt<bool> EnableMergeCompatibleInvokes(
171+
"simplifycfg-merge-compatible-invokes", cl::Hidden, cl::init(true),
172+
cl::desc("Allow SimplifyCFG to merge invokes together when appropriate"));
173+
170174
STATISTIC(NumBitMaps, "Number of switch instructions turned into bitmaps");
171175
STATISTIC(NumLinearMaps,
172176
"Number of switch instructions turned into linear mapping");
@@ -2528,6 +2532,9 @@ static void MergeCompatibleInvokesImpl(ArrayRef<InvokeInst *> Invokes,
25282532
/// edges invoke0->cont0 and invoke1->cont1 are "compatible",
25292533
/// and the invoked functions are "compatible".
25302534
static bool MergeCompatibleInvokes(BasicBlock *BB, DomTreeUpdater *DTU) {
2535+
if (!EnableMergeCompatibleInvokes)
2536+
return false;
2537+
25312538
bool Changed = false;
25322539

25332540
// FIXME: generalize to all exception handling blocks?

0 commit comments

Comments
 (0)