[PATCH] D88225: [DAG] Fold vector mul(x,0)/mul(x,1) to a clearing mask

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 08:09:19 PDT 2020


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

Not sure about AArch64, but this LG to me.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3708
 
+  // Fold ((mul x, 0/undef) -> 0 + fold (mul x, 1) -> x) -> and(x, mask)
+  // We can replace vectors with '0' and '1' factors with a clearing mask.
----------------
It took me 3 tries to read right. I'd suggest something closer to
```
// Fold ((mul x, 0/undef) -> 0,
//       (mul x, 1)       -> x))
       -> and(x, mask)
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88225



More information about the llvm-commits mailing list