Teach the new SROA a new trick. Now we zap any memcpy or memmoves which
authorChandler Carruth <chandlerc@gmail.com>
Fri, 5 Oct 2012 01:29:09 +0000 (01:29 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 5 Oct 2012 01:29:09 +0000 (01:29 +0000)
commitfca3f4021ae9a561edb6d2fcb4a282b6f25ab144
tree76579662ad00a378c1ea6f564bc2239ac7afa0ef
parent0e9da58af0e480af2fa87f8a61aa28b465fec280
Teach the new SROA a new trick. Now we zap any memcpy or memmoves which
are in fact identity operations. We detect these and kill their
partitions so that even splitting is unaffected by them. This is
particularly important because Clang relies on emitting identity memcpy
operations for struct copies, and these fold away to constants very
often after inlining.

Fixes the last big performance FIXME I have on my plate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165285 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SROA.cpp
test/Transforms/SROA/basictest.ll