[llvm-commits] [llvm] r118417 - in /llvm/trunk: lib/Transforms/IPO/FunctionAttrs.cpp test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll

Dan Gohman gohman at apple.com
Mon Nov 8 12:22:42 PST 2010


On Nov 8, 2010, at 11:51 AM, Duncan Sands wrote:

> Hi Dan,
> 
>>>> @@ -140,10 +141,14 @@
>>>>            for (CallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end();
>>>>                 CI != CE; ++CI) {
>>>>              Value *Arg = *CI;
>>>> -            if (Arg->getType()->isPointerTy()&&
>>>> -                !AA->pointsToConstantMemory(Arg, /*OrLocal=*/true))
>>>> -              // Writes memory.  Just give up.
>>>> -              return false;
>>>> +            if (Arg->getType()->isPointerTy()) {
>>>> +              AliasAnalysis::Location Loc(Arg,
>>>> +                                          AliasAnalysis::UnknownSize,
>>>> +                                          I->getMetadata(LLVMContext::MD_tbaa));
>>>> +              if (!AA->pointsToConstantMemory(Arg, /*OrLocal=*/true))
>>> 
>>> Shouldn't it be Loc not Arg in the call to pointsToConstantMemory?
>> 
>> Oops, yes. Fixed.
> 
> since the test was passing in spite of this, maybe it could do with a stronger
> testcase?

Makes sense. I've added one now.

Dan





More information about the llvm-commits mailing list