<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt"><div dir="ltr"><div class="gmail_default" style>Sorry for delays reviewing this, but I've been swamped with other patches.</div><div class="gmail_extra">
<br></div><div class="gmail_extra" style>I'm at a bit of a loss regarding your approach here:</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>- I don't think MemoryDependenceAnalysis can depend on LoopInfo -- it's used in *many* places where that isn't available.</div>
<div class="gmail_extra" style>- We can't rely on LoopInfo to describe all backedges as LoopInfo doesn't represent unnatural loops -- essentially it isn't guaranteed to find all cycles.</div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style>I think fundamentally, MemDep needs to use a conservative reachability analysis. We can't approximate this, or we will just miscompile ever more subtle code patterns.</div><div class="gmail_extra">
<br><div class="gmail_quote">On Tue, Dec 18, 2012 at 10:16 AM, Manman Ren <span dir="ltr"><<a href="mailto:mren@apple.com" target="_blank" class="cremed">mren@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
ping<br>
<br>
<br><br>
On Dec 14, 2012, at 3:01 PM, Manman Ren wrote:<br>
<br>
><br>
> ping<br>
><br>
> On Dec 13, 2012, at 10:34 AM, Manman Ren <<a href="mailto:mren@apple.com" class="cremed">mren@apple.com</a>> wrote:<br>
><br>
>><br>
>> Given input:<br>
>> while.body:<br>
>> call void @RunInMode(i32 100) nounwind<br>
>> %1 = load i32* %tasksIdle, align 4<br>
>> %tobool = icmp eq i32 %1, 0<br>
>> br i1 %tobool, label %while.cond.backedge, label %if.then<br>
>><br>
>> if.then:<br>
>> store i32 0, i32* %tasksIdle, align 4<br>
>> call void @TimerCreate(i32* %shouldExit) nounwind<br>
>> br label %while.cond.backedge<br>
>><br>
>> while.cond.backedge:<br>
>> %2 = load i32* %shouldExit, align 4<br>
>> %cmp = icmp eq i32 %2, 0<br>
>> br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge<br>
>><br>
>> Make sure we are not returning "call RunInMode" does not modify %shouldExit.<br>
>> Currently, we optimize this into<br>
>> while.cond.backedge:                              ; preds = %if.then, %while.body<br>
>> %1 = phi i32 [ %.pre, %if.then ], [ 0, %while.body ]<br>
>> %cmp = icmp eq i32 %1, 0<br>
>> br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge<br>
>><br>
>> The proper fix is to check all uses of %shouldExit as long as there is a possible<br>
>> path from the use to "call RunInMode". The proposed patch uses LoopInfo to approximate the reachability analysis.<br>
>> Suggestions on how to approximate this are welcome.<br>
>><br>
>> Please review, Thanks,<br>
>><br>
>> Manman<br>
>><br>
>> <mem_dep.patch>_______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@cs.uiuc.edu" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div></div></div>