aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/AutoUpgrade.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2011-05-27 19:38:10 +0000
committerChad Rosier <mcrosier@apple.com>2011-05-27 19:38:10 +0000
commit4591193b8d0f19547b73452366a08c43785678cc (patch)
tree08343b78db818106cddcb6da13bf953b8a9c1424 /lib/VMCore/AutoUpgrade.cpp
parent045c1d4e48e5e06ca05d04af340f7c487bc9975d (diff)
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
Diffstat (limited to 'lib/VMCore/AutoUpgrade.cpp')
-rw-r--r--lib/VMCore/AutoUpgrade.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp
index b2b3d0beb6..f8f15caec9 100644
--- a/lib/VMCore/AutoUpgrade.cpp
+++ b/lib/VMCore/AutoUpgrade.cpp
@@ -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";
}
}