[PATCH] D83710: TableGen/GlobalISel: Allow output instructions with multiple defs

Madhur Amilkanthwar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 12:14:34 PDT 2020


madhur13490 added inline comments.


================
Comment at: llvm/utils/TableGen/GlobalISelEmitter.cpp:4850
 
-  if (DstI.Operands.NumDefs != Src->getExtTypes().size())
-    return failedImport("Src pattern results and dst MI defs are different (" +
+  if (DstI.Operands.NumDefs < Src->getExtTypes().size())
+    return failedImport("Src pattern result has more defs than dst MI (" +
----------------
I was thinking about this for the other change. If DstI's NumDefs are less than what source pattern is defining then we can ignore the defs from source pattern.  So, this error message shouldn't be there and may be we can emit a warning or something. OTOH, if it's opposite, i.e. source  pattern is defining a fewer values then dstI's some value will be undefined. In any case, there need not be an error because both of these are valid some or the other backend. I am not sure what we should be doing ideally from matching perspective but both cases can occur.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83710/new/

https://reviews.llvm.org/D83710





More information about the llvm-commits mailing list