[PATCH] D19674: [SimplifyCFG] propagate branch metadata when creating select

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 20:53:11 PDT 2016


spatel added inline comments.

================
Comment at: test/Transforms/SimplifyCFG/preserve-branchweights.ll:422
@@ -421,3 +421,3 @@
 ; CHECK-NEXT:    [[BRMERGE:%.*]] = or i1 %cmpb, %cmpa
-; CHECK-NEXT:    [[DOTMUX:%.*]] = select i1 %cmpb, i32 0, i32 2
+; CHECK-NEXT:    [[DOTMUX:%.*]] = select i1 %cmpb, i32 0, i32 2, !prof !11
 ; CHECK-NEXT:    [[OUTVAL:%.*]] = select i1 [[BRMERGE]], i32 [[DOTMUX]], i32 1, !prof !12
----------------
davidxl wrote:
> If I read the code correctly, should the weights for select be 9:5 ? !11 does not look correct.
I thought the weights for the select would be equal to the weights of the original branch because they have the same comparison condition (%cmpb), 3:5. How do you calculate 9:5?


http://reviews.llvm.org/D19674





More information about the llvm-commits mailing list