This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] SDWA: several fixes for V_CVT and VOPC instructions
ClosedPublic

Authored by SamWot on Jun 26 2017, 8:28 AM.

Details

Summary
  1. Instruction V_CVT_U32_F32 allow omod operand (see SIInstrInfo.td:1435). In fact this operand shouldn't be allowed here. This fix checks if SDWA pseudo instruction has OMod operand and then copy it.
  2. There were several problems with support of VOPC instructions in SDWA peephole pass.

Bug 33566

Diff Detail

Repository
rL LLVM

Event Timeline

SamWot created this revision.Jun 26 2017, 8:28 AM
SamWot edited the summary of this revision. (Show Details)Jun 26 2017, 8:32 AM

Hi Sam,

I can confirm that this patch fixes my issues with video playback on my RX480. I'm not sure what the standard is for LLVM but you have my

Tested-by: Nick Sarnie <commendsarnex@gmail.com>

Thanks,
Sarnex

arsenm added inline comments.Jun 26 2017, 6:41 PM
lib/Target/AMDGPU/SIInstrInfo.cpp
2500 ↗(On Diff #103960)

Just OMod

lib/Target/AMDGPU/SIPeepholeSDWA.cpp
666–667 ↗(On Diff #103960)

You should just use getNamedOperand rather than checking if it will succeed and then using it

SamWot updated this revision to Diff 104135.Jun 27 2017, 4:22 AM

Fix comments from Matt

vpykhtin accepted this revision.Jun 27 2017, 7:50 AM

LGTM.

This revision is now accepted and ready to land.Jun 27 2017, 7:50 AM
kzhuravl accepted this revision.Jun 27 2017, 7:53 AM

LGTM.

This revision was automatically updated to reflect the committed changes.