[llvm] [LV] Separate runtime check cost from total overhead in profitability check (PR #176754)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 21 02:57:27 PST 2026


================
@@ -257,7 +257,7 @@ define ptr @std_find_caller(ptr noundef %first, ptr noundef %last) {
 ; CHECK-NEXT:    [[TMP1:%.*]] = sub i64 [[TMP0]], [[FIRST3]]
 ; CHECK-NEXT:    [[TMP2:%.*]] = lshr exact i64 [[TMP1]], 1
 ; CHECK-NEXT:    [[TMP3:%.*]] = add nuw i64 [[TMP2]], 1
-; CHECK-NEXT:    [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[TMP1]], 126
+; CHECK-NEXT:    [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[TMP1]], 14
----------------
lukel97 wrote:

Looks like cttz.elts in the earlyexit block costs 4 on AArch64, so we were overcosting the checks in MinTC2 by at least 40. Makes sense that the min TC would drop significantly then

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


More information about the llvm-commits mailing list