[PATCH] D103147: [SelectionDAG][RISCV] Don't unroll 0/1-type bool VSELECTs
Fraser Cormack via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 26 09:48:10 PDT 2021
frasercrmck marked an inline comment as done.
frasercrmck added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp:1192
+ auto BoolContents = TLI.getBooleanContents(Op1.getValueType());
+ if (BoolContents == TargetLowering::UndefinedBooleanContent ||
+ (BoolContents == TargetLowering::ZeroOrOneBooleanContent &&
----------------
craig.topper wrote:
> I wonder if this would be better as
>
> ```
> if (BoolContents != TargetLowering::ZeroOrNegativeOneBooleanContent &&
> !(BoolContents == TargetLowering::ZeroOrOneBooleanContent && Op1.getValueType().getVectorElementType() != MVT::i1)
> ```
>
> That way if some new boolean contents type gets added, only the values that are known to work get through.
Yep that's a good idea, thanks. Though the `!= MVT::i1` should be `==` unless I'm mistaken.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103147/new/
https://reviews.llvm.org/D103147
More information about the llvm-commits
mailing list