Re: [RISCV] redundant return-only BB not eliminated

Project / Subsystem

gcc / gcc

Date

2026-09-08

Proposer

Robert Guthrie <forkbombidable@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Reliance on `prev_bb`/`next_bb` vs. predecessor/successor lists for CFG manipulation.

All attributes

project
gcc
subsystem
gcc
patch_id
—
discussion_id
ap9pjXUOhYGVixBO@bertguix
source_type
public_inbox
title
Re: [RISCV] redundant return-only BB not eliminated
headline
Redundant return-only BB not eliminated
tldr
A patch to optimize CFG cleanup by removing redundant return-only basic blocks is discussed, with suggestions on implementation details.
proposer
Robert Guthrie <forkbombidable@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Reliance on `prev_bb`/`next_bb` vs. predecessor/successor lists for CFG manipulation.
series_id
—
series_role
standalone
series_parts
[]
tags
  • • optimization
  • • cfg
bugzilla_url
—
date
2026-09-08T00:00:00.000Z

Re: [RISCV] redundant return-only BB not eliminated

Robert Guthrie proposes a patch to eliminate redundant consecutive return-only basic blocks in the CFG cleanup pass. He initially struggled with debugging but found the solution straightforward after resolving misunderstandings. Another participant (implied by the quote) suggests a different approach, focusing on predecessor and successor lists rather than prev_bb/next_bb for block ordering.