- Notifications
You must be signed in to change notification settings - Fork 15.5k
[DAG] SDPatternMatch - Replace runtime data structures with lengths known at compile time#172064
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
[DAG] SDPatternMatch - Replace runtime data structures with lengths known at compile time #172064
Conversation
…ngth is known at compile time
bermondd commented Dec 12, 2025
I don't think I can select reviewers yet, but as these changes are relevant to a previous PR, CC @RKSimon@mshockwave |
RKSimon commented Dec 12, 2025
If we hoist NumPatterns out of match() and make a static class value then we can avoid having to pass it as a template argument. |
bermondd commented Dec 12, 2025
Hmm, true. I'll make that change in a next commit. |
… template arguments
mgorny commented Dec 13, 2025
I can confirm this change fixes the crash I'm seeing on x86, as I've reported in #169644 (comment). |
RKSimon left a comment
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.
LGTM - cheers
755a693 into llvm:mainUh oh!
There was an error while loading. Please reload this page.
llvm-ci commented Dec 14, 2025
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/186/builds/14708 Here is the relevant piece of the build log for the reference |
llvm-ci commented Dec 14, 2025
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/110/builds/6795 Here is the relevant piece of the build log for the reference |
bermondd commented Dec 14, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I have no idea what might be causing these issues, but I'll look into it. Should we revert this commit while I try to find what's wrong? |
bermondd commented Dec 14, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
This one's interesting. One of the lines say Edit:
And all of these fail because the builder can't find |
RKSimon commented Dec 14, 2025
Both are intermittent failures on more "exotic" buildbots - the trick is to check if they go green again the following build without a relevant commit fix :) |
bermondd commented Dec 14, 2025
Ah, I see. Thanks for the clarification! :) |
Following the suggestions in #170061, I replaced
SmallVector<SDValue>withstd::array<SDValue, NumPatterns>andSmallBitVectorwithBitset<NumPatterns>.I had to make some changes to the
collectLeavesandreassociatableMatchHelperfunctions. IncollectLeavesspecifically, I changed the return type so I could propagate a failure in case the number of found leaves is greater than the number of expected patterns. I also added a new unit test that, together with the one already present in the previous line, checks if the matching fails in the cases where the number of patterns is less or more than the number of leaves.I don't think this is going to completely address the increased compile time reported in #169644, but hopefully it leads to an improvement.