[PATCH] D23749: [NVPTX] Add NVPTXHoistAddrSpaceCast pass.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 20 17:27:07 PDT 2016


jlebar created this revision.
jlebar added a reviewer: jingyue.
jlebar added subscribers: tra, llvm-commits, majnemer.
Herald added a subscriber: jholewinski.

This pass transforms

  gep (addrspacecast p)

into

  addrspacecast (gep p)

Doing the addrspacecast instruction first (which is valid in NVPTX but
not on all targets) lets LLVM optimize better, because LLVM treats
addrspacecast as a black-box function.

This is particularly important for the idiom clang will use for lowering
the __ldg builtin.

https://reviews.llvm.org/D23749

Files:
  llvm/lib/Target/NVPTX/CMakeLists.txt
  llvm/lib/Target/NVPTX/NVPTX.h
  llvm/lib/Target/NVPTX/NVPTXHoistAddrSpaceCast.cpp
  llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
  llvm/test/CodeGen/NVPTX/hoist-addrspace-cast-e2e.ll
  llvm/test/CodeGen/NVPTX/hoist-addrspace-cast.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23749.68793.patch
Type: text/x-patch
Size: 16911 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160821/7d3e6c69/attachment.bin>


More information about the llvm-commits mailing list