[PATCH] D119854: [SimplifyCFG][CVP][PhaseOrdering] Defer lowering switch into an integer range comparison and branch until the end of function simplification pipeline

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 15 08:55:59 PST 2022


lebedev.ri created this revision.
lebedev.ri added reviewers: nikic, wwei, jcranmer, reames, jdoerfert.
lebedev.ri added a project: LLVM.
Herald added subscribers: ormris, zzheng, JDevlieghere, hiraditya.
lebedev.ri requested review of this revision.

That transformation is lossy, as discussed in 
https://github.com/llvm/llvm-project/issues/53853
and https://github.com/rust-lang/rust/issues/85133#issuecomment-904185574

This is an alternative to D119839 <https://reviews.llvm.org/D119839>.

Unlike lowering switch to lookup, we still want this transformation to happen
relatively early, but after giving a chance for the things like CVP to do their thing.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119854

Files:
  llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassBuilderPipelines.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
  llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
  llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
  llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Other/new-pm-print-pipeline.ll
  llvm/test/Transforms/Coroutines/coro-catchswitch-cleanuppad.ll
  llvm/test/Transforms/LoopUnroll/ARM/upperbound.ll
  llvm/test/Transforms/PhaseOrdering/simplifycfg-switch-lowering-vs-correlatedpropagation.ll
  llvm/test/Transforms/SimplifyCFG/DeadSetCC.ll
  llvm/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll
  llvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-no-new-successors.ll
  llvm/test/Transforms/SimplifyCFG/ForwardSwitchConditionToPHI.ll
  llvm/test/Transforms/SimplifyCFG/preserve-branchweights.ll
  llvm/test/Transforms/SimplifyCFG/switch-dead-default.ll
  llvm/test/Transforms/SimplifyCFG/switch-range-to-icmp.ll
  llvm/test/Transforms/SimplifyCFG/switch-to-icmp.ll
  llvm/test/Transforms/SimplifyCFG/switch_create-custom-dl.ll
  llvm/test/Transforms/SimplifyCFG/switch_create.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119854.408897.patch
Type: text/x-patch
Size: 25304 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220215/9be1be30/attachment.bin>


More information about the llvm-commits mailing list