[llvm] [GlobalIsel] Visit ICmp (PR #105991)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 08:41:14 PDT 2024


================
@@ -950,6 +950,30 @@ class GExtOrTruncOp : public GCastOp {
   };
 };
 
+/// Represents a splat vector.
+class GSplatVector : public GenericMachineInstr {
+public:
+  Register getValueReg() const { return getOperand(1).getReg(); }
+
+  static bool classof(const MachineInstr *MI) {
+    return MI->getOpcode() == TargetOpcode::G_SPLAT_VECTOR;
+  };
+};
+
+/// Represents an integer-like extending operation.
+class GZextOrSextOp : public GCastOp {
+public:
+  static bool classof(const MachineInstr *MI) {
+    switch (MI->getOpcode()) {
+    case TargetOpcode::G_SEXT:
+    case TargetOpcode::G_ZEXT:
+      return true;
+    default:
+      return false;
+    }
+  };
+};
+
----------------
tschuett wrote:

GSplatVector is already upstream. `GZextOrSextOp` has probably a lower market share.

https://github.com/llvm/llvm-project/pull/105991


More information about the llvm-commits mailing list