-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[RISCV] Add disjoint or patterns for vwadd[u].vv #136716
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 1 commit
6cd1750
644fe31
f69c8e6
9599e60
288fb1f
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 |
|---|---|---|
|
|
@@ -5982,7 +5982,9 @@ SDValue DAGCombiner::hoistLogicOpWithSameOpcodeHands(SDNode *N) { | |
| LegalTypes && !TLI.isTypeDesirableForOp(LogicOpcode, XVT)) | ||
| return SDValue(); | ||
| // logic_op (hand_op X), (hand_op Y) --> hand_op (logic_op X, Y) | ||
| SDValue Logic = DAG.getNode(LogicOpcode, DL, XVT, X, Y); | ||
| SDNodeFlags LogicFlags; | ||
| LogicFlags.setDisjoint(N->getFlags().hasDisjoint()); | ||
|
||
| SDValue Logic = DAG.getNode(LogicOpcode, DL, XVT, X, Y, LogicFlags); | ||
| if (HandOpcode == ISD::SIGN_EXTEND_INREG) | ||
| return DAG.getNode(HandOpcode, DL, VT, Logic, N0.getOperand(1)); | ||
| return DAG.getNode(HandOpcode, DL, VT, Logic); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -912,6 +912,25 @@ defm : VPatWidenBinarySDNode_VV_VX_WV_WX<add, sext_oneuse, "PseudoVWADD">; | |
| defm : VPatWidenBinarySDNode_VV_VX_WV_WX<add, zext_oneuse, "PseudoVWADDU">; | ||
| defm : VPatWidenBinarySDNode_VV_VX_WV_WX<add, anyext_oneuse, "PseudoVWADDU">; | ||
|
|
||
| // DAGCombiner::hoistLogicOpWithSameOpcodeHands may hoist disjoint ors | ||
|
Collaborator
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 have saying this - but remember this only covers scalable types, and that you probably need a follow up patch for the fixed length variant. |
||
| // to (ext (or disjoint (a, b))) | ||
| multiclass VPatWidenOrDisjoint_VV<SDNode extop, string instruction_name> { | ||
tclin914 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| foreach vtiToWti = AllWidenableIntVectors in { | ||
| defvar vti = vtiToWti.Vti; | ||
| defvar wti = vtiToWti.Wti; | ||
| let Predicates = !listconcat(GetVTypePredicates<vti>.Predicates, | ||
| GetVTypePredicates<wti>.Predicates) in { | ||
| def : Pat<(wti.Vector (extop (vti.Vector (or_disjoint vti.RegClass:$rs2, vti.RegClass:$rs1)))), | ||
|
||
| (!cast<Instruction>(instruction_name#"_VV_"#vti.LMul.MX) | ||
| (wti.Vector (IMPLICIT_DEF)), vti.RegClass:$rs2, | ||
| vti.RegClass:$rs1, vti.AVL, vti.Log2SEW, TA_MA)>; | ||
| } | ||
| } | ||
| } | ||
| defm : VPatWidenOrDisjoint_VV<sext, "PseudoVWADD">; | ||
| defm : VPatWidenOrDisjoint_VV<zext, "PseudoVWADDU">; | ||
| defm : VPatWidenOrDisjoint_VV<anyext, "PseudoVWADDU">; | ||
|
|
||
| defm : VPatWidenBinarySDNode_VV_VX_WV_WX<sub, sext_oneuse, "PseudoVWSUB">; | ||
| defm : VPatWidenBinarySDNode_VV_VX_WV_WX<sub, zext_oneuse, "PseudoVWSUBU">; | ||
| defm : VPatWidenBinarySDNode_VV_VX_WV_WX<sub, anyext_oneuse, "PseudoVWSUBU">; | ||
|
|
||
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.
Please see the existing or_is_add and add_like in RISCVInstrInfo.td. We can move into generic, but let's do that separately.