[PATCH] D95564: [GlobalISel] Add G_ASSERT_ZEXT

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 16:11:34 PST 2021


arsenm added inline comments.


================
Comment at: llvm/include/llvm/Target/GenericOpcodes.td:1345-1346
+
+// Asserts that an operation has already been zero-extended from a specific
+// type.
+def G_ASSERT_ZEXT : GenericInstruction {
----------------
Should mention this behaves identically to a COPY


================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:946
+    if (!MI->getOperand(2).isImm()) {
+      report("G_ASSERT_ZEXT expects an immediate operand #2", MI);
+      break;
----------------
I think these assert messages aren't consistent with using 0 indexing or not, but I guess this is the better direction


================
Comment at: llvm/test/CodeGen/AArch64/GlobalISel/legalize-ignore-hint.mir:18
+    %copy:_(s32) = COPY $w1
+    %hint:_(s32) = G_ASSERT_ZEXT %copy, 16
+    $w0 = COPY %hint
----------------
Should probably include a case with an illegal register type


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

https://reviews.llvm.org/D95564



More information about the llvm-commits mailing list