[LLVMdev] Memmove vs Dead Code Elimination (original) (raw)

Carl-Philip Hänsch cphaensch at googlemail.com
Sat Sep 17 00:43:35 PDT 2011


Hello,

I have attached an example file to show you how i'm doing string concatenation. (This is the result after opt -O3 from llvm3.0) There are two strings (a and b) allocated and filled with malloc and llvm.memcpy (from an internal constant). Then, a third string (c) is created. The new length is correctly constant folded, and llvm.memcpy copies the memory from the first two strings into the new one. If LLVM would change the memcpy from a and b to c to a memcpy from the internal constant to c, it would be much better optimizable:

I hope you can implement some optimization rules to achieve that improvement ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110917/9b1cabe6/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: stringref.ll Type: application/octet-stream Size: 13929 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110917/9b1cabe6/attachment.obj>



More information about the llvm-dev mailing list