[PATCH] D103147: [SelectionDAG][RISCV] Don't unroll 0/1-type bool VSELECTs

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 26 09:49:13 PDT 2021


craig.topper 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 &&
----------------
frasercrmck wrote:
> 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.
You're correct. I knew when I wrote that, I was going to mess up a ! somewhere.


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