As discussed in D100107, this patch first convert index_vector to
step_vector, and convert step_vector back to index_vector after LegalizeDAG.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
13658 | You should be able to use Op2 directly and thus remove the need for the SPLAT_VECTOR and MUL. | |
13665 | Is this a phased the rollout? As in I'm assuming that this will ultimately be expressed in terms of STEP_VECTOR as well. | |
15461–15462 | This is already a requirement for the node and asserted with getNode() so doesn't need to be duplicated here. |
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
13658 | Sounds reasonable to me, update later. | |
13665 | For non-constant op, we need lower index_vector into mul(splat(op2) step_vector()) + splat(base), mul may be lower to shl, even combine as mla with add which may confused the codegen. I'm not sure whether it is worth to deal this. |
Assuming you agree I think you can just delete a bit of code and then the patch is good to go.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
13653–13663 | With your previous DAGCombine patches in mind I figured I'd take this patch for a test drive and I believe there's no longer need for this specialisation because the generic block (i.e. the else case) lowers to the expected output (or at least running this patches version of sve-intrinsics-index.ll reports a pass). | |
15451–15453 | FYI: I imagine we're only a few isel patterns away from not need this, but there's no need to hold up this patch for it. |
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
13653–13663 | Yes, previous DAGCombine patches can handle this. Then I'll remove the if part. |
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
15451–15453 | Yep, We can remove index_vector node finally |
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
13650–13652 | Up to you but this change is not needed because Op1 and Op2 must be the same type. |
@paulwalker-arm, Thanks for the review, I added D101593 which removes index_vector, FYI.
Up to you but this change is not needed because Op1 and Op2 must be the same type.