llvm-project
6de78173 - [AMDGPU] Eliminate redundant s_round_mode and s_denorm_mode writes (#216305)

Commit
3 days ago
[AMDGPU] Eliminate redundant s_round_mode and s_denorm_mode writes (#216305) Add a block local peephole that drops writes to the FP round mode and the FP denorm mode which cannot be observed. A write is removed when a later write replaces the field before any instruction reads MODE, or when the value it writes is already live in MODE. s_round_mode and s_denorm_mode each assign one field of MODE and preserve the rest of the register, so the two fields are tracked independently: a write to one field is transparent to a pending write to the other. The analysis is intra-block only: the mode on entry to a block is treated as unknown, and a write still live at the end of a block is kept for its successors.
Author
Parents
Loading