fuzzgen: Use the correct ISA when running NaN Canonicalization pass #8360
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.
👋 Hey,
cranelift-fuzzgen unconditionally runs the NaN Canonicalization pass on all functions that it generates. This is so that we can ensure that when running in the interpreter vs natively we get the same bitpattern for all NaN's.
Until now we just picked a random ISA (the host ISA), disabled the verifier and ran the pass with that. This was because the ISA didn't really matter for the passes that we wanted to run.
In #8313 the ISA now drives some codegen decisions for the NaN Canonicalization pass. Namely, if the ISA supports Vectors, it tries to use that.
In #8359 a fuzz bug was reported where fuzzgen generated vector code for RISC-V without the
has_v
flag, something that should never happen, because we simply cannot compile that code.It turns out that fuzzgen did not generate vector code itself. But since we were passing the host ISA to the NaN canonicalization pass, it assumed that it could use vectors and did so. But the actual target ISA did not support vectors.
To fix this, we now correctly pass the target ISA that we are building a function for.
Fixes #8359