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:
parent
2872ac051d
commit
f2b2b472cc
@ -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";
|
||||
}
|
||||
}
|
||||
|
16
test/Bitcode/sse42_crc32.ll
Normal file
16
test/Bitcode/sse42_crc32.ll
Normal 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(}
|
||||
|
BIN
test/Bitcode/sse42_crc32.ll.bc
Normal file
BIN
test/Bitcode/sse42_crc32.ll.bc
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user