[all-commits] [llvm/llvm-project] efaed4: [SimplifyCFG] Shrink integer lookup tables (#202071)

Alexis Engelke via All-commits all-commits at lists.llvm.org
Sat Jun 6 23:19:36 PDT 2026


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

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Transforms/PhaseOrdering/X86/merge-functions2.ll
    M llvm/test/Transforms/SimplifyCFG/ARM/switch-to-lookup-table.ll
    M llvm/test/Transforms/SimplifyCFG/Hexagon/switch-to-lookup-table.ll
    M llvm/test/Transforms/SimplifyCFG/RISCV/switch-of-powers-of-two.ll
    M llvm/test/Transforms/SimplifyCFG/X86/debugloc-switch-powers-of-two.ll
    M llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
    M llvm/test/Transforms/SimplifyCFG/X86/switch-of-powers-of-two.ll
    M llvm/test/Transforms/SimplifyCFG/X86/switch-table-bug.ll
    M llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll
    M llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table_big.ll
    M llvm/test/Transforms/SimplifyCFG/switch-dead-default-lookup-table.ll
    M llvm/test/Transforms/SimplifyCFG/switch_mask.ll

  Log Message:
  -----------
  [SimplifyCFG] Shrink integer lookup tables (#202071)

After #200664, we generate lookup tables in more cases, leading to
higher memory use and larger binaries. Partially alleviate this by
shrinking the lookup tables if all elements are small integers. The
underlying idea is that an extra integer extension can typically be
folded into a load instruction at no extra cost.

This reduces the size of stage2-clang by 0.13%.



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