[PATCH] D104597: [SimplifyCFG] Tail-merging all blocks with `ret` terminator

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 19 11:57:58 PDT 2021


lebedev.ri created this revision.
lebedev.ri added reviewers: rnk, hans, fhahn, nikic, spatel.
lebedev.ri added a project: LLVM.
Herald added subscribers: ormris, wenlei, zzheng, hiraditya.
lebedev.ri requested review of this revision.

This is the same as D104445 <https://reviews.llvm.org/D104445>, but restricted to only the `ret` terminators.
Not all codegen tests have been updated.

The changes to the baseline implementation are:

1. there are no longer restrictions on what can be contained in the blocks with `ret` terminators
2. Instead of picking some existing block as canonical terminator, always create a new block, with just the terminator, and redirect to it
3. The code has been generalized to simplify dealing with multiple terminator types in the future.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104597

Files:
  llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
  llvm/test/CodeGen/AArch64/branch-relax-cbz.ll
  llvm/test/CodeGen/AArch64/cgp-usubo.ll
  llvm/test/CodeGen/AArch64/implicit-null-check.ll
  llvm/test/CodeGen/AArch64/ldst-opt-after-block-placement.ll
  llvm/test/CodeGen/AArch64/ldst-paired-aliasing.ll
  llvm/test/CodeGen/AArch64/statepoint-call-lowering.ll
  llvm/test/CodeGen/AArch64/use-cr-result-of-dom-icmp-st.ll
  llvm/test/CodeGen/AArch64/vec-extract-branch.ll
  llvm/test/Transforms/LoopUnroll/ARM/upperbound.ll
  llvm/test/Transforms/PGOProfile/chr.ll
  llvm/test/Transforms/PhaseOrdering/X86/simplifycfg-late.ll
  llvm/test/Transforms/PhaseOrdering/X86/vector-reductions.ll
  llvm/test/Transforms/PhaseOrdering/inlining-alignment-assumptions.ll
  llvm/test/Transforms/PruneEH/ipo-nounwind.ll
  llvm/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll
  llvm/test/Transforms/SimplifyCFG/ConditionalTrappingConstantExpr.ll
  llvm/test/Transforms/SimplifyCFG/DeadSetCC.ll
  llvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase-2.ll
  llvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase.ll
  llvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-no-new-successors.ll
  llvm/test/Transforms/SimplifyCFG/Hexagon/switch-to-lookup-table.ll
  llvm/test/Transforms/SimplifyCFG/HoistCode.ll
  llvm/test/Transforms/SimplifyCFG/SimplifyEqualityComparisonWithOnlyPredecessor-domtree-preservation-edgecase.ll
  llvm/test/Transforms/SimplifyCFG/basictest.ll
  llvm/test/Transforms/SimplifyCFG/branch-fold.ll
  llvm/test/Transforms/SimplifyCFG/duplicate-landingpad.ll
  llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest-two-preds-cost.ll
  llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll
  llvm/test/Transforms/SimplifyCFG/guards.ll
  llvm/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll
  llvm/test/Transforms/SimplifyCFG/indirectbr.ll
  llvm/test/Transforms/SimplifyCFG/invoke.ll
  llvm/test/Transforms/SimplifyCFG/pr39807.ll
  llvm/test/Transforms/SimplifyCFG/pr46638.ll
  llvm/test/Transforms/SimplifyCFG/pr48778-sdiv-speculation.ll
  llvm/test/Transforms/SimplifyCFG/preserve-branchweights.ll
  llvm/test/Transforms/SimplifyCFG/rangereduce.ll
  llvm/test/Transforms/SimplifyCFG/suppress-zero-branch-weights.ll
  llvm/test/Transforms/SimplifyCFG/switch-dead-default.ll
  llvm/test/Transforms/SimplifyCFG/switch-masked-bits.ll
  llvm/test/Transforms/SimplifyCFG/switch-on-const-select.ll
  llvm/test/Transforms/SimplifyCFG/switch-range-to-icmp.ll
  llvm/test/Transforms/SimplifyCFG/switch_create-custom-dl.ll
  llvm/test/Transforms/SimplifyCFG/switch_create.ll
  llvm/test/Transforms/SimplifyCFG/switch_switch_fold.ll
  llvm/test/Transforms/SimplifyCFG/switch_thread.ll
  llvm/test/Transforms/SimplifyCFG/unprofitable-pr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104597.353206.patch
Type: text/x-patch
Size: 117270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210619/80982a62/attachment-0001.bin>


More information about the llvm-commits mailing list