[llvm] r328748 - [MemorySSA] Consider callsite args for hashing and equality.

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 20:14:52 PDT 2018


Ooh, good call. Fixed in r328755. Thanks!

On Wed, Mar 28, 2018 at 7:01 PM, Friedman, Eli <efriedma at codeaurora.org>
wrote:

> On 3/28/2018 5:54 PM, George Burgess IV via llvm-commits wrote:
>
>> Author: gbiv
>> Date: Wed Mar 28 17:54:39 2018
>> New Revision: 328748
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=328748&view=rev
>> Log:
>> [MemorySSA] Consider callsite args for hashing and equality.
>>
>> We use a `DenseMap<MemoryLocOrCall, MemlocStackInfo>` to keep track of
>> prior work when optimizing uses in MemorySSA. Because we weren't
>> accounting for callsite arguments in either the hash code or equality
>> tests for `MemoryLocOrCall`s, we optimized uses too aggressively in
>> some rare cases.
>>
>> Fix by Daniel Berlin.
>>
>> Should fix PR36883.
>>
>> Added:
>>      llvm/trunk/test/Analysis/MemorySSA/pr36883.ll
>> Modified:
>>      llvm/trunk/lib/Analysis/MemorySSA.cpp
>>
>> Modified: llvm/trunk/lib/Analysis/MemorySSA.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/
>> MemorySSA.cpp?rev=328748&r1=328747&r2=328748&view=diff
>> ============================================================
>> ==================
>> --- llvm/trunk/lib/Analysis/MemorySSA.cpp (original)
>> +++ llvm/trunk/lib/Analysis/MemorySSA.cpp Wed Mar 28 17:54:39 2018
>> @@ -153,9 +153,14 @@ public:
>>       if (IsCall != Other.IsCall)
>>         return false;
>>   -    if (IsCall)
>> -      return CS.getCalledValue() == Other.CS.getCalledValue();
>> -    return Loc == Other.Loc;
>> +    if (!IsCall)
>> +      return Loc == Other.Loc;
>> +
>> +    if (CS.getCalledValue() != Other.CS.getCalledValue())
>> +      return false;
>> +
>> +    assert(CS.arg_size() == Other.CS.arg_size());
>>
>
> LLVM supports varargs functions... not sure you can assert this.
>
> -Eli
>
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180328/c1ace972/attachment.html>


More information about the llvm-commits mailing list