This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add verification for mandatory literals
ClosedPublic

Authored by foad on May 20 2022, 5:08 AM.

Details

Summary

Extend the literal operand checking in SIInstrInfo::verifyInstruction to
check VOP2 instructions like V_FMAAK_F32 which have a mandatory literal
operand. The rule is that src0 can also be a literal, but only if it is
the same literal value.

AMDGPUAsmParser::validateConstantBusLimitations already handles this
correctly.

Diff Detail

Event Timeline

foad created this revision.May 20 2022, 5:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2022, 5:08 AM
foad requested review of this revision.May 20 2022, 5:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2022, 5:08 AM

Please add a test with an sgpr, something like $vgpr0 = V_FMAAK_F32 $sgpr0, $vgpr0, 1077936128, implicit $mode, implicit $exec

foad updated this revision to Diff 430963.May 20 2022, 7:18 AM

Add an sgpr test which fails for GFX9 and passes for GFX10.

Joe_Nash accepted this revision.May 20 2022, 8:10 AM

Thanks, LGTM

This revision is now accepted and ready to land.May 20 2022, 8:10 AM
This revision was landed with ongoing or failed builds.May 20 2022, 8:17 AM
This revision was automatically updated to reflect the committed changes.