-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AMDGPU] Exclude certain opcodes from being marked as single use #91802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ class LetDummies { | |
bit isReMaterializable; | ||
bit isAsCheapAsAMove; | ||
bit FPDPRounding; | ||
bit IsInvalidSingleUseConsumer; | ||
bit IsInvalidSingleUseProducer; | ||
Predicate SubtargetPredicate; | ||
string Constraints; | ||
string DisableEncoding; | ||
|
@@ -81,6 +83,8 @@ class VOP_Pseudo <string opName, string suffix, VOPProfile P, dag outs, dag ins, | |
string Mnemonic = opName; | ||
Instruction Opcode = !cast<Instruction>(NAME); | ||
bit IsTrue16 = P.IsTrue16; | ||
bit IsInvalidSingleUseConsumer = P.IsInvalidSingleUseConsumer; | ||
bit IsInvalidSingleUseProducer = P.IsInvalidSingleUseProducer; | ||
Comment on lines
+86
to
+87
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just set them to 0 (or false) here and let specific instructions override them. |
||
VOPProfile Pfl = P; | ||
|
||
string AsmOperands; | ||
|
@@ -175,6 +179,8 @@ class VOP3P_Pseudo <string opName, VOPProfile P, list<dag> pattern = []> : | |
class VOP_Real<VOP_Pseudo ps> { | ||
Instruction Opcode = !cast<Instruction>(NAME); | ||
bit IsSingle = ps.Pfl.IsSingle; | ||
bit IsInvalidSingleUseConsumer = ps.Pfl.IsInvalidSingleUseConsumer; | ||
bit IsInvalidSingleUseProducer = ps.Pfl.IsInvalidSingleUseProducer; | ||
Comment on lines
+182
to
+183
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copy from the pseudo not the profile. |
||
} | ||
|
||
class VOP3_Real <VOP_Pseudo ps, int EncodingFamily, string asm_name = ps.Mnemonic> : | ||
|
@@ -819,9 +825,7 @@ class VOP3P_DPPe_Common<bits<7> op, VOPProfile P> : VOP3P_DPPe_Common_Base<op, P | |
|
||
class VOP_DPP_Pseudo <string OpName, VOPProfile P, list<dag> pattern=[], | ||
dag Ins = P.InsDPP, string asmOps = P.AsmDPP> : | ||
InstSI <P.OutsDPP, Ins, OpName#asmOps, pattern>, | ||
VOP <OpName>, | ||
SIMCInstr <OpName#"_dpp", SIEncodingFamily.NONE> { | ||
VOP_Pseudo<OpName, "_dpp", P, P.OutsDPP, Ins, asmOps, pattern> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change - is it just a cleanup? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change allows dpp instructions to be included in the searchable table by inheriting the IsInvalidSingleUse* bits from VOP_Pseudo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I think this just allows you to use VOP_Pseudo as a common superclass for all VOP instructions, DPP or not, when you define the searchable table. Perhaps you could use an even more common class like InstSI - I'm not sure if that would make the generated table bigger. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks reasonable to me and a refinement as well. I second Jay's words on whether it makes sense to limit the flags to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a followup I guess we could remove a lot of the definitions below like |
||
|
||
let isPseudo = 1; | ||
let isCodeGenOnly = 1; | ||
|
@@ -853,6 +857,9 @@ class VOP_DPP_Pseudo <string OpName, VOPProfile P, list<dag> pattern=[], | |
let DisableEncoding = !if(P.NumSrcArgs, P.TieRegDPP, ""); | ||
let DecoderNamespace = "GFX8"; | ||
|
||
let IsInvalidSingleUseConsumer = !not(VINTERP); | ||
let IsInvalidSingleUseProducer = !not(VINTERP); | ||
|
||
VOPProfile Pfl = P; | ||
} | ||
|
||
|
@@ -1719,3 +1726,12 @@ def VOPTrue16Table : GenericTable { | |
let PrimaryKey = ["Opcode"]; | ||
let PrimaryKeyName = "getTrue16OpcodeHelper"; | ||
} | ||
|
||
def SingleUseExceptionTable : GenericTable { | ||
let FilterClass = "VOP_Pseudo"; | ||
let CppTypeName = "SingleUseExceptionInfo"; | ||
let Fields = ["Opcode", "IsInvalidSingleUseConsumer", "IsInvalidSingleUseProducer"]; | ||
|
||
let PrimaryKey = ["Opcode"]; | ||
let PrimaryKeyName = "getSingleUseExceptionHelper"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking again, there is no reason for these fields to exist in VOPProfile.