[PATCH] D98152: [InstCombine] Canonicalize SPF to min/max intrinsics

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 09:00:41 PST 2022


RKSimon added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/minmax-fold.ll:283
+; CHECK-NEXT:    [[TMP2:%.*]] = call i32 @llvm.smin.i32(i32 [[TMP1]], i32 11)
+; CHECK-NEXT:    ret i32 [[TMP2]]
 ;
----------------
spatel wrote:
> spatel wrote:
> > nikic wrote:
> > > nikic wrote:
> > > > Regression
> > > This looks like a valuable fold.
> > Agree - I'll work on that one.
> > There should be some family of patterns like this:
> > https://alive2.llvm.org/ce/z/8nsAMp
> On 2nd thought, this is just a reassociation/simplify fold when we have 2 constant operands and matching min/max:
> https://alive2.llvm.org/ce/z/wW5HVM
Is a check for constants enough here or do we need full value tracking analysis?


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

https://reviews.llvm.org/D98152



More information about the llvm-commits mailing list