[PATCH] D149390: [NFC][EarlyCSE]Modify test case to ensure branch weights are preserved with cse.

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 15:55:35 PDT 2023


mingmingl created this revision.
Herald added a project: All.
mingmingl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149390

Files:
  llvm/test/Transforms/EarlyCSE/basic.ll


Index: llvm/test/Transforms/EarlyCSE/basic.ll
===================================================================
--- llvm/test/Transforms/EarlyCSE/basic.ll
+++ llvm/test/Transforms/EarlyCSE/basic.ll
@@ -137,15 +137,18 @@
 ;; Simple call CSE'ing.
 define i32 @test5(ptr%P) {
 ; CHECK-LABEL: @test5(
-; CHECK-NEXT:    [[V1:%.*]] = call i32 @func(ptr [[P:%.*]])
+; CHECK-NEXT:    [[V1:%.*]] = call i32 @func(ptr [[P:%.*]]), !prof !0
 ; CHECK-NEXT:    ret i32 0
 ;
-  %V1 = call i32 @func(ptr %P)
-  %V2 = call i32 @func(ptr %P)
+  %V1 = call i32 @func(ptr %P), !prof !0
+  %V2 = call i32 @func(ptr %P), !prof !1
   %Diff = sub i32 %V1, %V2
   ret i32 %Diff
 }
 
+!0 = !{!"branch_weights", i32 95}
+!1 = !{!"branch_weights", i32 95}
+
 ;; Trivial Store->load forwarding
 define i32 @test6(ptr%P) {
 ; CHECK-LABEL: @test6(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149390.517739.patch
Type: text/x-patch
Size: 819 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230427/141e9bcb/attachment.bin>


More information about the llvm-commits mailing list