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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 15 07:50:51 PDT 2021


spatel added inline comments.


================
Comment at: llvm/test/Transforms/PhaseOrdering/minmax.ll:23
+; CHECK-NEXT:    [[SUB39:%.*]] = sub i8 [[SUB6]], [[K_0]]
+; CHECK-NEXT:    call void @use(i8 [[SUB31]], i8 [[SUB35]], i8 [[SUB39]], i8 [[K_0]])
 ; CHECK-NEXT:    ret void
----------------
RKSimon wrote:
> Any ideas whats causing this code bloat?
We probably need to implement some reassociation folds for the intrinsics like instcombine's factorizeMinMaxTree():
https://github.com/llvm/llvm-project/blob/da55af7f1d348c133774d8e8117d60462363fef5/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp#L2222

D88287 might also help, but NaryReassociate isn't in the default optimization pipeline?


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

https://reviews.llvm.org/D98152



More information about the llvm-commits mailing list