1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

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.

llvm-svn: 132207
This commit is contained in:
Chad Rosier 2011-05-27 19:38:10 +00:00
parent 2872ac051d
commit f2b2b472cc
3 changed files with 21 additions and 5 deletions

View File

@ -290,18 +290,18 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
if (Name.compare(5, 13, "x86.sse42.crc", 13) == 0) {
const char* NewFnName = NULL;
if (Name.compare(18, 2, "32", 2) == 0) {
if (Name.compare(20, 2, ".8") == 0) {
if (Name.compare(20, 2, ".8") == 0 && Name.length() == 22) {
NewFnName = "llvm.x86.sse42.crc32.32.8";
} else if (Name.compare(20, 2, ".16") == 0) {
} else if (Name.compare(20, 3, ".16") == 0 && Name.length() == 23) {
NewFnName = "llvm.x86.sse42.crc32.32.16";
} else if (Name.compare(20, 2, ".32") == 0) {
} else if (Name.compare(20, 3, ".32") == 0 && Name.length() == 23) {
NewFnName = "llvm.x86.sse42.crc32.32.32";
}
}
else if (Name.compare(18, 2, "64", 2) == 0) {
if (Name.compare(20, 2, ".8") == 0) {
if (Name.compare(20, 2, ".8") == 0 && Name.length() == 22) {
NewFnName = "llvm.x86.sse42.crc32.64.8";
} else if (Name.compare(20, 2, ".64") == 0) {
} else if (Name.compare(20, 3, ".64") == 0 && Name.length() == 23) {
NewFnName = "llvm.x86.sse42.crc32.64.64";
}
}

View File

@ -0,0 +1,16 @@
; Check to make sure old CRC32 intrinsics are auto-upgraded
; correctly.
;
; Rdar: 9472944
;
; RUN: llvm-dis < %s.bc | not grep {i32 @llvm.x86.sse42.crc32.8(}
; RUN: llvm-dis < %s.bc | grep {i32 @llvm.x86.sse42.crc32.32.8(}
; RUN: llvm-dis < %s.bc | not grep {i32 @llvm.x86.sse42.crc32.16(}
; RUN: llvm-dis < %s.bc | grep {i32 @llvm.x86.sse42.crc32.32.16(}
; RUN: llvm-dis < %s.bc | not grep {i32 @llvm.x86.sse42.crc32.32(}
; RUN: llvm-dis < %s.bc | grep {i32 @llvm.x86.sse42.crc32.32.32(}
; RUN: llvm-dis < %s.bc | not grep {i64 @llvm.x86.sse42.crc64.8(}
; RUN: llvm-dis < %s.bc | grep {i64 @llvm.x86.sse42.crc32.64.8(}
; RUN: llvm-dis < %s.bc | not grep {i64 @llvm.x86.sse42.crc64.8(}
; RUN: llvm-dis < %s.bc | grep {i64 @llvm.x86.sse42.crc32.64.8(}

Binary file not shown.