[all-commits] [llvm/llvm-project] a4728f: [flang][PFT] record every target of multiway branches

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Thu Jul 16 02:08:44 PDT 2026


  Branch: refs/heads/users/ergawy/record_multiway_branches
  Home:   https://github.com/llvm/llvm-project
  Commit: a4728f462ae2e8da63b701836d33083e7d2d2f65
      https://github.com/llvm/llvm-project/commit/a4728f462ae2e8da63b701836d33083e7d2d2f65
  Author: ergawy <kareem.ergawy at gmail.com>
  Date:   2026-07-16 (Thu, 16 Jul 2026)

  Changed paths:
    M flang/include/flang/Lower/PFTBuilder.h
    M flang/lib/Lower/PFTBuilder.cpp
    A flang/test/Lower/pre-fir-tree-multiway-branch.f90
    M flang/test/Lower/pre-fir-tree02.f90

  Log Message:
  -----------
  [flang][PFT] record every target of multiway branches

The Evaluation node stored branch targets in a single `Evaluation *`
(`controlSuccessor`). `markBranchTarget` therefore silently dropped every
target after the first when lowering a computed `GO TO` or arithmetic `IF`,
so any analysis that consulted `controlSuccessor` to enumerate branch
targets saw only the first label.

Add `extraControlSuccessors` alongside
`controlSuccessor`. `markBranchTarget` still fills `controlSuccessor` with the
first target, but appends each subsequent distinct target to
`extraControlSuccessors`. Extend the PFT dumper to print the extra targets
after the first ("-> N, M, K"), so PFT dumps expose every branch target.

Co-Authored-By: Claude Sonnet 4.6 <noreply at anthropic.com>



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