This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Look through a bitcast user of an out argument
ClosedPublic

Authored by arsenm on Jul 27 2017, 8:20 PM.

Details

Summary

This allows handling of a lot more of the interesting
cases in Blender. Most of the large functions unlikely
to be inlined have this pattern.

This is a special case for what clang emits for OpenCL 3
element vectors. Annoyingly, these are emitted as
<3 x elt>* pointers, but accessed as <4 x elt>* operations.
This also needs to handle cases where a struct containing
a single vector is used.

Diff Detail

Event Timeline

arsenm created this revision.Jul 27 2017, 8:20 PM
rampitec added inline comments.Jul 27 2017, 9:40 PM
lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
386

That is probably legal for a source to cast pointer argument to anything. Looks like you need to check if that is a special case you are looking for rather than asserting.

arsenm added inline comments.Jul 27 2017, 11:11 PM
lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
386

checkArgumentUses filter those out earlier. For our datalayout the only case where this should happen is the 3 vector case since the alignment is specifically set to be the same as the 4 element case.

This revision is now accepted and ready to land.Jul 27 2017, 11:21 PM
arsenm closed this revision.Jul 28 2017, 12:06 PM

r309419