[PATCH] D106561: [AArch64] Optimise min/max lowering in ISel

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 28 07:43:26 PDT 2021


dmgreen added a comment.

Thanks for updating the costs.



================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:224-230
     auto LT = TLI->getTypeLegalizationCost(DL, RetTy);
     // umin(x,y) -> sub(x,usubsat(x,y))
     // umax(x,y) -> add(x,usubsat(y,x))
     if (LT.second == MVT::v2i64)
       return LT.first * 2;
     LLVM_FALLTHROUGH;
   }
----------------
This code can be removed now, it can fall through to the smin/smax cases.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:236
     auto LT = TLI->getTypeLegalizationCost(DL, RetTy);
+    if (LT.second == MVT::v2i64)
+      return LT.first * 2;
----------------
Maybe add a comment about it being converted to a cmp+bif?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106561



More information about the llvm-commits mailing list