[all-commits] [llvm/llvm-project] fa02a6: [SimplifyCFG] Permit less dense lookup tables (#20...

Alexis Engelke via All-commits all-commits at lists.llvm.org
Mon Jun 1 01:03:24 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa02a6ed66b1700c996b49c96c6bc0eb014c9518
      https://github.com/llvm/llvm-project/commit/fa02a6ed66b1700c996b49c96c6bc0eb014c9518
  Author: Alexis Engelke <engelke at in.tum.de>
  Date:   2026-06-01 (Mon, 01 Jun 2026)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Transforms/SimplifyCFG/RISCV/switch-of-powers-of-two.ll
    M llvm/test/Transforms/SimplifyCFG/rangereduce.ll

  Log Message:
  -----------
  [SimplifyCFG] Permit less dense lookup tables (#200664)

It should be most often beneficial to generate a lookup table instead of
a jump table: the lookup table is rarely larger, but saves on
instructions and an indirect branch. Therefore, adjust the lookup table
threshold to match the jump table threshold.

The motivation is clang::Decl::castToDeclContext, which is a rather hot
function when parsing C++ programs, but the switch density is just 38%.
This improves stage2-O0g by 0.17% (7zip/kimwitu++ >0.5%).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list