[PATCH] D36084: [globalisel][tablegen] Support zero-instruction emission.

Diana Picus via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 05:51:34 PDT 2017


rovka added a comment.

Hi Daniel,

Can you point me to the test that you've already committed? Was it an AArch64 inst select test? If so, I think you should also add a test in GlobalISelEmitter.td (I see one for a bitconvert -> COPY_TO_REGCLASS, but none checking mutations to COPY).

Thanks,
Diana



================
Comment at: lib/Target/AArch64/AArch64InstructionSelector.cpp:1169
+    // Imported SelectionDAG rules can handle everything except pointer types
+    // which didn't exist in that instruction selector.
+    if (MRI.getType(I.getOperand(0).getReg()).isPointer() ||
----------------
Can you point out those rules? The comments in SelectionDAGCompat say that G_INTTOPTR has no SelectionDAG equivalent, so I'm not sure where to look. 


================
Comment at: lib/Target/AArch64/AArch64InstructionSelector.cpp:1171
+    if (MRI.getType(I.getOperand(0).getReg()).isPointer() ||
+        MRI.getType(I.getOperand(1).getReg()).isPointer())
+      return selectCopy(I, TII, MRI, TRI, RBI);
----------------
Doesn't the destination always have to be a pointer and the source a scalar?


================
Comment at: utils/TableGen/GlobalISelEmitter.cpp:2293
                         to_string(Src->getExtTypes().size()) + " def(s) vs " +
                         to_string(DstI.Operands.NumDefs) + " def(s))");
 
----------------
Would it make sense to move these 2 checks higher up, as a quick exit? (So we don't createAndImport the Src only to discover that Dst wasn't an instruction in the first place).


https://reviews.llvm.org/D36084





More information about the llvm-commits mailing list