[PATCH] D111638: [AArch64][SVE] Combine predicated FMUL/FADD into FMA

Matt Devereau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 21 05:33:58 PDT 2021


MattDevereau marked 6 inline comments as done.
MattDevereau added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:715
+    return None;
+  auto FMulInst = dyn_cast<IntrinsicInst>(FMul);
+  if (!FMulInst->hasOneUse() || (p != II.getOperand(0)))
----------------
peterwaller-arm wrote:
> Is the dyn_cast needed? You should only need it if you need some methods which are on IntrinsicInst but not Value.
> 
> Also, nit, dyn_cast has logic which checks the type of the thing being cast -- this is unnecessary because the type is already constrained by the match() logic above, so if you did need a cast you can write `cast<Ty>(Val)` instead of `dyn_cast`.
replaced the dyn_cast with cast


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:716
+  auto FMulInst = dyn_cast<IntrinsicInst>(FMul);
+  if (!FMulInst->hasOneUse() || (p != II.getOperand(0)))
+    return None;
----------------
peterwaller-arm wrote:
> It seems to me that p != II.getOperand(0) should already be being checked by m_Deferred?
removed it


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111638



More information about the llvm-commits mailing list