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

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 21 05:44:20 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())
----------------
sdesmalen-arm wrote:

I guess you could argue that without a scheduling model, the throughput of all opcodes is the same, and so the opcode of one instruction can never be (higher or) less than that of another instruction?

Alternatively, you could pass in the scheduling model by reference so that without a scheduling model this function can't be called, thus removing the ambiguity.

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


More information about the llvm-commits mailing list