llvm-project
a82b97c5 - [CodeGen] Fix lpad padding at section start after empty block (#112595)

Commit
137 days ago
[CodeGen] Fix lpad padding at section start after empty block (#112595) If a landing pad is at the very start of a split section, it has to be padded by a nop instruction. Otherwise its offset is marked as zero in the LSDA, which means no landing pad (leading it to be skipped). LLVM already handles this. If a landing pad is the first machine block in a section, a nop is inserted to ensure a non-zero offset. However, if the landing pad is preceeded by an empty block, the nop would be omitted. To fix this, this patch adds a field to machine blocks indicating whether this block contains the first instruction in its section. This variable is then used to determine whether to emit the padding. Co-authored-by: Jinjie Huang <huangjinjie@bytedance.com>
Author
Parents
Loading