[PATCH] D147243: [X86] MatchVectorAllZeroTest - add support for icmp(bitcast(icmp_ne(X,Y)),0) vector reduction patterns

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 30 13:01:46 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:24503
+  // TODO: Expand to icmp(bitcast(icmp_eq(X,Y)),-1) patterns.
+  if (Op.getOpcode() == ISD::BITCAST && Mask.isAllOnes()) {
+    SDValue Src = Op.getOperand(0);
----------------
RKSimon wrote:
> goldstein.w.n wrote:
> > Maybe just `PeekThroughBitCast(Op).getOpcode() == ISD::SETCC`?
> We'd need to repeat the PeekThroughBitCast call - is that clearer or not? Very minor tbh, I'm happy to do either.
Cant you do:
```
SDValue Src = PeekThroughBitCast(Op);
If(Mask.isAllOnes() && Src.getOpcode() == ISD::SETCC ....
```
?

But generally think thats preferable just because bitcast(bitcast(....)) or no bitcast / etc...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147243/new/

https://reviews.llvm.org/D147243



More information about the llvm-commits mailing list