This covers forms involving "CPY (immediate, zeroing)".
This doesn't handle the case where the operands are reversed, and the condition is freely invertible. Not sure how to handle that. Maybe a DAGCombine.
Paths
| Differential D79598
[AArch64][SVE] Add patterns for VSELECT of immediates. ClosedPublic Authored by efriedma on May 7 2020, 2:08 PM.
Details Summary This covers forms involving "CPY (immediate, zeroing)". This doesn't handle the case where the operands are reversed, and the condition is freely invertible. Not sure how to handle that. Maybe a DAGCombine.
Diff Detail
Event TimelineComment Actions Hi @efriedma , thanks you for working on this.
Do you mean cases like select <vscale x 2 x i1> %p, <vscale x 2 x i64> zeroinitializer, <vscale x 2 x i64> %three? If that the case, the "merging" version of CPY , where %three is allocated to the dest register, should do it? CPY <Zd>.<T>, <Pg>/M, <R><n|SP>. Kind regards, Francesco
Comment Actions
I was more specifically thinking of the case where %p is something like an icmp, where we can potentially rewrite the operation to produce an inverted result for free. Otherwise, yes, we can use merging CPY. Comment Actions
I am not sure I understand. Can you give an explicit example? Regards, Francesco
Comment Actions Say you have something like x < 0 ? 0 : 1. That doesn't match. But if you rewrite it to x >= 0 ? 1 : 0, it does.
Comment Actions LGTM
A combine is probably easiest as it avoids having to specify the sequence to negate the predicate.
This revision is now accepted and ready to land.May 11 2020, 3:03 PM efriedma added inline comments.
Closed by commit rGa8874c76e8ae: [AArch64][SVE] Add patterns for VSELECT of immediates. (authored by efriedma). · Explain WhyMay 11 2020, 5:18 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 262955 llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
llvm/lib/Target/AArch64/SVEInstrFormats.td
llvm/test/CodeGen/AArch64/sve-vselect-imm.ll
|
Can I assume this was already handled by the PredicateMethod of SVECpyImmOperand8?