barannikov88 accepted this revision. barannikov88 added a comment. This revision is now accepted and ready to land.
LGTM ================ Comment at: llvm/include/llvm/Support/MathExtras.h:212 /// Only unsigned integral types are allowed. -/// -/// \param ZB the behavior on an input of 0. Only ZB_Max and ZB_Undefined are -/// valid arguments. -template <typename T> T findFirstSet(T Val, ZeroBehavior ZB = ZB_Max) { - if (ZB == ZB_Max && Val == 0) +template <typename T> T findFirstSet(T Val) { + if (Val == 0) ---------------- kazu wrote: > craig.topper wrote: > > Note, x86 does not have an efficient instruction for find first set with > > zero returning -1. It will require a cmov to handle zero. > The new iteration of the patch leaves findFirstSet and findLastSet untouched. (optional) ZB could be made a template argument and constexpr-ifed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141798/new/ https://reviews.llvm.org/D141798 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits