diff options
| author | Piotr Padlewski <piotr.padlewski@gmail.com> | 2018-05-03 11:03:01 +0000 |
|---|---|---|
| committer | Piotr Padlewski <piotr.padlewski@gmail.com> | 2018-05-03 11:03:01 +0000 |
| commit | 5dde809404f73b30bb41b79f7060c0e14cfe0426 (patch) | |
| tree | fecca61a8b4aadbc1d23e57be1793ac2d72c1d68 /llvm/lib/IR | |
| parent | 90b0a53499c98ec3b4903f1f4f0c7b404c236ab3 (diff) | |
| download | bcm5719-llvm-5dde809404f73b30bb41b79f7060c0e14cfe0426.tar.gz bcm5719-llvm-5dde809404f73b30bb41b79f7060c0e14cfe0426.zip | |
Rename invariant.group.barrier to launder.invariant.group
Summary:
This is one of the initial commit of "RFC: Devirtualization v2" proposal:
https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing
Reviewers: rsmith, amharc, kuhar, sanjoy
Subscribers: arsenm, nhaehnle, javed.absar, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D45111
llvm-svn: 331448
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/AutoUpgrade.cpp | 11 | ||||
| -rw-r--r-- | llvm/lib/IR/Value.cpp | 14 |
2 files changed, 18 insertions, 7 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp index 13fb2782472..fd403f3df81 100644 --- a/llvm/lib/IR/AutoUpgrade.cpp +++ b/llvm/lib/IR/AutoUpgrade.cpp @@ -528,6 +528,17 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { return true; } } + if (Name.startswith("invariant.group.barrier")) { + // Rename invariant.group.barrier to launder.invariant.group + auto Args = F->getFunctionType()->params(); + Type* ObjectPtr[1] = {Args[0]}; + rename(F); + NewFn = Intrinsic::getDeclaration(F->getParent(), + Intrinsic::launder_invariant_group, ObjectPtr); + return true; + + } + break; } case 'm': { diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index a479d04c3f0..2f95e9348b4 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -499,7 +499,7 @@ namespace { enum PointerStripKind { PSK_ZeroIndices, PSK_ZeroIndicesAndAliases, - PSK_ZeroIndicesAndAliasesAndBarriers, + PSK_ZeroIndicesAndAliasesAndInvariantGroups, PSK_InBoundsConstantIndices, PSK_InBounds }; @@ -518,7 +518,7 @@ static const Value *stripPointerCastsAndOffsets(const Value *V) { if (auto *GEP = dyn_cast<GEPOperator>(V)) { switch (StripKind) { case PSK_ZeroIndicesAndAliases: - case PSK_ZeroIndicesAndAliasesAndBarriers: + case PSK_ZeroIndicesAndAliasesAndInvariantGroups: case PSK_ZeroIndices: if (!GEP->hasAllZeroIndices()) return V; @@ -546,11 +546,11 @@ static const Value *stripPointerCastsAndOffsets(const Value *V) { V = RV; continue; } - // The result of invariant.group.barrier must alias it's argument, + // The result of launder.invariant.group must alias it's argument, // but it can't be marked with returned attribute, that's why it needs // special case. - if (StripKind == PSK_ZeroIndicesAndAliasesAndBarriers && - CS.getIntrinsicID() == Intrinsic::invariant_group_barrier) { + if (StripKind == PSK_ZeroIndicesAndAliasesAndInvariantGroups && + CS.getIntrinsicID() == Intrinsic::launder_invariant_group) { V = CS.getArgOperand(0); continue; } @@ -576,8 +576,8 @@ const Value *Value::stripInBoundsConstantOffsets() const { return stripPointerCastsAndOffsets<PSK_InBoundsConstantIndices>(this); } -const Value *Value::stripPointerCastsAndBarriers() const { - return stripPointerCastsAndOffsets<PSK_ZeroIndicesAndAliasesAndBarriers>( +const Value *Value::stripPointerCastsAndInvariantGroups() const { + return stripPointerCastsAndOffsets<PSK_ZeroIndicesAndAliasesAndInvariantGroups>( this); } |

