diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-08-13 23:31:24 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-08-13 23:31:24 +0000 |
commit | 8c629ecf3af5bc2717ceb62b73e4dda98fdfe82d (patch) | |
tree | d1ff68a6b1c249867ab65dd8800fe56595cc9ebb /llvm/lib/IR/AutoUpgrade.cpp | |
parent | 164ac651dad386a91bb745f13260100b7856693d (diff) | |
download | bcm5719-llvm-8c629ecf3af5bc2717ceb62b73e4dda98fdfe82d.tar.gz bcm5719-llvm-8c629ecf3af5bc2717ceb62b73e4dda98fdfe82d.zip |
Revert "Revert "Invariant start/end intrinsics overloaded for address space""
This reverts commit 32fc6488e48eafc0ca1bac1bd9cbf0008224d530.
llvm-svn: 278609
Diffstat (limited to 'llvm/lib/IR/AutoUpgrade.cpp')
-rw-r--r-- | llvm/lib/IR/AutoUpgrade.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp index 01f922766ff..883cf29497c 100644 --- a/llvm/lib/IR/AutoUpgrade.cpp +++ b/llvm/lib/IR/AutoUpgrade.cpp @@ -148,7 +148,31 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { } break; } - + case 'i': { + if (Name.startswith("invariant.start")) { + auto Args = F->getFunctionType()->params(); + Type* ObjectPtr[1] = {Args[1]}; + if (F->getName() != + Intrinsic::getName(Intrinsic::invariant_start, ObjectPtr)) { + F->setName(Name + ".old"); + NewFn = Intrinsic::getDeclaration( + F->getParent(), Intrinsic::invariant_start, ObjectPtr); + return true; + } + } + if (Name.startswith("invariant.end")) { + auto Args = F->getFunctionType()->params(); + Type* ObjectPtr[1] = {Args[2]}; + if (F->getName() != + Intrinsic::getName(Intrinsic::invariant_end, ObjectPtr)) { + F->setName(Name + ".old"); + NewFn = Intrinsic::getDeclaration(F->getParent(), + Intrinsic::invariant_end, ObjectPtr); + return true; + } + } + break; + } case 'm': { if (Name.startswith("masked.load.")) { Type *Tys[] = { F->getReturnType(), F->arg_begin()->getType() }; @@ -1339,6 +1363,8 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { return; } + case Intrinsic::invariant_start: + case Intrinsic::invariant_end: case Intrinsic::masked_load: case Intrinsic::masked_store: { SmallVector<Value *, 4> Args(CI->arg_operands().begin(), |