[clang] [lld] [llvm] [LLVM][WebAssembly] Implement branch hinting proposal (PR #146230)

Lukas Döllerer via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 28 07:19:25 PST 2025


================
@@ -0,0 +1,100 @@
+; RUN: llc -mcpu=mvp -filetype=asm %s -mattr=+branch-hinting -wasm-branch-prob-high=.5 -wasm-branch-prob-low=0.5 -o - | FileCheck --check-prefixes=C1 %s
+; RUN: llc -mcpu=mvp -filetype=asm %s -mattr=+branch-hinting -wasm-branch-prob-high=.76 -wasm-branch-prob-low=0 -o - | FileCheck --check-prefixes=C2 %s
+; RUN: llc -mcpu=mvp -filetype=asm %s -mattr=+branch-hinting -wasm-branch-prob-high=.75 -wasm-branch-prob-low=0 -o - | FileCheck --check-prefixes=C3 %s
+
+; C1:	.section	.custom_section.target_features,"",@
+; C1-NEXT:	.int8	1
+; C1-NEXT:	.int8	43
+; C1-NEXT:	.int8	14
+; C1-NEXT:	.ascii	"branch-hinting"
+; C1-NEXT:	.section	.text.test2,"",@
+; C1:       .section  .custom_section.metadata.code.branch_hint,"",@
+; C1-NEXT:  .int8 3
+; C1-DAG:   .uleb128 test0 at FUNCINDEX
----------------
Lukasdoe wrote:

Just added the test for the correct assembling to the lit file :)

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


More information about the llvm-commits mailing list