-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[RISCV] Convert more constant splats in tests to splat shorthand. NFC #87616
Conversation
…. NFC A handy shorthand for specifying the shufflevector(insertelement(poison, foo, 0), poison, zeroinitializer) splat pattern was introduced in llvm#74620. Some of the RISC-V tests were converted over to use this new form in dbb65dd, this patch handles the rest. This converts some constant expressions to the new form, but it also converts instruction sequences that weren't previously constant expressions to constant expressions as well. In some cases this causes some minor code motion in the test output, but it's not significant to the test itself. E.g. see llvm/test/CodeGen/RISCV/rvv/fixed-vectors-masked-{gather,scatter}.ll
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, thanks!
(Did you convert these tests manually or via some scripts?)
I wrote a Perl script, it should be attached it in the PR description. I really don't know Perl at all though, I'm sure it's terrible! |
Yeah, I see it now (the script is collapsed so I didn't notice it). |
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 assuming no codegen changes are hidden in here. I see you split those out.
…set of tests with codegen diffs
0413b64
to
a361f6f
Compare
…hand. NFC This follows on from llvm#87616, but includes the tests with codegen differences. These are presumably due to the fact that the splat is now a constant expression. They don't seem to affect anything that we were specifically testing for.
A handy shorthand for specifying the shufflevector(insertelement(poison, foo, 0), poison, zeroinitializer) splat pattern was introduced in #74620.
Some of the RISC-V tests were converted over to use this new form in dbb65dd, this patch handles the rest which didn't have any codegen diffs.
This not only converts some constant expressions to the new form, but also instruction sequences that weren't previously constant expressions to constant expressions as well. In some cases this affects codegen, but these have been omitted here and will be handled in a separate PR to show the diff better.
Script used for reference