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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits