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

David Li via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 22:20:07 PDT 2016


davidxl accepted this revision.
davidxl added a comment.
This revision is now accepted and ready to land.

lgtm


================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2882
@@ +2881,3 @@
+      // The program structure has changed. We are speculatively executing this
+      // select, so the original branch weights for PBI do not apply to the new
+      // select.
----------------
The select is newly created instruction that does not exist before -- it sits at the same BB where the original phi, so it is not 'speculatively' executed. 

The original PBI's branch weights do not apply because the select's 'logical' edges are incoming edges of the phi that is eliminated, not the out edges of PBI.


http://reviews.llvm.org/D19674





More information about the llvm-commits mailing list