<div dir="ltr">Sigh.<div><br></div><div>Two things need your thoughts on george.</div><div><br></div><div>First, it looks like your attempt to add basicAA in setupAnalyses is not doing anything:</div><div><div> 76  <span class="gmail-Apple-tab-span" style="white-space:pre">  </span>AliasResult AAResults::alias(const MemoryLocation &LocA,</div><div>   77  <span class="gmail-Apple-tab-span" style="white-space:pre"> </span>                             const MemoryLocation &LocB) {</div><div>-> 78  <span class="gmail-Apple-tab-span" style="white-space:pre">        </span>  for (const auto &AA : AAs) {</div><div>   79  <span class="gmail-Apple-tab-span" style="white-space:pre">  </span>    auto Result = AA->alias(LocA, LocB);</div><div>   80  <span class="gmail-Apple-tab-span" style="white-space:pre">        </span>    if (Result != MayAlias)</div><div>   81  <span class="gmail-Apple-tab-span" style="white-space:pre">        </span>      return Result;</div><div>(lldb) p AAs</div></div><div>(std::__1::vector<std::__1::unique_ptr<llvm::AAResults::Concept, std::__1::default_delete<llvm::AAResults::Concept> >, std::__1::allocator<std::__1::unique_ptr<llvm::AAResults::Concept, std::__1::default_delete<llvm::AAResults::Concept> > > >) $33 = size=0 {}<br></div><div><br></div><div><br></div><div><br></div><div>Simple way to see this:<br><br></div><div>In the unit test, the following:</div><div><div>  Type *Int8 = Type::getInt8Ty(C);</div><div>  Value *AllocaA = B.CreateAlloca(Int8, ConstantInt::get(Int8, 1), "A");</div><div>  Instruction *SIA = B.CreateStore(ConstantInt::get(Int8, 0), AllocaA);</div><div>  Value *AllocaB = B.CreateAlloca(Int8, ConstantInt::get(Int8, 1), "B");</div><div>  Instruction *SIB = B.CreateStore(ConstantInt::get(Int8, 0), AllocaB);</div><div>  Instruction *LIA = B.CreateLoad(AllocaA);</div></div><div><br></div><div>results in:<br><div>define void @F() {</div><div>  %A = alloca i8, i8 1</div><div>; 1 = MemoryDef(liveOnEntry)</div><div>  store i8 0, i8* %A</div><div>  %B = alloca i8, i8 1</div><div>; 2 = MemoryDef(1)</div><div>  store i8 0, i8* %B</div><div>; MemoryUse(2)</div><div>  %1 = load i8, i8* %A</div><div>}</div></div><div><br></div><div>(The load is not being optimized because there is no AA).</div><div><br></div><div>Second, we can only reset optimized properly if all operand setting is done through setDefinedAccess.</div><div><br></div><div>We have no way to catch all the Use.set's that i can find.</div><div><br></div><div>If that's correct, i'll drop the optimized flag, and just keep the part to reset setDefiningAccess.</div><div><br></div><div>This means we will still pay a cost for calling getclobberingmemoryaccess on loads.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 2, 2016 at 7:39 PM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dberlin added a comment.<br>
<br>
(Unittest that resets the defining access, and calls getClobberingAccess, coming)<br>
<br>
<br>
<a href="https://reviews.llvm.org/D25172" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25172</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>