-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failing assertion in AMDGPUAttributor with ptrtoint casts and AS 3 #120256
Comments
@llvm/issue-subscribers-backend-amdgpu Author: Fabian Ritter (ritter-x2a)
I observe a failing assertion in the AMDGPUAttributor in code with ptrtoint casts and address space 3. It occurs on trunk since commit 41ed16c by @jwanggit86.
Reproducer:
Used cmake options (probably not minimal):
I reduced the above IR from this HIP code:
|
checkConstForAddrSpaceCastFromPrivate has 2 issues, and is solving a problem it shouldn't need to be solving. It's assuming the type of the expression will be a pointer, which is the source of the assertion. The second issue is it doesn't know it can even parse the constant expressions this way, as it's only looking at the top level operation. This will not work correctly for any nested expression. It's using getConstantAccess, which is performing the necessary walk. The access type type returned by getConstantAccess should have been broadened to which type of addrspacecast |
Also this code should probably have been using llvm.ptrmask (i.e. __builtin_align_up) |
This was assuming that the top level constant expression was an addrspacecast. The first encountered expression may not be pointer typed, and may not be the addrspacecast. We need to distinguish the types of addrspacecasts unlike the previous queue ptr search, so do that. Fixes #120256
@jwanggit86 are you working on removing the old amdgpu-stack-objects and amdgpu-calls usage? |
I observe a failing assertion in the AMDGPUAttributor in code with ptrtoint casts and address space 3. It occurs on trunk since commit 41ed16c by @jwanggit86.
Reproducer:
opt -mcpu=gfx1030 --amdgpu-attributor frame.ll
with the above asframe.ll
yields:Used cmake options (probably not minimal):
I reduced the above IR from this HIP code:
The text was updated successfully, but these errors were encountered: