[llvm] [SLP] NFC. Use InstructionsState::valid if users just want to know whether VL has same opcode. (PR #120217)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 24 10:17:08 PST 2024
================
@@ -821,7 +821,8 @@ class InstructionsState {
/// The main/alternate opcodes for the list of instructions.
unsigned getOpcode() const {
- return MainOp ? MainOp->getOpcode() : 0;
+ assert(MainOp && "InstructionsState is invalid.");
----------------
alexey-bataev wrote:
```suggestion
assert(valid() && "InstructionsState is invalid.");
```
https://github.com/llvm/llvm-project/pull/120217
More information about the llvm-commits
mailing list