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

Irina Dobrescu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 28 07:44:46 PDT 2021


Rin added inline comments.


================
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;
   }
----------------
dmgreen wrote:
> This code can be removed now, it can fall through to the smin/smax cases.
Yeah, I was wondering about that. I'll remove it


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


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