This is an archive of the discontinued LLVM Phabricator instance.

fix regression on VI with SDWA gfx9 support
Needs ReviewPublic

Authored by airlied on Jun 22 2017, 8:40 PM.

Details

Reviewers
SamWot
Summary

The SDWA gfx9 support broke VI, this fixes the assert at least.

Diff Detail

Repository
rL LLVM

Event Timeline

airlied created this revision.Jun 22 2017, 8:40 PM
sarnex added a subscriber: sarnex.Jun 22 2017, 8:56 PM

This patch fixes the bug I sent to llvm-commits, https://bugs.freedesktop.org/show_bug.cgi?id=101561

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

Thanks,
Sarnex

Consider this a bug report for Sam, I'm not even sure where to start writing a test.

SamWot edited edge metadata.Jun 22 2017, 10:07 PM

Hi,
I have no access to bug report: https://bugs.freedesktop.org/show_bug.cgi?id=101561
Can you send me failing .ll?

Thanks

This change should in fact fix problem, but it is only workaround.
Ultimately problem is that instruction V_CVT_U32_F32 allow omod operand (see SIInstrInfo.td:1435). In fact this operand shouldn't be allowed here.
This should work as quickfix for assert if you need this. But I think it is better to provide full fix.

Hi Sam,

I just emailed you the good and bad shader dumps.

Thanks,
Sarnex

arsenm added inline comments.Jun 23 2017, 8:57 AM
lib/Target/AMDGPU/SIPeepholeSDWA.cpp
718

This is also no reason to use hasModifiersSet. That is a convenience wrapper when you don't have the operand, you can check the value of it directly here

At the moment this is more than an assert fix, we have broken VI in favour of GFX9 which nobody has. Please get a workaround, revert or fix into llvm master asap.