[PATCH] D115448: [AArch64][SVE] Instcombine SDIV to ASRD

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 14 04:30:38 PST 2021


paulwalker-arm added a comment.

Just a couple of things to consider before committing.



================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1040-1041
+
+  if (!isSplatValue(DivVec))
+    return None;
+  Value *SplatValue = getSplatValue(DivVec);
----------------
FYI: If you use `dyn_cast_or_null<ConstantInt>(SplatValue)` you can remove this extra check.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1050
+    Constant *ExponentLog2 =
+        ConstantInt::get(Int32Ty, Exponent.logBase2(), true);
+    auto ASRD = Builder.CreateIntrinsic(
----------------
You shouldn't need this as the exponent cannot be negative and the intrinsic it's passed to (aarch64_sve_asrd) does not support this operand being negative either.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1058
+    Constant *ExponentLog2 =
+        ConstantInt::get(Int32Ty, Exponent.logBase2(), true);
+    auto ASRD = Builder.CreateIntrinsic(
----------------
As above.


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

https://reviews.llvm.org/D115448



More information about the llvm-commits mailing list