[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
Thu Dec 26 21:54:23 PST 2024
================
@@ -8144,9 +8147,8 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
}
// Don't handle scalable vectors
- if (S.getOpcode() == Instruction::ExtractElement &&
- isa<ScalableVectorType>(
- cast<ExtractElementInst>(S.getMainOp())->getVectorOperandType())) {
+ if (auto *EE = dyn_cast_if_present<ExtractElementInst>(S.getMainOp());
----------------
HanKuanChen wrote:
It can work. See https://github.com/llvm/llvm-project/pull/120210/commits/c9ccb5577ac8c9994199bd761231ab1b1fd41321.
`isa_and_present<>` = `S.valid() && isa<>`
https://github.com/llvm/llvm-project/pull/120217
More information about the llvm-commits
mailing list