[llvm] [SLP] NFC. Replace MainOp and AltOp in TreeEntry with InstructionsState. (PR #120198)

Han-Kuan Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 04:37:32 PST 2024


================
@@ -836,7 +836,7 @@ class InstructionsState {
     return getOpcode() == CheckedOpcode || getAltOpcode() == CheckedOpcode;
   }
 
-  InstructionsState() = delete;
+  InstructionsState() = default;
----------------
HanKuanChen wrote:

1. From `setOperations` we can know it should store InstructionsState.
```
    void setOperations(const InstructionsState &S) {
      MainOp = S.getMainOp();
      AltOp = S.getAltOp();
    }
```
2. The `TreeEntry` reimplemented all of the functions of `InstructionsState`. If we need to add some functions in `InstructionsState`, we may need to reimplement it in `TreeEntry` again.
3. I expect to add some functions in `InstructionsState` to solve the performance issue for https://github.com/llvm/llvm-project/pull/112181.

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


More information about the llvm-commits mailing list