Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
No, it's not related to profile information.
It's used to do things like explicitly enable or disable vectorization, unrolling, etc. I added you to the review because this is similar in spirit to what you did for the profile information.
Moving the loop metadata to the new latch looks good to me and I think it's a great idea to preserve it as best as we can. I'm reluctant to accept the revision only because I'm fairly new to LLVM and my experience with SimplifyCFG.cpp is rather limited.
@danielcdh the language ref provides a good overview over the information contained in MD_Loop (http://llvm.org/docs/LangRef.html#llvm-loop)
Thanks for the clarification and Thanks Florian for the pointer to the doc.
The patch LGTM, but I think Hal would be more qualified than I do to approve this.
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).
Thanks,
Dehao
lib/Transforms/Utils/SimplifyCFG.cpp | ||
---|---|---|
2795 ↗ | (On Diff #81677) | Maybe make it explicit in the comment that "BI was a loop latch" means "BI has MD_loop" Metadata. |
I'm a bit confused, I thought merging MD_prof is what the code directly above this does.
lib/Transforms/Utils/SimplifyCFG.cpp | ||
---|---|---|
2795 ↗ | (On Diff #81677) | 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. |