[PATCH] D60932: [NFC] Add baseline tests for int isKnownNonZero

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 23:59:54 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/cttz.ll:31
+  ret i32 %res
+}
----------------
nikic wrote:
> dlrobertson wrote:
> > dlrobertson wrote:
> > > nikic wrote:
> > > > It would be good to also test the ctlz case here. Possibly with a vector type, so we have at least one test that checks this transform with a vector zero.
> > > +1 sounds good
> > After looking at this, I'm not sure how this would work. The input value `x` would be a vector, but you can not `br` on a vector of `i1`s
> That's a good point! I guess vectors are indeed not subject to this transform, at least not without additional handling (we'd have to recognize an "all elements zero" pattern for the branch condition.)
> 
> In that case it might make sense to add an early exit for vector types in the main patch to avoid unnecessary walking the uses.
%t0 = bitcast <8 x i1> to i8
icmp eq i8 %t0, 0


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

https://reviews.llvm.org/D60932





More information about the llvm-commits mailing list