[PATCH] D119854: [SimplifyCFG][PhaseOrdering] Defer lowering switch into an integer range comparison and branch until after at least the IPSCCP

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 17 00:21:46 PST 2022


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h:26
   bool ForwardSwitchCondToPhi = false;
+  bool ConvertSwitchRangeToICmp = false;
   bool ConvertSwitchToLookupTable = false;
----------------
lebedev.ri wrote:
> nikic wrote:
> > As we want to disable this essentially only for the first SimplifyCFG run, may make the default true?
> I acknowledge that this is a tricky question,
> but opting-into something lossy seems better
> than ensuring that we opt-out everywhere,
> so i've gone with that.
> I don't think there is The Right choice here.
I think this is mostly a pragmatic choice (if a new SimplifyCFG run gets added, which behavior should it most likely have?) but I don't care strongly about it...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119854/new/

https://reviews.llvm.org/D119854



More information about the llvm-commits mailing list