This patch is to order the AVX instructions ahead of AVX512 instructions
in the matching table so that the AVX instructions can be matched first.
Thanks Craig for the idea.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
There are 16 test case fails.
Failed Tests (16): LLVM :: MC/AMDGPU/expressions.s LLVM :: MC/AMDGPU/gfx1011_dlops.s LLVM :: MC/AMDGPU/gfx10_asm_smem.s LLVM :: MC/AMDGPU/gfx7_asm_mubuf.s LLVM :: MC/AMDGPU/gfx8_asm_mubuf.s LLVM :: MC/AMDGPU/gfx90a_asm_features.s LLVM :: MC/AMDGPU/gfx90a_ldst_acc.s LLVM :: MC/AMDGPU/gfx9_asm_mubuf.s LLVM :: MC/AMDGPU/gfx9_asm_smem.s LLVM :: MC/AMDGPU/literalv216.s LLVM :: MC/AMDGPU/mubuf.s LLVM :: MC/AMDGPU/smem.s LLVM :: MC/AMDGPU/trap.s LLVM :: MC/AMDGPU/vop3-literal.s LLVM :: MC/Mips/micromips32r6/valid.s LLVM :: MC/WebAssembly/tables.s
llvm/utils/TableGen/AsmMatcherEmitter.cpp | ||
---|---|---|
648 | Is there any approach to check it is X86 target? |
llvm/utils/TableGen/AsmMatcherEmitter.cpp | ||
---|---|---|
648 | Sure. You can check TheDef->isSubClassOf("X86Inst") |
llvm/utils/TableGen/AsmMatcherEmitter.cpp | ||
---|---|---|
648 | Great! I'll update the patch. |
I personally prefer this patch, because it is more general and is easier to implement.
llvm/utils/TableGen/AsmMatcherEmitter.cpp | ||
---|---|---|
639–640 | Suggestion: This is X86-specific code in target-independent file. Please add some comments about why you specialize the code for X86 here and how the strict total order of ID is defined. |
Having something specific to some specific target in a generic code
(esp. if there is no precedent for it) seems conceptually wrong.
We can see in line 636, it also do some specific things for ARM. We can also see ReportMultipleNearMisses is added for ARM.
I think you understand that i'm not talking about doing specific for target X - adding new hooks is fine,
but specifically about checking for the subclass name and doing different stuff based on that.
Do you have any suggestions? I don't know if there is any mechanism that can invoke target specific function in generic code in tablegen.
llvm/utils/TableGen/AsmMatcherEmitter.cpp | ||
---|---|---|
624 | I have a question here. AVX512 instructions have larger register class, e.g. VR128X vs. VR128. Why doesn't (Could) the code work for them? |
llvm/utils/TableGen/AsmMatcherEmitter.cpp | ||
---|---|---|
624 | Oh, it seems they are all the same since only GPRs and memory. |
How about we add a EncodingCost to the base class Instruction and set a high cost for EVEX? Or we can reuse the Size in it, since all X86 instructions set it to 0. We can use it as the encoding cost.
@lebedev.ri How about adding a hook such as hasPositionOrder, which means the order in which the instructions appear in TD file affects the order of assembler matching ?
llvm/include/llvm/Target/Target.td | ||
---|---|---|
656–659 | Redundant? |
llvm/include/llvm/Target/Target.td | ||
---|---|---|
656–659 |
Opps! I forget to delete it. |
Redundant?