[llvm] [SandboxIR][Tracker] Track eraseFromParent() (PR #99431)
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 18 10:33:08 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:
if we add a test extension it should be pretty clear that it's not for users. that would also be a nice way to show how to write an extension that doesn't contain all the vectorization complexity.
but I'm ok with adding a TODO to test multi-instructions and filling that in in a separate PR that adds a test extension
https://github.com/llvm/llvm-project/pull/99431
More information about the llvm-commits
mailing list