[llvm] e56c2ce - [IR] Remove llvm.strip.invariant.group intrinsic (#225399)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 01:46:25 PDT 2026


Author: Nikita Popov
Date: 2026-09-23T10:46:16+02:00
New Revision: e56c2cefc3e7978de4a2d799fa3abec77d75af21

URL: https://github.com/llvm/llvm-project/commit/e56c2cefc3e7978de4a2d799fa3abec77d75af21
DIFF: https://github.com/llvm/llvm-project/commit/e56c2cefc3e7978de4a2d799fa3abec77d75af21.diff

LOG: [IR] Remove llvm.strip.invariant.group intrinsic (#225399)

This intrinsic was originally introduced to make sure that if we have a
dominating condition like `a == launder.invariant.group(a)`, we don't
end up replacing the latter with the former, as that would allow the
optimizer to assume that the memory stays invariant, despite going
through a launder operation. Wrapping both comparison operands in
strip.invariant.group avoids the issue, because replacing one stripped
pointer with another is safe.

The underlying issue was fixed in
https://github.com/llvm/llvm-project/pull/224281 (and prior work), which
ensures that the problematic replacement cannot happen in the first
place.

https://github.com/llvm/llvm-project/pull/225072 stopped emitting
llvm.strip.invariant.group on the clang side.

This PR now removes the intrinsic entirely. To be on the safe side, it
is upgraded to llvm.launder.invariant.group. For Clang's specific usage,
just dropping it would be fine.

Added: 
    llvm/test/Bitcode/upgrade-strip-invariant-group.ll

Modified: 
    llvm/docs/LangRef.md
    llvm/docs/ReleaseNotes.md
    llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    llvm/include/llvm/Analysis/ValueTracking.h
    llvm/include/llvm/IR/IRBuilder.h
    llvm/include/llvm/IR/Instruction.h
    llvm/include/llvm/IR/Intrinsics.td
    llvm/include/llvm/IR/Value.h
    llvm/lib/Analysis/ConstantFolding.cpp
    llvm/lib/Analysis/InlineCost.cpp
    llvm/lib/Analysis/ValueTracking.cpp
    llvm/lib/CodeGen/CodeGenPrepare.cpp
    llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
    llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
    llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    llvm/lib/IR/AutoUpgrade.cpp
    llvm/lib/IR/IRBuilder.cpp
    llvm/lib/IR/Instruction.cpp
    llvm/lib/IR/Value.cpp
    llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
    llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
    llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
    llvm/test/Analysis/BasicAA/call-escape-source.ll
    llvm/test/Analysis/CostModel/X86/free-intrinsics.ll
    llvm/test/Analysis/CostModel/free-intrinsics-datalayout.ll
    llvm/test/Analysis/CostModel/free-intrinsics-no_info.ll
    llvm/test/Analysis/ValueTracking/invariant.group.ll
    llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-no-op-intrinsics.ll
    llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-pointer-ops.ll
    llvm/test/CodeGen/AMDGPU/promote-alloca-invariant-markers.ll
    llvm/test/CodeGen/Generic/intrinsics.ll
    llvm/test/Other/invariant.group.ll
    llvm/test/Transforms/Attributor/nocapture-1.ll
    llvm/test/Transforms/CodeGenPrepare/AArch64/large-offset-gep.ll
    llvm/test/Transforms/CodeGenPrepare/X86/invariant.group.ll
    llvm/test/Transforms/DeadStoreElimination/launder.invariant.group.ll
    llvm/test/Transforms/FunctionAttrs/nocapture.ll
    llvm/test/Transforms/GVN/assume-equal.ll
    llvm/test/Transforms/GVN/invariant.group.ll
    llvm/test/Transforms/GlobalOpt/invariant.group.ll
    llvm/test/Transforms/Inline/invariant-group-sroa.ll
    llvm/test/Transforms/Inline/launder.invariant.group.ll
    llvm/test/Transforms/InstCombine/invariant.group.ll
    llvm/test/Transforms/InstCombine/load.ll
    llvm/test/Transforms/InstCombine/new-delete-itanium.ll
    llvm/test/Transforms/InstSimplify/invariant.group-load.ll
    llvm/test/Transforms/NewGVN/invariant.group.ll
    llvm/test/Transforms/SROA/invariant-group.ll
    llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest-free-cost.ll
    mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
    mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
    mlir/test/Dialect/LLVMIR/mem2reg.mlir
    mlir/test/Dialect/LLVMIR/roundtrip.mlir
    mlir/test/Target/LLVMIR/Import/intrinsic.ll
    mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir

Removed: 
    llvm/test/Instrumentation/MemorySanitizer/msan_llvm_strip_invariant.ll
    llvm/test/Transforms/Inline/inline_inv_group.ll


################################################################################
diff  --git a/llvm/docs/LangRef.md b/llvm/docs/LangRef.md
index a4816d337e02b3..3d906ee36a9979 100644
--- a/llvm/docs/LangRef.md
+++ b/llvm/docs/LangRef.md
@@ -24340,36 +24340,6 @@ Returns another pointer that aliases its argument but which is considered 
diff er
 for the purposes of `load`/`store` `invariant.group` metadata.
 It does not read any accessible memory and the execution can be speculated.
 
-#### '`llvm.strip.invariant.group`' Intrinsic
-
-##### Syntax:
-This is an overloaded intrinsic. The {ref}`allocated object<allocatedobjects>`
-can belong to any address space. The returned pointer must belong to the same
-address space as the argument.
-
-```
-declare ptr @llvm.strip.invariant.group.p0(ptr <ptr>)
-```
-
-##### Overview:
-
-The '`llvm.strip.invariant.group`' intrinsic can be used when an invariant
-established by `invariant.group` metadata no longer holds, to obtain a new pointer
-value that does not carry the invariant information. It is an experimental
-intrinsic, which means that its semantics might change in the future.
-
-
-##### Arguments:
-
-The `llvm.strip.invariant.group` takes only one argument, which is a pointer
-to the memory.
-
-##### Semantics:
-
-Returns another pointer that aliases its argument but which has no associated
-`invariant.group` metadata.
-It does not read any memory and can be speculated.
-
 
 
 (constrainedfp)=

diff  --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md
index c743245f42d578..b7bda525ea748e 100644
--- a/llvm/docs/ReleaseNotes.md
+++ b/llvm/docs/ReleaseNotes.md
@@ -161,6 +161,10 @@ Makes programs 10x faster by doing Special New Thing.
   The `llvm.vp.merge` will be folded away but the `%evl` will be propagated to
   the add instruction.
 
+* The `llvm.strip.invariant.group` intrinsic has been removed. It existed to
+  work around a bug relating to replacement of pointers with 
diff erent
+  provenance based on dominating equality conditions, and is no longer needed.
+
 * Introduced the generic `!atomic.ignore.denormal.mode` metadata for
   floating-point `atomicrmw` instructions, generalizing the previously
   AMDGPU-specific `!amdgpu.ignore.denormal.mode`.

diff  --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index 1ab4ec03e8e7e9..625433e2e0a0b9 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -940,7 +940,6 @@ class LLVM_ABI TargetTransformInfoImplBase {
     case Intrinsic::invariant_start:
     case Intrinsic::invariant_end:
     case Intrinsic::launder_invariant_group:
-    case Intrinsic::strip_invariant_group:
     case Intrinsic::is_constant:
     case Intrinsic::lifetime_start:
     case Intrinsic::lifetime_end:

diff  --git a/llvm/include/llvm/Analysis/ValueTracking.h b/llvm/include/llvm/Analysis/ValueTracking.h
index e71f77942db9b0..5fce5907b4f054 100644
--- a/llvm/include/llvm/Analysis/ValueTracking.h
+++ b/llvm/include/llvm/Analysis/ValueTracking.h
@@ -451,8 +451,8 @@ getArgumentAliasingToReturnedPointer(CallBase *Call, bool MustPreserveOffset,
       MustPreserveProvenance));
 }
 
-/// {launder,strip}.invariant.group returns pointer that aliases its argument,
-/// and it only captures pointer by returning it.
+/// launder.invariant.group and similar intrinsics return a pointer that
+/// aliases their argument, and only capture the pointer by returning it.
 /// These intrinsics are not marked as nocapture, because returning is
 /// considered as capture. The arguments are not marked as returned neither,
 /// because it would make it useless. See getArgumentAliasingToReturnedPointer()

diff  --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index 8b5fa73c9c3e9e..6634cf4116bb47 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -2789,11 +2789,6 @@ class IRBuilderBase {
   /// address space before call and casted back to Ptr type after call.
   LLVM_ABI Value *CreateLaunderInvariantGroup(Value *Ptr);
 
-  /// \brief Create a strip.invariant.group intrinsic call. If Ptr type is
-  /// 
diff erent from pointer to i8, it's casted to pointer to i8 in the same
-  /// address space before call and casted back to Ptr type after call.
-  LLVM_ABI Value *CreateStripInvariantGroup(Value *Ptr);
-
   /// Return a vector value that contains the vector V reversed
   LLVM_ABI Value *CreateVectorReverse(Value *V, const Twine &Name = "");
 

diff  --git a/llvm/include/llvm/IR/Instruction.h b/llvm/include/llvm/IR/Instruction.h
index 8a37f25238de7f..0ad9e4ff47b66d 100644
--- a/llvm/include/llvm/IR/Instruction.h
+++ b/llvm/include/llvm/IR/Instruction.h
@@ -951,10 +951,6 @@ class Instruction : public User,
   /// llvm.lifetime.end marker.
   LLVM_ABI bool isLifetimeStartOrEnd() const LLVM_READONLY;
 
-  /// Return true if the instruction is a llvm.launder.invariant.group or
-  /// llvm.strip.invariant.group.
-  LLVM_ABI bool isLaunderOrStripInvariantGroup() const LLVM_READONLY;
-
   /// Return true if the instruction is a DbgInfoIntrinsic or PseudoProbeInst.
   LLVM_ABI bool isDebugOrPseudoInst() const LLVM_READONLY;
 

diff  --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td
index 26b7c772eb2446..fa1ab702873d22 100644
--- a/llvm/include/llvm/IR/Intrinsics.td
+++ b/llvm/include/llvm/IR/Intrinsics.td
@@ -1918,11 +1918,6 @@ def int_launder_invariant_group : DefaultAttrsIntrinsic<[llvm_anyptr_ty],
                                     [IntrInaccessibleMemOnly,
                                      IntrSpeculatable]>;
 
-
-def int_strip_invariant_group : DefaultAttrsIntrinsic<[llvm_anyptr_ty],
-                                          [LLVMMatchType<0>],
-                                          [IntrSpeculatable, IntrNoMem]>;
-
 //===------------------------ Stackmap Intrinsics -------------------------===//
 //
 def int_experimental_stackmap : DefaultAttrsIntrinsic<[],

diff  --git a/llvm/include/llvm/IR/Value.h b/llvm/include/llvm/IR/Value.h
index 436a29761a180e..fbaa26469e4da4 100644
--- a/llvm/include/llvm/IR/Value.h
+++ b/llvm/include/llvm/IR/Value.h
@@ -685,7 +685,7 @@ class Value {
   /// accumulated even if the GEP is not "inbounds".
   ///
   /// If \p AllowInvariantGroup is true then this method also looks through
-  /// strip.invariant.group and launder.invariant.group intrinsics.
+  /// launder.invariant.group intrinsics.
   ///
   /// If \p ExternalAnalysis is provided it will be used to calculate a offset
   /// when a operand of GEP is not constant.

diff  --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index a9dedc622b998e..18921240799bda 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -1746,7 +1746,6 @@ static bool canConstantFoldIntrinsic(Intrinsic::ID ID, bool IsStrictFP) {
   case Intrinsic::pdep:
   case Intrinsic::pext:
   case Intrinsic::launder_invariant_group:
-  case Intrinsic::strip_invariant_group:
   case Intrinsic::masked_load:
   case Intrinsic::get_active_lane_mask:
   case Intrinsic::abs:
@@ -2634,15 +2633,13 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
       return Constant::getNullValue(Ty);
     if (IntrinsicID == Intrinsic::bswap ||
         IntrinsicID == Intrinsic::bitreverse ||
-        IntrinsicID == Intrinsic::launder_invariant_group ||
-        IntrinsicID == Intrinsic::strip_invariant_group)
+        IntrinsicID == Intrinsic::launder_invariant_group)
       return Operands[0];
   }
 
   if (isa<ConstantPointerNull>(Operands[0])) {
-    // launder(null) == null == strip(null) iff in addrspace 0
-    if (IntrinsicID == Intrinsic::launder_invariant_group ||
-        IntrinsicID == Intrinsic::strip_invariant_group) {
+    // launder(null) == null iff in addrspace 0
+    if (IntrinsicID == Intrinsic::launder_invariant_group) {
       // If instruction is not yet put in a basic block (e.g. when cloning
       // a function during inlining), Call's caller may not be available.
       // So check Call's BB first before querying Call->getCaller.

diff  --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index d4f4d937aa06a9..0a540c1b8fb677 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -2535,7 +2535,6 @@ bool CallAnalyzer::visitCallBase(CallBase &Call) {
       InitsVargArgs = true;
       return false;
     case Intrinsic::launder_invariant_group:
-    case Intrinsic::strip_invariant_group:
       if (auto *SROAArg = getSROAArgForValueOrNull(II->getOperand(0)))
         SROAArgValues[II] = SROAArg;
       return true;

diff  --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 44ba5bdc4c6028..ed1e2f7467e197 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -7233,7 +7233,6 @@ bool llvm::isIntrinsicReturningPointerAliasingArgumentWithoutCapturing(
     bool MustPreserveProvenance) {
   switch (Call->getIntrinsicID()) {
   case Intrinsic::launder_invariant_group:
-  case Intrinsic::strip_invariant_group:
   case Intrinsic::aarch64_irg:
   case Intrinsic::aarch64_tagp:
   // The amdgcn_make_buffer_rsrc function does not alter the address of the

diff  --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 3e0b8a956ca813..ff40f210c57902 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -2817,8 +2817,7 @@ bool CodeGenPrepare::optimizeCallInst(CallInst *CI, ModifyDT &ModifiedDT) {
       return true;
     }
 
-    case Intrinsic::launder_invariant_group:
-    case Intrinsic::strip_invariant_group: {
+    case Intrinsic::launder_invariant_group: {
       Value *ArgVal = II->getArgOperand(0);
       auto it = LargeOffsetGEPMap.find(II);
       if (it != LargeOffsetGEPMap.end()) {

diff  --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index dcf3e5beb8b9c7..6d1fcdb18834a9 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -3287,7 +3287,6 @@ bool IRTranslatorImpl::translateKnownIntrinsic(const CallInst &CI,
   case Intrinsic::annotation:
   case Intrinsic::ptr_annotation:
   case Intrinsic::launder_invariant_group:
-  case Intrinsic::strip_invariant_group:
   case Intrinsic::threadlocal_address: {
     // Drop the intrinsic, but forward the value.
     MIRBuilder.buildCopy(getOrCreateVReg(CI),

diff  --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 8f1869b5e03a10..5fc4611d077b02 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -1413,7 +1413,6 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) {
   }
 
   case Intrinsic::launder_invariant_group:
-  case Intrinsic::strip_invariant_group:
   case Intrinsic::expect:
   case Intrinsic::expect_with_probability: {
     Register ResultReg = getRegForValue(II->getArgOperand(0));

diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 065347d9030335..eea69e41b26ebc 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -7781,7 +7781,6 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
   case Intrinsic::annotation:
   case Intrinsic::ptr_annotation:
   case Intrinsic::launder_invariant_group:
-  case Intrinsic::strip_invariant_group:
     // Drop the intrinsic, but forward the value
     setValue(&I, getValue(I.getOperand(0)));
     return;

diff  --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 158fca39f6d34b..16751a4954844f 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -2330,6 +2330,15 @@ static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn,
       NewFn = nullptr;
       return true;
     }
+    if (Name.starts_with("strip.invariant.group")) {
+      // For clang's usage it would be safe to just drop the
+      // strip.invariant.group, but to be conservative replace with the
+      // stronger launder.invariant.group instead.
+      NewFn = Intrinsic::getOrInsertDeclaration(
+          F->getParent(), Intrinsic::launder_invariant_group,
+          F->getReturnType());
+      return true;
+    }
     break;
 
   case 't':

diff  --git a/llvm/lib/IR/IRBuilder.cpp b/llvm/lib/IR/IRBuilder.cpp
index 52cb9daba65822..fbf902654403a6 100644
--- a/llvm/lib/IR/IRBuilder.cpp
+++ b/llvm/lib/IR/IRBuilder.cpp
@@ -1211,23 +1211,6 @@ Value *IRBuilderBase::CreateLaunderInvariantGroup(Value *Ptr) {
   return CreateCall(FnLaunderInvariantGroup, {Ptr});
 }
 
-Value *IRBuilderBase::CreateStripInvariantGroup(Value *Ptr) {
-  assert(isa<PointerType>(Ptr->getType()) &&
-         "strip.invariant.group only applies to pointers.");
-
-  auto *PtrType = Ptr->getType();
-  Module *M = BB->getParent()->getParent();
-  Function *FnStripInvariantGroup = Intrinsic::getOrInsertDeclaration(
-      M, Intrinsic::strip_invariant_group, {PtrType});
-
-  assert(FnStripInvariantGroup->getReturnType() == PtrType &&
-         FnStripInvariantGroup->getFunctionType()->getParamType(0) ==
-             PtrType &&
-         "StripInvariantGroup should take and return the same type");
-
-  return CreateCall(FnStripInvariantGroup, {Ptr});
-}
-
 Value *IRBuilderBase::CreateVectorReverse(Value *V, const Twine &Name) {
   auto *Ty = cast<VectorType>(V->getType());
   if (isa<ScalableVectorType>(Ty)) {

diff  --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp
index 60e4f353585dbe..4e819c8a00ca01 100644
--- a/llvm/lib/IR/Instruction.cpp
+++ b/llvm/lib/IR/Instruction.cpp
@@ -1382,15 +1382,6 @@ bool Instruction::isLifetimeStartOrEnd() const {
   return ID == Intrinsic::lifetime_start || ID == Intrinsic::lifetime_end;
 }
 
-bool Instruction::isLaunderOrStripInvariantGroup() const {
-  auto *II = dyn_cast<IntrinsicInst>(this);
-  if (!II)
-    return false;
-  Intrinsic::ID ID = II->getIntrinsicID();
-  return ID == Intrinsic::launder_invariant_group ||
-         ID == Intrinsic::strip_invariant_group;
-}
-
 bool Instruction::isDebugOrPseudoInst() const {
   return isa<DbgInfoIntrinsic>(this) || isa<PseudoProbeInst>(this);
 }

diff  --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index 50882ec0d7b100..2737192307b990 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -696,8 +696,7 @@ static const Value *stripPointerCastsAndOffsets(
         // but it can't be marked with returned attribute, that's why it needs
         // special case.
         if (StripKind == PSK_ForAliasAnalysis &&
-            (Call->getIntrinsicID() == Intrinsic::launder_invariant_group ||
-             Call->getIntrinsicID() == Intrinsic::strip_invariant_group)) {
+            Call->getIntrinsicID() == Intrinsic::launder_invariant_group) {
           V = Call->getArgOperand(0);
           continue;
         }
@@ -797,7 +796,8 @@ const Value *Value::stripAndAccumulateConstantOffsets(
     } else if (const auto *Call = dyn_cast<CallBase>(V)) {
       if (const Value *RV = Call->getReturnedArgOperand())
         V = RV;
-      if (AllowInvariantGroup && Call->isLaunderOrStripInvariantGroup())
+      if (AllowInvariantGroup &&
+          Call->getIntrinsicID() == Intrinsic::launder_invariant_group)
         V = Call->getArgOperand(0);
     } else if (auto *Int2Ptr = dyn_cast<Operator>(V)) {
       // Try to accumulate across (inttoptr (add (ptrtoint p), off)).

diff  --git a/llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp b/llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
index 81b7d4360e967c..a00f3372c1f60e 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
@@ -2468,7 +2468,6 @@ static bool isRemovablePointerIntrinsic(Intrinsic::ID IID) {
   case Intrinsic::invariant_start:
   case Intrinsic::invariant_end:
   case Intrinsic::launder_invariant_group:
-  case Intrinsic::strip_invariant_group:
   case Intrinsic::memcpy:
   case Intrinsic::memcpy_inline:
   case Intrinsic::memmove:
@@ -2553,8 +2552,7 @@ PtrParts SplitPtrStructs::visitIntrinsicInst(IntrinsicInst &I) {
     I.replaceAllUsesWith(NewRsrc);
     return {nullptr, nullptr};
   }
-  case Intrinsic::launder_invariant_group:
-  case Intrinsic::strip_invariant_group: {
+  case Intrinsic::launder_invariant_group: {
     Value *Ptr = I.getArgOperand(0);
     if (!isSplitFatPtr(Ptr->getType()))
       return {nullptr, nullptr};

diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
index 4f54ca98bd5fcb..aefcabd0d3bf17 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
@@ -1342,7 +1342,6 @@ static bool isCallPromotable(CallInst *CI) {
   case Intrinsic::invariant_start:
   case Intrinsic::invariant_end:
   case Intrinsic::launder_invariant_group:
-  case Intrinsic::strip_invariant_group:
   case Intrinsic::objectsize:
     return true;
   default:
@@ -1749,8 +1748,7 @@ bool AMDGPUPromoteAllocaImpl::tryPromoteAllocaToLDS(
     }
     case Intrinsic::invariant_start:
     case Intrinsic::invariant_end:
-    case Intrinsic::launder_invariant_group:
-    case Intrinsic::strip_invariant_group: {
+    case Intrinsic::launder_invariant_group: {
       assert(Intr->getArgOperand(Intr->arg_size() - 1)->getType() == NewPtrTy &&
              "pointer operand should already have been promoted");
       Function *NewF = Intrinsic::getOrInsertDeclaration(

diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 86dd4397f22c97..c00f4a7a1b820e 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -447,12 +447,8 @@ Instruction *InstCombinerImpl::simplifyMaskedScatter(IntrinsicInst &II) {
   return nullptr;
 }
 
-/// This function transforms launder.invariant.group and strip.invariant.group
-/// like:
+/// This function transforms launder.invariant.group like:
 /// launder(launder(%x)) -> launder(%x)       (the result is not the argument)
-/// launder(strip(%x)) -> launder(%x)
-/// strip(strip(%x)) -> strip(%x)             (the result is not the argument)
-/// strip(launder(%x)) -> strip(%x)
 /// This is legal because it preserves the most recent information about
 /// the presence or absence of invariant.group.
 static Instruction *simplifyInvariantGroupIntrinsic(IntrinsicInst &II,
@@ -461,23 +457,15 @@ static Instruction *simplifyInvariantGroupIntrinsic(IntrinsicInst &II,
   auto *StrippedArg = Arg->stripPointerCasts();
   auto *StrippedInvariantGroupsArg = StrippedArg;
   while (auto *Intr = dyn_cast<IntrinsicInst>(StrippedInvariantGroupsArg)) {
-    if (Intr->getIntrinsicID() != Intrinsic::launder_invariant_group &&
-        Intr->getIntrinsicID() != Intrinsic::strip_invariant_group)
+    if (Intr->getIntrinsicID() != Intrinsic::launder_invariant_group)
       break;
     StrippedInvariantGroupsArg = Intr->getArgOperand(0)->stripPointerCasts();
   }
   if (StrippedArg == StrippedInvariantGroupsArg)
-    return nullptr; // No launders/strips to remove.
+    return nullptr; // No launders to remove.
 
-  Value *Result = nullptr;
-
-  if (II.getIntrinsicID() == Intrinsic::launder_invariant_group)
-    Result = IC.Builder.CreateLaunderInvariantGroup(StrippedInvariantGroupsArg);
-  else if (II.getIntrinsicID() == Intrinsic::strip_invariant_group)
-    Result = IC.Builder.CreateStripInvariantGroup(StrippedInvariantGroupsArg);
-  else
-    llvm_unreachable(
-        "simplifyInvariantGroupIntrinsic only handles launder and strip");
+  Value *Result =
+      IC.Builder.CreateLaunderInvariantGroup(StrippedInvariantGroupsArg);
   if (Result->getType()->getPointerAddressSpace() !=
       II.getType()->getPointerAddressSpace())
     Result = IC.Builder.CreateAddrSpaceCast(Result, II.getType());
@@ -2644,7 +2632,6 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
   case Intrinsic::masked_scatter:
     return simplifyMaskedScatter(*II);
   case Intrinsic::launder_invariant_group:
-  case Intrinsic::strip_invariant_group:
     if (auto *SkippedBarrier = simplifyInvariantGroupIntrinsic(*II, *this))
       return replaceInstUsesWith(*II, SkippedBarrier);
     break;

diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index d0c9c159a335d6..e15708ce31b176 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -7694,12 +7694,12 @@ static Instruction *foldICmpInvariantGroup(ICmpInst &I) {
           I.getOperand(0)->getType()->getPointerAddressSpace())) {
     return nullptr;
   }
-  Instruction *Op;
-  if (match(I.getOperand(0), m_Instruction(Op)) &&
-      match(I.getOperand(1), m_Zero()) &&
-      Op->isLaunderOrStripInvariantGroup()) {
-    return ICmpInst::Create(Instruction::ICmp, I.getPredicate(),
-                            Op->getOperand(0), I.getOperand(1));
+  Value *Ptr;
+  if (match(I.getOperand(0),
+            m_Intrinsic<Intrinsic::launder_invariant_group>(m_Value(Ptr))) &&
+      match(I.getOperand(1), m_Zero())) {
+    return ICmpInst::Create(Instruction::ICmp, I.getPredicate(), Ptr,
+                            I.getOperand(1));
   }
   return nullptr;
 }

diff  --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index e2fcc8c7702945..3ca4974a2d6612 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -3828,7 +3828,6 @@ isAllocSiteRemovable(Instruction *AI, SmallVectorImpl<Instruction *> &Users,
             Users.emplace_back(I);
             continue;
           case Intrinsic::launder_invariant_group:
-          case Intrinsic::strip_invariant_group:
             Users.emplace_back(I);
             Worklist.push_back(I);
             continue;

diff  --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index 4084f3d580e57a..214262a95e41a8 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -5909,7 +5909,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
       handleLifetimeStart(I);
       break;
     case Intrinsic::launder_invariant_group:
-    case Intrinsic::strip_invariant_group:
       handleInvariantGroup(I);
       break;
     case Intrinsic::bswap:

diff  --git a/llvm/test/Analysis/BasicAA/call-escape-source.ll b/llvm/test/Analysis/BasicAA/call-escape-source.ll
index 95fcdbab914c55..4182af453df66b 100644
--- a/llvm/test/Analysis/BasicAA/call-escape-source.ll
+++ b/llvm/test/Analysis/BasicAA/call-escape-source.ll
@@ -7,7 +7,7 @@ define i32 @test() {
 ; CHECK-LABEL: Function: test
 ; CHECK-NEXT: MustAlias: i32* %a, i32* %p7
   %a = alloca i32
-  %p1 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
+  %p1 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
   %p2 = getelementptr i8, ptr %p1, i64 1
   %p3 = getelementptr i8, ptr %p2, i64 -1
   %p4 = getelementptr i8, ptr %p3, i64 1
@@ -19,4 +19,4 @@ define i32 @test() {
   ret i32 %v
 }
 
-declare ptr @llvm.strip.invariant.group.p0(ptr)
+declare ptr @llvm.launder.invariant.group.p0(ptr)

diff  --git a/llvm/test/Analysis/CostModel/X86/free-intrinsics.ll b/llvm/test/Analysis/CostModel/X86/free-intrinsics.ll
index 49f1bd83e96ddd..ff728ddf45d196 100644
--- a/llvm/test/Analysis/CostModel/X86/free-intrinsics.ll
+++ b/llvm/test/Analysis/CostModel/X86/free-intrinsics.ll
@@ -12,7 +12,6 @@ define i32 @trivially_free() {
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
-; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a4 = call i1 @llvm.is.constant.i32(i32 undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.start.p0(ptr %alloca)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.end.p0(ptr %alloca)
@@ -30,7 +29,6 @@ define i32 @trivially_free() {
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
-; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a4 = call i1 @llvm.is.constant.i32(i32 undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.start.p0(ptr %alloca)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.end.p0(ptr %alloca)
@@ -47,7 +45,6 @@ define i32 @trivially_free() {
   %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
   call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
   %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
-  %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
   %a4 = call i1 @llvm.is.constant.i32(i32 undef)
   call void @llvm.lifetime.start.p0(ptr %alloca)
   call void @llvm.lifetime.end.p0(ptr %alloca)
@@ -64,7 +61,6 @@ declare void @llvm.sideeffect()
 declare ptr @llvm.invariant.start.p0(i64, ptr)
 declare void @llvm.invariant.end.p0(ptr, i64, ptr)
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
 declare i1 @llvm.is.constant.i32(i32)
 declare void @llvm.lifetime.start.p0(ptr)
 declare void @llvm.lifetime.end.p0(ptr)

diff  --git a/llvm/test/Analysis/CostModel/free-intrinsics-datalayout.ll b/llvm/test/Analysis/CostModel/free-intrinsics-datalayout.ll
index 4eeac08318cda5..5503cc37de1300 100644
--- a/llvm/test/Analysis/CostModel/free-intrinsics-datalayout.ll
+++ b/llvm/test/Analysis/CostModel/free-intrinsics-datalayout.ll
@@ -14,7 +14,6 @@ define i32 @trivially_free() {
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
-; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a4 = call i1 @llvm.is.constant.i32(i32 undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.start.p0(ptr %alloca)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.end.p0(ptr %alloca)
@@ -34,7 +33,6 @@ define i32 @trivially_free() {
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
-; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a4 = call i1 @llvm.is.constant.i32(i32 undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.start.p0(ptr %alloca)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.end.p0(ptr %alloca)
@@ -53,7 +51,6 @@ define i32 @trivially_free() {
   %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
   call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
   %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
-  %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
   %a4 = call i1 @llvm.is.constant.i32(i32 undef)
   call void @llvm.lifetime.start.p0(ptr %alloca)
   call void @llvm.lifetime.end.p0(ptr %alloca)
@@ -72,7 +69,6 @@ declare void @llvm.sideeffect()
 declare ptr @llvm.invariant.start.p0(i64, ptr)
 declare void @llvm.invariant.end.p0(ptr, i64, ptr)
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
 declare i1 @llvm.is.constant.i32(i32)
 declare void @llvm.lifetime.start.p0(ptr)
 declare void @llvm.lifetime.end.p0(ptr)

diff  --git a/llvm/test/Analysis/CostModel/free-intrinsics-no_info.ll b/llvm/test/Analysis/CostModel/free-intrinsics-no_info.ll
index eab298a9bedf58..e868ebc3735a38 100644
--- a/llvm/test/Analysis/CostModel/free-intrinsics-no_info.ll
+++ b/llvm/test/Analysis/CostModel/free-intrinsics-no_info.ll
@@ -12,7 +12,6 @@ define i32 @trivially_free() {
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
-; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a4 = call i1 @llvm.is.constant.i32(i32 undef)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.start.p0(ptr %alloca)
 ; CHECK-SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.end.p0(ptr %alloca)
@@ -32,7 +31,6 @@ define i32 @trivially_free() {
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
-; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %a4 = call i1 @llvm.is.constant.i32(i32 undef)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.start.p0(ptr %alloca)
 ; CHECK-THROUGHPUT-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: call void @llvm.lifetime.end.p0(ptr %alloca)
@@ -51,7 +49,6 @@ define i32 @trivially_free() {
   %a1 = call ptr @llvm.invariant.start.p0(i64 1, ptr undef)
   call void @llvm.invariant.end.p0(ptr undef, i64 1, ptr undef)
   %a2 = call ptr @llvm.launder.invariant.group.p0(ptr undef)
-  %a3 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
   %a4 = call i1 @llvm.is.constant.i32(i32 undef)
   call void @llvm.lifetime.start.p0(ptr %alloca)
   call void @llvm.lifetime.end.p0(ptr %alloca)
@@ -70,7 +67,6 @@ declare void @llvm.sideeffect()
 declare ptr @llvm.invariant.start.p0(i64, ptr)
 declare void @llvm.invariant.end.p0(ptr, i64, ptr)
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
 declare i1 @llvm.is.constant.i32(i32)
 declare void @llvm.lifetime.start.p0(ptr)
 declare void @llvm.lifetime.end.p0(ptr)

diff  --git a/llvm/test/Analysis/ValueTracking/invariant.group.ll b/llvm/test/Analysis/ValueTracking/invariant.group.ll
index 3d699a75b7f4cc..da660d2213de80 100644
--- a/llvm/test/Analysis/ValueTracking/invariant.group.ll
+++ b/llvm/test/Analysis/ValueTracking/invariant.group.ll
@@ -14,21 +14,6 @@ entry:
   ret void
 }
 
-; CHECK-LABEL: define void @checkNonnullStrip()
-define void @checkNonnullStrip() {
-; CHECK:   %[[p:.*]] = call ptr @llvm.strip.invariant.group.p0(ptr nonnull %0)
-; CHECK:   call void @use(ptr nonnull %[[p]])
-entry:
-  %0 = alloca i8, align 8
-
-  %p = call ptr @llvm.strip.invariant.group.p0(ptr %0)
-  %p2 = call ptr @llvm.strip.invariant.group.p0(ptr %p)
-  call void @use(ptr %p2)
-
-  ret void
-}
-
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
 
 declare void @use(ptr)

diff  --git a/llvm/test/Bitcode/upgrade-strip-invariant-group.ll b/llvm/test/Bitcode/upgrade-strip-invariant-group.ll
new file mode 100644
index 00000000000000..c320a7fd089bde
--- /dev/null
+++ b/llvm/test/Bitcode/upgrade-strip-invariant-group.ll
@@ -0,0 +1,22 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt -S < %s | FileCheck %s
+
+define ptr @test(ptr %p) {
+; CHECK-LABEL: define ptr @test(
+; CHECK-SAME: ptr [[P:%.*]]) {
+; CHECK-NEXT:    [[RES:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[P]])
+; CHECK-NEXT:    ret ptr [[RES]]
+;
+  %res = call ptr @llvm.strip.invariant.group.p0(ptr %p)
+  ret ptr %res
+}
+
+define ptr addrspace(1) @test_addrspace(ptr addrspace(1) %p) {
+; CHECK-LABEL: define ptr addrspace(1) @test_addrspace(
+; CHECK-SAME: ptr addrspace(1) [[P:%.*]]) {
+; CHECK-NEXT:    [[RES:%.*]] = call ptr addrspace(1) @llvm.launder.invariant.group.p1(ptr addrspace(1) [[P]])
+; CHECK-NEXT:    ret ptr addrspace(1) [[RES]]
+;
+  %res = call ptr addrspace(1) @llvm.strip.invariant.group.p1(ptr addrspace(1) %p)
+  ret ptr addrspace(1) %res
+}

diff  --git a/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-no-op-intrinsics.ll b/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-no-op-intrinsics.ll
index 3ab10edc726ff1..d2fcbe2473e39a 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-no-op-intrinsics.ll
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-no-op-intrinsics.ll
@@ -72,25 +72,11 @@ define ptr @launder_invariant_group(ptr %p) {
   ret ptr %q
 }
 
-define ptr @strip_invariant_group(ptr %p) {
-  ; CHECK-LABEL: name: strip_invariant_group
-  ; CHECK: bb.1 (%ir-block.0):
-  ; CHECK-NEXT:   liveins: $x0
-  ; CHECK-NEXT: {{  $}}
-  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:_(p0) = COPY $x0
-  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
-  ; CHECK-NEXT:   $x0 = COPY [[COPY1]](p0)
-  ; CHECK-NEXT:   RET_ReallyLR implicit $x0
-  %q = call ptr @llvm.strip.invariant.group.p0(ptr %p)
-  ret ptr %q
-}
-
 declare i64 @llvm.expect.i64(i64, i64) #0
 declare i64 @llvm.expect.with.probability.i64(i64, i64, double) #0
 declare ptr @llvm.ptr.annotation.p0(ptr, ptr, ptr, i32, ptr) #1
 declare i32 @llvm.annotation.i32(i32, ptr, ptr, i32) #1
 declare ptr @llvm.launder.invariant.group.p0(ptr) #2
-declare ptr @llvm.strip.invariant.group.p0(ptr) #3
 
 attributes #0 = { nounwind readnone willreturn }
 attributes #1 = { nounwind willreturn }

diff  --git a/llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-pointer-ops.ll b/llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-pointer-ops.ll
index 6c117f6628196b..a7c45de437ff8c 100644
--- a/llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-pointer-ops.ll
+++ b/llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-pointer-ops.ll
@@ -659,7 +659,6 @@ define i32 @invariant_start_end(ptr addrspace(7) %p) {
 }
 
 declare ptr addrspace(7) @llvm.launder.invariant.group.p7(ptr addrspace(7) nocapture)
-declare ptr addrspace(7) @llvm.strip.invariant.group.p7(ptr addrspace(7) nocapture)
 
 define ptr addrspace(7) @invariant_group(ptr addrspace(7) %p) {
 ; CHECK-LABEL: define { ptr addrspace(8), i32 } @invariant_group
@@ -667,12 +666,10 @@ define ptr addrspace(7) @invariant_group(ptr addrspace(7) %p) {
 ; CHECK-NEXT:    [[P_RSRC:%.*]] = extractvalue { ptr addrspace(8), i32 } [[P]], 0
 ; CHECK-NEXT:    [[P_OFF:%.*]] = extractvalue { ptr addrspace(8), i32 } [[P]], 1
 ; CHECK-NEXT:    [[LAUNDERED:%.*]] = call ptr addrspace(8) @llvm.launder.invariant.group.p8(ptr addrspace(8) [[P_RSRC]])
-; CHECK-NEXT:    [[STRIPPED:%.*]] = call ptr addrspace(8) @llvm.strip.invariant.group.p8(ptr addrspace(8) [[LAUNDERED]])
-; CHECK-NEXT:    [[TMP1:%.*]] = insertvalue { ptr addrspace(8), i32 } poison, ptr addrspace(8) [[STRIPPED]], 0
+; CHECK-NEXT:    [[TMP1:%.*]] = insertvalue { ptr addrspace(8), i32 } poison, ptr addrspace(8) [[LAUNDERED]], 0
 ; CHECK-NEXT:    [[TMP2:%.*]] = insertvalue { ptr addrspace(8), i32 } [[TMP1]], i32 [[P_OFF]], 1
 ; CHECK-NEXT:    ret { ptr addrspace(8), i32 } [[TMP2]]
 ;
   %laundered = call ptr addrspace(7) @llvm.launder.invariant.group.p7(ptr addrspace(7) %p)
-  %stripped = call ptr addrspace(7) @llvm.strip.invariant.group.p7(ptr addrspace(7) %laundered)
-  ret ptr addrspace(7) %stripped
+  ret ptr addrspace(7) %laundered
 }

diff  --git a/llvm/test/CodeGen/AMDGPU/promote-alloca-invariant-markers.ll b/llvm/test/CodeGen/AMDGPU/promote-alloca-invariant-markers.ll
index 7363498473d4a2..2803ab537e1253 100644
--- a/llvm/test/CodeGen/AMDGPU/promote-alloca-invariant-markers.ll
+++ b/llvm/test/CodeGen/AMDGPU/promote-alloca-invariant-markers.ll
@@ -4,7 +4,6 @@
 declare ptr @llvm.invariant.start.p5(i64, ptr addrspace(5) nocapture)
 declare void @llvm.invariant.end.p5(ptr, i64, ptr addrspace(5) nocapture)
 declare ptr addrspace(5) @llvm.launder.invariant.group.p5(ptr addrspace(5))
-declare ptr addrspace(5) @llvm.strip.invariant.group.p5(ptr addrspace(5))
 
 define amdgpu_kernel void @use_invariant_start_and_end() {
 ; CHECK-LABEL: define amdgpu_kernel void @use_invariant_start_and_end() {
@@ -37,8 +36,8 @@ bb:
   ret void
 }
 
-define amdgpu_kernel void @use_invariant_group_and_strip() {
-; CHECK-LABEL: define amdgpu_kernel void @use_invariant_group_and_strip() {
+define amdgpu_kernel void @use_invariant_group_and_launder() {
+; CHECK-LABEL: define amdgpu_kernel void @use_invariant_group_and_launder() {
 ; CHECK-NEXT:  [[BB:.*:]]
 ; CHECK-NEXT:    [[TMP0:%.*]] = call noalias nonnull dereferenceable(64) ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()
 ; CHECK-NEXT:    [[TMP1:%.*]] = getelementptr inbounds i32, ptr addrspace(4) [[TMP0]], i64 1
@@ -54,19 +53,15 @@ define amdgpu_kernel void @use_invariant_group_and_strip() {
 ; CHECK-NEXT:    [[TMP11:%.*]] = mul nuw nsw i32 [[TMP7]], [[TMP4]]
 ; CHECK-NEXT:    [[TMP12:%.*]] = add i32 [[TMP10]], [[TMP11]]
 ; CHECK-NEXT:    [[TMP13:%.*]] = add i32 [[TMP12]], [[TMP8]]
-; CHECK-NEXT:    [[TMP14:%.*]] = getelementptr inbounds [1024 x i32], ptr addrspace(3) @use_invariant_group_and_strip.alloca, i32 0, i32 [[TMP13]]
-; CHECK-NEXT:    [[INVARIANT2:%.*]] = call ptr addrspace(3) @llvm.launder.invariant.group.p3(ptr addrspace(3) [[TMP14]])
-; CHECK-NEXT:    store <2 x i1> zeroinitializer, ptr addrspace(3) [[INVARIANT2]], align 1
-; CHECK-NEXT:    [[STRIP1:%.*]] = call ptr addrspace(3) @llvm.strip.invariant.group.p3(ptr addrspace(3) [[TMP14]])
-; CHECK-NEXT:    store <2 x i1> zeroinitializer, ptr addrspace(3) [[STRIP1]], align 1
+; CHECK-NEXT:    [[TMP14:%.*]] = getelementptr inbounds [1024 x i32], ptr addrspace(3) @use_invariant_group_and_launder.alloca, i32 0, i32 [[TMP13]]
+; CHECK-NEXT:    [[INVARIANT:%.*]] = call ptr addrspace(3) @llvm.launder.invariant.group.p3(ptr addrspace(3) [[TMP14]])
+; CHECK-NEXT:    store <2 x i1> zeroinitializer, ptr addrspace(3) [[INVARIANT]], align 1
 ; CHECK-NEXT:    ret void
 ;
 bb:
   %alloca = alloca i32, align 4, addrspace(5)
   %invariant = call ptr addrspace(5) @llvm.launder.invariant.group.p5(ptr addrspace(5) %alloca)
   store <2 x i1> zeroinitializer, ptr addrspace(5) %invariant, align 1
-  %strip = call ptr addrspace(5) @llvm.strip.invariant.group.p5(ptr addrspace(5) %alloca)
-  store <2 x i1> zeroinitializer, ptr addrspace(5) %strip, align 1
   ret void
 }
 
@@ -126,12 +121,9 @@ define amdgpu_kernel void @use_invariant_group_and_strip_gep(ptr addrspace(1) %o
 ; CHECK-NEXT:    [[TMP14:%.*]] = getelementptr inbounds [1024 x [4 x i32]], ptr addrspace(3) @use_invariant_group_and_strip_gep.alloca, i32 0, i32 [[TMP13]]
 ; CHECK-NEXT:    [[GEP:%.*]] = getelementptr inbounds [4 x i32], ptr addrspace(3) [[TMP14]], i32 0, i32 1
 ; CHECK-NEXT:    store i32 22, ptr addrspace(3) [[GEP]], align 4
-; CHECK-NEXT:    [[LAUNDER2:%.*]] = call ptr addrspace(3) @llvm.launder.invariant.group.p3(ptr addrspace(3) [[GEP]])
-; CHECK-NEXT:    [[V1:%.*]] = load i32, ptr addrspace(3) [[LAUNDER2]], align 4
-; CHECK-NEXT:    [[STRIP1:%.*]] = call ptr addrspace(3) @llvm.strip.invariant.group.p3(ptr addrspace(3) [[GEP]])
+; CHECK-NEXT:    [[STRIP1:%.*]] = call ptr addrspace(3) @llvm.launder.invariant.group.p3(ptr addrspace(3) [[GEP]])
 ; CHECK-NEXT:    [[V2:%.*]] = load i32, ptr addrspace(3) [[STRIP1]], align 4
-; CHECK-NEXT:    [[SUM:%.*]] = add i32 [[V1]], [[V2]]
-; CHECK-NEXT:    store i32 [[SUM]], ptr addrspace(1) [[OUT]], align 4
+; CHECK-NEXT:    store i32 [[V2]], ptr addrspace(1) [[OUT]], align 4
 ; CHECK-NEXT:    ret void
 ;
 bb:
@@ -140,10 +132,7 @@ bb:
   store i32 22, ptr addrspace(5) %gep, align 4
   %launder = call ptr addrspace(5) @llvm.launder.invariant.group.p5(ptr addrspace(5) %gep)
   %v1 = load i32, ptr addrspace(5) %launder, align 4
-  %strip = call ptr addrspace(5) @llvm.strip.invariant.group.p5(ptr addrspace(5) %gep)
-  %v2 = load i32, ptr addrspace(5) %strip, align 4
-  %sum = add i32 %v1, %v2
-  store i32 %sum, ptr addrspace(1) %out, align 4
+  store i32 %v1, ptr addrspace(1) %out, align 4
   ret void
 }
 ;.

diff  --git a/llvm/test/CodeGen/Generic/intrinsics.ll b/llvm/test/CodeGen/Generic/intrinsics.ll
index d2b62f77b5d37b..685cd41121f03f 100644
--- a/llvm/test/CodeGen/Generic/intrinsics.ll
+++ b/llvm/test/CodeGen/Generic/intrinsics.ll
@@ -19,13 +19,6 @@ define ptr @launder(ptr %p) {
         ret ptr %q
 }
 
-declare ptr @llvm.strip.invariant.group(ptr)
-
-define ptr @strip(ptr %p) {
-        %q = call ptr @llvm.strip.invariant.group(ptr %p)
-        ret ptr %q
-}
-
 declare void @llvm.sideeffect()
 
 define void @test_sideeffect() {

diff  --git a/llvm/test/Instrumentation/MemorySanitizer/msan_llvm_strip_invariant.ll b/llvm/test/Instrumentation/MemorySanitizer/msan_llvm_strip_invariant.ll
deleted file mode 100644
index 3323947414565b..00000000000000
--- a/llvm/test/Instrumentation/MemorySanitizer/msan_llvm_strip_invariant.ll
+++ /dev/null
@@ -1,21 +0,0 @@
-; Make sure MSan handles llvm.launder.invariant.group correctly.
-
-; RUN: opt < %s -passes='module(msan),default<O1>' -msan-kernel=1 -S | FileCheck -check-prefixes=CHECK %s
-; RUN: opt < %s -passes='module(msan),default<O1>' -S | FileCheck -check-prefixes=CHECK %s
-
-target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
-
- at flag = dso_local local_unnamed_addr global i8 0, align 1
-
-define dso_local ptr @f(ptr %x) local_unnamed_addr #0 {
-entry:
-  %0 = call ptr @llvm.strip.invariant.group.p0(ptr %x)
-  ret ptr %0
-}
-
-; CHECK-NOT: call void @__msan_warning_with_origin_noreturn
-
-declare ptr @llvm.strip.invariant.group.p0(ptr)
-
-attributes #0 = { sanitize_memory uwtable }

diff  --git a/llvm/test/Other/invariant.group.ll b/llvm/test/Other/invariant.group.ll
index d8dde8864b1ea9..c8c29db4ba0748 100644
--- a/llvm/test/Other/invariant.group.ll
+++ b/llvm/test/Other/invariant.group.ll
@@ -79,11 +79,6 @@ define void @dontProveEquality(ptr %a) {
 ; CHECK: call void @useBool(i1 %r)
   call void @useBool(i1 %r)
 
-  %b2 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
-  %r2 = icmp eq ptr %b2, %a
-; CHECK: call void @useBool(i1 %r2)
-  call void @useBool(i1 %r2)
-
   ret void
 }
 
@@ -95,9 +90,5 @@ declare void @clobber(ptr)
 ; CHECK-NEXT: declare ptr @llvm.launder.invariant.group.p0(ptr)
 declare ptr @llvm.launder.invariant.group.p0(ptr)
 
-; CHECK: Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none){{$}}
-; CHECK-NEXT: declare ptr @llvm.strip.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
-
 
 !0 = !{}

diff  --git a/llvm/test/Transforms/Attributor/nocapture-1.ll b/llvm/test/Transforms/Attributor/nocapture-1.ll
index 45a196a7e1eec5..dee5cd6e85d023 100644
--- a/llvm/test/Transforms/Attributor/nocapture-1.ll
+++ b/llvm/test/Transforms/Attributor/nocapture-1.ll
@@ -8,7 +8,6 @@
 ; CHECK: @g = global ptr null
 ; CHECK: @lookup_table = global [2 x i1] [i1 false, i1 true]
 ; CHECK: @g2 = global ptr null
-; CHECK: @g3 = global ptr null
 ;.
 define ptr @c1(ptr %q) {
 ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
@@ -35,13 +34,13 @@ define void @c3(ptr %q) {
 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
 ; TUNIT-LABEL: define {{[^@]+}}@c3
 ; TUNIT-SAME: (ptr nofree writeonly [[Q:%.*]]) #[[ATTR1]] {
-; TUNIT-NEXT:    call void @c2(ptr nofree writeonly [[Q]]) #[[ATTR18:[0-9]+]]
+; TUNIT-NEXT:    call void @c2(ptr nofree writeonly [[Q]]) #[[ATTR16:[0-9]+]]
 ; TUNIT-NEXT:    ret void
 ;
 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write)
 ; CGSCC-LABEL: define {{[^@]+}}@c3
 ; CGSCC-SAME: (ptr nofree writeonly [[Q:%.*]]) #[[ATTR2:[0-9]+]] {
-; CGSCC-NEXT:    call void @c2(ptr nofree writeonly [[Q]]) #[[ATTR21:[0-9]+]]
+; CGSCC-NEXT:    call void @c2(ptr nofree writeonly [[Q]]) #[[ATTR19:[0-9]+]]
 ; CGSCC-NEXT:    ret void
 ;
   call void @c2(ptr %q)
@@ -187,14 +186,14 @@ define i1 @c7(ptr %q, i32 %bitno) {
 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read)
 ; TUNIT-LABEL: define {{[^@]+}}@c7
 ; TUNIT-SAME: (ptr nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2]] {
-; TUNIT-NEXT:    [[PTR:%.*]] = call ptr @lookup_bit(ptr noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR19:[0-9]+]]
+; TUNIT-NEXT:    [[PTR:%.*]] = call ptr @lookup_bit(ptr noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR17:[0-9]+]]
 ; TUNIT-NEXT:    [[VAL:%.*]] = load i1, ptr [[PTR]], align 1
 ; TUNIT-NEXT:    ret i1 [[VAL]]
 ;
 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read)
 ; CGSCC-LABEL: define {{[^@]+}}@c7
 ; CGSCC-SAME: (ptr nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR6:[0-9]+]] {
-; CGSCC-NEXT:    [[PTR:%.*]] = call ptr @lookup_bit(ptr noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR22:[0-9]+]]
+; CGSCC-NEXT:    [[PTR:%.*]] = call ptr @lookup_bit(ptr noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR20:[0-9]+]]
 ; CGSCC-NEXT:    [[VAL:%.*]] = load i1, ptr [[PTR]], align 1
 ; CGSCC-NEXT:    ret i1 [[VAL]]
 ;
@@ -293,13 +292,13 @@ define void @nc2(ptr %p, ptr %q) {
 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
 ; TUNIT-LABEL: define {{[^@]+}}@nc2
 ; TUNIT-SAME: (ptr nofree captures(none) [[P:%.*]], ptr nofree [[Q:%.*]]) #[[ATTR5]] {
-; TUNIT-NEXT:    [[TMP1:%.*]] = call i32 @nc1(ptr nofree [[Q]], ptr nofree captures(none) [[P]], i1 noundef false) #[[ATTR20:[0-9]+]]
+; TUNIT-NEXT:    [[TMP1:%.*]] = call i32 @nc1(ptr nofree [[Q]], ptr nofree captures(none) [[P]], i1 noundef false) #[[ATTR18:[0-9]+]]
 ; TUNIT-NEXT:    ret void
 ;
 ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn
 ; CGSCC-LABEL: define {{[^@]+}}@nc2
 ; CGSCC-SAME: (ptr nofree align 4 captures(none) [[P:%.*]], ptr nofree [[Q:%.*]]) #[[ATTR8:[0-9]+]] {
-; CGSCC-NEXT:    [[TMP1:%.*]] = call i32 @nc1(ptr nofree [[Q]], ptr nofree align 4 captures(none) [[P]], i1 noundef false) #[[ATTR23:[0-9]+]]
+; CGSCC-NEXT:    [[TMP1:%.*]] = call i32 @nc1(ptr nofree [[Q]], ptr nofree align 4 captures(none) [[P]], i1 noundef false) #[[ATTR21:[0-9]+]]
 ; CGSCC-NEXT:    ret void
 ;
   %1 = call i32 @nc1(ptr %q, ptr %p, i1 0)		; <i32> [#uses=0]
@@ -324,13 +323,13 @@ define void @nc4(ptr %p) {
 ; TUNIT: Function Attrs: nounwind memory(argmem: readwrite)
 ; TUNIT-LABEL: define {{[^@]+}}@nc4
 ; TUNIT-SAME: (ptr [[P:%.*]]) #[[ATTR6:[0-9]+]] {
-; TUNIT-NEXT:    call void @external(ptr nofree readonly [[P]]) #[[ATTR21:[0-9]+]]
+; TUNIT-NEXT:    call void @external(ptr nofree readonly [[P]]) #[[ATTR19:[0-9]+]]
 ; TUNIT-NEXT:    ret void
 ;
 ; CGSCC: Function Attrs: nounwind memory(argmem: readwrite)
 ; CGSCC-LABEL: define {{[^@]+}}@nc4
 ; CGSCC-SAME: (ptr [[P:%.*]]) #[[ATTR9:[0-9]+]] {
-; CGSCC-NEXT:    call void @external(ptr nofree readonly [[P]]) #[[ATTR24:[0-9]+]]
+; CGSCC-NEXT:    call void @external(ptr nofree readonly [[P]]) #[[ATTR22:[0-9]+]]
 ; CGSCC-NEXT:    ret void
 ;
   call void @external(ptr %p)
@@ -611,7 +610,7 @@ define void @nocaptureLaunder(ptr %p) {
 ; TUNIT-LABEL: define {{[^@]+}}@nocaptureLaunder
 ; TUNIT-SAME: (ptr nofree captures(none) [[P:%.*]]) #[[ATTR10:[0-9]+]] {
 ; TUNIT-NEXT:  entry:
-; TUNIT-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR22:[0-9]+]]
+; TUNIT-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR20:[0-9]+]]
 ; TUNIT-NEXT:    store i8 42, ptr [[B]], align 1
 ; TUNIT-NEXT:    ret void
 ;
@@ -619,7 +618,7 @@ define void @nocaptureLaunder(ptr %p) {
 ; CGSCC-LABEL: define {{[^@]+}}@nocaptureLaunder
 ; CGSCC-SAME: (ptr nofree captures(none) [[P:%.*]]) #[[ATTR13:[0-9]+]] {
 ; CGSCC-NEXT:  entry:
-; CGSCC-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR25:[0-9]+]]
+; CGSCC-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR23:[0-9]+]]
 ; CGSCC-NEXT:    store i8 42, ptr [[B]], align 1
 ; CGSCC-NEXT:    ret void
 ;
@@ -634,14 +633,14 @@ define void @captureLaunder(ptr %p) {
 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
 ; TUNIT-LABEL: define {{[^@]+}}@captureLaunder
 ; TUNIT-SAME: (ptr nofree [[P:%.*]]) #[[ATTR5]] {
-; TUNIT-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR22]]
+; TUNIT-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR20]]
 ; TUNIT-NEXT:    store ptr [[B]], ptr @g2, align 8
 ; TUNIT-NEXT:    ret void
 ;
 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
 ; CGSCC-LABEL: define {{[^@]+}}@captureLaunder
 ; CGSCC-SAME: (ptr nofree [[P:%.*]]) #[[ATTR7]] {
-; CGSCC-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR25]]
+; CGSCC-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR23]]
 ; CGSCC-NEXT:    store ptr [[B]], ptr @g2, align 8
 ; CGSCC-NEXT:    ret void
 ;
@@ -650,50 +649,6 @@ define void @captureLaunder(ptr %p) {
   ret void
 }
 
-define void @nocaptureStrip(ptr %p) {
-; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
-; TUNIT-LABEL: define {{[^@]+}}@nocaptureStrip
-; TUNIT-SAME: (ptr nofree writeonly captures(none) [[P:%.*]]) #[[ATTR11:[0-9]+]] {
-; TUNIT-NEXT:  entry:
-; TUNIT-NEXT:    [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR23:[0-9]+]]
-; TUNIT-NEXT:    store i8 42, ptr [[B]], align 1
-; TUNIT-NEXT:    ret void
-;
-; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
-; CGSCC-LABEL: define {{[^@]+}}@nocaptureStrip
-; CGSCC-SAME: (ptr nofree writeonly captures(none) [[P:%.*]]) #[[ATTR14:[0-9]+]] {
-; CGSCC-NEXT:  entry:
-; CGSCC-NEXT:    [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR22]]
-; CGSCC-NEXT:    store i8 42, ptr [[B]], align 1
-; CGSCC-NEXT:    ret void
-;
-entry:
-  %b = call ptr @llvm.strip.invariant.group.p0(ptr %p)
-  store i8 42, ptr %b
-  ret void
-}
-
- at g3 = global ptr null
-define void @captureStrip(ptr %p) {
-; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
-; TUNIT-LABEL: define {{[^@]+}}@captureStrip
-; TUNIT-SAME: (ptr nofree writeonly [[P:%.*]]) #[[ATTR1]] {
-; TUNIT-NEXT:    [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR23]]
-; TUNIT-NEXT:    store ptr [[B]], ptr @g3, align 8
-; TUNIT-NEXT:    ret void
-;
-; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
-; CGSCC-LABEL: define {{[^@]+}}@captureStrip
-; CGSCC-SAME: (ptr nofree writeonly [[P:%.*]]) #[[ATTR1]] {
-; CGSCC-NEXT:    [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR22]]
-; CGSCC-NEXT:    store ptr [[B]], ptr @g3, align 8
-; CGSCC-NEXT:    ret void
-;
-  %b = call ptr @llvm.strip.invariant.group.p0(ptr %p)
-  store ptr %b, ptr @g3
-  ret void
-}
-
 define i1 @captureICmp(ptr %x) {
 ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
 ; CHECK-LABEL: define {{[^@]+}}@captureICmp
@@ -752,13 +707,13 @@ define i1 @nocaptureDereferenceableOrNullICmp(ptr dereferenceable_or_null(4) %x)
 define i1 @captureDereferenceableOrNullICmp(ptr dereferenceable_or_null(4) %x) null_pointer_is_valid {
 ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none)
 ; TUNIT-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp
-; TUNIT-SAME: (ptr nofree noundef readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR12:[0-9]+]] {
+; TUNIT-SAME: (ptr nofree noundef readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR11:[0-9]+]] {
 ; TUNIT-NEXT:    [[TMP1:%.*]] = icmp eq ptr [[X]], null
 ; TUNIT-NEXT:    ret i1 [[TMP1]]
 ;
 ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none)
 ; CGSCC-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp
-; CGSCC-SAME: (ptr nofree noundef readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR15:[0-9]+]] {
+; CGSCC-SAME: (ptr nofree noundef readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR14:[0-9]+]] {
 ; CGSCC-NEXT:    [[TMP1:%.*]] = icmp eq ptr [[X]], null
 ; CGSCC-NEXT:    ret i1 [[TMP1]]
 ;
@@ -783,14 +738,14 @@ declare ptr @unknownpi8pi8(ptr,ptr returned)
 define ptr @test_returned1(ptr %A, ptr returned %B) nounwind readonly {
 ; TUNIT: Function Attrs: nosync nounwind memory(read)
 ; TUNIT-LABEL: define {{[^@]+}}@test_returned1
-; TUNIT-SAME: (ptr captures(none) [[A:%.*]], ptr returned [[B:%.*]]) #[[ATTR13:[0-9]+]] {
+; TUNIT-SAME: (ptr captures(none) [[A:%.*]], ptr returned [[B:%.*]]) #[[ATTR12:[0-9]+]] {
 ; TUNIT-NEXT:  entry:
 ; TUNIT-NEXT:    [[P:%.*]] = call ptr @unknownpi8pi8(ptr [[A]], ptr [[B]])
 ; TUNIT-NEXT:    ret ptr [[P]]
 ;
 ; CGSCC: Function Attrs: nosync nounwind memory(read)
 ; CGSCC-LABEL: define {{[^@]+}}@test_returned1
-; CGSCC-SAME: (ptr captures(none) [[A:%.*]], ptr returned [[B:%.*]]) #[[ATTR16:[0-9]+]] {
+; CGSCC-SAME: (ptr captures(none) [[A:%.*]], ptr returned [[B:%.*]]) #[[ATTR15:[0-9]+]] {
 ; CGSCC-NEXT:  entry:
 ; CGSCC-NEXT:    [[P:%.*]] = call ptr @unknownpi8pi8(ptr [[A]], ptr [[B]])
 ; CGSCC-NEXT:    ret ptr [[P]]
@@ -803,16 +758,16 @@ entry:
 define ptr @test_returned2(ptr %A, ptr %B) {
 ; TUNIT: Function Attrs: nosync nounwind memory(read)
 ; TUNIT-LABEL: define {{[^@]+}}@test_returned2
-; TUNIT-SAME: (ptr readonly [[A:%.*]], ptr readonly [[B:%.*]]) #[[ATTR13]] {
+; TUNIT-SAME: (ptr readonly [[A:%.*]], ptr readonly [[B:%.*]]) #[[ATTR12]] {
 ; TUNIT-NEXT:  entry:
-; TUNIT-NEXT:    [[P:%.*]] = call ptr @unknownpi8pi8(ptr readonly [[A]], ptr readonly [[B]]) #[[ATTR13]]
+; TUNIT-NEXT:    [[P:%.*]] = call ptr @unknownpi8pi8(ptr readonly [[A]], ptr readonly [[B]]) #[[ATTR12]]
 ; TUNIT-NEXT:    ret ptr [[P]]
 ;
 ; CGSCC: Function Attrs: nosync nounwind memory(read)
 ; CGSCC-LABEL: define {{[^@]+}}@test_returned2
-; CGSCC-SAME: (ptr readonly [[A:%.*]], ptr readonly [[B:%.*]]) #[[ATTR16]] {
+; CGSCC-SAME: (ptr readonly [[A:%.*]], ptr readonly [[B:%.*]]) #[[ATTR15]] {
 ; CGSCC-NEXT:  entry:
-; CGSCC-NEXT:    [[P:%.*]] = call ptr @unknownpi8pi8(ptr readonly [[A]], ptr readonly [[B]]) #[[ATTR16]]
+; CGSCC-NEXT:    [[P:%.*]] = call ptr @unknownpi8pi8(ptr readonly [[A]], ptr readonly [[B]]) #[[ATTR15]]
 ; CGSCC-NEXT:    ret ptr [[P]]
 ;
 entry:
@@ -828,13 +783,13 @@ declare void @val_use(i8 %ptr) readonly nounwind willreturn
 define void @ptr_uses(ptr %ptr, ptr %wptr) {
 ; TUNIT: Function Attrs: mustprogress nosync nounwind willreturn
 ; TUNIT-LABEL: define {{[^@]+}}@ptr_uses
-; TUNIT-SAME: (ptr [[PTR:%.*]], ptr nofree noundef nonnull writeonly captures(none) dereferenceable(1) [[WPTR:%.*]]) #[[ATTR15:[0-9]+]] {
+; TUNIT-SAME: (ptr [[PTR:%.*]], ptr nofree noundef nonnull writeonly captures(none) dereferenceable(1) [[WPTR:%.*]]) #[[ATTR14:[0-9]+]] {
 ; TUNIT-NEXT:    store i8 0, ptr [[WPTR]], align 1
 ; TUNIT-NEXT:    ret void
 ;
 ; CGSCC: Function Attrs: mustprogress nosync nounwind willreturn
 ; CGSCC-LABEL: define {{[^@]+}}@ptr_uses
-; CGSCC-SAME: (ptr [[PTR:%.*]], ptr nofree noundef nonnull writeonly captures(none) dereferenceable(1) [[WPTR:%.*]]) #[[ATTR18:[0-9]+]] {
+; CGSCC-SAME: (ptr [[PTR:%.*]], ptr nofree noundef nonnull writeonly captures(none) dereferenceable(1) [[WPTR:%.*]]) #[[ATTR17:[0-9]+]] {
 ; CGSCC-NEXT:    store i8 0, ptr [[WPTR]], align 1
 ; CGSCC-NEXT:    ret void
 ;
@@ -846,7 +801,6 @@ define void @ptr_uses(ptr %ptr, ptr %wptr) {
 }
 
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
 ;.
 ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
 ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) }
@@ -859,19 +813,16 @@ declare ptr @llvm.strip.invariant.group.p0(ptr)
 ; TUNIT: attributes #[[ATTR8]] = { mustprogress norecurse nounwind willreturn memory(argmem: readwrite) }
 ; TUNIT: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind memory(argmem: readwrite) }
 ; TUNIT: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
-; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
-; TUNIT: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) }
-; TUNIT: attributes #[[ATTR13]] = { nosync nounwind memory(read) }
-; TUNIT: attributes #[[ATTR14:[0-9]+]] = { nounwind willreturn memory(read) }
-; TUNIT: attributes #[[ATTR15]] = { mustprogress nosync nounwind willreturn }
-; TUNIT: attributes #[[ATTR16:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite) }
-; TUNIT: attributes #[[ATTR17:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
-; TUNIT: attributes #[[ATTR18]] = { nofree nosync nounwind willreturn memory(write) }
-; TUNIT: attributes #[[ATTR19]] = { nofree nosync nounwind willreturn memory(none) }
-; TUNIT: attributes #[[ATTR20]] = { nofree nosync nounwind willreturn }
-; TUNIT: attributes #[[ATTR21]] = { nounwind }
-; TUNIT: attributes #[[ATTR22]] = { nofree willreturn }
-; TUNIT: attributes #[[ATTR23]] = { nofree nosync willreturn }
+; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) }
+; TUNIT: attributes #[[ATTR12]] = { nosync nounwind memory(read) }
+; TUNIT: attributes #[[ATTR13:[0-9]+]] = { nounwind willreturn memory(read) }
+; TUNIT: attributes #[[ATTR14]] = { mustprogress nosync nounwind willreturn }
+; TUNIT: attributes #[[ATTR15:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite) }
+; TUNIT: attributes #[[ATTR16]] = { nofree nosync nounwind willreturn memory(write) }
+; TUNIT: attributes #[[ATTR17]] = { nofree nosync nounwind willreturn memory(none) }
+; TUNIT: attributes #[[ATTR18]] = { nofree nosync nounwind willreturn }
+; TUNIT: attributes #[[ATTR19]] = { nounwind }
+; TUNIT: attributes #[[ATTR20]] = { nofree willreturn }
 ;.
 ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
 ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) }
@@ -887,16 +838,14 @@ declare ptr @llvm.strip.invariant.group.p0(ptr)
 ; CGSCC: attributes #[[ATTR11]] = { mustprogress norecurse nounwind willreturn memory(argmem: readwrite) }
 ; CGSCC: attributes #[[ATTR12]] = { nofree norecurse nosync nounwind memory(argmem: readwrite) }
 ; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) }
-; CGSCC: attributes #[[ATTR14]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
-; CGSCC: attributes #[[ATTR15]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) }
-; CGSCC: attributes #[[ATTR16]] = { nosync nounwind memory(read) }
-; CGSCC: attributes #[[ATTR17:[0-9]+]] = { nounwind willreturn memory(read) }
-; CGSCC: attributes #[[ATTR18]] = { mustprogress nosync nounwind willreturn }
-; CGSCC: attributes #[[ATTR19:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite) }
-; CGSCC: attributes #[[ATTR20:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
-; CGSCC: attributes #[[ATTR21]] = { nofree nounwind willreturn memory(write) }
-; CGSCC: attributes #[[ATTR22]] = { nofree nosync willreturn }
-; CGSCC: attributes #[[ATTR23]] = { nofree nounwind willreturn }
-; CGSCC: attributes #[[ATTR24]] = { nounwind }
-; CGSCC: attributes #[[ATTR25]] = { nofree willreturn }
+; CGSCC: attributes #[[ATTR14]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) }
+; CGSCC: attributes #[[ATTR15]] = { nosync nounwind memory(read) }
+; CGSCC: attributes #[[ATTR16:[0-9]+]] = { nounwind willreturn memory(read) }
+; CGSCC: attributes #[[ATTR17]] = { mustprogress nosync nounwind willreturn }
+; CGSCC: attributes #[[ATTR18:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite) }
+; CGSCC: attributes #[[ATTR19]] = { nofree nounwind willreturn memory(write) }
+; CGSCC: attributes #[[ATTR20]] = { nofree nosync willreturn }
+; CGSCC: attributes #[[ATTR21]] = { nofree nounwind willreturn }
+; CGSCC: attributes #[[ATTR22]] = { nounwind }
+; CGSCC: attributes #[[ATTR23]] = { nofree willreturn }
 ;.

diff  --git a/llvm/test/Transforms/CodeGenPrepare/AArch64/large-offset-gep.ll b/llvm/test/Transforms/CodeGenPrepare/AArch64/large-offset-gep.ll
index 097575ca86bccb..1bfa8afaded040 100644
--- a/llvm/test/Transforms/CodeGenPrepare/AArch64/large-offset-gep.ll
+++ b/llvm/test/Transforms/CodeGenPrepare/AArch64/large-offset-gep.ll
@@ -249,7 +249,7 @@ while_end:
   ret void
 }
 
-declare ptr @llvm.strip.invariant.group.p0(ptr)
+declare ptr @llvm.launder.invariant.group.p0(ptr)
 
 define void @test_invariant_group(i32 %arg, i1 %c) {
 ; CHECK-LABEL: test_invariant_group:
@@ -287,7 +287,7 @@ bb5:                                              ; preds = %bb4, %bb2, %bb1, %b
   ret void
 
 bb6:                                              ; preds = %bb
-  %i7 = call ptr @llvm.strip.invariant.group.p0(ptr nonnull undef)
+  %i7 = call ptr @llvm.launder.invariant.group.p0(ptr nonnull undef)
   %i8 = icmp eq i32 %arg, 0
   br i1 %i8, label %bb2, label %bb1
 }

diff  --git a/llvm/test/Transforms/CodeGenPrepare/X86/invariant.group.ll b/llvm/test/Transforms/CodeGenPrepare/X86/invariant.group.ll
index a0bac01d116577..f9870781000aac 100644
--- a/llvm/test/Transforms/CodeGenPrepare/X86/invariant.group.ll
+++ b/llvm/test/Transforms/CodeGenPrepare/X86/invariant.group.ll
@@ -18,23 +18,5 @@ enter:
 }
 ; CHECK-LABEL: }
 
-; CHECK-LABEL: define void @foo2() {
-define void @foo2() {
-enter:
-  ; CHECK-NOT: !invariant.group
-  ; CHECK-NOT: @llvm.strip.invariant.group.p0(
-  ; CHECK: %val = load i8, ptr @tmp, align 1{{$}}
-  %val = load i8, ptr @tmp, !invariant.group !0
-  %ptr = call ptr @llvm.strip.invariant.group.p0(ptr @tmp)
-
-  ; CHECK: store i8 42, ptr @tmp, align 1{{$}}
-  store i8 42, ptr %ptr, !invariant.group !0
-
-  ret void
-}
-; CHECK-LABEL: }
-
-
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
 !0 = !{}

diff  --git a/llvm/test/Transforms/DeadStoreElimination/launder.invariant.group.ll b/llvm/test/Transforms/DeadStoreElimination/launder.invariant.group.ll
index 7665f6372bb28b..5c62b8839c101f 100644
--- a/llvm/test/Transforms/DeadStoreElimination/launder.invariant.group.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/launder.invariant.group.ll
@@ -27,39 +27,5 @@ define void @skip2Barriers(ptr %ptr) {
   ret void
 }
 
-; CHECK-LABEL: void @skip3Barriers(ptr %ptr)
-define void @skip3Barriers(ptr %ptr) {
-; CHECK-NOT: store i8 42
-  store i8 42, ptr %ptr
-; CHECK: %ptr2 = call ptr @llvm.strip.invariant.group.p0(ptr %ptr)
-  %ptr2 = call ptr @llvm.strip.invariant.group.p0(ptr %ptr)
-; CHECK-NOT: store i8 43
-  store i8 43, ptr %ptr2
-  %ptr3 = call ptr @llvm.strip.invariant.group.p0(ptr %ptr2)
-  %ptr4 = call ptr @llvm.strip.invariant.group.p0(ptr %ptr3)
-
-; CHECK: store i8 44
-  store i8 44, ptr %ptr4
-  ret void
-}
-
-; CHECK-LABEL: void @skip4Barriers(ptr %ptr)
-define void @skip4Barriers(ptr %ptr) {
-; CHECK-NOT: store i8 42
-  store i8 42, ptr %ptr
-; CHECK: %ptr2 = call ptr @llvm.strip.invariant.group.p0(ptr %ptr)
-  %ptr2 = call ptr @llvm.strip.invariant.group.p0(ptr %ptr)
-; CHECK-NOT: store i8 43
-  store i8 43, ptr %ptr2
-  %ptr3 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr2)
-  %ptr4 = call ptr @llvm.strip.invariant.group.p0(ptr %ptr3)
-  %ptr5 = call ptr @llvm.launder.invariant.group.p0(ptr %ptr3)
-
-; CHECK: store i8 44
-  store i8 44, ptr %ptr5
-  ret void
-}
-
 
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)

diff  --git a/llvm/test/Transforms/FunctionAttrs/nocapture.ll b/llvm/test/Transforms/FunctionAttrs/nocapture.ll
index 4ff806ca6aeb6a..fc5daa18cd3c8c 100644
--- a/llvm/test/Transforms/FunctionAttrs/nocapture.ll
+++ b/llvm/test/Transforms/FunctionAttrs/nocapture.ll
@@ -46,7 +46,7 @@ define void @c3(ptr %q) {
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
 ; ATTRIBUTOR-LABEL: define void @c3
 ; ATTRIBUTOR-SAME: (ptr nofree writeonly [[Q:%.*]]) #[[ATTR1]] {
-; ATTRIBUTOR-NEXT:    call void @c2(ptr nofree writeonly [[Q]]) #[[ATTR22:[0-9]+]]
+; ATTRIBUTOR-NEXT:    call void @c2(ptr nofree writeonly [[Q]]) #[[ATTR21:[0-9]+]]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
   call void @c2(ptr %q)
@@ -232,7 +232,7 @@ define i1 @c7(ptr %q, i32 %bitno) {
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read)
 ; ATTRIBUTOR-LABEL: define i1 @c7
 ; ATTRIBUTOR-SAME: (ptr nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2]] {
-; ATTRIBUTOR-NEXT:    [[PTR:%.*]] = call ptr @lookup_bit(ptr nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR23:[0-9]+]]
+; ATTRIBUTOR-NEXT:    [[PTR:%.*]] = call ptr @lookup_bit(ptr nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR22:[0-9]+]]
 ; ATTRIBUTOR-NEXT:    [[VAL:%.*]] = load i1, ptr [[PTR]], align 1
 ; ATTRIBUTOR-NEXT:    ret i1 [[VAL]]
 ;
@@ -337,7 +337,7 @@ define void @nc2(ptr %p, ptr %q) {
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
 ; ATTRIBUTOR-LABEL: define void @nc2
 ; ATTRIBUTOR-SAME: (ptr nofree captures(none) [[P:%.*]], ptr nofree [[Q:%.*]]) #[[ATTR5]] {
-; ATTRIBUTOR-NEXT:    [[TMP1:%.*]] = call i32 @nc1(ptr nofree [[Q]], ptr nofree captures(none) [[P]], i1 false) #[[ATTR24:[0-9]+]]
+; ATTRIBUTOR-NEXT:    [[TMP1:%.*]] = call i32 @nc1(ptr nofree [[Q]], ptr nofree captures(none) [[P]], i1 false) #[[ATTR23:[0-9]+]]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
   %1 = call i32 @nc1(ptr %q, ptr %p, i1 0)		; <i32> [#uses=0]
@@ -389,7 +389,7 @@ define void @readonly_nounwind_willreturn(ptr %p) {
 ; ATTRIBUTOR: Function Attrs: mustprogress nosync nounwind willreturn memory(read)
 ; ATTRIBUTOR-LABEL: define void @readonly_nounwind_willreturn
 ; ATTRIBUTOR-SAME: (ptr readonly captures(none) [[P:%.*]]) #[[ATTR9:[0-9]+]] {
-; ATTRIBUTOR-NEXT:    call void @external_willreturn(ptr readonly captures(none) [[P]]) #[[ATTR25:[0-9]+]]
+; ATTRIBUTOR-NEXT:    call void @external_willreturn(ptr readonly captures(none) [[P]]) #[[ATTR24:[0-9]+]]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
   call void @external_willreturn(ptr %p)
@@ -732,7 +732,7 @@ define void @nocaptureLaunder(ptr %p) {
 ; ATTRIBUTOR-LABEL: define void @nocaptureLaunder
 ; ATTRIBUTOR-SAME: (ptr nofree captures(none) [[P:%.*]]) #[[ATTR13:[0-9]+]] {
 ; ATTRIBUTOR-NEXT:  entry:
-; ATTRIBUTOR-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[P]]) #[[ATTR26:[0-9]+]]
+; ATTRIBUTOR-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[P]]) #[[ATTR25:[0-9]+]]
 ; ATTRIBUTOR-NEXT:    store i8 42, ptr [[B]], align 1
 ; ATTRIBUTOR-NEXT:    ret void
 ;
@@ -754,7 +754,7 @@ define void @captureLaunder(ptr %p) {
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
 ; ATTRIBUTOR-LABEL: define void @captureLaunder
 ; ATTRIBUTOR-SAME: (ptr nofree [[P:%.*]]) #[[ATTR5]] {
-; ATTRIBUTOR-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[P]]) #[[ATTR26]]
+; ATTRIBUTOR-NEXT:    [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[P]]) #[[ATTR25]]
 ; ATTRIBUTOR-NEXT:    store ptr [[B]], ptr @g2, align 8
 ; ATTRIBUTOR-NEXT:    ret void
 ;
@@ -763,50 +763,6 @@ define void @captureLaunder(ptr %p) {
   ret void
 }
 
-define void @nocaptureStrip(ptr %p) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
-; FNATTRS-LABEL: define void @nocaptureStrip
-; FNATTRS-SAME: (ptr nofree writeonly captures(none) [[P:%.*]]) #[[ATTR17:[0-9]+]] {
-; FNATTRS-NEXT:  entry:
-; FNATTRS-NEXT:    [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[P]])
-; FNATTRS-NEXT:    store i8 42, ptr [[B]], align 1
-; FNATTRS-NEXT:    ret void
-;
-; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
-; ATTRIBUTOR-LABEL: define void @nocaptureStrip
-; ATTRIBUTOR-SAME: (ptr nofree writeonly captures(none) [[P:%.*]]) #[[ATTR14:[0-9]+]] {
-; ATTRIBUTOR-NEXT:  entry:
-; ATTRIBUTOR-NEXT:    [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[P]]) #[[ATTR23]]
-; ATTRIBUTOR-NEXT:    store i8 42, ptr [[B]], align 1
-; ATTRIBUTOR-NEXT:    ret void
-;
-entry:
-  %b = call ptr @llvm.strip.invariant.group.p0(ptr %p)
-  store i8 42, ptr %b
-  ret void
-}
-
- at g3 = global ptr null
-define void @captureStrip(ptr %p) {
-; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none, target_mem: none)
-; FNATTRS-LABEL: define void @captureStrip
-; FNATTRS-SAME: (ptr [[P:%.*]]) #[[ATTR1]] {
-; FNATTRS-NEXT:    [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[P]])
-; FNATTRS-NEXT:    store ptr [[B]], ptr @g3, align 8
-; FNATTRS-NEXT:    ret void
-;
-; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
-; ATTRIBUTOR-LABEL: define void @captureStrip
-; ATTRIBUTOR-SAME: (ptr nofree writeonly [[P:%.*]]) #[[ATTR1]] {
-; ATTRIBUTOR-NEXT:    [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[P]]) #[[ATTR23]]
-; ATTRIBUTOR-NEXT:    store ptr [[B]], ptr @g3, align 8
-; ATTRIBUTOR-NEXT:    ret void
-;
-  %b = call ptr @llvm.strip.invariant.group.p0(ptr %p)
-  store ptr %b, ptr @g3
-  ret void
-}
-
 define i1 @captureICmp(ptr %x) {
 ; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
 ; FNATTRS-LABEL: define i1 @captureICmp
@@ -940,14 +896,14 @@ define i1 @notInboundsGEPICmp(ptr %x) {
 define i1 @inboundsGEPICmpNullPointerDefined(ptr %x) null_pointer_is_valid {
 ; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none)
 ; FNATTRS-LABEL: define i1 @inboundsGEPICmpNullPointerDefined
-; FNATTRS-SAME: (ptr nofree readnone captures(address) [[X:%.*]]) #[[ATTR18:[0-9]+]] {
+; FNATTRS-SAME: (ptr nofree readnone captures(address) [[X:%.*]]) #[[ATTR17:[0-9]+]] {
 ; FNATTRS-NEXT:    [[TMP1:%.*]] = getelementptr i32, ptr [[X]], i32 5
 ; FNATTRS-NEXT:    [[TMP2:%.*]] = icmp eq ptr [[TMP1]], null
 ; FNATTRS-NEXT:    ret i1 [[TMP2]]
 ;
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none)
 ; ATTRIBUTOR-LABEL: define i1 @inboundsGEPICmpNullPointerDefined
-; ATTRIBUTOR-SAME: (ptr nofree readnone [[X:%.*]]) #[[ATTR15:[0-9]+]] {
+; ATTRIBUTOR-SAME: (ptr nofree readnone [[X:%.*]]) #[[ATTR14:[0-9]+]] {
 ; ATTRIBUTOR-NEXT:    [[TMP1:%.*]] = getelementptr i32, ptr [[X]], i32 5
 ; ATTRIBUTOR-NEXT:    [[TMP2:%.*]] = icmp eq ptr [[TMP1]], null
 ; ATTRIBUTOR-NEXT:    ret i1 [[TMP2]]
@@ -977,13 +933,13 @@ define i1 @nocaptureDereferenceableOrNullICmp(ptr dereferenceable_or_null(4) %x)
 define i1 @captureDereferenceableOrNullICmp(ptr dereferenceable_or_null(4) %x) null_pointer_is_valid {
 ; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none)
 ; FNATTRS-LABEL: define noundef i1 @captureDereferenceableOrNullICmp
-; FNATTRS-SAME: (ptr nofree readnone captures(address_is_null) dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR18]] {
+; FNATTRS-SAME: (ptr nofree readnone captures(address_is_null) dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR17]] {
 ; FNATTRS-NEXT:    [[TMP1:%.*]] = icmp eq ptr [[X]], null
 ; FNATTRS-NEXT:    ret i1 [[TMP1]]
 ;
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none)
 ; ATTRIBUTOR-LABEL: define i1 @captureDereferenceableOrNullICmp
-; ATTRIBUTOR-SAME: (ptr nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR15]] {
+; ATTRIBUTOR-SAME: (ptr nofree readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR14]] {
 ; ATTRIBUTOR-NEXT:    [[TMP1:%.*]] = icmp eq ptr [[X]], null
 ; ATTRIBUTOR-NEXT:    ret i1 [[TMP1]]
 ;
@@ -1032,14 +988,14 @@ define void @recurse_fptr(ptr %f, ptr %p) {
 define void @readnone_indirec(ptr %f, ptr %p) {
 ; FNATTRS: Function Attrs: nofree nosync memory(none)
 ; FNATTRS-LABEL: define void @readnone_indirec
-; FNATTRS-SAME: (ptr nofree readonly captures(none) [[F:%.*]], ptr nofree readnone captures(address) [[P:%.*]]) #[[ATTR19:[0-9]+]] {
-; FNATTRS-NEXT:    call void [[F]](ptr [[P]]) #[[ATTR25:[0-9]+]]
+; FNATTRS-SAME: (ptr nofree readonly captures(none) [[F:%.*]], ptr nofree readnone captures(address) [[P:%.*]]) #[[ATTR18:[0-9]+]] {
+; FNATTRS-NEXT:    call void [[F]](ptr [[P]]) #[[ATTR24:[0-9]+]]
 ; FNATTRS-NEXT:    ret void
 ;
 ; ATTRIBUTOR: Function Attrs: nosync memory(none)
 ; ATTRIBUTOR-LABEL: define void @readnone_indirec
-; ATTRIBUTOR-SAME: (ptr nofree nonnull readnone captures(none) [[F:%.*]], ptr readnone [[P:%.*]]) #[[ATTR16:[0-9]+]] {
-; ATTRIBUTOR-NEXT:    call void [[F]](ptr [[P]]) #[[ATTR27:[0-9]+]]
+; ATTRIBUTOR-SAME: (ptr nofree nonnull readnone captures(none) [[F:%.*]], ptr readnone [[P:%.*]]) #[[ATTR15:[0-9]+]] {
+; ATTRIBUTOR-NEXT:    call void [[F]](ptr [[P]]) #[[ATTR26:[0-9]+]]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
   call void %f(ptr %p) readnone
@@ -1293,7 +1249,7 @@ define void @dont_increase_existing_captures_scc2(ptr %p) {
 define void @addr_only_scc(ptr %p) {
 ; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: read, inaccessiblemem: none, target_mem: none)
 ; FNATTRS-LABEL: define void @addr_only_scc
-; FNATTRS-SAME: (ptr nofree readonly captures(address_is_null) [[P:%.*]]) #[[ATTR20:[0-9]+]] {
+; FNATTRS-SAME: (ptr nofree readonly captures(address_is_null) [[P:%.*]]) #[[ATTR19:[0-9]+]] {
 ; FNATTRS-NEXT:    [[V:%.*]] = load i8, ptr [[P]], align 1
 ; FNATTRS-NEXT:    store i8 [[V]], ptr @g, align 1
 ; FNATTRS-NEXT:    call void @addr_only_scc2(ptr [[P]])
@@ -1301,10 +1257,10 @@ define void @addr_only_scc(ptr %p) {
 ;
 ; ATTRIBUTOR: Function Attrs: nofree nosync nounwind
 ; ATTRIBUTOR-LABEL: define void @addr_only_scc
-; ATTRIBUTOR-SAME: (ptr nofree nonnull [[P:%.*]]) #[[ATTR17:[0-9]+]] {
+; ATTRIBUTOR-SAME: (ptr nofree nonnull [[P:%.*]]) #[[ATTR16:[0-9]+]] {
 ; ATTRIBUTOR-NEXT:    [[V:%.*]] = load i8, ptr [[P]], align 1
 ; ATTRIBUTOR-NEXT:    store i8 [[V]], ptr @g, align 1
-; ATTRIBUTOR-NEXT:    call void @addr_only_scc2(ptr nofree nonnull [[P]]) #[[ATTR17]]
+; ATTRIBUTOR-NEXT:    call void @addr_only_scc2(ptr nofree nonnull [[P]]) #[[ATTR16]]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
   %v = load i8, ptr %p
@@ -1316,7 +1272,7 @@ define void @addr_only_scc(ptr %p) {
 define void @addr_only_scc2(ptr %p) {
 ; FNATTRS: Function Attrs: nofree nosync nounwind memory(write, argmem: read, inaccessiblemem: none, target_mem: none)
 ; FNATTRS-LABEL: define void @addr_only_scc2
-; FNATTRS-SAME: (ptr nofree readonly captures(address_is_null) [[P:%.*]]) #[[ATTR20]] {
+; FNATTRS-SAME: (ptr nofree readonly captures(address_is_null) [[P:%.*]]) #[[ATTR19]] {
 ; FNATTRS-NEXT:    [[CMP:%.*]] = icmp ne ptr [[P]], null
 ; FNATTRS-NEXT:    br i1 [[CMP]], label [[IF:%.*]], label [[EXIT:%.*]]
 ; FNATTRS:       if:
@@ -1327,11 +1283,11 @@ define void @addr_only_scc2(ptr %p) {
 ;
 ; ATTRIBUTOR: Function Attrs: nofree nosync nounwind
 ; ATTRIBUTOR-LABEL: define void @addr_only_scc2
-; ATTRIBUTOR-SAME: (ptr nofree [[P:%.*]]) #[[ATTR17]] {
+; ATTRIBUTOR-SAME: (ptr nofree [[P:%.*]]) #[[ATTR16]] {
 ; ATTRIBUTOR-NEXT:    [[CMP:%.*]] = icmp ne ptr [[P]], null
 ; ATTRIBUTOR-NEXT:    br i1 [[CMP]], label [[IF:%.*]], label [[EXIT:%.*]]
 ; ATTRIBUTOR:       if:
-; ATTRIBUTOR-NEXT:    call void @addr_only_scc(ptr nofree [[P]]) #[[ATTR17]]
+; ATTRIBUTOR-NEXT:    call void @addr_only_scc(ptr nofree [[P]]) #[[ATTR16]]
 ; ATTRIBUTOR-NEXT:    br label [[EXIT]]
 ; ATTRIBUTOR:       exit:
 ; ATTRIBUTOR-NEXT:    ret void
@@ -1350,14 +1306,14 @@ exit:
 define void @assume_align(ptr %p) {
 ; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write)
 ; FNATTRS-LABEL: define void @assume_align
-; FNATTRS-SAME: (ptr nofree readnone captures(none) [[P:%.*]]) #[[ATTR21:[0-9]+]] {
+; FNATTRS-SAME: (ptr nofree readnone captures(none) [[P:%.*]]) #[[ATTR20:[0-9]+]] {
 ; FNATTRS-NEXT:    call void @llvm.assume(i1 true) [ "align"(ptr [[P]], i64 8) ]
 ; FNATTRS-NEXT:    ret void
 ;
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write)
 ; ATTRIBUTOR-LABEL: define void @assume_align
-; ATTRIBUTOR-SAME: (ptr nofree readnone captures(none) [[P:%.*]]) #[[ATTR18:[0-9]+]] {
-; ATTRIBUTOR-NEXT:    call void @llvm.assume(i1 true) #[[ATTR28:[0-9]+]] [ "align"(ptr [[P]], i64 8) ]
+; ATTRIBUTOR-SAME: (ptr nofree readnone captures(none) [[P:%.*]]) #[[ATTR17:[0-9]+]] {
+; ATTRIBUTOR-NEXT:    call void @llvm.assume(i1 true) #[[ATTR27:[0-9]+]] [ "align"(ptr [[P]], i64 8) ]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
   call void @llvm.assume(i1 true) ["align"(ptr %p, i64 8)]
@@ -1367,14 +1323,14 @@ define void @assume_align(ptr %p) {
 define void @assume_dereferenceable(ptr %p) {
 ; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write)
 ; FNATTRS-LABEL: define void @assume_dereferenceable
-; FNATTRS-SAME: (ptr nofree readnone captures(none) [[P:%.*]]) #[[ATTR21]] {
+; FNATTRS-SAME: (ptr nofree readnone captures(none) [[P:%.*]]) #[[ATTR20]] {
 ; FNATTRS-NEXT:    call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[P]], i64 8) ]
 ; FNATTRS-NEXT:    ret void
 ;
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write)
 ; ATTRIBUTOR-LABEL: define void @assume_dereferenceable
-; ATTRIBUTOR-SAME: (ptr nofree nonnull readnone captures(none) [[P:%.*]]) #[[ATTR18]] {
-; ATTRIBUTOR-NEXT:    call void @llvm.assume(i1 true) #[[ATTR28]] [ "dereferenceable"(ptr [[P]], i64 8) ]
+; ATTRIBUTOR-SAME: (ptr nofree nonnull readnone captures(none) [[P:%.*]]) #[[ATTR17]] {
+; ATTRIBUTOR-NEXT:    call void @llvm.assume(i1 true) #[[ATTR27]] [ "dereferenceable"(ptr [[P]], i64 8) ]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
   call void @llvm.assume(i1 true) ["dereferenceable"(ptr %p, i64 8)]
@@ -1384,14 +1340,14 @@ define void @assume_dereferenceable(ptr %p) {
 define void @assume_nonnull(ptr %p) {
 ; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write)
 ; FNATTRS-LABEL: define void @assume_nonnull
-; FNATTRS-SAME: (ptr nofree readnone captures(none) [[P:%.*]]) #[[ATTR21]] {
+; FNATTRS-SAME: (ptr nofree readnone captures(none) [[P:%.*]]) #[[ATTR20]] {
 ; FNATTRS-NEXT:    call void @llvm.assume(i1 true) [ "nonnull"(ptr [[P]]) ]
 ; FNATTRS-NEXT:    ret void
 ;
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: write)
 ; ATTRIBUTOR-LABEL: define void @assume_nonnull
-; ATTRIBUTOR-SAME: (ptr nofree nonnull readnone captures(none) [[P:%.*]]) #[[ATTR18]] {
-; ATTRIBUTOR-NEXT:    call void @llvm.assume(i1 true) #[[ATTR28]] [ "nonnull"(ptr [[P]]) ]
+; ATTRIBUTOR-SAME: (ptr nofree nonnull readnone captures(none) [[P:%.*]]) #[[ATTR17]] {
+; ATTRIBUTOR-NEXT:    call void @llvm.assume(i1 true) #[[ATTR27]] [ "nonnull"(ptr [[P]]) ]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
   call void @llvm.assume(i1 true) ["nonnull"(ptr %p)]
@@ -1401,13 +1357,13 @@ define void @assume_nonnull(ptr %p) {
 define void @captures_metadata_address_is_null(ptr %x, ptr %y) {
 ; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
 ; FNATTRS-LABEL: define void @captures_metadata_address_is_null
-; FNATTRS-SAME: (ptr nofree readnone captures(address_is_null) [[X:%.*]], ptr nofree writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) #[[ATTR17]] {
+; FNATTRS-SAME: (ptr nofree readnone captures(address_is_null) [[X:%.*]], ptr nofree writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) #[[ATTR21:[0-9]+]] {
 ; FNATTRS-NEXT:    store ptr [[X]], ptr [[Y]], align 8, !captures [[META0:![0-9]+]]
 ; FNATTRS-NEXT:    ret void
 ;
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
 ; ATTRIBUTOR-LABEL: define void @captures_metadata_address_is_null
-; ATTRIBUTOR-SAME: (ptr nofree writeonly [[X:%.*]], ptr nofree nonnull writeonly captures(none) [[Y:%.*]]) #[[ATTR14]] {
+; ATTRIBUTOR-SAME: (ptr nofree writeonly [[X:%.*]], ptr nofree nonnull writeonly captures(none) [[Y:%.*]]) #[[ATTR18:[0-9]+]] {
 ; ATTRIBUTOR-NEXT:    store ptr [[X]], ptr [[Y]], align 8, !captures [[META0:![0-9]+]]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
@@ -1418,13 +1374,13 @@ define void @captures_metadata_address_is_null(ptr %x, ptr %y) {
 define void @captures_metadata_address(ptr %x, ptr %y) {
 ; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
 ; FNATTRS-LABEL: define void @captures_metadata_address
-; FNATTRS-SAME: (ptr nofree readnone captures(address) [[X:%.*]], ptr nofree writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) #[[ATTR17]] {
+; FNATTRS-SAME: (ptr nofree readnone captures(address) [[X:%.*]], ptr nofree writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) #[[ATTR21]] {
 ; FNATTRS-NEXT:    store ptr [[X]], ptr [[Y]], align 8, !captures [[META1:![0-9]+]]
 ; FNATTRS-NEXT:    ret void
 ;
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
 ; ATTRIBUTOR-LABEL: define void @captures_metadata_address
-; ATTRIBUTOR-SAME: (ptr nofree writeonly [[X:%.*]], ptr nofree nonnull writeonly captures(none) [[Y:%.*]]) #[[ATTR14]] {
+; ATTRIBUTOR-SAME: (ptr nofree writeonly [[X:%.*]], ptr nofree nonnull writeonly captures(none) [[Y:%.*]]) #[[ATTR18]] {
 ; ATTRIBUTOR-NEXT:    store ptr [[X]], ptr [[Y]], align 8, !captures [[META1:![0-9]+]]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
@@ -1435,13 +1391,13 @@ define void @captures_metadata_address(ptr %x, ptr %y) {
 define void @captures_metadata_address_read_provenance(ptr %x, ptr %y) {
 ; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
 ; FNATTRS-LABEL: define void @captures_metadata_address_read_provenance
-; FNATTRS-SAME: (ptr nofree readonly captures(address, read_provenance) [[X:%.*]], ptr nofree writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) #[[ATTR17]] {
+; FNATTRS-SAME: (ptr nofree readonly captures(address, read_provenance) [[X:%.*]], ptr nofree writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) #[[ATTR21]] {
 ; FNATTRS-NEXT:    store ptr [[X]], ptr [[Y]], align 8, !captures [[META2:![0-9]+]]
 ; FNATTRS-NEXT:    ret void
 ;
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
 ; ATTRIBUTOR-LABEL: define void @captures_metadata_address_read_provenance
-; ATTRIBUTOR-SAME: (ptr nofree writeonly [[X:%.*]], ptr nofree nonnull writeonly captures(none) [[Y:%.*]]) #[[ATTR14]] {
+; ATTRIBUTOR-SAME: (ptr nofree writeonly [[X:%.*]], ptr nofree nonnull writeonly captures(none) [[Y:%.*]]) #[[ATTR18]] {
 ; ATTRIBUTOR-NEXT:    store ptr [[X]], ptr [[Y]], align 8, !captures [[META2:![0-9]+]]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
@@ -1452,13 +1408,13 @@ define void @captures_metadata_address_read_provenance(ptr %x, ptr %y) {
 define void @captures_metadata_provenance(ptr %x, ptr %y) {
 ; FNATTRS: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
 ; FNATTRS-LABEL: define void @captures_metadata_provenance
-; FNATTRS-SAME: (ptr captures(provenance) [[X:%.*]], ptr nofree writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) #[[ATTR17]] {
+; FNATTRS-SAME: (ptr captures(provenance) [[X:%.*]], ptr nofree writeonly captures(none) initializes((0, 8)) [[Y:%.*]]) #[[ATTR21]] {
 ; FNATTRS-NEXT:    store ptr [[X]], ptr [[Y]], align 8, !captures [[META3:![0-9]+]]
 ; FNATTRS-NEXT:    ret void
 ;
 ; ATTRIBUTOR: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
 ; ATTRIBUTOR-LABEL: define void @captures_metadata_provenance
-; ATTRIBUTOR-SAME: (ptr nofree writeonly [[X:%.*]], ptr nofree nonnull writeonly captures(none) [[Y:%.*]]) #[[ATTR14]] {
+; ATTRIBUTOR-SAME: (ptr nofree writeonly [[X:%.*]], ptr nofree nonnull writeonly captures(none) [[Y:%.*]]) #[[ATTR18]] {
 ; ATTRIBUTOR-NEXT:    store ptr [[X]], ptr [[Y]], align 8, !captures [[META3:![0-9]+]]
 ; ATTRIBUTOR-NEXT:    ret void
 ;
@@ -1467,4 +1423,3 @@ define void @captures_metadata_provenance(ptr %x, ptr %y) {
 }
 
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)

diff  --git a/llvm/test/Transforms/GVN/assume-equal.ll b/llvm/test/Transforms/GVN/assume-equal.ll
index f2ff8c8d411f5d..67b84510b9ca62 100644
--- a/llvm/test/Transforms/GVN/assume-equal.ll
+++ b/llvm/test/Transforms/GVN/assume-equal.ll
@@ -464,20 +464,6 @@ define i8 @assume_ptr_eq_same_prov(ptr %p, i64 %x) {
   ret i8 %v
 }
 
-define ptr @test_strip_invariant(ptr %x) {
-; CHECK-LABEL: define ptr @test_strip_invariant(
-; CHECK-SAME: ptr [[X:%.*]]) {
-; CHECK-NEXT:    [[X_STRIP:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[X]])
-; CHECK-NEXT:    [[CMP:%.*]] = icmp eq ptr [[X]], [[X_STRIP]]
-; CHECK-NEXT:    call void @llvm.assume(i1 [[CMP]])
-; CHECK-NEXT:    ret ptr [[X_STRIP]]
-;
-  %x.strip = call ptr @llvm.strip.invariant.group(ptr %x)
-  %cmp = icmp eq ptr %x, %x.strip
-  call void @llvm.assume(i1 %cmp)
-  ret ptr %x.strip
-}
-
 define ptr @test_launder_invariant(ptr %x) {
 ; CHECK-LABEL: define ptr @test_launder_invariant(
 ; CHECK-SAME: ptr [[X:%.*]]) {

diff  --git a/llvm/test/Transforms/GVN/invariant.group.ll b/llvm/test/Transforms/GVN/invariant.group.ll
index 307f638e6ece2d..50dbfe4f3100b4 100644
--- a/llvm/test/Transforms/GVN/invariant.group.ll
+++ b/llvm/test/Transforms/GVN/invariant.group.ll
@@ -71,20 +71,6 @@ entry:
   ret i8 %b
 }
 
-; FIXME: The first call could be also removed by GVN. Right now
-; DCE removes it. The second call is CSE'd with the first one.
-define i1 @proveEqualityForStrip(ptr %a) {
-; CHECK-LABEL: define i1 @proveEqualityForStrip(
-; CHECK-SAME: ptr [[A:%.*]]) {
-; CHECK-NEXT:    [[B1:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[A]])
-; CHECK-NEXT:    ret i1 true
-;
-  %b1 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
-  %b2 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
-  %r = icmp eq ptr %b1, %b2
-  ret i1 %r
-}
-
 define i8 @unoptimizable1() {
 ; CHECK-LABEL: define i8 @unoptimizable1() {
 ; CHECK-NEXT:  [[ENTRY:.*:]]
@@ -573,7 +559,6 @@ declare void @_ZN1AC1Ev(ptr)
 declare void @fooBit(ptr, i1)
 
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
 
 
 declare void @llvm.assume(i1 %cmp.vtables)

diff  --git a/llvm/test/Transforms/GlobalOpt/invariant.group.ll b/llvm/test/Transforms/GlobalOpt/invariant.group.ll
index f91bc954a37775..819aa79700d4f8 100644
--- a/llvm/test/Transforms/GlobalOpt/invariant.group.ll
+++ b/llvm/test/Transforms/GlobalOpt/invariant.group.ll
@@ -72,7 +72,7 @@ entry:
 define void @_GLOBAL__I_b() {
 enter:
   %val = call i32 @TheAnswerToLifeTheUniverseAndEverything()
-  %p2 = call ptr @llvm.strip.invariant.group.p0(ptr @tmp4)
+  %p2 = call ptr @llvm.launder.invariant.group.p0(ptr @tmp4)
   store i32 %val, ptr %p2
   ret void
 }
@@ -98,6 +98,5 @@ enter:
 declare void @changeTmp3ValAndCallBarrierInside()
 
 declare ptr @llvm.launder.invariant.group(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
 
 !0 = !{}

diff  --git a/llvm/test/Transforms/Inline/inline_inv_group.ll b/llvm/test/Transforms/Inline/inline_inv_group.ll
deleted file mode 100644
index f99e90a4fbe7c0..00000000000000
--- a/llvm/test/Transforms/Inline/inline_inv_group.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
-; RUN: opt < %s -passes=inline -S | FileCheck %s
-
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
-
-define ptr @callee() alwaysinline {
-; CHECK-LABEL: define ptr @callee
-; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
-; CHECK-NEXT:    [[TMP1:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr null)
-; CHECK-NEXT:    ret ptr [[TMP1]]
-;
-  %1 = call ptr @llvm.strip.invariant.group.p0(ptr null)
-  ret ptr %1
-}
-
-define ptr @caller() null_pointer_is_valid {
-; CHECK-LABEL: define ptr @caller
-; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
-; CHECK-NEXT:    [[TMP1:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr null)
-; CHECK-NEXT:    ret ptr [[TMP1]]
-;
-  %1 = call ptr @callee()
-  ret ptr %1
-}
-
-declare ptr @llvm.strip.invariant.group.p0(ptr)

diff  --git a/llvm/test/Transforms/Inline/invariant-group-sroa.ll b/llvm/test/Transforms/Inline/invariant-group-sroa.ll
index 4842cf01c9cf61..f037e75a709e96 100644
--- a/llvm/test/Transforms/Inline/invariant-group-sroa.ll
+++ b/llvm/test/Transforms/Inline/invariant-group-sroa.ll
@@ -4,7 +4,6 @@
 ; CHECK: SROACostSavings: 10
 
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
 
 declare void @b()
 
@@ -19,6 +18,5 @@ define i32 @g(ptr %a) {
   %i1 = load i32, ptr %a_inv_i8
   %i2 = load i32, ptr %a_inv_i8
   %i3 = add i32 %i1, %i2
-  %t = call ptr @llvm.strip.invariant.group.p0(ptr %a_inv_i8)
   ret i32 %i3
 }

diff  --git a/llvm/test/Transforms/Inline/launder.invariant.group.ll b/llvm/test/Transforms/Inline/launder.invariant.group.ll
index 9c1ddf7b5666ed..ddbcbca0842dc1 100644
--- a/llvm/test/Transforms/Inline/launder.invariant.group.ll
+++ b/llvm/test/Transforms/Inline/launder.invariant.group.ll
@@ -30,28 +30,27 @@ define i32 @foo(ptr noalias)  {
 ; This test checks if invariant group intrinsics have zero cost for inlining.
 ; CHECK-LABEL: define ptr @caller(ptr
 define ptr @caller(ptr %p) {
-; CHECK-NOT: call ptr @lot_of_launders_and_strips
-  %a1 = call ptr @lot_of_launders_and_strips(ptr %p)
-  %a2 = call ptr @lot_of_launders_and_strips(ptr %a1)
-  %a3 = call ptr @lot_of_launders_and_strips(ptr %a2)
-  %a4 = call ptr @lot_of_launders_and_strips(ptr %a3)
+; CHECK-NOT: call ptr @lot_of_launders
+  %a1 = call ptr @lot_of_launders(ptr %p)
+  %a2 = call ptr @lot_of_launders(ptr %a1)
+  %a3 = call ptr @lot_of_launders(ptr %a2)
+  %a4 = call ptr @lot_of_launders(ptr %a3)
   ret ptr %a4
 }
 
-define ptr @lot_of_launders_and_strips(ptr %p) {
+define ptr @lot_of_launders(ptr %p) {
   %a1 = call ptr @llvm.launder.invariant.group.p0(ptr %p)
   %a2 = call ptr @llvm.launder.invariant.group.p0(ptr %a1)
   %a3 = call ptr @llvm.launder.invariant.group.p0(ptr %a2)
   %a4 = call ptr @llvm.launder.invariant.group.p0(ptr %a3)
 
-  %s1 = call ptr @llvm.strip.invariant.group.p0(ptr %a4)
-  %s2 = call ptr @llvm.strip.invariant.group.p0(ptr %s1)
-  %s3 = call ptr @llvm.strip.invariant.group.p0(ptr %s2)
-  %s4 = call ptr @llvm.strip.invariant.group.p0(ptr %s3)
+  %s1 = call ptr @llvm.launder.invariant.group.p0(ptr %a4)
+  %s2 = call ptr @llvm.launder.invariant.group.p0(ptr %s1)
+  %s3 = call ptr @llvm.launder.invariant.group.p0(ptr %s2)
+  %s4 = call ptr @llvm.launder.invariant.group.p0(ptr %s3)
 
    ret ptr %s4
 }
 
 
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)

diff  --git a/llvm/test/Transforms/InstCombine/invariant.group.ll b/llvm/test/Transforms/InstCombine/invariant.group.ll
index 3ba7f7526a1c3d..d4998900ad68de 100644
--- a/llvm/test/Transforms/InstCombine/invariant.group.ll
+++ b/llvm/test/Transforms/InstCombine/invariant.group.ll
@@ -43,48 +43,6 @@ define ptr addrspace(42) @simplifyUndefLaunder2() {
   ret ptr addrspace(42) %b2
 }
 
-define ptr @simplifyNullStrip() {
-; CHECK-LABEL: @simplifyNullStrip(
-; CHECK-NEXT:    ret ptr null
-;
-  %b2 = call ptr @llvm.strip.invariant.group.p0(ptr null)
-  ret ptr %b2
-}
-
-define ptr @dontSimplifyNullStripNonNullOpt() #0 {
-; CHECK-LABEL: @dontSimplifyNullStripNonNullOpt(
-; CHECK-NEXT:    [[B2:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr null)
-; CHECK-NEXT:    ret ptr [[B2]]
-;
-  %b2 = call ptr @llvm.strip.invariant.group.p0(ptr null)
-  ret ptr %b2
-}
-
-define ptr addrspace(42) @dontsimplifyNullStripForDifferentAddrspace() {
-; CHECK-LABEL: @dontsimplifyNullStripForDifferentAddrspace(
-; CHECK-NEXT:    [[B2:%.*]] = call ptr addrspace(42) @llvm.strip.invariant.group.p42(ptr addrspace(42) null)
-; CHECK-NEXT:    ret ptr addrspace(42) [[B2]]
-;
-  %b2 = call ptr addrspace(42) @llvm.strip.invariant.group.p42(ptr addrspace(42) null)
-  ret ptr addrspace(42) %b2
-}
-
-define ptr @simplifyUndefStrip() {
-; CHECK-LABEL: @simplifyUndefStrip(
-; CHECK-NEXT:    ret ptr undef
-;
-  %b2 = call ptr @llvm.strip.invariant.group.p0(ptr undef)
-  ret ptr %b2
-}
-
-define ptr addrspace(42) @simplifyUndefStrip2() {
-; CHECK-LABEL: @simplifyUndefStrip2(
-; CHECK-NEXT:    ret ptr addrspace(42) undef
-;
-  %b2 = call ptr addrspace(42) @llvm.strip.invariant.group.p42(ptr addrspace(42) undef)
-  ret ptr addrspace(42) %b2
-}
-
 define ptr @simplifyLaunderOfLaunder(ptr %a) {
 ; CHECK-LABEL: @simplifyLaunderOfLaunder(
 ; CHECK-NEXT:    [[A3:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[A:%.*]])
@@ -95,64 +53,6 @@ define ptr @simplifyLaunderOfLaunder(ptr %a) {
   ret ptr %a3
 }
 
-define ptr @simplifyStripOfLaunder(ptr %a) {
-; CHECK-LABEL: @simplifyStripOfLaunder(
-; CHECK-NEXT:    [[A3:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[A:%.*]])
-; CHECK-NEXT:    ret ptr [[A3]]
-;
-  %a2 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
-  %a3 = call ptr @llvm.strip.invariant.group.p0(ptr %a2)
-  ret ptr %a3
-}
-
-define i1 @simplifyForCompare(ptr %a) {
-; CHECK-LABEL: @simplifyForCompare(
-; CHECK-NEXT:    [[A3:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[A:%.*]])
-; CHECK-NEXT:    ret i1 true
-;
-  %a2 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
-
-  %a3 = call ptr @llvm.strip.invariant.group.p0(ptr %a2)
-  %b2 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
-  %c = icmp eq ptr %a3, %b2
-  ret i1 %c
-}
-
-define ptr @skipWithDifferentTypes(ptr %a) {
-; CHECK-LABEL: @skipWithDifferentTypes(
-; CHECK-NEXT:    [[A3:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[A:%.*]])
-; CHECK-NEXT:    ret ptr [[A3]]
-;
-  %a2 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
-
-  %a3 = call ptr @llvm.strip.invariant.group.p0(ptr %a2)
-  ret ptr %a3
-}
-
-define ptr addrspace(42) @skipWithDifferentTypesAddrspace(ptr addrspace(42) %a) {
-; CHECK-LABEL: @skipWithDifferentTypesAddrspace(
-; CHECK-NEXT:    [[A3:%.*]] = call ptr addrspace(42) @llvm.strip.invariant.group.p42(ptr addrspace(42) [[A:%.*]])
-; CHECK-NEXT:    ret ptr addrspace(42) [[A3]]
-;
-  %a2 = call ptr addrspace(42) @llvm.launder.invariant.group.p42(ptr addrspace(42) %a)
-
-  %a3 = call ptr addrspace(42) @llvm.strip.invariant.group.p42(ptr addrspace(42) %a2)
-  ret ptr addrspace(42) %a3
-}
-
-define ptr addrspace(42) @skipWithDifferentTypesDifferentAddrspace(ptr %a) {
-; CHECK-LABEL: @skipWithDifferentTypesDifferentAddrspace(
-; CHECK-NEXT:    [[TMP1:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[A:%.*]])
-; CHECK-NEXT:    [[A3:%.*]] = addrspacecast ptr [[TMP1]] to ptr addrspace(42)
-; CHECK-NEXT:    ret ptr addrspace(42) [[A3]]
-;
-  %cast = addrspacecast ptr %a to ptr addrspace(42)
-  %a2 = call ptr addrspace(42) @llvm.launder.invariant.group.p42(ptr addrspace(42) %cast)
-
-  %a3 = call ptr addrspace(42) @llvm.strip.invariant.group.p42(ptr addrspace(42) %a2)
-  ret ptr addrspace(42) %a3
-}
-
 define i1 @icmp_null_launder(ptr %a) {
 ; CHECK-LABEL: @icmp_null_launder(
 ; CHECK-NEXT:    [[R:%.*]] = icmp eq ptr [[A:%.*]], null
@@ -163,16 +63,6 @@ define i1 @icmp_null_launder(ptr %a) {
   ret i1 %r
 }
 
-define i1 @icmp_null_strip(ptr %a) {
-; CHECK-LABEL: @icmp_null_strip(
-; CHECK-NEXT:    [[R:%.*]] = icmp eq ptr [[A:%.*]], null
-; CHECK-NEXT:    ret i1 [[R]]
-;
-  %a2 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
-  %r = icmp eq ptr %a2, null
-  ret i1 %r
-}
-
 define i1 @icmp_null_launder_valid_null(ptr %a) #0 {
 ; CHECK-LABEL: @icmp_null_launder_valid_null(
 ; CHECK-NEXT:    [[A2:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[A:%.*]])
@@ -184,17 +74,6 @@ define i1 @icmp_null_launder_valid_null(ptr %a) #0 {
   ret i1 %r
 }
 
-define i1 @icmp_null_strip_valid_null(ptr %a) #0 {
-; CHECK-LABEL: @icmp_null_strip_valid_null(
-; CHECK-NEXT:    [[A2:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[A:%.*]])
-; CHECK-NEXT:    [[R:%.*]] = icmp eq ptr [[A2]], null
-; CHECK-NEXT:    ret i1 [[R]]
-;
-  %a2 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
-  %r = icmp eq ptr %a2, null
-  ret i1 %r
-}
-
 ; Check that null always becomes the RHS
 define i1 @icmp_null_launder_lhs(ptr %a) {
 ; CHECK-LABEL: @icmp_null_launder_lhs(
@@ -228,8 +107,6 @@ define i32 @retype_keeps_invariant_group(ptr %p) {
 
 declare ptr @llvm.launder.invariant.group.p0(ptr)
 declare ptr addrspace(42) @llvm.launder.invariant.group.p42(ptr addrspace(42))
-declare ptr @llvm.strip.invariant.group.p0(ptr)
-declare ptr addrspace(42) @llvm.strip.invariant.group.p42(ptr addrspace(42))
 
 attributes #0 = { null_pointer_is_valid }
 

diff  --git a/llvm/test/Transforms/InstCombine/load.ll b/llvm/test/Transforms/InstCombine/load.ll
index 67bc405a09ce9c..9277e70b9a89f3 100644
--- a/llvm/test/Transforms/InstCombine/load.ll
+++ b/llvm/test/Transforms/InstCombine/load.ll
@@ -414,13 +414,13 @@ define i16 @load_from_zero_with_dynamic_offset(i64 %idx) {
   ret i16 %v
 }
 
-declare ptr @llvm.strip.invariant.group.p0(ptr %p)
+declare ptr @llvm.launder.invariant.group.p0(ptr %p)
 
-define i32 @load_via_strip_invariant_group() {
-; CHECK-LABEL: @load_via_strip_invariant_group(
+define i32 @load_via_launder_invariant_group() {
+; CHECK-LABEL: @load_via_launder_invariant_group(
 ; CHECK-NEXT:    ret i32 37
 ;
-  %a = call ptr @llvm.strip.invariant.group.p0(ptr @Y)
+  %a = call ptr @llvm.launder.invariant.group.p0(ptr @Y)
   %b = getelementptr i8, ptr %a, i64 8
   %d = load i32, ptr %b
   ret i32 %d

diff  --git a/llvm/test/Transforms/InstCombine/new-delete-itanium.ll b/llvm/test/Transforms/InstCombine/new-delete-itanium.ll
index 373c97dc391d8d..76c9193b4f4e85 100644
--- a/llvm/test/Transforms/InstCombine/new-delete-itanium.ll
+++ b/llvm/test/Transforms/InstCombine/new-delete-itanium.ll
@@ -187,7 +187,6 @@ define void @test11() {
 }
 
 declare ptr @llvm.launder.invariant.group(ptr)
-declare ptr @llvm.strip.invariant.group(ptr)
 
 define void @test17() {
 ; CHECK-LABEL: @test17(
@@ -195,8 +194,7 @@ define void @test17() {
 ;
   %nw1 = call ptr @_Znwm(i64 32) builtin
   %nw2 = call ptr @llvm.launder.invariant.group(ptr %nw1)
-  %nw3 = call ptr @llvm.strip.invariant.group(ptr %nw2)
-  store i8 1, ptr %nw3
+  store i8 1, ptr %nw2
   call void @_ZdlPv(ptr %nw2) builtin
   ret void
 }

diff  --git a/llvm/test/Transforms/InstSimplify/invariant.group-load.ll b/llvm/test/Transforms/InstSimplify/invariant.group-load.ll
index 661b216e9474d3..17c1717513c137 100644
--- a/llvm/test/Transforms/InstSimplify/invariant.group-load.ll
+++ b/llvm/test/Transforms/InstSimplify/invariant.group-load.ll
@@ -4,19 +4,8 @@
 @A = linkonce_odr hidden constant { i64, i64 } { i64 2, i64 3 }
 @B = linkonce_odr hidden global { i64, i64 } { i64 2, i64 3 }
 
-declare ptr @llvm.strip.invariant.group.p0(ptr %p)
 declare ptr @llvm.launder.invariant.group.p0(ptr %p)
 
-define i64 @f() {
-; CHECK-LABEL: @f(
-; CHECK-NEXT:    ret i64 3
-;
-  %a = call ptr @llvm.strip.invariant.group.p0(ptr @A)
-  %b = getelementptr i8, ptr %a, i32 8
-  %d = load i64, ptr %b
-  ret i64 %d
-}
-
 define i64 @g() {
 ; CHECK-LABEL: @g(
 ; CHECK-NEXT:    ret i64 3

diff  --git a/llvm/test/Transforms/NewGVN/invariant.group.ll b/llvm/test/Transforms/NewGVN/invariant.group.ll
index 8e3b6d17a7e9d5..8787d5d5a4a88c 100644
--- a/llvm/test/Transforms/NewGVN/invariant.group.ll
+++ b/llvm/test/Transforms/NewGVN/invariant.group.ll
@@ -71,17 +71,6 @@ entry:
   ret i8 %b
 }
 
-define i1 @proveEqualityForStrip(ptr %a) {
-; CHECK-LABEL: define i1 @proveEqualityForStrip(
-; CHECK-SAME: ptr [[A:%.*]]) {
-; CHECK-NEXT:    ret i1 true
-;
-  %b1 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
-  %b2 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
-  %r = icmp eq ptr %b1, %b2
-  ret i1 %r
-}
-
 define i8 @unoptimizable1() {
 ; CHECK-LABEL: define i8 @unoptimizable1() {
 ; CHECK-NEXT:  entry:
@@ -582,7 +571,6 @@ declare void @_ZN1AC1Ev(ptr)
 declare void @fooBit(ptr, i1)
 
 declare ptr @llvm.launder.invariant.group.p0(ptr)
-declare ptr @llvm.strip.invariant.group.p0(ptr)
 
 ; Function Attrs: nounwind
 declare void @llvm.assume(i1 %cmp.vtables) #0

diff  --git a/llvm/test/Transforms/SROA/invariant-group.ll b/llvm/test/Transforms/SROA/invariant-group.ll
index c9c9e031ca95fc..c321eeb9f3d3d8 100644
--- a/llvm/test/Transforms/SROA/invariant-group.ll
+++ b/llvm/test/Transforms/SROA/invariant-group.ll
@@ -5,7 +5,6 @@
 %t = type { i32, i32 }
 
 declare ptr @llvm.launder.invariant.group.p0(ptr %a)
-declare ptr @llvm.strip.invariant.group.p0(ptr %a)
 declare void @h(i32 %a)
 declare i32 @somevalue()
 
@@ -57,7 +56,7 @@ define void @g() {
 ; CHECK-NEXT:    [[V2:%.*]] = load i32, ptr [[A2]], align 4
 ; CHECK-NEXT:    call void @h(i32 [[V1]])
 ; CHECK-NEXT:    call void @h(i32 [[V2]])
-; CHECK-NEXT:    [[A1_STRIPPED:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[A]])
+; CHECK-NEXT:    [[A1_STRIPPED:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[A]])
 ; CHECK-NEXT:    [[A1_INT:%.*]] = ptrtoint ptr [[A1_STRIPPED]] to i32
 ; CHECK-NEXT:    call void @h(i32 [[A1_INT]])
 ; CHECK-NEXT:    ret void
@@ -79,8 +78,8 @@ define void @g() {
   call void @h(i32 %v1)
   call void @h(i32 %v2)
 
-  %a1_stripped = call ptr @llvm.strip.invariant.group.p0(ptr %a)
-  %a1_int = ptrtoint ptr %a1_stripped to i32
+  %a1_laundered = call ptr @llvm.launder.invariant.group.p0(ptr %a)
+  %a1_int = ptrtoint ptr %a1_laundered to i32
   call void @h(i32 %a1_int)
 
   ret void

diff  --git a/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest-free-cost.ll b/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest-free-cost.ll
index 4b067459e1aa9a..f89bd396757d0f 100644
--- a/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest-free-cost.ll
+++ b/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest-free-cost.ll
@@ -1,15 +1,15 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt < %s -S -passes=simplifycfg -bonus-inst-threshold=1 | FileCheck %s
 
-declare ptr @llvm.strip.invariant.group.p0(ptr)
+declare ptr @llvm.launder.invariant.group.p0(ptr)
 
 declare void @g1()
 declare void @g2()
 
 define void @f(ptr %a, ptr %b, i1 %c, i1 %d, i1 %e) {
 ; CHECK-LABEL: @f(
-; CHECK-NEXT:    [[A1:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[A:%.*]])
-; CHECK-NEXT:    [[B1:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr [[B:%.*]])
+; CHECK-NEXT:    [[A1:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[A:%.*]])
+; CHECK-NEXT:    [[B1:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr [[B:%.*]])
 ; CHECK-NEXT:    [[I:%.*]] = icmp eq ptr [[A1]], [[B1]]
 ; CHECK-NEXT:    [[OR_COND:%.*]] = select i1 [[C:%.*]], i1 [[I]], i1 false
 ; CHECK-NEXT:    br i1 [[OR_COND]], label [[L2:%.*]], label [[L3:%.*]]
@@ -24,8 +24,8 @@ define void @f(ptr %a, ptr %b, i1 %c, i1 %d, i1 %e) {
 ;
   br i1 %c, label %l1, label %l3
 l1:
-  %a1 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
-  %b1 = call ptr @llvm.strip.invariant.group.p0(ptr %b)
+  %a1 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
+  %b1 = call ptr @llvm.launder.invariant.group.p0(ptr %b)
   %i = icmp eq ptr %a1, %b1
   br i1 %i, label %l2, label %l3
 l2:

diff  --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
index 1704005a8e5b1b..15c2ae2076a90f 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
@@ -448,15 +448,6 @@ def LLVM_LaunderInvariantGroupOp
   let assemblyFormat = "$ptr attr-dict `:` qualified(type($ptr))";
 }
 
-def LLVM_StripInvariantGroupOp
-    : LLVM_OneResultIntrOp<"strip.invariant.group", [], [0],
-        [DeclareOpInterfaceMethods<PromotableOpInterface>,
-         SameOperandsAndResultType]> {
-  let arguments = (ins LLVM_AnyPointer:$ptr);
-  let results = (outs LLVM_AnyPointer:$res);
-  let assemblyFormat = "$ptr attr-dict `:` qualified(type($ptr))";
-}
-
 // Constrained Floating-Point Intrinsics.
 
 class LLVM_ConstrainedIntr<string mnem, int numArgs,

diff  --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
index 2416e01a679551..0d2737b286ced2 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
@@ -619,18 +619,6 @@ DeletionKind LLVM::LaunderInvariantGroupOp::removeBlockingUses(
   return DeletionKind::Delete;
 }
 
-bool LLVM::StripInvariantGroupOp::canUsesBeRemoved(
-    const SmallPtrSetImpl<OpOperand *> &blockingUses,
-    SmallVectorImpl<OpOperand *> &newBlockingUses,
-    const DataLayout &dataLayout) {
-  return forwardToUsers(*this, newBlockingUses);
-}
-
-DeletionKind LLVM::StripInvariantGroupOp::removeBlockingUses(
-    const SmallPtrSetImpl<OpOperand *> &blockingUses, OpBuilder &builder) {
-  return DeletionKind::Delete;
-}
-
 bool LLVM::DbgDeclareOp::canUsesBeRemoved(
     const SmallPtrSetImpl<OpOperand *> &blockingUses,
     SmallVectorImpl<OpOperand *> &newBlockingUses,

diff  --git a/mlir/test/Dialect/LLVMIR/mem2reg.mlir b/mlir/test/Dialect/LLVMIR/mem2reg.mlir
index 67a543768f4ef6..6887794e834b53 100644
--- a/mlir/test/Dialect/LLVMIR/mem2reg.mlir
+++ b/mlir/test/Dialect/LLVMIR/mem2reg.mlir
@@ -419,7 +419,6 @@ llvm.func @ignore_invariant_group() {
   %0 = llvm.mlir.constant(1 : i32) : i32
   %1 = llvm.alloca %0 x i32 {alignment = 4 : i64} : (i32) -> !llvm.ptr
   %2 = llvm.intr.launder.invariant.group %1 : !llvm.ptr
-  %3 = llvm.intr.strip.invariant.group %2 : !llvm.ptr
   llvm.return
 }
 

diff  --git a/mlir/test/Dialect/LLVMIR/roundtrip.mlir b/mlir/test/Dialect/LLVMIR/roundtrip.mlir
index 02e0bdaf3b694b..06791117c66f8d 100644
--- a/mlir/test/Dialect/LLVMIR/roundtrip.mlir
+++ b/mlir/test/Dialect/LLVMIR/roundtrip.mlir
@@ -809,8 +809,6 @@ llvm.func @invariant(%p: !llvm.ptr) {
 llvm.func @invariant_group_intrinsics(%p: !llvm.ptr) {
   // CHECK: %{{.+}} = llvm.intr.launder.invariant.group %[[P]] : !llvm.ptr
   %1 = llvm.intr.launder.invariant.group %p : !llvm.ptr
-  // CHECK: %{{.+}} = llvm.intr.strip.invariant.group %[[P]] : !llvm.ptr
-  %2 = llvm.intr.strip.invariant.group %p : !llvm.ptr
   llvm.return
 }
 

diff  --git a/mlir/test/Target/LLVMIR/Import/intrinsic.ll b/mlir/test/Target/LLVMIR/Import/intrinsic.ll
index 62018064b6afa8..a2f3df554f4a88 100644
--- a/mlir/test/Target/LLVMIR/Import/intrinsic.ll
+++ b/mlir/test/Target/LLVMIR/Import/intrinsic.ll
@@ -1080,8 +1080,6 @@ define void @invariant(ptr %0) {
 define void @invariant_group(ptr %0) {
   ; CHECK: %{{.+}} = llvm.intr.launder.invariant.group %{{.*}} : !llvm.ptr
   %2 = call ptr @llvm.launder.invariant.group.p0(ptr %0)
-  ; CHECK: %{{.+}} = llvm.intr.strip.invariant.group %{{.*}} : !llvm.ptr
-  %3 = call ptr @llvm.strip.invariant.group.p0(ptr %0)
   ret void
 }
 

diff  --git a/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir b/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
index c0ed71aac90e4a..7752226de882d1 100644
--- a/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
+++ b/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
@@ -1252,8 +1252,6 @@ llvm.func @invariant(%p: !llvm.ptr) {
 llvm.func @invariant_group(%p: !llvm.ptr) {
   // CHECK: call ptr @llvm.launder.invariant.group
   %1 = llvm.intr.launder.invariant.group %p : !llvm.ptr
-  // CHECK: call ptr @llvm.strip.invariant.group
-  %2 = llvm.intr.strip.invariant.group %p : !llvm.ptr
   llvm.return
 }
 


        


More information about the llvm-commits mailing list