summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AutoUpgrade.cpp
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2008-06-25 08:15:39 +0000
committerMon P Wang <wangmp@apple.com>2008-06-25 08:15:39 +0000
commit6a490371c923d98143d574730ec9010bbbb89139 (patch)
tree79b5b1309f0962c3d01214272dfadeeb8c26eba8 /llvm/lib/VMCore/AutoUpgrade.cpp
parent2e2001d8b9786ccb6703011810817f3751f0e787 (diff)
downloadbcm5719-llvm-6a490371c923d98143d574730ec9010bbbb89139.tar.gz
bcm5719-llvm-6a490371c923d98143d574730ec9010bbbb89139.zip
Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and atomic.lss => atomic.load.sub llvm-svn: 52706
Diffstat (limited to 'llvm/lib/VMCore/AutoUpgrade.cpp')
-rw-r--r--llvm/lib/VMCore/AutoUpgrade.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/AutoUpgrade.cpp b/llvm/lib/VMCore/AutoUpgrade.cpp
index 7b6369208c1..c2c19c45e4c 100644
--- a/llvm/lib/VMCore/AutoUpgrade.cpp
+++ b/llvm/lib/VMCore/AutoUpgrade.cpp
@@ -39,6 +39,30 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
Module *M = F->getParent();
switch (Name[5]) {
default: break;
+ case 'a':
+ // This upgrades the llvm.atomic.lcs, llvm.atomic.las, and llvm.atomic.lss
+ // to their new function name
+ if (Name.compare(5,8,"atomic.l",8) == 0) {
+ if (Name.compare(12,3,"lcs",3) == 0) {
+ std::string::size_type delim = Name.find('.',12);
+ F->setName("llvm.atomic.cmp.swap"+Name.substr(delim));
+ NewFn = F;
+ return true;
+ }
+ else if (Name.compare(12,3,"las",3) == 0) {
+ std::string::size_type delim = Name.find('.',12);
+ F->setName("llvm.atomic.load.add"+Name.substr(delim));
+ NewFn = F;
+ return true;
+ }
+ else if (Name.compare(12,3,"lss",3) == 0) {
+ std::string::size_type delim = Name.find('.',12);
+ F->setName("llvm.atomic.load.sub"+Name.substr(delim));
+ NewFn = F;
+ return true;
+ }
+ }
+ break;
case 'b':
// This upgrades the name of the llvm.bswap intrinsic function to only use
// a single type name for overloading. We only care about the old format
OpenPOWER on IntegriCloud