Some Code Generation optimisation for lowering bit reverse in ISel. It uses vrev32 and vrev64 to optimise the lowering of bit reverse in the cases when VT is v4i32 and v2i64.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
6868 | Perhaps an assert here for VT == MVT::v4i32 || VT == MVT::v2i64. | |
6869 | How about these SVE checks, do we need tests for that? | |
6872 | Nit: /*OverrideNEON=*/true ? And we don't need the curly brackets for this if. | |
6879 | then this can be an else. | |
6881 | Wanted add a nit about Bitreverse -> BitReverse, but perhaps we don't need it: return DAG.getNode(AArch64ISD::NVCAST, DL, VT, DAG.getNode(ISD::BITREVERSE, DL, MVT::v16i8, REVB)); |
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
6869 | I think those are already tested for. That's just old code for the SVE case that I put here to make sure I don't change anything for SVE |
Add optimisation for v2i32 and v1i64 bitreverse lowering and respond to review comments
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
6872 | I think he meant to add /*OverrideNEON=*/, as it makes the code easier to read. | |
6873 | If we have the unreachable below, we probably don't need the assert as well. | |
6884 | As the code in each of these case blocks are very similar, is it worth having the switch just set some variables (BitReverseType and RevOpcode), and having the actual code shared below the switch? |
Thanks. LGTM.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
6885 | You can probably remove some of this extra whitespace. |
Since this change LLVM :: Analysis/CostModel/AArch64/bitreverse.ll is failing.
https://lab.llvm.org/buildbot/#/builders/43/builds/6828/steps/5/logs/FAIL__LLVM__bitreverse_ll
In case it's not just a forgotten test (didn't fail in buildkite which is odd), you can find the config used here https://lab.llvm.org/buildbot/#/builders/43/builds/6828/steps/3/logs/stdio.
Sorry about that. This new test wasn't caught and I am working on updating it right now to add a fix.
If it takes a while to fix, can we revert this in the meantime to get the bots back to green?
it doesn't take much at all, just retesting now to make sure everything is fine so no need to revert.
clang-tidy: warning: invalid case style for function 'LowerBitreverse' [readability-identifier-naming]
not useful