[llvm] r242199 - GVN: tolerate an instruction being replaced without existing in the leaderboard

Nick Lewycky nicholas at mxc.ca
Thu Jul 16 01:54:23 PDT 2015


Okay then. Thanks for checking up on it!

Daniel Berlin wrote:
> FWIW: When i wrote NewGVN, i went down the same path Tim did, and came
> to the same conclusion. The solution i came up with was to rewrite all
> of the eliminator and PRE handling.
>
> On Wed, Jul 15, 2015 at 2:29 PM, Tim Northover<tnorthover at apple.com>  wrote:
>> Hi Nick,
>>
>> Thanks for looking.
>>
>>> On 14 Jul 2015, at 21:00, Nick Lewycky<nicholas at mxc.ca>  wrote:
>>> This sounds very suspicious to me. While I agree that this fix does not miscompile, it sounds like you've fixed a symptom and that the underlying problem is inserting an instruction mid-GVN and not updating the leader table. Could you explain why that isn't a bug?
>>
>> I started out assuming I'd want to add the instruction to the list too. And it would probably still be a possible improvement in some cases (in this case it appears to make no difference).
>>
>> But GVN doesn't seem to be setup to do that; it creates instructions all over the place without updating its internal tables, and seems to expect them to remain reasonably stable. Even the most conservative attempts I've made to adapt it are scary (they also crash left, right&  centre; see attachment). In the end I decided the possible benefits just didn't justify it.
>>
>> Tim.
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>




More information about the llvm-commits mailing list