[llvm] [SLP] NFC. Use InstructionsState::getOpcode only when necessary. (PR #120210)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 23 05:34:59 PST 2024
alexey-bataev wrote:
> Use `isa_and_present` may be better than valid check + `getOpcode`. e.g., old code: `if (S.getOpcode() != Instruction::PHI || S.isAltShuffle())`
>
> isa_and_present: `if (!isa_and_present<PHINode>(S.getMainOp()) || S.isAltShuffle())`
>
> valid check: `if ((!S.valid() || S.getOpcode() != Instruction::PHI) || S.isAltShuffle())`
Better to have last (`valid` based) approach
https://github.com/llvm/llvm-project/pull/120210
More information about the llvm-commits
mailing list