[llvm] [SandboxIR][Tracker] Track eraseFromParent() (PR #99431)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 10:03:38 PDT 2024


================
@@ -99,6 +100,46 @@ class UseSet : public IRChangeBase {
 #endif
 };
 
+class EraseFromParent : public IRChangeBase {
+  /// Contains all the data we need to restore an "erased" (i.e., detached)
+  /// instruction: the instruction itself and the operands data.
+  struct InstrData {
+    /// The operand and the corresponding operand number.
+    struct OpData {
+      llvm::Value *Op;
+      unsigned OpNum;
+    };
+    /// The operands that got dropped.
+    SmallVector<OpData> OpDataVec;
+    /// The instruction that got "erased".
+    llvm::Instruction *LLVMI;
+  };
+  /// The instruction data is in reverse program order, which helps create the
+  /// original program order during revert().
+  SmallVector<InstrData> InstrData;
----------------
aeubanks wrote:

we can't test the multi-instruction code because we don't have an multi-instructions right now right? we should figure out a way to test that. maybe a test extension with a multi-instruction?

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


More information about the llvm-commits mailing list