This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix SITargetLowering::LowerCall for pointer info of byval argument
ClosedPublic

Authored by yaxunl on Nov 14 2017, 9:55 AM.

Details

Summary

SITargetLowering::LowerCall uses dummy pointer info for byval argument, which causes
flat load instead of buffer load.

This patch fixes that.

Diff Detail

Repository
rL LLVM

Event Timeline

yaxunl created this revision.Nov 14 2017, 9:55 AM
This revision is now accepted and ready to land.Nov 14 2017, 10:33 AM
arsenm added inline comments.Nov 14 2017, 4:50 PM
lib/Target/AMDGPU/SIISelLowering.cpp
2284 ↗(On Diff #122862)

I think this should be a Stack PseudoSourceValue, but don't remember why it isn't

arsenm added inline comments.Nov 14 2017, 4:53 PM
lib/Target/AMDGPU/SIISelLowering.cpp
2284 ↗(On Diff #122862)

The destination is a Stack PSV. The source I guess is unknown. We do need to figure out something other than undef for these

yaxunl added inline comments.Nov 14 2017, 8:17 PM
lib/Target/AMDGPU/SIISelLowering.cpp
2284 ↗(On Diff #122862)

The source is a pointer in private address space, other than that we don't know anything about the source. For example, in the lit test the source is inttoptr i32 16 to i8 addrspace(5)*. At the point of isel, this source is a constant integer 16. Currently there is no PSV to represent address space only. At least llvm undef value conveys the address space information.

arsenm accepted this revision.Nov 16 2017, 3:58 PM

LGTM

This revision was automatically updated to reflect the committed changes.