[all-commits] [llvm/llvm-project] 6e2628: [CIR] Dedup indirect branch successors
adams381 via All-commits
all-commits at lists.llvm.org
Thu Jun 25 12:19:22 PDT 2026
Branch: refs/heads/users/adams381/cir-computed-goto-blockaddress
Home: https://github.com/llvm/llvm-project
Commit: 6e2628f09d5c4910d386d71754c2288adee0b230
https://github.com/llvm/llvm-project/commit/6e2628f09d5c4910d386d71754c2288adee0b230
Author: Adam Smith <adams at nvidia.com>
Date: 2026-06-25 (Thu, 25 Jun 2026)
Changed paths:
M clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
M clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
M clang/lib/CIR/CodeGen/CIRGenFunction.cpp
M clang/lib/CIR/CodeGen/CIRGenFunction.h
M clang/test/CIR/CodeGen/goto-address-label-table.c
M clang/test/CIR/CodeGen/label-values.c
Log Message:
-----------
[CIR] Dedup indirect branch successors
A block only needs to appear once in a `cir.indirect_br` successor list,
but `finishIndirectBranch` added one successor per address-taken label, so
a dispatch table that named a label twice (or `&&label` taken twice) wired
the same block in as several identical successors. The duplicates serve no
purpose, so resolve each label to its block and skip blocks already seen.
CIR diverges from classic codegen here, which keeps the duplicates.
Also drop the `takeAddressOfLabel` wrapper; its only job was to push onto
the public `indirectGotoTargets` vector, so the two callers push directly.
Updates `goto-address-label-table.c` (g) and `label-values.c` (D), whose
duplicate-label cases now emit a single successor on the CIR side while
the OGCG checks keep classic's duplicates.
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