[llvm-commits] [llvm] r82300 - in /llvm/trunk/lib/Transforms: IPO/FunctionAttrs.cpp IPO/GlobalOpt.cpp Scalar/GVN.cpp Scalar/InstructionCombining.cpp Scalar/Reassociate.cpp Scalar/SCCP.cpp Scalar/SimplifyLibCalls.cpp Scalar/TailDuplication.cpp Utils/InlineCost.cpp
Victor Hernandez
vhernandez at apple.com
Mon Oct 19 14:47:39 PDT 2009
Chris,
This code review got ignored while I investigated the nightly
regressions.
>> + // fall through
>> + case Instruction::GetElementPtr:
>> FlowsToReturn.insert(RVI->getOperand(0));
>> continue;
>> case Instruction::Select: {
>> @@ -267,6 +271,8 @@
>> case Instruction::Malloc:
>> break;
>> case Instruction::Call:
>> + if (isMalloc(RVI))
>> + break;
>
>
> 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.
>
> I see that you already modified SimplifyLibCalls.cpp to handle
> malloc, so this can probably be removed.
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.
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
>> (original)
>> @@ -5891,9 +5893,9 @@
>>
>> // icmp <global/alloca*/null>, <global/alloca*/null> - Global/
>> Stack value
>> // addresses never equal each other! We already know that Op0 !=
>> Op1.
>> - if ((isa<GlobalValue>(Op0) || isa<AllocaInst>(Op0) ||
>> + if ((isa<GlobalValue>(Op0) || isa<AllocaInst>(Op0) || isMalloc
>> (Op0) ||
>> isa<ConstantPointerNull>(Op0)) &&
>> - (isa<GlobalValue>(Op1) || isa<AllocaInst>(Op1) ||
>> + (isa<GlobalValue>(Op1) || isa<AllocaInst>(Op1) || isMalloc
>> (Op1) ||
>> isa<ConstantPointerNull>(Op1)))
>
> Instead of special casing malloc here, please handle all "noalias"
> functions the same.
I have already stopped special-casing malloc here.
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091019/27b6a503/attachment.html>
More information about the llvm-commits
mailing list