[PATCH] D60932: [NFC] Add baseline tests for int isKnownNonZero
Dan Robertson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 25 04:39:11 PDT 2019
dlrobertson marked an inline comment as done.
dlrobertson added inline comments.
================
Comment at: llvm/test/Transforms/InstCombine/cttz.ll:31
+ ret i32 %res
+}
----------------
nikic wrote:
> lebedev.ri wrote:
> > 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
> @lebedev.ri Thanks! I'm not sure whether it's worthwhile to add handling for this, as it would require walking uses three levels deep (uses of the original value, uses of the bitcast, uses of the icmp). It wouldn't hurt to add a test for it though, even if it'll not be handled by this patch.
> %t0 = bitcast <8 x i1> to i8
> icmp eq i8 %t0, 0
awesome! I'll add a test with this
> In that case it might make sense to add an early exit for vector types
Good point. I'll add that
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60932/new/
https://reviews.llvm.org/D60932
More information about the llvm-commits
mailing list