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
This commit is contained in:
Chandler Carruth
2012-10-05 01:29:09 +00:00
parent 0e9da58af0
commit fca3f4021a
2 changed files with 94 additions and 45 deletions
+2 -4
View File
@@ -862,8 +862,7 @@ define void @PR13916.1() {
; Ensure that we handle overlapping memcpy intrinsics correctly, especially in
; the case where there is a directly identical value for both source and dest.
; CHECK: @PR13916.1
; FIXME: We shouldn't leave this alloca around.
; CHECK: alloca
; CHECK-NOT: alloca
; CHECK: ret void
entry:
@@ -878,8 +877,7 @@ define void @PR13916.2() {
; different pointer value chains, but during rewriting we coalesce them into the
; same value.
; CHECK: @PR13916.2
; FIXME: We shouldn't leave this alloca around.
; CHECK: alloca
; CHECK-NOT: alloca
; CHECK: ret void
entry: