[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 06:11:46 PST 2024
================
@@ -836,7 +836,7 @@ class InstructionsState {
return getOpcode() == CheckedOpcode || getAltOpcode() == CheckedOpcode;
}
- InstructionsState() = delete;
+ InstructionsState() = default;
----------------
HanKuanChen wrote:
The problem is when we call `newTreeEntry`, we don't provide the `MainOp` and `AltOp`.
```
TreeEntry *newTreeEntry(ArrayRef<Value *> VL,
TreeEntry::EntryState EntryState,
std::optional<ScheduleData *> Bundle,
const InstructionsState &S,
const EdgeInfo &UserTreeIdx,
ArrayRef<int> ReuseShuffleIndices = {},
ArrayRef<unsigned> ReorderIndices = {}) {
assert(((!Bundle && EntryState == TreeEntry::NeedToGather) ||
(Bundle && EntryState != TreeEntry::NeedToGather)) &&
"Need to vectorize gather entry?");
// Gathered loads still gathered? Do not create entry, use the original one.
if (GatheredLoadsEntriesFirst.has_value() &&
EntryState == TreeEntry::NeedToGather &&
S.getOpcode() == Instruction::Load && UserTreeIdx.EdgeIdx == UINT_MAX &&
!UserTreeIdx.UserTE)
return nullptr;
VectorizableTree.push_back(std::make_unique<TreeEntry>(VectorizableTree));
TreeEntry *Last = VectorizableTree.back().get();
```
It will make `TreeEntry` call the default constructor of `InstructionsState`. However, it is deleted.
This patch will make `InstructionsState` can be constructed by default constructor.
https://github.com/llvm/llvm-project/pull/120198
More information about the llvm-commits
mailing list