[PATCH] [NVPTXFavorNonGenericAddrSpaces] recursively trace into GEP and BitCast

Jingyue Wu jingyue at google.com
Wed May 27 15:01:07 PDT 2015


Hi broune, eliben, meheff, jholewinski,

This patch allows NVPTXFavorNonGenericAddrSpaces to remove addrspacecast
from longer chains consisting of GEPs and BitCasts. For example, it can
now optimize

  %0 = addrspacecast [10 x float] addrspace(3)* @a to [10 x float]*
  %1 = gep [10 x float]* %0, i64 0, i64 %i
  %2 = bitcast float* %1 to i32*
  %3 = load i32* %2 ; emits ld.u32

to

  %0 = gep [10 x float] addrspace(3)* @a, i64 0, i64 %i
  %1 = bitcast float addrspace(3)* %0 to i32 addrspace(3)*
  %3 = load i32 addrspace(3)* %1 ; emits ld.shared.f32

http://reviews.llvm.org/D10074

Files:
  lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp
  test/CodeGen/NVPTX/access-non-generic.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10074.26638.patch
Type: text/x-patch
Size: 13084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150527/b20869fa/attachment.bin>


More information about the llvm-commits mailing list