[PATCH] D72612: [AArch64][SVE] Add ImmArg property to intrinsics with immediates
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 13 12:27:54 PST 2020
efriedma added inline comments.
================
Comment at: llvm/lib/Target/AArch64/AArch64InstrFormats.td:1099
+class AsmVectorIndexOpnd<ValueType ty, AsmOperandClass mc, int Val>
+ : Operand<ty>, ComplexPattern<ty, 1, "SelectVectorIndex<" # Val # ">", []> {
let ParserMatchClass = mc;
----------------
sdesmalen wrote:
> @efriedma @rengolin The idea here is to use a ComplexPattern to match either a TargetConstant or a Constant (as at this point in selectiondag, it probably no longer matters what kind of constant it is, as we want to match an instruction). This avoids having to duplicate patternfragments for TImmLeaf and ImmLeaf for all the operands deriving from AsmVectorIndexOpnd.
>
> Any thoughts on this approach?
You should never need to duplicate a pattern. If the pattern is matching an ImmArg intrinsic, it has to be a TargetConstant; otherwise, it has to be a Constant. I would rather keep the corresponding pattern fragments strict, to avoid confusion about what we're expecting. Also, looking to the future, ComplexPatterns are more complicated to port to GlobalISel.
If the concern is just that you'll have to define the pattern fragments multiple times, could you use a multiclass?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72612/new/
https://reviews.llvm.org/D72612
More information about the cfe-commits
mailing list