<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">If you want to use Alias analysis see MemoryDependenceAnalysis::getDependency(Instruction *QueryInst) for an example how-to query AA if two accesses might alias. In principle,  you query AA->getLocation(Inst) to obtain the location (ignoring special cases). You then use this info to query AA->alias(Loc1, Loc2).<br><br>You might be able to just use MemoryDependenceAnalysis.<br><br>I am not sure the cases we would catch justify the added cost. This would have to be evaluated.<br><br>- Arnold<div><br><div><div>On Feb 6, 2013, at 11:29 AM, Renato Golin <<a href="mailto:renato.golin@linaro.org">renato.golin@linaro.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div>Hi Arnold,</div><div><br></div><div>Thanks for the review. Please note that the patch is not ready, I'm looking for ideas... not final code review. ;)</div></div><div><br></div><div><br></div>On 6 February 2013 17:03, Arnold Schwaighofer <span dir="ltr"><<a href="mailto:aschwaighofer@apple.com" target="_blank">aschwaighofer@apple.com</a>></span> wrote:<br>
<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I don't think this is correct. You are asserting that: "Two geps will only alias if they have the same elements in the index list"?<br>
</blockquote><div><br></div><div>I *know* it's not correct. I should have been a bit more clear about that in my first email... ;)<br></div><div style=""><br></div><div style="">I haven't put in proper alias analysis yet, just trying to see if the skeleton of the code makes sense. Ignore the checks and alias analysis, for now...</div>
<div style=""><br></div><div style="">My plan is to add the AA steps directly on the WriteObjects values, but I don't know at which level it'd be more effective (instruction, or underlying value). If I do at the value level, I lose the instruction and thus the GEP info. If I do at the instruction level, I can't match reads against writes.</div>
<div style=""><br></div><div style="">My question for this iteration is: To make it easier for the Alias Analysis (which I still don't know how to do but am guessing something to do with AliasAnalysis::alias(Loc, Loc)), what should I keep in the Set?</div>
<div style=""><br></div><div style="">I could keep the Location of each access, so that on the read part, I'd just ask:</div><div style=""><br></div><div style="">  if (AliasAnalysis::alias(PrevWriteLoc, ThisReadLoc))) { BAD! }</div>
<div style=""><br></div><div style="">Would that take care of all cases? Would that be sensible?</div><div style=""><br></div><div style="">cheers,</div><div style="">--renato</div></div></div></div>
</blockquote></div><br></div></body></html>