-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Add m_SelectCCLike matcher to match SELECT_CC or SELECT with SETCC #149646
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
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
432880f
Add m_SelectCCLike matcher to match SELECT_CC or SELECT with SETCC
houngkoungting 060eba0
Add m_SelectCCLike matcher to match SELECT_CC or SELECT with SETCC-1
houngkoungting 72ad2f7
[DAGCombiner] Add SelectCCLike matcher and unit test
houngkoungting f703bf7
[DAGCombiner] Add SelectCCLike matcher and unit test-1
houngkoungting 42279f8
[DAGCombiner] Add SelectCCLike matcher and unit test-2
houngkoungting 2e22456
[DAGCombiner] Add SelectCCLike matcher and unit test-3
houngkoungting ebab64b
[DAGCombiner] Add SelectCCLike matcher and unit test-3
houngkoungting 6436237
[DAGCombiner] Add SelectCCLike matcher and unit test-4
houngkoungting 065aa5a
[DAGCombiner] Add SelectCCLike matcher and unit test-5
houngkoungting eca282d
[DAGCombiner] Add SelectCCLike matcher and unit test-6
houngkoungting 4e17482
[DAGCombiner] Add SelectCCLike matcher and unit test-7
houngkoungting d24f058
[DAG] Add m_SelectCCLike matcher for SELECT_CC and SELECT(SETCC(...))
houngkoungting 82b9b2c
[DAG] Add m_SelectCCLike matcher for SELECT_CC and SELECT(SETCC(...))-1
houngkoungting 4651216
[DAG] Add m_SelectCCLike matcher for SELECT_CC and SELECT(SETCC(...))-2
houngkoungting 06290be
Merge branch 'main' into main
RKSimon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -859,3 +859,35 @@ TEST_F(SelectionDAGPatternMatchTest, MatchZeroOneAllOnes) { | |
| EXPECT_TRUE(sd_match(Vec, DAG.get(), m_AllOnes(true))); | ||
| } | ||
| } | ||
|
|
||
| TEST_F(SelectionDAGPatternMatchTest, MatchSelectCCLike) { | ||
|
||
| using namespace SDPatternMatch; | ||
|
|
||
| SDValue LHS = DAG->getConstant(1, SDLoc(), MVT::i32); | ||
| SDValue RHS = DAG->getConstant(2, SDLoc(), MVT::i32); | ||
| SDValue TVal = DAG->getConstant(3, SDLoc(), MVT::i32); | ||
| SDValue FVal = DAG->getConstant(4, SDLoc(), MVT::i32); | ||
| SDValue Select = DAG->getNode(ISD::SELECT_CC, SDLoc(), MVT::i32, LHS, RHS, | ||
| TVal, FVal, DAG->getCondCode(ISD::SETLT)); | ||
|
|
||
| ISD::CondCode CC = ISD::SETLT; | ||
| EXPECT_TRUE(sd_match( | ||
| Select, m_SelectCCLike(m_Specific(LHS), m_Specific(RHS), m_Specific(TVal), | ||
| m_Specific(FVal), m_CondCode(CC)))); | ||
| } | ||
|
|
||
| TEST_F(SelectionDAGPatternMatchTest, MatchSelectCC) { | ||
| using namespace SDPatternMatch; | ||
|
|
||
| SDValue LHS = DAG->getConstant(1, SDLoc(), MVT::i32); | ||
| SDValue RHS = DAG->getConstant(2, SDLoc(), MVT::i32); | ||
| SDValue TVal = DAG->getConstant(3, SDLoc(), MVT::i32); | ||
| SDValue FVal = DAG->getConstant(4, SDLoc(), MVT::i32); | ||
| SDValue Select = DAG->getNode(ISD::SELECT_CC, SDLoc(), MVT::i32, LHS, RHS, | ||
| TVal, FVal, DAG->getCondCode(ISD::SETLT)); | ||
|
|
||
| ISD::CondCode CC = ISD::SETLT; | ||
| EXPECT_TRUE(sd_match(Select, m_SelectCC(m_Specific(LHS), m_Specific(RHS), | ||
| m_Specific(TVal), m_Specific(FVal), | ||
| m_CondCode(CC)))); | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you remove matchUMinSubSelect and revert this back to using m_Select/m_VSelect? I'm hoping that once #150019 lands m_SelectCCLike can support m_VSelect as well.