[llvm] [SLP] NFC. Use InstructionsState::valid if users just want to know whether VL has same opcode. (PR #120217)

Han-Kuan Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 06:57:25 PST 2025


HanKuanChen wrote:

> getMainOp and getAltOp should assert if the state is invalid

Cannot. `TreeEntry` will use `InstructionsState::getMainOp` and `InstructionsState::getAltOp`. But the `InstructionsState` may be invalid (`newTreeEntry` may get an invalid `InstructionsState`).

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


More information about the llvm-commits mailing list