Skip to content

Commit

Permalink
[NFC] Introduce option to switch off compatible invokes merge
Browse files Browse the repository at this point in the history
Does not affect default behavior (transform is on).
  • Loading branch information
xortator committed Feb 15, 2022
1 parent ac5a5a9 commit bfc1217
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions llvm/lib/Transforms/Utils/SimplifyCFG.cpp
Expand Up @@ -167,6 +167,10 @@ static cl::opt<unsigned> BranchFoldToCommonDestVectorMultiplier(
"to fold branch to common destination when vector operations are "
"present"));

static cl::opt<bool> EnableMergeCompatibleInvokes(
"simplifycfg-merge-compatible-invokes", cl::Hidden, cl::init(true),
cl::desc("Allow SimplifyCFG to merge invokes together when appropriate"));

STATISTIC(NumBitMaps, "Number of switch instructions turned into bitmaps");
STATISTIC(NumLinearMaps,
"Number of switch instructions turned into linear mapping");
Expand Down Expand Up @@ -2528,6 +2532,9 @@ static void MergeCompatibleInvokesImpl(ArrayRef<InvokeInst *> Invokes,
/// edges invoke0->cont0 and invoke1->cont1 are "compatible",
/// and the invoked functions are "compatible".
static bool MergeCompatibleInvokes(BasicBlock *BB, DomTreeUpdater *DTU) {
if (!EnableMergeCompatibleInvokes)
return false;

bool Changed = false;

// FIXME: generalize to all exception handling blocks?
Expand Down

0 comments on commit bfc1217

Please sign in to comment.