llvm-6502/lib/Target/NVPTX
Jingyue Wu c9f86c1260 [NVPTX] make load on global readonly memory to use ldg
Summary:
[NVPTX] make load on global readonly memory to use ldg

Summary:
As describe in [1], ld.global.nc may be used to load memory by nvcc when
__restrict__ is used and compiler can detect whether read-only data cache
is safe to use.

This patch will try to check whether ldg is safe to use and use them to
replace ld.global when possible. This change can improve the performance
by 18~29% on affected kernels (ratt*_kernel and rwdot*_kernel) in 
S3D benchmark of shoc [2]. 

Patched by Xuetian Weng. 

[1] http://docs.nvidia.com/cuda/kepler-tuning-guide/#read-only-data-cache
[2] https://github.com/vetter/shoc

Test Plan: test/CodeGen/NVPTX/load-with-non-coherent-cache.ll

Reviewers: jholewinski, jingyue

Subscribers: jholewinski, llvm-commits

Differential Revision: http://reviews.llvm.org/D11314

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242713 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 21:28:54 +00:00
..
InstPrinter
MCTargetDesc MC: Remove MCSubtargetInfo() default constructor 2015-07-10 22:43:42 +00:00
TargetInfo
cl_common_defines.h
CMakeLists.txt
LLVMBuild.txt
Makefile
ManagedStringPool.h
NVPTX.h
NVPTX.td
NVPTXAllocaHoisting.cpp
NVPTXAllocaHoisting.h
NVPTXAsmPrinter.cpp Move most user of TargetMachine::getDataLayout to the Module one 2015-07-16 06:11:10 +00:00
NVPTXAsmPrinter.h
NVPTXAssignValidGlobalNames.cpp
NVPTXFavorNonGenericAddrSpaces.cpp
NVPTXFrameLowering.cpp
NVPTXFrameLowering.h
NVPTXGenericToNVVM.cpp
NVPTXImageOptimizer.cpp
NVPTXInstrFormats.td
NVPTXInstrInfo.cpp
NVPTXInstrInfo.h
NVPTXInstrInfo.td
NVPTXIntrinsics.td
NVPTXISelDAGToDAG.cpp [NVPTX] make load on global readonly memory to use ldg 2015-07-20 21:28:54 +00:00
NVPTXISelDAGToDAG.h
NVPTXISelLowering.cpp Remove getDataLayout() from TargetLowering 2015-07-09 02:09:52 +00:00
NVPTXISelLowering.h Re-instate the EVT parameter to getScalarShiftAmountTy() for OOT user 2015-07-09 15:12:23 +00:00
NVPTXLowerAggrCopies.cpp Use inbounds GEPs for memcpy and memset lowering 2015-07-17 16:42:33 +00:00
NVPTXLowerAggrCopies.h
NVPTXLowerAlloca.cpp
NVPTXLowerKernelArgs.cpp
NVPTXMachineFunctionInfo.h
NVPTXMCExpr.cpp
NVPTXMCExpr.h
NVPTXPeephole.cpp [NVPTX] Move NVPTXPeephole after NVPTXPrologEpilogPass 2015-07-01 20:08:06 +00:00
NVPTXPrologEpilogPass.cpp
NVPTXRegisterInfo.cpp
NVPTXRegisterInfo.h
NVPTXRegisterInfo.td
NVPTXReplaceImageHandles.cpp Cosmetic cleanups - NFC 2015-07-08 16:33:21 +00:00
NVPTXSection.h
NVPTXSubtarget.cpp Remove getDataLayout() from TargetSelectionDAGInfo (had no users) 2015-07-09 02:10:08 +00:00
NVPTXSubtarget.h
NVPTXTargetMachine.cpp [NVPTX] enable SpeculativeExecution in NVPTX 2015-07-16 20:13:48 +00:00
NVPTXTargetMachine.h
NVPTXTargetObjectFile.h Remove DataLayout from TargetLoweringObjectFile, redirect to Module 2015-07-16 06:04:17 +00:00
NVPTXTargetTransformInfo.cpp Enable partial and runtime loop unrolling for NVPTX. 2015-07-13 18:33:21 +00:00
NVPTXTargetTransformInfo.h Enable partial and runtime loop unrolling for NVPTX. 2015-07-13 18:33:21 +00:00
NVPTXUtilities.cpp
NVPTXUtilities.h
NVPTXVector.td
NVVMReflect.cpp