<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Chris,</div><div>This code review got ignored while I investigated the nightly regressions.</div><div><br></div><div><blockquote type="cite"><div><blockquote type="cite">+ // fall through<br></blockquote><blockquote type="cite">+ case Instruction::GetElementPtr:<br></blockquote><blockquote type="cite"> FlowsToReturn.insert(RVI->getOperand(0));<br></blockquote><blockquote type="cite"> continue;<br></blockquote><blockquote type="cite"> case Instruction::Select: {<br></blockquote><blockquote type="cite">@@ -267,6 +271,8 @@<br></blockquote><blockquote type="cite"> case Instruction::Malloc:<br></blockquote><blockquote type="cite"> break;<br></blockquote><blockquote type="cite"> case Instruction::Call:<br></blockquote><blockquote type="cite">+ if (isMalloc(RVI))<br></blockquote><blockquote type="cite">+ break;<br></blockquote><br><br>This *shouldn't* be needed. The result of the malloc prototype should already be marked NoAlias. Please verify that this is happening (likewise for calloc, valloc, memalign, etc). If not, llvm-gcc/clang and simplifylibcalls should be updated to make this happen. One bonus of this that more stuff will benefit.<br><br>I see that you already modified SimplifyLibCalls.cpp to handle malloc, so this can probably be removed.<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><div><br></div><div>Just verified that malloc prototype is being marked NoAlias. And SimplifyLibCalls is marking all of those functions NoAlias also. I just deleted the isMalloc() check in rev 84541.</div><div><br></div><br><blockquote type="cite"><div><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)<br></blockquote><blockquote type="cite">@@ -5891,9 +5893,9 @@<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> // icmp <global/alloca*/null>, <global/alloca*/null> - Global/Stack value<br></blockquote><blockquote type="cite"> // addresses never equal each other! We already know that Op0 != Op1.<br></blockquote><blockquote type="cite">- if ((isa<GlobalValue>(Op0) || isa<AllocaInst>(Op0) ||<br></blockquote><blockquote type="cite">+ if ((isa<GlobalValue>(Op0) || isa<AllocaInst>(Op0) || isMalloc(Op0) ||<br></blockquote><blockquote type="cite"> isa<ConstantPointerNull>(Op0)) &&<br></blockquote><blockquote type="cite">- (isa<GlobalValue>(Op1) || isa<AllocaInst>(Op1) ||<br></blockquote><blockquote type="cite">+ (isa<GlobalValue>(Op1) || isa<AllocaInst>(Op1) || isMalloc(Op1) ||<br></blockquote><blockquote type="cite"> isa<ConstantPointerNull>(Op1)))<br></blockquote><br>Instead of special casing malloc here, please handle all "noalias" functions the same.<br></div></blockquote></div><br><div>I have already stopped special-casing malloc here.</div><div><br></div><div>Victor</div></body></html>