-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[DAG] Cleanup MatchFunnelPosNeg by using SDPatternMatch matchers
#129431
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 |
|---|---|---|
|
|
@@ -8528,6 +8528,13 @@ SDValue DAGCombiner::MatchFunnelPosNeg(SDValue N0, SDValue N1, SDValue Pos, | |
| return DAG.getNode(ISD::FSHL, DL, VT, N0, N1.getOperand(0), Pos); | ||
| } | ||
|
|
||
| SDValue X1, Y; | ||
| if (sd_match(N1, m_Srl(X1, m_SpecificInt(1))) && | ||
|
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. X1 -> m_Value(X1) |
||
| sd_match(InnerNeg, m_Xor(Y, m_SpecificInt(EltBits - 1))) && | ||
|
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. You can remove Y and use m_Specific(InnerPos) |
||
| Y == InnerPos && TLI.isOperationLegalOrCustom(ISD::FSHL, VT)) { | ||
| return DAG.getNode(ISD::FSHL, DL, VT, N0, N1.getOperand(0), Pos); | ||
|
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. N1.getOperand(0) -> X1 |
||
| } | ||
|
|
||
| // fold (or (shl (shl x0, 1), (xor y, 31)), (srl x1, y)) | ||
| // -> (fshr x0, x1, y) | ||
| if (IsBinOpImm(N0, ISD::SHL, 1) && | ||
|
|
||
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.
This should be removed entirely