summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/NVPTX/NVPTXLowerStructArgs.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Clean up NVPTXLowerStructArgs.cpp. NFCEli Bendersky2014-11-061-54/+37
| | | | | | | | | * Remove unnecessary const_casts and C-style casts * Simplify attribute access code * Simplify ArrayRef creation * 80-col and clang-format llvm-svn: 221464
* Fixing some -Wcast-qual warnings; NFC.Aaron Ballman2014-11-061-6/+7
| | | | llvm-svn: 221454
* [NVPTX] Add NVPTXLowerStructArgs passJustin Holewinski2014-11-051-0/+150
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
OpenPOWER on IntegriCloud