[PATCH] D63963: [Codegen][SelectionDAG] X u% C == 0 fold: non-splat vector improvements

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 20 07:59:25 PDT 2019


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

LGTM with one minor



================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:4468
+  // Is there a value for which the Predicate does *NOT* match? What is it?
+  if (SDValue *SplatValue = llvm::find_if_not(Values, Predicate)) {
+    // Does Values consist only of SplatValue's and values matching Predicate?
----------------
lebedev.ri wrote:
> RKSimon wrote:
> > I haven't used find_if_not before - so this is guaranteed to return nullptr for no match?
> Whoops, neither llvm wrappers nor the STL versions return nullptr here, this should be checking for `!= Values.end()`
> Thanks!
Better to use "auto SplatValue"? I'd expect the return type to be some kind of iterator type not a regular pointer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63963





More information about the llvm-commits mailing list