<div dir="ltr">@silvas: <div>It's not clear how can I use CHECK-DAG to group together the branch weight meta data and the related instruction. if there is a single instruction and single meta data, I can move up the branch weight meta data next the the instruction.  But if there are multiple, I don't know how to do it. From the document, CHECK-DAG can be used b/w two matches (or before the first match, or after the last match).  Move the branch-weight meta data and use USE-DAG is not working.</div><div><br></div><div>I also tried to change all use USE to USE (except the first and last). That won't work either.</div><div><br></div><div>As for the loop2, it just a more complex data flow. I'll change it to two level nexted loop according to David's suggestion.</div><div><br></div><div>@david: </div><div>I used to use a buttom test loop, but I removed based on silvas's suggestion. I'll add more tests later if necessary.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 30, 2015 at 8:38 PM, David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davidxl added inline comments.<br>
<span class=""><br>
================<br>
Comment at: test/Transforms/PGOProfile/loop2.ll:9<br>
@@ +8,3 @@<br>
+<br>
+define i32 @test_nested_for(i32 %r, i32 %s, i32 %t) {<br>
+entry:<br>
----------------<br>
</span><span class="">silvas wrote:<br>
> What is the importance of testing a nested for loop? What part of the code are you trying to exercise that isn't covered by loop1.ll?<br>
</span>Having loop nest in the test for better coverage is fine -- but looks like we don't actually need 3-deep nest -- a 2-deep loop nest is good enough and will be easier to read.<br>
<br>
loop1.ll has a loop with top test. How about a loop test with bottom testing. Also a loop with more control flow inside the body, and a loop with early exit might be nice to have -- but those can be added later as follow ups if needed.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D12781" rel="noreferrer" target="_blank">http://reviews.llvm.org/D12781</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>