[PATCH] Teach SROA about addrspacecast.

Jingyue Wu jingyue at google.com
Mon Jun 15 15:45:39 PDT 2015

This patch is not in SROA yet. Do you mind I check it in?

I was bitten by the same issue in the NVPTX backend. Code patterns such as

  %0 = alloca i32
  %1 = addrspacecast i32* %0 to addrspace(4) i32* ; cast from generic to local so that later accesses can be much faster
  ... use %1 ...

will appear quite often after NVPTXFavorNonGenericAddrSpaces (http://llvm.org/docs/doxygen/html/NVPTXTargetMachine_8cpp_source.html#l00169) with some WIP checked in. It would be great if SROA can nuke these allocas across addrspacecasts.



More information about the llvm-commits mailing list