This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Optimize s_setreg_b32 to s_denorm_mode/s_round_mode
ClosedPublic

Authored by arsenm on May 29 2020, 3:01 PM.

Details

Summary

This is a custom inserter because it was less work than teaching
tablegen a way to indicate that it is sometimes OK to have a no side
effect instruction in the output of a side effecting pattern.

The asm is needed to look like a read of the mode register to prevent
it from being deleted. However, there seems to be a bug where the mode
register def instructions are moved across the asm sideeffect by the
post-RA scheduler.

Another oddity is the immediate is formatted differently between
s_denorm_mode and s_round_mode.

Diff Detail

Event Timeline

arsenm created this revision.May 29 2020, 3:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 29 2020, 3:01 PM
rampitec accepted this revision.May 29 2020, 4:07 PM
This revision is now accepted and ready to land.May 29 2020, 4:07 PM