[all-commits] [llvm/llvm-project] c91684: [SimplifyCFG] Improve SwitchToLookupTable optimiza...

Alexander Shaposhnikov via All-commits all-commits at lists.llvm.org
Wed Jul 13 16:22:40 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c9168405396d9a536743d2bbc1fb9892954b4c03
      https://github.com/llvm/llvm-project/commit/c9168405396d9a536743d2bbc1fb9892954b4c03
  Author: Alexander Shaposhnikov <ashaposhnikov at google.com>
  Date:   2022-07-13 (Wed, 13 Jul 2022)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll

  Log Message:
  -----------
  [SimplifyCFG] Improve SwitchToLookupTable optimization

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

Test plan:
1/ ninja check-all
2/ bootstrapped LLVM + Clang pass tests

Differential revision: https://reviews.llvm.org/D128897




More information about the All-commits mailing list