[llvm] [CodeGen] Fix lpad padding at section start after empty block (PR #112595)
Daniel Hoekwater via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 07:52:28 PDT 2024
================
@@ -673,10 +677,17 @@ class MachineBasicBlock
/// Returns true if this block ends any section.
bool isEndSection() const { return IsEndSection; }
+ /// Returns true if this block contains the first instruction of its section.
+ bool isFirstNonEmptyBBInSection() const { return IsFirstNonEmptyBBInSection; }
----------------
dhoekwater wrote:
I'm hesitant to add another maintained value to `MachineBasicBlock` because it introduces one more point of failure for silently invalidated invariants if subsequent MF passes don't properly update the value (for example, [`BranchRelaxation`](https://github.com/llvm/llvm-project/blob/8b6764fdc0c9550e3d8033006a4acfb466f74840/llvm/lib/CodeGen/BranchRelaxation.cpp#L267-L269) inserts basic blocks, potentially invalidating `isBeginSection`).
It looks like this value is only needed in `BasicBlockSections`; would it make sense to compute it directly there?
https://github.com/llvm/llvm-project/pull/112595
More information about the llvm-commits
mailing list