summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorJustin Holewinski <jholewinski@nvidia.com>2014-11-05 18:19:30 +0000
committerJustin Holewinski <jholewinski@nvidia.com>2014-11-05 18:19:30 +0000
commit3d140fcfd1b34bb2d3440b929c4510ee97fe8296 (patch)
tree5ed6bf3fcb542d78ac67930a709db8305017b0e1 /clang/lib/Lex/ModuleMap.cpp
parent2b049767b386d7aff238017df325a06b79806111 (diff)
downloadbcm5719-llvm-3d140fcfd1b34bb2d3440b929c4510ee97fe8296.tar.gz
bcm5719-llvm-3d140fcfd1b34bb2d3440b929c4510ee97fe8296.zip
[NVPTX] Add NVPTXLowerStructArgs pass
This works around the limitation that PTX does not allow .param space loads/stores with arbitrary pointers. If a function has a by-val struct ptr arg, say foo(%struct.x *byval %d), then add the following instructions to the first basic block : %temp = alloca %struct.x, align 8 %tt1 = bitcast %struct.x * %d to i8 * %tt2 = llvm.nvvm.cvt.gen.to.param %tt2 %tempd = bitcast i8 addrspace(101) * to %struct.x addrspace(101) * %tv = load %struct.x addrspace(101) * %tempd store %struct.x %tv, %struct.x * %temp, align 8 The above code allocates some space in the stack and copies the incoming struct from param space to local space. Then replace all occurences of %d by %temp. Fixes PR21465. llvm-svn: 221377
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud