llvm-6502/lib/Target/NVPTX
Justin Holewinski e459c0bf65 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221377 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05 18:19:30 +00:00
..
InstPrinter Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
MCTargetDesc Fix a bit of confusion about .set and produce more readable assembly. 2014-10-21 01:17:30 +00:00
TargetInfo Prune redundant dependencies in LLVMBuild.txt. 2013-12-11 00:30:57 +00:00
cl_common_defines.h Update a couple of header inclusion guards 2014-05-31 21:26:09 +00:00
CMakeLists.txt [NVPTX] Add NVPTXLowerStructArgs pass 2014-11-05 18:19:30 +00:00
LLVMBuild.txt NVPTX/LLVMBuild.txt: Add "Scalar" to required_libraries. It is really referenced. 2014-07-14 02:52:19 +00:00
Makefile
ManagedStringPool.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTX.h [NVPTX] Add NVPTXLowerStructArgs pass 2014-11-05 18:19:30 +00:00
NVPTX.td [NVPTX] Add target options for PTX 3.2/4.0 and SM 5.0 (Maxwell) 2014-06-27 18:35:18 +00:00
NVPTXAllocaHoisting.cpp
NVPTXAllocaHoisting.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXAsmPrinter.cpp Reduce double set lookups. NFC. 2014-10-10 15:32:50 +00:00
NVPTXAsmPrinter.h NVPTX: remove raw delete call 2014-08-25 01:59:29 +00:00
NVPTXAssignValidGlobalNames.cpp [C++11] Add 'override' keywords and remove 'virtual'. Additionally add 'final' and leave 'virtual' on some methods that are marked virtual without overriding anything and have no obvious overrides themselves. NVPTX edition 2014-04-29 07:57:44 +00:00
NVPTXFavorNonGenericAddrSpaces.cpp Test commit. 2014-05-23 06:30:12 +00:00
NVPTXFrameLowering.cpp Have MachineFunction cache a pointer to the subtarget to make lookups 2014-08-05 02:39:49 +00:00
NVPTXFrameLowering.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXGenericToNVVM.cpp IR: MDNode => Value: NamedMDNode::getOperator() 2014-11-05 18:16:03 +00:00
NVPTXImageOptimizer.cpp Fix typos 2014-06-07 21:23:09 +00:00
NVPTXInstrFormats.td [NVPTX] Add more surface/texture intrinsics, including CUDA unified texture fetch 2014-07-17 11:59:04 +00:00
NVPTXInstrInfo.cpp Remove caching of the target machine in NVPTXInstrInfo and 2014-06-27 01:27:08 +00:00
NVPTXInstrInfo.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXInstrInfo.td [NVPTX] Improve handling of FP fusion 2014-07-17 18:10:09 +00:00
NVPTXIntrinsics.td NVPTX: support direct f16 <-> f64 conversions via intrinsics. 2014-07-18 08:30:10 +00:00
NVPTXISelDAGToDAG.cpp [NVPTX] Remove MemIntrinsicSDNode/MemSDNode duplicate checking 2014-08-13 04:59:51 +00:00
NVPTXISelDAGToDAG.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXISelLowering.cpp [NVPTX] aligned byte-buffers for vector return types 2014-10-25 03:46:16 +00:00
NVPTXISelLowering.h Add override to overriden virtual methods, remove virtual keywords. 2014-09-03 11:41:21 +00:00
NVPTXLowerAggrCopies.cpp [C++11] Add range based accessors for the Use-Def chain of a Value. 2014-03-09 03:16:01 +00:00
NVPTXLowerAggrCopies.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXLowerStructArgs.cpp [NVPTX] Add NVPTXLowerStructArgs pass 2014-11-05 18:19:30 +00:00
NVPTXMachineFunctionInfo.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXMCExpr.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:41:26 +00:00
NVPTXMCExpr.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXPrologEpilogPass.cpp Have MachineFunction cache a pointer to the subtarget to make lookups 2014-08-05 02:39:49 +00:00
NVPTXRegisterInfo.cpp [NVPTX] Rename registers %fl -> %fd and %rl -> %rd 2014-07-16 16:26:58 +00:00
NVPTXRegisterInfo.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXRegisterInfo.td [NVPTX] Rename registers %fl -> %fd and %rl -> %rd 2014-07-16 16:26:58 +00:00
NVPTXReplaceImageHandles.cpp Add override to overriden virtual methods, remove virtual keywords. 2014-09-03 11:41:21 +00:00
NVPTXSection.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXSubtarget.cpp Improve some const-correctness to remove a -Wcast-qual warning. No functional changes intended. 2014-08-01 12:34:58 +00:00
NVPTXSubtarget.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXTargetMachine.cpp [NVPTX] Add NVPTXLowerStructArgs pass 2014-11-05 18:19:30 +00:00
NVPTXTargetMachine.h Reverting NFC changes from r218050. Instead, the warning was disabled for GCC in r218059, so these changes are no longer required. 2014-09-18 17:34:23 +00:00
NVPTXTargetObjectFile.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXutil.cpp
NVPTXutil.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXUtilities.cpp IR: MDNode => Value: NamedMDNode::getOperator() 2014-11-05 18:16:03 +00:00
NVPTXUtilities.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
NVPTXVector.td
NVVMReflect.cpp [NVPTX] Add reflect intrinsic (better than matching by function name) 2014-06-27 18:36:11 +00:00