Details
Diff Detail
Event Timeline
llvm/lib/Target/AArch64/AArch64InstrFormats.td | ||
---|---|---|
1099 | @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? | |
llvm/lib/Target/AArch64/SVEInstrFormats.td | ||
4386 | I think these can just as well use tvecshiftR8, tvecshiftR16, (etc) as those already exist. |
llvm/lib/Target/AArch64/AArch64InstrFormats.td | ||
---|---|---|
1099 | 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? |
- Removed shiftimm patterns and reused tvecshiftR8, etc
- Removed complex patterns used by AsmVectorIndexOpnd and instead created a multiclass (VectorIndex) to create a PatLeaf with timm if "_timm" is appended
LGTM with one question
llvm/lib/Target/AArch64/AArch64InstrFormats.td | ||
---|---|---|
1106 | Using ImmLeaf/TImmLeaf doesn't work here? |
llvm/lib/Target/AArch64/AArch64InstrFormats.td | ||
---|---|---|
1106 | Thanks for the suggestion, it looks like I can use ImmLeaf & TImmLeaf here (and use Imm again instead of N->getZExtValue() in VectorIndex1, etc below) |
@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?