[PATCH] D157628: [AArch64][SVE2] Change the cost of extends with S/URHADD to 0

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 03:37:31 PDT 2023


sdesmalen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:2088
+  // The add should only have one user, a right shift of 1.
+  auto *Add = cast<Instruction>(*I->user_begin());
+  if (Add->getOpcode() != Instruction::Add || !Add->hasOneUser())
----------------
Is it possible for I to have no users? (if so, should it return?)


================
Comment at: llvm/test/Transforms/LoopVectorize/AArch64/sve2-ext-rhadd-costs.ll:44
+
+for.body:
+  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
----------------
Is there a way to test this without requiring a loop? (and without requiring these tests to be in llvm/test/Transforms/LoopVectorize)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157628



More information about the llvm-commits mailing list