aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
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
commit28873106309db515d58889a4c4fa3e0a92d1b60e (patch)
tree55754230852c1d76c8058edec38ed42a47b3ddc7 /lib/VMCore
parentea9e516e86b3a6ca1b3a5b374365735e1cca414d (diff)
downloadexternal_llvm-28873106309db515d58889a4c4fa3e0a92d1b60e.zip
external_llvm-28873106309db515d58889a4c4fa3e0a92d1b60e.tar.gz
external_llvm-28873106309db515d58889a4c4fa3e0a92d1b60e.tar.bz2
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52706 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/AutoUpgrade.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp
index 7b63692..c2c19c4 100644
--- a/lib/VMCore/AutoUpgrade.cpp
+++ b/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