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

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 20:31:26 PDT 2016


davidxl 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
----------------
If I read the code correctly, should the weights for select be 9:5 ? !11 does not look correct.

================
Comment at: test/Transforms/SimplifyCFG/preserve-branchweights.ll:423
@@ -423,2 +422,3 @@
+; CHECK-NEXT:    [[DOTMUX:%.*]] = select i1 %cmpb, i32 0, i32 2, !prof !11
 ; CHECK-NEXT:    [[OUTVAL:%.*]] = select i1 [[BRMERGE]], i32 [[DOTMUX]], i32 1, !prof !12
 ; CHECK-NEXT:    ret i32 [[OUTVAL]]
----------------
This one is correct.


http://reviews.llvm.org/D19674





More information about the llvm-commits mailing list