[llvm] [LV] Scale block costs using BranchFrequencyInfo (PR #71793)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 03:01:11 PST 2024


================
@@ -0,0 +1,113 @@
+; RUN: opt -mtriple=riscv64 -mattr=+v -riscv-v-vector-bits-max=128 -riscv-v-register-bit-width-lmul=1 -passes='require<profile-summary>,loop-vectorize' -debug-only=loop-vectorize -disable-output < %s 2>&1 | FileCheck %s
+
+; Check that branch weights make a difference when computing cost of scalar loop
+
+define void @foo_with_wts(ptr %A, ptr %B, i32 %n) {
+; CHECK: LV: Checking a loop in 'foo_with_wts'
+; CHECK: LV: Scalar loop costs: [[COST:[0-9]+]].
----------------
fhahn wrote:

This is a rare case where I think it would make sense to check the costs as printed in the debug output to make sure they are scaled as expected

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


More information about the llvm-commits mailing list