[PATCH] D85000: [ValueTracking] Improve llvm.abs handling in computeKnownBits.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 31 15:40:23 PDT 2020


spatel added a comment.

LGTM



================
Comment at: llvm/test/Transforms/InstCombine/abs-intrinsic.ll:55
+
+; FIXME: We can just remove this abs all together.
+define i1 @abs_known_positive_input(i31 %x) {
----------------
craig.topper wrote:
> spatel wrote:
> > This test folds, so FIXME here is confusing. Do we want a reduced test without the icmp?
> > 
> > ```
> > define i32 @abs_of_zext(i31 %x) {
> >   %zext = zext i31 %x to i32
> >   %abs = call i32 @llvm.abs.i32(i32 %zext, i1 false)
> >   ret i32 %abs
> > }
> > 
> > ```
> I assume this will be covered by your InstSimplify change?
Yes, that will get it. No need to duplicate here.


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

https://reviews.llvm.org/D85000



More information about the llvm-commits mailing list