[llvm] [AArch64] Give a higher cost for more expensive SVE FCMP instructions (PR #153816)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 18 06:45:26 PDT 2025


================
@@ -4365,6 +4365,34 @@ AArch64TTIImpl::getAddressComputationCost(Type *PtrTy, ScalarEvolution *SE,
   return 1;
 }
 
+/// Check whether Opcode1 has less throughput according to the scheduling
+/// model than Opcode2.
+bool AArch64TTIImpl::hasLessThroughputFromSchedulingModel(
+    unsigned Opcode1, unsigned Opcode2) const {
+  const MCSchedModel &Sched = ST->getSchedModel();
+  const TargetInstrInfo *TII = ST->getInstrInfo();
+  if (!Sched.hasInstrSchedModel())
----------------
david-arm wrote:

Returning false here implies that throughput(opcode1) is always >= throughput(opcode2), whereas actually the answer is just unknown. Is it worth renaming the function to be something like `isKnownLessThroughput`? That way it's a bit clearer that returning false could mean either: 1) the answer is unknown, or 2) the answer is known to be false.

https://github.com/llvm/llvm-project/pull/153816


More information about the llvm-commits mailing list