[llvm] [FuncSpec] Only compute Latency bonus when necessary (PR #113159)

Alexandros Lamprineas via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 10:32:06 PDT 2024


================
@@ -819,6 +831,15 @@ static Function *cloneCandidateFunction(Function *F, unsigned NSpecs) {
   return Clone;
 }
 
+static unsigned getCostValue(const Cost &C) {
+  int64_t Value = *C.getValue();
+
+  assert(Value >= 0 && "CodeSize and Latency cannot be negative");
----------------
labrinea wrote:

The assertion message is now a bit misleading since we don't know what the parameter represents anymore, but I don't have a better suggestion.

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


More information about the llvm-commits mailing list