llvm.org GIT mirror llvm / 4591193
CRC32 intrinsics were renamed at revision 132163. This submission fixes aliasing issues with the old and new names as well as adds test cases for the auto-upgrader. Fixes rdar 9472944. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132207 91177308-0d34-0410-b5e6-96231b3b80d8 Chad Rosier 9 years ago
3 changed file(s) with 21 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
289289 if (Name.compare(5, 13, "x86.sse42.crc", 13) == 0) {
290290 const char* NewFnName = NULL;
291291 if (Name.compare(18, 2, "32", 2) == 0) {
292 if (Name.compare(20, 2, ".8") == 0) {
292 if (Name.compare(20, 2, ".8") == 0 && Name.length() == 22) {
293293 NewFnName = "llvm.x86.sse42.crc32.32.8";
294 } else if (Name.compare(20, 2, ".16") == 0) {
294 } else if (Name.compare(20, 3, ".16") == 0 && Name.length() == 23) {
295295 NewFnName = "llvm.x86.sse42.crc32.32.16";
296 } else if (Name.compare(20, 2, ".32") == 0) {
296 } else if (Name.compare(20, 3, ".32") == 0 && Name.length() == 23) {
297297 NewFnName = "llvm.x86.sse42.crc32.32.32";
298298 }
299299 }
300300 else if (Name.compare(18, 2, "64", 2) == 0) {
301 if (Name.compare(20, 2, ".8") == 0) {
301 if (Name.compare(20, 2, ".8") == 0 && Name.length() == 22) {
302302 NewFnName = "llvm.x86.sse42.crc32.64.8";
303 } else if (Name.compare(20, 2, ".64") == 0) {
303 } else if (Name.compare(20, 3, ".64") == 0 && Name.length() == 23) {
304304 NewFnName = "llvm.x86.sse42.crc32.64.64";
305305 }
306306 }
0 ; Check to make sure old CRC32 intrinsics are auto-upgraded
1 ; correctly.
2 ;
3 ; Rdar: 9472944
4 ;
5 ; RUN: llvm-dis < %s.bc | not grep {i32 @llvm.x86.sse42.crc32.8(}
6 ; RUN: llvm-dis < %s.bc | grep {i32 @llvm.x86.sse42.crc32.32.8(}
7 ; RUN: llvm-dis < %s.bc | not grep {i32 @llvm.x86.sse42.crc32.16(}
8 ; RUN: llvm-dis < %s.bc | grep {i32 @llvm.x86.sse42.crc32.32.16(}
9 ; RUN: llvm-dis < %s.bc | not grep {i32 @llvm.x86.sse42.crc32.32(}
10 ; RUN: llvm-dis < %s.bc | grep {i32 @llvm.x86.sse42.crc32.32.32(}
11 ; RUN: llvm-dis < %s.bc | not grep {i64 @llvm.x86.sse42.crc64.8(}
12 ; RUN: llvm-dis < %s.bc | grep {i64 @llvm.x86.sse42.crc32.64.8(}
13 ; RUN: llvm-dis < %s.bc | not grep {i64 @llvm.x86.sse42.crc64.8(}
14 ; RUN: llvm-dis < %s.bc | grep {i64 @llvm.x86.sse42.crc32.64.8(}
15