[PATCH] D27830: Preserve loop metadata when folding branches to a common destination

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 16:26:25 PST 2016


mkuper added a comment.

In https://reviews.llvm.org/D27830#624538, @danielcdh wrote:

> Optional: while you are at it, it'll be very useful to handle the MD_prof here for branch probability. (e.g. when PBI has no MD_prof while BI has, or like the case described in TODO comment).


I'm a bit confused, I thought merging MD_prof is what the code directly above this does.



================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2795
 
+    // If BI was a loop latch, PBI is the new latch. If we have
+    // loop metadata, copy it over.
----------------
danielcdh wrote:
> Maybe make it explicit in the comment that "BI was a loop latch" means "BI has MD_loop" Metadata.
Right, what I was trying to say was that MD_loop is expected to live on loop latches, so that's when BI could have MD_loop.
I'll rephrase, thanks.


https://reviews.llvm.org/D27830





More information about the llvm-commits mailing list