[PATCH] D128897: [SimplifyCFG] Improve SwitchToLookupTable optimization

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 02:00:53 PDT 2022


alexander-shaposhnikov created this revision.
alexander-shaposhnikov added reviewers: nikic, majnemer, rnk.
alexander-shaposhnikov created this object with visibility "All Users".
Herald added a subscriber: hiraditya.
Herald added a project: All.
alexander-shaposhnikov requested review of this revision.
Herald added a project: LLVM.

Try to use the original value as an index (in the lookup table) in more cases
(to avoid one subtraction and actually shorten the dependency chain).
This addresses https://github.com/llvm/llvm-project/issues/56189

Test plan: ninja check-all


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128897

Files:
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128897.441312.patch
Type: text/x-patch
Size: 6299 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220630/afbe875b/attachment-0001.bin>


More information about the llvm-commits mailing list