Add patterns for SVE2 unpredicated multiply instructions:
- mul, smulh, umulh, pmul, sqdmulh, sqrdmulh
Also removed negative tests for immediate multiply that are set up to fail, since the case now can succeed and also is handled in the new test.
Paths
| Differential D72799
[SVE] Add SVE2 patterns for unpredicated multiply instructions ClosedPublic Authored by dancgr on Jan 15 2020, 12:11 PM.
Details Summary Add patterns for SVE2 unpredicated multiply instructions:
Also removed negative tests for immediate multiply that are set up to fail, since the case now can succeed and also is handled in the new test.
Diff Detail
Event TimelineComment Actions Can we also also add mul patterns for targets that have SVE, but not SVE2?
Comment Actions
That instruction is restricted to SVE2. Do we have unpredicated vector mul instructions for SVE targets as well? The way the instruction is implemented did not allow me to match with SVE targets.
Comment Actions
We can synthesize a predicate using ptrue. We do this in a few places currently; for example, to implement bswap.
Comment Actions
I hadn't thought of that. I will implement SVE fallbacks for the SVE2 instructions using ptrue.
Comment Actions Thanks for efforts on this patch @dancgr! As you can see, I have requested some changes to the patch to avoid diverging too much while we try to upstream the ACLE.
This revision now requires changes to proceed.Jan 16 2020, 9:41 AM Comment Actions I'm not sure on some parts, but I have prepared a major update for this patch that I hope will fix most of @sdesmalen concerns.
dancgr marked 2 inline comments as done. Comment ActionsTentative changes to address some comments from the reviewers. Comment Actions I'm not sure on some parts, but I have prepared a major update for this patch that I hope will fix most of @sdesmalen concerns. Comment Actions
Great, thanks for updating your patch! The patch is nearly good to go I think, just one more little change needed to remove _m.
dancgr marked an inline comment as done. Comment ActionsRemove _m from intrinsics, as it is the default behaviour. Also, add unpredicated patterns for SVE2 smulh, umulh. This revision is now accepted and ready to land.Jan 23 2020, 5:37 AM Closed by commit rG58ceb81d318b: [SVE] Add SVE2 patterns for unpredicated multiply instructions (authored by dancgr). · Explain WhyJan 23 2020, 10:28 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 239937 llvm/include/llvm/IR/IntrinsicsAArch64.td
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
llvm/lib/Target/AArch64/SVEInstrFormats.td
llvm/test/CodeGen/AArch64/sve-int-arith-imm.ll
llvm/test/CodeGen/AArch64/sve-int-mul-pred.ll
llvm/test/CodeGen/AArch64/sve-neg-int-arith-imm-2.ll
llvm/test/CodeGen/AArch64/sve-neg-int-arith-imm.ll
llvm/test/CodeGen/AArch64/sve2-int-mul.ll
|
smulh needs to be predicated AdvSIMD_Pred2VectorArg_Intrinsic, so that we can implement the predicated ACLE intrinsic with this LLVM IR intrinsic.
You can choose to optimize this predicated form (with ptrue predicate mask) into an unpredicated form using a ISel pattern.