[llvm] [SandboxIR] Implement PossiblyDisjointInst (PR #106148)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 21:48:01 PDT 2024


================
@@ -2453,6 +2455,22 @@ class BinaryOperator : public SingleLLVMInstructionImpl<llvm::BinaryOperator> {
   void swapOperands() { swapOperandsInternal(0, 1); }
 };
 
+/// An or instruction, which can be marked as "disjoint", indicating that the
+/// inputs don't have a 1 in the same bit position. Meaning this instruction
+/// can also be treated as an add.
+class PossiblyDisjointInst : public BinaryOperator {
+public:
+  void setIsDisjoint(bool B);
+  bool isDisjoint() const {
+    return cast<llvm::PossiblyDisjointInst>(Val)->isDisjoint();
+  }
+  /// For isa/dyn_cast.
+  static bool classof(const Value *From) {
+    return isa<Instruction>(From) &&
----------------
tschuett wrote:

`dyn_cast` !

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


More information about the llvm-commits mailing list