[LLVMdev] Memcpy / Memset for address spaces >= 256

Manuel Jacob me at manueljacob.de
Tue Mar 11 06:23:51 PDT 2014


Hi,

SelectionDAGBuilder doesn't know how to lower a Memcpy and Memset if one 
of the pointer operands have an address space >= 256.  This is 
understandable since the libc's memcpy / memset don't work for these 
address spaces.  However, both Clang (when copying a struct) and some 
optimization passes (LoopIdiomRecognize, MemCpyOpt) can emit memcpy / 
memset for these address spaces.  This triggers an assert in 
SelectionDAGBuilder.  The optimization passes could be modified to give 
up when they encounter an address space >= 256, but I think clang would 
need some new code that emits a struct copy member-by-member.  I think 
it's better to extend the code generator to be able to emit code for 
that.  What do you think?

The problem is also described here: 
http://llvm.org/bugs/show_bug.cgi?id=18549

-Manuel



More information about the llvm-dev mailing list