[PATCH] D36094: [globalisel][tablegen] Do not merge memoperands from instructions that weren't in the match.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 02:51:18 PDT 2017


fhahn added inline comments.


================
Comment at: include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h:377
+      int64_t MergeInsnID = -1;
+      while ((MergeInsnID = MatchTable[CurrentIdx++]) != -1) {
+        DEBUG(dbgs() << ", MIs[" << MergeInsnID << "]");
----------------
dsanders wrote:
> fhahn wrote:
> > Does this mean that now we are advancing CurrentIdx till the end? Could this have an impact on further actions after GIR_MergeMemOperands?
> Until the end of the variable-length MergeInsnID list which is indicated with a -1. After breaking out of this loop, CurrentIdx will be the index for the next GIR_* opcode.
Ah I thought it was something like that.

It might be slightly clearer if we would use a defined constant like END_VARARGS or something instead of -1, but that may be just because I have not much knowledge about GlobalISel


https://reviews.llvm.org/D36094





More information about the llvm-commits mailing list