[fast-isel] Remove an invalid assert.
authorChad Rosier <mcrosier@apple.com>
Mon, 18 Feb 2013 21:46:28 +0000 (21:46 +0000)
committerChad Rosier <mcrosier@apple.com>
Mon, 18 Feb 2013 21:46:28 +0000 (21:46 +0000)
If the memcpy has an odd length with an alignment of 2, this would incorrectly
assert on the last 1 byte copy.
rdar://13202135

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175459 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMFastISel.cpp
test/CodeGen/ARM/fast-isel-intrinsic.ll

index 022fe9702662b5efe7b0ff2ac2c90347feb66777..b545dbc3ea1c0aaa9cd1ea7e14b528fc4b9c9b1d 100644 (file)
@@ -2458,7 +2458,6 @@ bool ARMFastISel::ARMTryEmitSmallMemCpy(Address Dest, Address Src,
       if (Len >= 2 && Alignment == 2)
         VT = MVT::i16;
       else {
-        assert (Alignment == 1 && "Expected an alignment of 1!");
         VT = MVT::i8;
       }
     }
index 7d38cc2a7f893a619a2c1135acde563b69b04635..3128f5ee342e8cf5f69b1ad18c5663c3bdc5a0fc 100644 (file)
@@ -231,3 +231,10 @@ define void @t6() nounwind ssp {
   call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 16), i32 10, i32 1, i1 false)
   ret void
 }
+
+rdar://13202135
+define void @t7() nounwind ssp {
+; Just make sure this doesn't assert when we have an odd length and an alignment of 2.
+  call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 16), i32 3, i32 2, i1 false)
+  ret void
+}