[llvm] r367443 - [AMDGPU] Fix for vectorizer crash with pointers of different size

Mekhanoshin, Stanislav via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 11:14:39 PDT 2019


In your case search ends before pointers change address space. They all come to the same root casted pointer "%alloc16 = addrspacecast i8* %alloc1 to i8 addrspace(1)*". In the failing case which was fixed one of the pointers has addrspacecast stripped while the search was still in progress, which has caused the problem.

I am looking if I can find a better cutoff criteria. Size is one of such possible criteria, but I want to look into this a little more.


--

Stas

-----Original Message-----
From: Benjamin Kramer <benny.kra at gmail.com<mailto:Benjamin%20Kramer%20%3cbenny.kra at gmail.com%3e>>
To: "Arsenault, Matthew" <Matthew.Arsenault at amd.com<mailto:%22Arsenault,%20Matthew%22%20%3cMatthew.Arsenault at amd.com%3e>>
Cc: "Mekhanoshin, Stanislav" <Stanislav.Mekhanoshin at amd.com<mailto:%22Mekhanoshin,%20Stanislav%22%20%3cStanislav.Mekhanoshin at amd.com%3e>>, llvm-commits <llvm-commits at lists.llvm.org<mailto:llvm-commits%20%3cllvm-commits at lists.llvm.org%3e>>
Subject: Re: [llvm] r367443 - [AMDGPU] Fix for vectorizer crash with pointers of different size
Date: Thu, 01 Aug 2019 16:53:43 +0200

[CAUTION: External Email]
Currently not at my workstation, attached is a test case that I scraped from the logs. This should have a <4 x float> load & store and scalar arithmetic after going through LoadStoreVectorizer.

On Thu, Aug 1, 2019 at 3:14 PM Arsenault, Matthew <Matthew.Arsenault at amd.com<mailto:Matthew.Arsenault at amd.com>> wrote:




This is too aggressive, it will prevent any pointer pair that's addrspacecast'ed from ever being recognized as consecutive. What's the reason for not checking the size? I'm seeing regressions where pointers are getting loaded from memory and then casted to the right addresspace.

- Ben

Do you have an example where this matters? I would expect any cases that are vectorizable and involve an addrspacecast would be taken care of by InferAddressSpaces, so the vectorizer doesn’t need to worry about them.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190801/6937acef/attachment.html>


More information about the llvm-commits mailing list