[PATCH] D11481: [LoopUnswitch] Improve loop unswitch pass to find trivial unswitch conditions more effectively

Chen Li meloli87 at gmail.com
Fri Jul 24 11:32:31 PDT 2015

chenli added inline comments.

Comment at: lib/Transforms/Scalar/LoopUnswitch.cpp:752
@@ -751,3 +751,3 @@
 /// always unswitch trivial condition.
 bool LoopUnswitch::TryTrivialLoopUnswitch(bool &Changed) {
broune wrote:
> This comment is correct if we consider the header to extend across several basic blocks, as you do later on in a comment. I suspect that that's not a standard definition of the loop header (correct me if I'm wrong?), making this comment tricky to understand correctly. I think it would be clearer to explain this in terms of the first non-constant branch in the loop. Then probably the "Header" variable should be renamed to something else, like BB. Though this is subjective, so if you prefer the current way, I'll LGTM that.
Thanks for the suggestion. I should have made the comments consistent with each other. I will revise this :)


More information about the llvm-commits mailing list