Skip to content

Commit 6c25573

Browse files
committed
[simplify-cfg] Enable remove unreachable blocks to shrink the CFG a bit.
1 parent 8082ea0 commit 6c25573

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/SILOptimizer/Transforms/SimplifyCFG.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,6 +3170,10 @@ bool SimplifyCFG::run() {
31703170
// First remove any block not reachable from the entry.
31713171
bool Changed = removeUnreachableBlocks(Fn);
31723172

3173+
// If we have ownership bail. We jus4t want to remove unreachable blocks.
3174+
if (Fn.hasOwnership())
3175+
return Changed;
3176+
31733177
// Find the set of loop headers. We don't want to jump-thread through headers.
31743178
findLoopHeaders();
31753179

@@ -3920,10 +3924,6 @@ namespace {
39203924
class SimplifyCFGPass : public SILFunctionTransform {
39213925
public:
39223926
void run() override {
3923-
// FIXME: We should be able to handle ownership.
3924-
if (getFunction()->hasOwnership())
3925-
return;
3926-
39273927
if (SimplifyCFG(*getFunction(), *this, getOptions().VerifyAll,
39283928
/*EnableJumpThread=*/false)
39293929
.run())

0 commit comments

Comments
 (0)