[PATCH] D80845: AMDGPU: Optimize s_setreg_b32 to s_denorm_mode/s_round_mode

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 15:20:11 PDT 2020


arsenm created this revision.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.
arsenm added reviewers: rampitec, foad, kerbowa, b-sumner.

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.


https://reviews.llvm.org/D80845

Files:
  llvm/lib/Target/AMDGPU/SIDefines.h
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/lib/Target/AMDGPU/SOPInstructions.td
  llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.s.setreg.ll
  llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.setreg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80845.267380.patch
Type: text/x-patch
Size: 25299 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200529/0d2418b6/attachment.bin>


More information about the llvm-commits mailing list