-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fuzzgen: Generate compiler flags #5020
Conversation
Subscribe to Label Actioncc @fitzgen
This issue or pull request has been labeled: "cranelift", "cranelift:meta", "fuzzing"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
d4dd238
to
d15645b
Compare
This PR had some performance issues:
execs/s seems way better than before, which is nice. And for those who are interested, here's a flamegraph of where we spend time. This is about 2min at 1Khz around 190k inputs into my normal benchmark run: Edit: I should note, this is all on top of #5034 |
d15645b
to
a80376e
Compare
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.
Generally looks great, thanks! Some thoughts below on specifics but I'm happy to see this landed whenever you think it's appropriate to actually start fuzzing.
|
||
writeln!(f, "target aarch64")?; | ||
writeln!(f, "target s390x")?; | ||
writeln!(f, "target x86_64\n")?; |
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.
Does it make sense to add riscv64
here too (or are you worried it would find too many issues)?
Actually in the spirit of your enum .all()
method above -- perhaps we can define a cranelift_codegen::isa::all()
that returns all Triple
s compiled into the build, and use that here? (Feel free to drop that idea though if it's more than ~20 lines of complexity or so.)
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.
Yeah the all()
idea sounds good, I've been adding them where it think they would be useful for others.
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 ended up not being very easy to do, I might try it again later. But either way I've added riscv64
to the target list.
I've given this one round of fuzzing on AArch64 and x86, and it found the two issues with |
This allows a user to iterate all flags that exist.
It's finally here! 🥳
a80376e
to
711bcff
Compare
@cfallin What do you think about merging this with the It's getting a bit annoying having to rebase my other work on this PR just to fuzz it. I've fuzzed this for about an hour on both AArch64 and x86 without |
Oh, for sure, I didn't know we were waiting on something here; sorry! I was waiting for your go-ahead to merge. FWIW the PR is still marked as a draft; go ahead and transition it to "Ready for review" when you want me to merge. I actually think maybe it's fine to include |
I wasn't really, I just got a bit annoyed today at having to do a rebase for the third time, that's where that suggestion came from! I'm okay with merging this as is and letting ossfuzz report issues as we go along. |
👋 Hey,
This PR allows fuzzgen to generate compiler flags and test using those. We only allow compiler flags that shouldn't change the behaviour of the code.
I wanted to submit this now so that we could fuzz PR's such as #4953 and #5004 that require optimizations enabled.
However, when testing this it has found an issue with one of the passes (I haven't yet narrowed it down), but I don't want to start fixing it if we are going to change pretty much everything once #4953 lands. I'm opening this as a draft, and lets re test this once #4953 lands.
The actual bug manifests as following:
Fails with:
And I cannot reproduce via the CLIF file since that runs into #4875 (comment) (which I kinda forgot about 😅 ). But I'm going to try and investigate that one in the mean time.
This also enables regalloc_checker as we discussed in #4979.
cc: @jameysharp