[llvm] e93ac1e - [Attributor][FIX] Account for undef in the constant value lattice

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Sun May 23 20:08:42 PDT 2021


Author: Johannes Doerfert
Date: 2021-05-23T20:47:06-05:00
New Revision: e93ac1e2de66e8feae3cec3b6c0707b14c79dfeb

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

LOG: [Attributor][FIX] Account for undef in the constant value lattice

The constant value lattice looks like this

```
  <None>
     |
  <undef>
  /  |   \
... <0>  ...
 \   |   /
 <unknown>
```
We did not account for the undef and assumed a value meant we could not
change anymore. Now we actually check if we have the same value as
before, which will signal CHANGED to the users when we go from undef to
a specific constant.

This fixes, among other things, the bug exposed by @ipccp4 in
`value-simplify.ll`.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/Attributor.cpp
    llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll
    llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll
    llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll
    llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll
    llvm/test/Transforms/Attributor/memory_locations.ll
    llvm/test/Transforms/Attributor/nodelete.ll
    llvm/test/Transforms/Attributor/nonnull.ll
    llvm/test/Transforms/Attributor/undefined_behavior.ll
    llvm/test/Transforms/Attributor/value-simplify.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 0d48e94093321..d49c1fc069f54 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -558,7 +558,7 @@ Attributor::getAssumedConstant(const Value &V, const AbstractAttribute &AA,
   }
   if (isa_and_nonnull<UndefValue>(SimplifiedV.getValue())) {
     recordDependence(ValueSimplifyAA, AA, DepClassTy::OPTIONAL);
-    return llvm::None;
+    return UndefValue::get(V.getType());
   }
   Constant *CI = dyn_cast_or_null<Constant>(SimplifiedV.getValue());
   if (CI && CI->getType() != V.getType()) {

diff  --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index b6e6e00a79983..d3eff98209046 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -4708,7 +4708,7 @@ struct AAValueSimplifyArgument final : AAValueSimplifyImpl {
         return indicatePessimisticFixpoint();
     }
 
-    bool HasValueBefore = SimplifiedAssociatedValue.hasValue();
+    auto Before = SimplifiedAssociatedValue;
 
     auto PredForCallSite = [&](AbstractCallSite ACS) {
       const IRPosition &ACSArgPos =
@@ -4746,9 +4746,8 @@ struct AAValueSimplifyArgument final : AAValueSimplifyImpl {
         return indicatePessimisticFixpoint();
 
     // If a candicate was found in this update, return CHANGED.
-    return HasValueBefore == SimplifiedAssociatedValue.hasValue()
-               ? ChangeStatus::UNCHANGED
-               : ChangeStatus ::CHANGED;
+    return Before == SimplifiedAssociatedValue ? ChangeStatus::UNCHANGED
+                                               : ChangeStatus ::CHANGED;
   }
 
   /// See AbstractAttribute::trackStatistics()
@@ -4763,7 +4762,7 @@ struct AAValueSimplifyReturned : AAValueSimplifyImpl {
 
   /// See AbstractAttribute::updateImpl(...).
   ChangeStatus updateImpl(Attributor &A) override {
-    bool HasValueBefore = SimplifiedAssociatedValue.hasValue();
+    auto Before = SimplifiedAssociatedValue;
 
     auto PredForReturned = [&](Value &V) {
       return checkAndUpdate(A, *this, V, SimplifiedAssociatedValue);
@@ -4774,9 +4773,8 @@ struct AAValueSimplifyReturned : AAValueSimplifyImpl {
         return indicatePessimisticFixpoint();
 
     // If a candicate was found in this update, return CHANGED.
-    return HasValueBefore == SimplifiedAssociatedValue.hasValue()
-               ? ChangeStatus::UNCHANGED
-               : ChangeStatus ::CHANGED;
+    return Before == SimplifiedAssociatedValue ? ChangeStatus::UNCHANGED
+                                               : ChangeStatus ::CHANGED;
   }
 
   ChangeStatus manifest(Attributor &A) override {
@@ -4891,19 +4889,20 @@ struct AAValueSimplifyFloating : AAValueSimplifyImpl {
             SimplifiedAssociatedValue == NewVal) &&
            "Did not expect to change value for zero-comparison");
 
-    bool HasValueBefore = SimplifiedAssociatedValue.hasValue();
+    auto Before = SimplifiedAssociatedValue;
     SimplifiedAssociatedValue = NewVal;
 
     if (PtrNonNullAA.isKnownNonNull())
       indicateOptimisticFixpoint();
 
-    Changed = HasValueBefore ? ChangeStatus::UNCHANGED : ChangeStatus ::CHANGED;
+    Changed = Before == SimplifiedAssociatedValue ? ChangeStatus::UNCHANGED
+                                                  : ChangeStatus ::CHANGED;
     return true;
   }
 
   /// See AbstractAttribute::updateImpl(...).
   ChangeStatus updateImpl(Attributor &A) override {
-    bool HasValueBefore = SimplifiedAssociatedValue.hasValue();
+    auto Before = SimplifiedAssociatedValue;
 
     ChangeStatus Changed;
     if (checkForNullPtrCompare(A, dyn_cast<ICmpInst>(&getAnchorValue()),
@@ -4933,10 +4932,8 @@ struct AAValueSimplifyFloating : AAValueSimplifyImpl {
         return indicatePessimisticFixpoint();
 
     // If a candicate was found in this update, return CHANGED.
-
-    return HasValueBefore == SimplifiedAssociatedValue.hasValue()
-               ? ChangeStatus::UNCHANGED
-               : ChangeStatus ::CHANGED;
+    return Before == SimplifiedAssociatedValue ? ChangeStatus::UNCHANGED
+                                               : ChangeStatus ::CHANGED;
   }
 
   /// See AbstractAttribute::trackStatistics()

diff  --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll
index b968178dd0158..cda7dddc1ef5c 100644
--- a/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll
+++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll
@@ -31,6 +31,7 @@ define void @baz(<8 x i32> %arg) local_unnamed_addr {
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@baz
 ; IS__TUNIT____-SAME: (<8 x i32> [[ARG:%.*]]) local_unnamed_addr #[[ATTR0]] {
 ; IS__TUNIT____-NEXT:  bb:
+; IS__TUNIT____-NEXT:    [[TMP1:%.*]] = extractvalue [[STRUCT_ZOT:%.*]] undef, 0, 0
 ; IS__TUNIT____-NEXT:    ret void
 ;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn

diff  --git a/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll b/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll
index 77e34e4e82a8f..f49f4732cddaa 100644
--- a/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll
+++ b/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll
@@ -7,59 +7,71 @@ target datalayout = "E-m:e-i64:64-n32:64"
 target triple = "powerpc64le-unknown-linux"
 
 define void @test(i32 signext %n) {
-; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test
 ; IS__TUNIT____-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
 ; IS__TUNIT____-NEXT:  entry:
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       if.then:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    ret void
 ; IS__TUNIT____:       if.end:
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       if.then2:
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       if.end4:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    [[SUB_N:%.*]] = select i1 undef, i32 undef, i32 [[N]]
+; IS__TUNIT____-NEXT:    switch i32 [[SUB_N]], label [[IF_ELSE14:%.*]] [
+; IS__TUNIT____-NEXT:    i32 0, label [[IF_THEN9:%.*]]
+; IS__TUNIT____-NEXT:    i32 1, label [[IF_THEN12:%.*]]
+; IS__TUNIT____-NEXT:    ]
 ; IS__TUNIT____:       if.then9:
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       if.then12:
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       if.else14:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    br label [[DO_BODY:%.*]]
 ; IS__TUNIT____:       do.body:
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       if.then33:
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       cond.false.i28:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    [[TMP0:%.*]] = bitcast ppc_fp128 0xM3FF00000000000000000000000000000 to i128
+; IS__TUNIT____-NEXT:    [[TOBOOL_I26:%.*]] = icmp slt i128 [[TMP0]], 0
+; IS__TUNIT____-NEXT:    br label [[_ZN5BOOST4MATH4SIGNIGEEIRKT__EXIT30:%.*]]
 ; IS__TUNIT____:       _ZN5boost4math4signIgEEiRKT_.exit30:
 ; IS__TUNIT____-NEXT:    unreachable
 ;
-; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone
+; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test
 ; IS__CGSCC____-SAME: (i32 signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
 ; IS__CGSCC____-NEXT:  entry:
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       if.then:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret void
 ; IS__CGSCC____:       if.end:
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       if.then2:
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       if.end4:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    [[SUB_N:%.*]] = select i1 undef, i32 undef, i32 [[N]]
+; IS__CGSCC____-NEXT:    switch i32 [[SUB_N]], label [[IF_ELSE14:%.*]] [
+; IS__CGSCC____-NEXT:    i32 0, label [[IF_THEN9:%.*]]
+; IS__CGSCC____-NEXT:    i32 1, label [[IF_THEN12:%.*]]
+; IS__CGSCC____-NEXT:    ]
 ; IS__CGSCC____:       if.then9:
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       if.then12:
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       if.else14:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    br label [[DO_BODY:%.*]]
 ; IS__CGSCC____:       do.body:
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       if.then33:
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       cond.false.i28:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    [[TMP0:%.*]] = bitcast ppc_fp128 0xM3FF00000000000000000000000000000 to i128
+; IS__CGSCC____-NEXT:    [[TOBOOL_I26:%.*]] = icmp slt i128 [[TMP0]], 0
+; IS__CGSCC____-NEXT:    br label [[_ZN5BOOST4MATH4SIGNIGEEIRKT__EXIT30:%.*]]
 ; IS__CGSCC____:       _ZN5boost4math4signIgEEiRKT_.exit30:
 ; IS__CGSCC____-NEXT:    unreachable
 ;
@@ -109,7 +121,7 @@ _ZN5boost4math4signIgEEiRKT_.exit30:              ; preds = %cond.false.i28, %if
 }
 
 ;.
-; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind readnone }
+; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone }
 ;.
-; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone }
+; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone }
 ;.

diff  --git a/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll b/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll
index ea4eaba0eccd3..9a498e598e5ae 100644
--- a/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll
+++ b/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll
@@ -36,8 +36,7 @@ define i8* @start(i8 %v) {
 ; IS__CGSCC____-NEXT:    [[C2:%.*]] = icmp eq i8 [[V]], 1
 ; IS__CGSCC____-NEXT:    br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]]
 ; IS__CGSCC____:       c2_true:
-; IS__CGSCC____-NEXT:    [[CA1:%.*]] = musttail call i8* @no_side_effects(i8 undef)
-; IS__CGSCC____-NEXT:    ret i8* [[CA1]]
+; IS__CGSCC____-NEXT:    ret i8* undef
 ; IS__CGSCC____:       c2_false:
 ; IS__CGSCC____-NEXT:    [[CA2:%.*]] = musttail call i8* @dont_zap_me(i8 undef)
 ; IS__CGSCC____-NEXT:    ret i8* [[CA2]]

diff  --git a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll
index 29954d0600fb1..b84492c9ee440 100644
--- a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll
+++ b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll
@@ -5,6 +5,18 @@
 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM
 
 define internal i32 @testf(i1 %c) {
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
+; IS__TUNIT____-LABEL: define {{[^@]+}}@testf
+; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
+; IS__TUNIT____-NEXT:  entry:
+; IS__TUNIT____-NEXT:    br i1 [[C]], label [[IF_COND:%.*]], label [[IF_END:%.*]]
+; IS__TUNIT____:       if.cond:
+; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____:       if.then:
+; IS__TUNIT____-NEXT:    ret i32 11
+; IS__TUNIT____:       if.end:
+; IS__TUNIT____-NEXT:    ret i32 10
+;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@testf
 ; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
@@ -13,9 +25,9 @@ define internal i32 @testf(i1 %c) {
 ; IS__CGSCC____:       if.cond:
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       if.then:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret i32 11
 ; IS__CGSCC____:       if.end:
-; IS__CGSCC____-NEXT:    ret i32 undef
+; IS__CGSCC____-NEXT:    ret i32 10
 ;
 entry:
   br i1 %c, label %if.cond, label %if.end
@@ -31,17 +43,33 @@ if.end:                                          ; preds = %if.then1, %entry
 }
 
 define internal i32 @test1(i1 %c) {
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
+; IS__TUNIT____-LABEL: define {{[^@]+}}@test1
+; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] {
+; IS__TUNIT____-NEXT:  entry:
+; IS__TUNIT____-NEXT:    br label [[IF_THEN:%.*]]
+; IS__TUNIT____:       if.then:
+; IS__TUNIT____-NEXT:    [[CALL:%.*]] = call i32 @testf(i1 [[C]]) #[[ATTR0]], !range [[RNG0:![0-9]+]]
+; IS__TUNIT____-NEXT:    [[RES:%.*]] = icmp eq i32 [[CALL]], 10
+; IS__TUNIT____-NEXT:    br i1 [[RES]], label [[RET1:%.*]], label [[RET2:%.*]]
+; IS__TUNIT____:       ret1:
+; IS__TUNIT____-NEXT:    ret i32 99
+; IS__TUNIT____:       ret2:
+; IS__TUNIT____-NEXT:    ret i32 0
+;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test1
 ; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] {
 ; IS__CGSCC____-NEXT:  entry:
 ; IS__CGSCC____-NEXT:    br label [[IF_THEN:%.*]]
 ; IS__CGSCC____:       if.then:
-; IS__CGSCC____-NEXT:    br label [[RET1:%.*]]
+; IS__CGSCC____-NEXT:    [[CALL:%.*]] = call i32 @testf(i1 [[C]]) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]]
+; IS__CGSCC____-NEXT:    [[RES:%.*]] = icmp eq i32 [[CALL]], 10
+; IS__CGSCC____-NEXT:    br i1 [[RES]], label [[RET1:%.*]], label [[RET2:%.*]]
 ; IS__CGSCC____:       ret1:
-; IS__CGSCC____-NEXT:    ret i32 undef
+; IS__CGSCC____-NEXT:    ret i32 99
 ; IS__CGSCC____:       ret2:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret i32 0
 ;
 entry:
   br label %if.then
@@ -61,13 +89,15 @@ ret2:                                           ; preds = %if.then, %entry
 define i32 @main(i1 %c) {
 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@main
-; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0:[0-9]+]] {
-; IS__TUNIT____-NEXT:    ret i32 99
+; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] {
+; IS__TUNIT____-NEXT:    [[RES:%.*]] = call i32 @test1(i1 [[C]]) #[[ATTR0]], !range [[RNG1:![0-9]+]]
+; IS__TUNIT____-NEXT:    ret i32 [[RES]]
 ;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@main
 ; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR0]] {
-; IS__CGSCC____-NEXT:    ret i32 99
+; IS__CGSCC____-NEXT:    [[RES:%.*]] = call i32 @test1(i1 [[C]]) #[[ATTR1]], !range [[RNG1:![0-9]+]]
+; IS__CGSCC____-NEXT:    ret i32 [[RES]]
 ;
   %res = call i32 @test1(i1 %c)
   ret i32 %res
@@ -76,4 +106,8 @@ define i32 @main(i1 %c) {
 ; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn }
 ;.
 ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn }
+; IS__CGSCC____: attributes #[[ATTR1]] = { readnone willreturn }
+;.
+; CHECK: [[META0:![0-9]+]] = !{i32 10, i32 12}
+; CHECK: [[META1:![0-9]+]] = !{i32 0, i32 100}
 ;.

diff  --git a/llvm/test/Transforms/Attributor/memory_locations.ll b/llvm/test/Transforms/Attributor/memory_locations.ll
index dce907097af7c..88858d8ccb086 100644
--- a/llvm/test/Transforms/Attributor/memory_locations.ll
+++ b/llvm/test/Transforms/Attributor/memory_locations.ll
@@ -631,7 +631,7 @@ define i8 @readnone_caller(i1 %c) {
 define internal i8 @recursive_not_readnone_internal2(i8* %ptr, i1 %c) {
 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal2
-; IS__TUNIT____-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] {
+; IS__TUNIT____-SAME: (i8* noalias nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] {
 ; IS__TUNIT____-NEXT:    [[ALLOC:%.*]] = alloca i8, align 1
 ; IS__TUNIT____-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
 ; IS__TUNIT____:       t:
@@ -644,7 +644,7 @@ define internal i8 @recursive_not_readnone_internal2(i8* %ptr, i1 %c) {
 ;
 ; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@recursive_not_readnone_internal2
-; IS__CGSCC____-SAME: (i8* nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] {
+; IS__CGSCC____-SAME: (i8* noalias nocapture nofree nonnull writeonly [[PTR:%.*]], i1 [[C:%.*]]) #[[ATTR8]] {
 ; IS__CGSCC____-NEXT:    [[ALLOC:%.*]] = alloca i8, align 1
 ; IS__CGSCC____-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
 ; IS__CGSCC____:       t:

diff  --git a/llvm/test/Transforms/Attributor/nodelete.ll b/llvm/test/Transforms/Attributor/nodelete.ll
index a214084af5e08..9b66359a27dd1 100644
--- a/llvm/test/Transforms/Attributor/nodelete.ll
+++ b/llvm/test/Transforms/Attributor/nodelete.ll
@@ -29,7 +29,7 @@ entry:
 define internal i64 @f2(%"a"* %this) align 2 {
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@f2
-; IS__CGSCC____-SAME: (%a* noalias nocapture nofree noundef nonnull readnone align 8 dereferenceable(8) [[THIS:%.*]]) #[[ATTR0]] align 2 {
+; IS__CGSCC____-SAME: (%a* nofree noundef nonnull align 8 dereferenceable(8) [[THIS:%.*]]) #[[ATTR0]] align 2 {
 ; IS__CGSCC____-NEXT:  entry:
 ; IS__CGSCC____-NEXT:    [[THIS_ADDR:%.*]] = alloca %a*, align 8
 ; IS__CGSCC____-NEXT:    store %a* [[THIS]], %a** [[THIS_ADDR]], align 8

diff  --git a/llvm/test/Transforms/Attributor/nonnull.ll b/llvm/test/Transforms/Attributor/nonnull.ll
index 9a7a98bea5c65..d61f3b3788495 100644
--- a/llvm/test/Transforms/Attributor/nonnull.ll
+++ b/llvm/test/Transforms/Attributor/nonnull.ll
@@ -42,10 +42,10 @@ define i8* @test2A(i1 %c, i8* %ret) {
 ; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] {
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
 ; NOT_CGSCC_OPM:       A:
-; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12:[0-9]+]] [ "nonnull"(i8* [[RET]]) ]
+; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR11:[0-9]+]] [ "nonnull"(i8* [[RET]]) ]
 ; NOT_CGSCC_OPM-NEXT:    ret i8* [[RET]]
 ; NOT_CGSCC_OPM:       B:
-; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[RET]]) ]
+; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nonnull"(i8* [[RET]]) ]
 ; NOT_CGSCC_OPM-NEXT:    ret i8* [[RET]]
 ;
 ; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
@@ -53,10 +53,10 @@ define i8* @test2A(i1 %c, i8* %ret) {
 ; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] {
 ; IS__CGSCC_OPM-NEXT:    br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
 ; IS__CGSCC_OPM:       A:
-; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR13:[0-9]+]] [ "nonnull"(i8* [[RET]]) ]
+; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12:[0-9]+]] [ "nonnull"(i8* [[RET]]) ]
 ; IS__CGSCC_OPM-NEXT:    ret i8* [[RET]]
 ; IS__CGSCC_OPM:       B:
-; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR13]] [ "nonnull"(i8* [[RET]]) ]
+; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[RET]]) ]
 ; IS__CGSCC_OPM-NEXT:    ret i8* [[RET]]
 ;
   br i1 %c, label %A, label %B
@@ -75,10 +75,10 @@ define i8* @test2B(i1 %c, i8* %ret) {
 ; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] {
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
 ; NOT_CGSCC_OPM:       A:
-; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ]
+; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "dereferenceable"(i8* [[RET]], i32 4) ]
 ; NOT_CGSCC_OPM-NEXT:    ret i8* [[RET]]
 ; NOT_CGSCC_OPM:       B:
-; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ]
+; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "dereferenceable"(i8* [[RET]], i32 4) ]
 ; NOT_CGSCC_OPM-NEXT:    ret i8* [[RET]]
 ;
 ; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
@@ -86,10 +86,10 @@ define i8* @test2B(i1 %c, i8* %ret) {
 ; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] {
 ; IS__CGSCC_OPM-NEXT:    br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
 ; IS__CGSCC_OPM:       A:
-; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR13]] [ "dereferenceable"(i8* [[RET]], i32 4) ]
+; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ]
 ; IS__CGSCC_OPM-NEXT:    ret i8* [[RET]]
 ; IS__CGSCC_OPM:       B:
-; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR13]] [ "dereferenceable"(i8* [[RET]], i32 4) ]
+; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ]
 ; IS__CGSCC_OPM-NEXT:    ret i8* [[RET]]
 ;
   br i1 %c, label %A, label %B
@@ -227,27 +227,14 @@ define i8* @test5(i1 %c) {
 
 ; Local analysis, but going through a self recursive phi
 define i8* @test6a() {
-; NOT_CGSCC_OPM: Function Attrs: noreturn
-; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test6a
-; NOT_CGSCC_OPM-SAME: () #[[ATTR3:[0-9]+]] {
-; NOT_CGSCC_OPM-NEXT:  entry:
-; NOT_CGSCC_OPM-NEXT:    [[RET:%.*]] = call i8* @ret_nonnull()
-; NOT_CGSCC_OPM-NEXT:    br label [[LOOP:%.*]]
-; NOT_CGSCC_OPM:       loop:
-; NOT_CGSCC_OPM-NEXT:    unreachable
-; NOT_CGSCC_OPM:       exit:
-; NOT_CGSCC_OPM-NEXT:    unreachable
-;
-; IS__CGSCC_OPM: Function Attrs: noreturn
-; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test6a
-; IS__CGSCC_OPM-SAME: () #[[ATTR4:[0-9]+]] {
-; IS__CGSCC_OPM-NEXT:  entry:
-; IS__CGSCC_OPM-NEXT:    [[RET:%.*]] = call i8* @ret_nonnull()
-; IS__CGSCC_OPM-NEXT:    br label [[LOOP:%.*]]
-; IS__CGSCC_OPM:       loop:
-; IS__CGSCC_OPM-NEXT:    unreachable
-; IS__CGSCC_OPM:       exit:
-; IS__CGSCC_OPM-NEXT:    unreachable
+; CHECK-LABEL: define {{[^@]+}}@test6a() {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[RET:%.*]] = call nonnull i8* @ret_nonnull()
+; CHECK-NEXT:    br label [[LOOP:%.*]]
+; CHECK:       loop:
+; CHECK-NEXT:    unreachable
+; CHECK:       exit:
+; CHECK-NEXT:    ret i8* [[RET]]
 ;
 entry:
   %ret = call i8* @ret_nonnull()
@@ -338,14 +325,14 @@ define i8* @test10(i8* %a, i64 %n) {
 ; NOT_CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test10
 ; NOT_CGSCC_OPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] {
-; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12]]
+; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR11]]
 ; NOT_CGSCC_OPM-NEXT:    [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]]
 ; NOT_CGSCC_OPM-NEXT:    ret i8* [[B]]
 ;
 ; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10
 ; IS__CGSCC_OPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] {
-; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR13]]
+; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12]]
 ; IS__CGSCC_OPM-NEXT:    [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]]
 ; IS__CGSCC_OPM-NEXT:    ret i8* [[B]]
 ;
@@ -404,15 +391,15 @@ define void @test13_helper() {
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13_helper() {
 ; NOT_CGSCC_OPM-NEXT:    [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull()
 ; NOT_CGSCC_OPM-NEXT:    [[MAYBENULLPTR:%.*]] = tail call i8* @unknown()
-; NOT_CGSCC_OPM-NEXT:    tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR4:[0-9]+]]
-; NOT_CGSCC_OPM-NEXT:    tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR3:[0-9]+]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13_helper() {
 ; IS__CGSCC_OPM-NEXT:    [[NONNULLPTR:%.*]] = tail call nonnull i8* @ret_nonnull()
 ; IS__CGSCC_OPM-NEXT:    [[MAYBENULLPTR:%.*]] = tail call i8* @unknown()
-; IS__CGSCC_OPM-NEXT:    tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR5:[0-9]+]]
-; IS__CGSCC_OPM-NEXT:    tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR4:[0-9]+]]
+; IS__CGSCC_OPM-NEXT:    tail call void @test13(i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]], i8* noalias nocapture nofree readnone [[MAYBENULLPTR]], i8* noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
   %nonnullptr = tail call i8* @ret_nonnull()
@@ -424,18 +411,18 @@ define void @test13_helper() {
 define internal void @test13(i8* %a, i8* %b, i8* %c) {
 ; NOT_CGSCC_OPM: Function Attrs: nounwind
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test13
-; NOT_CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR4]] {
-; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR4]]
-; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR4]]
-; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR3]] {
+; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR3]]
+; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR3]]
+; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13
-; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR5]] {
-; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR5]]
-; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR5]]
-; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR5]]
+; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone [[A:%.*]], i8* noalias nocapture nofree readnone [[B:%.*]], i8* noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR4]] {
+; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR4]]
+; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[B]]) #[[ATTR4]]
+; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[C]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
   call void @use_i8_ptr(i8* %a)
@@ -462,7 +449,7 @@ define internal i32* @f1(i32* %arg) {
 ; FIXME: missing nonnull It should be nonnull @f1(i32* nonnull readonly %arg)
 ; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f1
-; NOT_CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
+; NOT_CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] {
 ; NOT_CGSCC_OPM-NEXT:  bb:
 ; NOT_CGSCC_OPM-NEXT:    [[TMP:%.*]] = icmp eq i32* [[ARG]], null
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]]
@@ -472,11 +459,11 @@ define internal i32* @f1(i32* %arg) {
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]]
 ; NOT_CGSCC_OPM:       bb4:
 ; NOT_CGSCC_OPM-NEXT:    [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1
-; NOT_CGSCC_OPM-NEXT:    [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR13:[0-9]+]]
+; NOT_CGSCC_OPM-NEXT:    [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR12:[0-9]+]]
 ; NOT_CGSCC_OPM-NEXT:    [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1
 ; NOT_CGSCC_OPM-NEXT:    br label [[BB9]]
 ; NOT_CGSCC_OPM:       bb6:
-; NOT_CGSCC_OPM-NEXT:    [[TMP7:%.*]] = tail call nonnull i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR13]]
+; NOT_CGSCC_OPM-NEXT:    [[TMP7:%.*]] = tail call nonnull i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR12]]
 ; NOT_CGSCC_OPM-NEXT:    ret i32* [[TMP7]]
 ; NOT_CGSCC_OPM:       bb9:
 ; NOT_CGSCC_OPM-NEXT:    [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ]
@@ -484,7 +471,7 @@ define internal i32* @f1(i32* %arg) {
 ;
 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1
-; IS__CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR6:[0-9]+]] {
+; IS__CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
 ; IS__CGSCC_OPM-NEXT:  bb:
 ; IS__CGSCC_OPM-NEXT:    [[TMP:%.*]] = icmp eq i32* [[ARG]], null
 ; IS__CGSCC_OPM-NEXT:    br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]]
@@ -494,11 +481,11 @@ define internal i32* @f1(i32* %arg) {
 ; IS__CGSCC_OPM-NEXT:    br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]]
 ; IS__CGSCC_OPM:       bb4:
 ; IS__CGSCC_OPM-NEXT:    [[TMP5:%.*]] = getelementptr inbounds i32, i32* [[ARG]], i64 1
-; IS__CGSCC_OPM-NEXT:    [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR14:[0-9]+]]
+; IS__CGSCC_OPM-NEXT:    [[TMP5B:%.*]] = tail call i32* @f3(i32* nofree nonnull readonly [[TMP5]]) #[[ATTR13:[0-9]+]]
 ; IS__CGSCC_OPM-NEXT:    [[TMP5C:%.*]] = getelementptr inbounds i32, i32* [[TMP5B]], i64 -1
 ; IS__CGSCC_OPM-NEXT:    br label [[BB9]]
 ; IS__CGSCC_OPM:       bb6:
-; IS__CGSCC_OPM-NEXT:    [[TMP7:%.*]] = tail call nonnull i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR14]]
+; IS__CGSCC_OPM-NEXT:    [[TMP7:%.*]] = tail call nonnull i32* @f2(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR13]]
 ; IS__CGSCC_OPM-NEXT:    ret i32* [[TMP7]]
 ; IS__CGSCC_OPM:       bb9:
 ; IS__CGSCC_OPM-NEXT:    [[TMP10:%.*]] = phi i32* [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to i32*), [[BB:%.*]] ]
@@ -532,16 +519,16 @@ bb9:                                              ; preds = %bb4, %bb
 define internal i32* @f2(i32* %arg) {
 ; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f2
-; NOT_CGSCC_OPM-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5]] {
+; NOT_CGSCC_OPM-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR4]] {
 ; NOT_CGSCC_OPM-NEXT:  bb:
-; NOT_CGSCC_OPM-NEXT:    [[TMP:%.*]] = tail call nonnull i32* @f1(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR13]]
+; NOT_CGSCC_OPM-NEXT:    [[TMP:%.*]] = tail call nonnull i32* @f1(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR12]]
 ; NOT_CGSCC_OPM-NEXT:    ret i32* [[TMP]]
 ;
 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2
-; IS__CGSCC_OPM-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR6]] {
+; IS__CGSCC_OPM-SAME: (i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5]] {
 ; IS__CGSCC_OPM-NEXT:  bb:
-; IS__CGSCC_OPM-NEXT:    [[TMP:%.*]] = tail call nonnull i32* @f1(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR14]]
+; IS__CGSCC_OPM-NEXT:    [[TMP:%.*]] = tail call nonnull i32* @f1(i32* nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR13]]
 ; IS__CGSCC_OPM-NEXT:    ret i32* [[TMP]]
 ;
 bb:
@@ -553,16 +540,16 @@ define dso_local noalias i32* @f3(i32* %arg) {
 ; FIXME: missing nonnull. It should be nonnull @f3(i32* nonnull readonly %arg)
 ; NOT_CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f3
-; NOT_CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5]] {
+; NOT_CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR4]] {
 ; NOT_CGSCC_OPM-NEXT:  bb:
-; NOT_CGSCC_OPM-NEXT:    [[TMP:%.*]] = call nonnull i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR13]]
+; NOT_CGSCC_OPM-NEXT:    [[TMP:%.*]] = call nonnull i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR12]]
 ; NOT_CGSCC_OPM-NEXT:    ret i32* [[TMP]]
 ;
 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind readonly
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3
-; IS__CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR6]] {
+; IS__CGSCC_OPM-SAME: (i32* nofree readonly [[ARG:%.*]]) #[[ATTR5]] {
 ; IS__CGSCC_OPM-NEXT:  bb:
-; IS__CGSCC_OPM-NEXT:    [[TMP:%.*]] = call nonnull i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR14]]
+; IS__CGSCC_OPM-NEXT:    [[TMP:%.*]] = call nonnull i32* @f1(i32* nofree readonly [[ARG]]) #[[ATTR13]]
 ; IS__CGSCC_OPM-NEXT:    ret i32* [[TMP]]
 ;
 bb:
@@ -596,26 +583,26 @@ declare void @fun3(i8*, i8*, i8*) #1
 define void @f16(i8* %a, i8 * %b, i8 %c) {
 ; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f16
-; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6:[0-9]+]] {
+; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5:[0-9]+]] {
 ; NOT_CGSCC_OPM-NEXT:    [[CMP:%.*]] = icmp eq i8 [[C]], 0
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
 ; NOT_CGSCC_OPM:       if.then:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) #[[ATTR6]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) #[[ATTR5]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ; NOT_CGSCC_OPM:       if.else:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR6]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR5]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f16
-; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR7:[0-9]+]] {
+; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6:[0-9]+]] {
 ; IS__CGSCC_OPM-NEXT:    [[CMP:%.*]] = icmp eq i8 [[C]], 0
 ; IS__CGSCC_OPM-NEXT:    br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
 ; IS__CGSCC_OPM:       if.then:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) #[[ATTR7]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun2(i8* nonnull [[A]], i8* nonnull [[B]]) #[[ATTR6]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ; IS__CGSCC_OPM:       if.else:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR7]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun2(i8* nonnull [[A]], i8* [[B]]) #[[ATTR6]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
   %cmp = icmp eq i8 %c, 0
@@ -637,32 +624,32 @@ if.else:
 define void @f17(i8* %a, i8 %c) {
 ; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f17
-; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR6]] {
+; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR5]] {
 ; NOT_CGSCC_OPM-NEXT:    [[CMP:%.*]] = icmp eq i8 [[C]], 0
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
 ; NOT_CGSCC_OPM:       if.then:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR6]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR5]]
 ; NOT_CGSCC_OPM-NEXT:    br label [[CONT:%.*]]
 ; NOT_CGSCC_OPM:       if.else:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR6]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR5]]
 ; NOT_CGSCC_OPM-NEXT:    br label [[CONT]]
 ; NOT_CGSCC_OPM:       cont:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f17
-; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR7]] {
+; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR6]] {
 ; IS__CGSCC_OPM-NEXT:    [[CMP:%.*]] = icmp eq i8 [[C]], 0
 ; IS__CGSCC_OPM-NEXT:    br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
 ; IS__CGSCC_OPM:       if.then:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR7]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR6]]
 ; IS__CGSCC_OPM-NEXT:    br label [[CONT:%.*]]
 ; IS__CGSCC_OPM:       if.else:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR7]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR6]]
 ; IS__CGSCC_OPM-NEXT:    br label [[CONT]]
 ; IS__CGSCC_OPM:       cont:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR7]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
   %cmp = icmp eq i8 %c, 0
@@ -691,50 +678,50 @@ cont:
 define void @f18(i8* %a, i8* %b, i8 %c) {
 ; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f18
-; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6]] {
+; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5]] {
 ; NOT_CGSCC_OPM-NEXT:    [[CMP1:%.*]] = icmp eq i8 [[C]], 0
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
 ; NOT_CGSCC_OPM:       if.then:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR6]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR5]]
 ; NOT_CGSCC_OPM-NEXT:    br label [[CONT:%.*]]
 ; NOT_CGSCC_OPM:       if.else:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR6]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR5]]
 ; NOT_CGSCC_OPM-NEXT:    br label [[CONT]]
 ; NOT_CGSCC_OPM:       cont:
 ; NOT_CGSCC_OPM-NEXT:    [[CMP2:%.*]] = icmp eq i8 [[C]], 1
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]]
 ; NOT_CGSCC_OPM:       cont.then:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR6]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR5]]
 ; NOT_CGSCC_OPM-NEXT:    br label [[CONT2:%.*]]
 ; NOT_CGSCC_OPM:       cont.else:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR6]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR5]]
 ; NOT_CGSCC_OPM-NEXT:    br label [[CONT2]]
 ; NOT_CGSCC_OPM:       cont2:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f18
-; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR7]] {
+; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* [[B:%.*]], i8 [[C:%.*]]) #[[ATTR6]] {
 ; IS__CGSCC_OPM-NEXT:    [[CMP1:%.*]] = icmp eq i8 [[C]], 0
 ; IS__CGSCC_OPM-NEXT:    br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
 ; IS__CGSCC_OPM:       if.then:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR7]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR6]]
 ; IS__CGSCC_OPM-NEXT:    br label [[CONT:%.*]]
 ; IS__CGSCC_OPM:       if.else:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR7]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR6]]
 ; IS__CGSCC_OPM-NEXT:    br label [[CONT]]
 ; IS__CGSCC_OPM:       cont:
 ; IS__CGSCC_OPM-NEXT:    [[CMP2:%.*]] = icmp eq i8 [[C]], 1
 ; IS__CGSCC_OPM-NEXT:    br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]]
 ; IS__CGSCC_OPM:       cont.then:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR7]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR6]]
 ; IS__CGSCC_OPM-NEXT:    br label [[CONT2:%.*]]
 ; IS__CGSCC_OPM:       cont.else:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR7]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun0() #[[ATTR6]]
 ; IS__CGSCC_OPM-NEXT:    br label [[CONT2]]
 ; IS__CGSCC_OPM:       cont2:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR7]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR6]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
   %cmp1 = icmp eq i8 %c, 0
@@ -764,32 +751,32 @@ cont2:
 define void @f19(i8* %a, i8* %b, i8 %c) {
 ; NOT_CGSCC_OPM: Function Attrs: nounwind
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@f19
-; NOT_CGSCC_OPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR4]] {
+; NOT_CGSCC_OPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR3]] {
 ; NOT_CGSCC_OPM-NEXT:    br label [[LOOP_HEADER:%.*]]
 ; NOT_CGSCC_OPM:       loop.header:
 ; NOT_CGSCC_OPM-NEXT:    [[CMP2:%.*]] = icmp eq i8 [[C]], 0
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]]
 ; NOT_CGSCC_OPM:       loop.body:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR4]]
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR3]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    br label [[LOOP_HEADER]]
 ; NOT_CGSCC_OPM:       loop.exit:
-; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f19
-; IS__CGSCC_OPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5]] {
+; IS__CGSCC_OPM-SAME: (i8* [[A:%.*]], i8* nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR4]] {
 ; IS__CGSCC_OPM-NEXT:    br label [[LOOP_HEADER:%.*]]
 ; IS__CGSCC_OPM:       loop.header:
 ; IS__CGSCC_OPM-NEXT:    [[CMP2:%.*]] = icmp eq i8 [[C]], 0
 ; IS__CGSCC_OPM-NEXT:    br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]]
 ; IS__CGSCC_OPM:       loop.body:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR5]]
-; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR4]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    br label [[LOOP_HEADER]]
 ; IS__CGSCC_OPM:       loop.exit:
-; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    tail call void @fun1(i8* nonnull [[B]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
   br label %loop.header
@@ -925,13 +912,13 @@ define i8 @parent6(i8* %a, i8* %b) {
 define i8 @parent7(i8* %a) {
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@parent7
 ; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]]) {
-; NOT_CGSCC_OPM-NEXT:    [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR14:[0-9]+]]
+; NOT_CGSCC_OPM-NEXT:    [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR13:[0-9]+]]
 ; NOT_CGSCC_OPM-NEXT:    call void @use1nonnull(i8* nonnull [[A]])
 ; NOT_CGSCC_OPM-NEXT:    ret i8 [[RET]]
 ;
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@parent7
 ; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]]) {
-; IS__CGSCC_OPM-NEXT:    [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR15:[0-9]+]]
+; IS__CGSCC_OPM-NEXT:    [[RET:%.*]] = call i8 @use1safecall(i8* nonnull readonly [[A]]) #[[ATTR14:[0-9]+]]
 ; IS__CGSCC_OPM-NEXT:    call void @use1nonnull(i8* nonnull [[A]])
 ; IS__CGSCC_OPM-NEXT:    ret i8 [[RET]]
 ;
@@ -949,7 +936,7 @@ declare i32 @esfp(...)
 define i1 @parent8(i8* %a, i8* %bogus1, i8* %b) personality i8* bitcast (i32 (...)* @esfp to i8*){
 ; NOT_CGSCC_OPM: Function Attrs: nounwind
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@parent8
-; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR4]] personality i8* bitcast (i32 (...)* @esfp to i8*) {
+; NOT_CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR3]] personality i8* bitcast (i32 (...)* @esfp to i8*) {
 ; NOT_CGSCC_OPM-NEXT:  entry:
 ; NOT_CGSCC_OPM-NEXT:    invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]])
 ; NOT_CGSCC_OPM-NEXT:    to label [[CONT:%.*]] unwind label [[EXC:%.*]]
@@ -962,7 +949,7 @@ define i1 @parent8(i8* %a, i8* %bogus1, i8* %b) personality i8* bitcast (i32 (..
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@parent8
-; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR5]] personality i8* bitcast (i32 (...)* @esfp to i8*) {
+; IS__CGSCC_OPM-SAME: (i8* nonnull [[A:%.*]], i8* nocapture nofree readnone [[BOGUS1:%.*]], i8* nonnull [[B:%.*]]) #[[ATTR4]] personality i8* bitcast (i32 (...)* @esfp to i8*) {
 ; IS__CGSCC_OPM-NEXT:  entry:
 ; IS__CGSCC_OPM-NEXT:    invoke void @use2nonnull(i8* nonnull [[A]], i8* nonnull [[B]])
 ; IS__CGSCC_OPM-NEXT:    to label [[CONT:%.*]] unwind label [[EXC:%.*]]
@@ -1009,19 +996,19 @@ define i32* @gep1_no_null_opt(i32* %p) #0 {
 ; Should't be able to derive nonnull based on gep.
 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind null_pointer_is_valid readnone willreturn
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@gep1_no_null_opt
-; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR8:[0-9]+]] {
+; IS__TUNIT____-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR7:[0-9]+]] {
 ; IS__TUNIT____-NEXT:    [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1
 ; IS__TUNIT____-NEXT:    ret i32* [[Q]]
 ;
 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@gep1_no_null_opt
-; IS__CGSCC_OPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR9:[0-9]+]] {
+; IS__CGSCC_OPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR8:[0-9]+]] {
 ; IS__CGSCC_OPM-NEXT:    [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1
 ; IS__CGSCC_OPM-NEXT:    ret i32* [[Q]]
 ;
 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn
 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@gep1_no_null_opt
-; IS__CGSCC_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR8:[0-9]+]] {
+; IS__CGSCC_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR7:[0-9]+]] {
 ; IS__CGSCC_NPM-NEXT:    [[Q:%.*]] = getelementptr inbounds i32, i32* [[P]], i32 1
 ; IS__CGSCC_NPM-NEXT:    ret i32* [[Q]]
 ;
@@ -1090,14 +1077,14 @@ declare void @use_i32_ptr(i32* readnone nocapture) nounwind
 define internal void @called_by_weak(i32* %a) {
 ; NOT_CGSCC_OPM: Function Attrs: nounwind
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_weak
-; NOT_CGSCC_OPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR4]] {
-; NOT_CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR3]] {
+; NOT_CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@called_by_weak
-; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR5]] {
-; IS__CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR4]] {
+; IS__CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
   call void @use_i32_ptr(i32* %a)
@@ -1108,12 +1095,12 @@ define internal void @called_by_weak(i32* %a) {
 define weak_odr void @weak_caller(i32* nonnull %a) {
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@weak_caller
 ; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]]) {
-; NOT_CGSCC_OPM-NEXT:    call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@weak_caller
 ; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]]) {
-; IS__CGSCC_OPM-NEXT:    call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    call void @called_by_weak(i32* noalias nocapture nonnull readnone [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
   call void @called_by_weak(i32* %a)
@@ -1124,14 +1111,14 @@ define weak_odr void @weak_caller(i32* nonnull %a) {
 define internal void @control(i32* dereferenceable(4) %a) {
 ; NOT_CGSCC_OPM: Function Attrs: nounwind
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@control
-; NOT_CGSCC_OPM-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] {
-; NOT_CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] {
+; NOT_CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@control
-; IS__CGSCC_OPM-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR5]] {
-; IS__CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-SAME: (i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] {
+; IS__CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
   call void @use_i32_ptr(i32* %a)
@@ -1141,13 +1128,13 @@ define internal void @control(i32* dereferenceable(4) %a) {
 define internal void @naked(i32* dereferenceable(4) %a) naked {
 ; NOT_CGSCC_OPM: Function Attrs: naked
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@naked
-; NOT_CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR9:[0-9]+]] {
+; NOT_CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR8:[0-9]+]] {
 ; NOT_CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* [[A]])
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM: Function Attrs: naked
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@naked
-; IS__CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR10:[0-9]+]] {
+; IS__CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR9:[0-9]+]] {
 ; IS__CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* [[A]])
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
@@ -1158,13 +1145,13 @@ define internal void @naked(i32* dereferenceable(4) %a) naked {
 define internal void @optnone(i32* dereferenceable(4) %a) optnone noinline {
 ; NOT_CGSCC_OPM: Function Attrs: noinline optnone
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@optnone
-; NOT_CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR10:[0-9]+]] {
+; NOT_CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR9:[0-9]+]] {
 ; NOT_CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* [[A]])
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM: Function Attrs: noinline optnone
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@optnone
-; IS__CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR11:[0-9]+]] {
+; IS__CGSCC_OPM-SAME: (i32* dereferenceable(4) [[A:%.*]]) #[[ATTR10:[0-9]+]] {
 ; IS__CGSCC_OPM-NEXT:    call void @use_i32_ptr(i32* [[A]])
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
@@ -1175,14 +1162,14 @@ define void @make_live(i32* nonnull dereferenceable(8) %a) {
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@make_live
 ; NOT_CGSCC_OPM-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) {
 ; NOT_CGSCC_OPM-NEXT:    call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]])
-; NOT_CGSCC_OPM-NEXT:    call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]])
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@make_live
 ; IS__CGSCC_OPM-SAME: (i32* noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) {
 ; IS__CGSCC_OPM-NEXT:    call void @naked(i32* noundef nonnull align 16 dereferenceable(8) [[A]])
-; IS__CGSCC_OPM-NEXT:    call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    call void @control(i32* noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    call void @optnone(i32* noundef nonnull align 16 dereferenceable(8) [[A]])
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
@@ -1205,48 +1192,48 @@ define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) {
 ;
 ; IS__TUNIT_OPM: Function Attrs: nounwind
 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1
-; IS__TUNIT_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR4]] {
+; IS__TUNIT_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR3]] {
 ; IS__TUNIT_OPM-NEXT:  en:
 ; IS__TUNIT_OPM-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[B]], 0
 ; IS__TUNIT_OPM-NEXT:    br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]]
 ; IS__TUNIT_OPM:       ex:
-; IS__TUNIT_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]]
+; IS__TUNIT_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]]
 ; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP5]]
 ; IS__TUNIT_OPM:       hd:
 ; IS__TUNIT_OPM-NEXT:    [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ]
-; IS__TUNIT_OPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR4]]
+; IS__TUNIT_OPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR3]]
 ; IS__TUNIT_OPM-NEXT:    [[TMP8]] = add nuw i32 [[TMP7]], 1
 ; IS__TUNIT_OPM-NEXT:    [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]]
 ; IS__TUNIT_OPM-NEXT:    br i1 [[TMP9]], label [[EX]], label [[HD]]
 ;
 ; IS________NPM: Function Attrs: nounwind willreturn
 ; IS________NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1
-; IS________NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] {
+; IS________NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] {
 ; IS________NPM-NEXT:  en:
 ; IS________NPM-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[B]], 0
 ; IS________NPM-NEXT:    br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]]
 ; IS________NPM:       ex:
-; IS________NPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR6]]
+; IS________NPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]]
 ; IS________NPM-NEXT:    ret i32 [[TMP5]]
 ; IS________NPM:       hd:
 ; IS________NPM-NEXT:    [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ]
-; IS________NPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR6]]
+; IS________NPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR5]]
 ; IS________NPM-NEXT:    [[TMP8]] = add nuw i32 [[TMP7]], 1
 ; IS________NPM-NEXT:    [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]]
 ; IS________NPM-NEXT:    br i1 [[TMP9]], label [[EX]], label [[HD]]
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1
-; IS__CGSCC_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] {
+; IS__CGSCC_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR4]] {
 ; IS__CGSCC_OPM-NEXT:  en:
 ; IS__CGSCC_OPM-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[B]], 0
 ; IS__CGSCC_OPM-NEXT:    br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]]
 ; IS__CGSCC_OPM:       ex:
-; IS__CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP5]]
 ; IS__CGSCC_OPM:       hd:
 ; IS__CGSCC_OPM-NEXT:    [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ]
-; IS__CGSCC_OPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    [[TMP8]] = add nuw i32 [[TMP7]], 1
 ; IS__CGSCC_OPM-NEXT:    [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]]
 ; IS__CGSCC_OPM-NEXT:    br i1 [[TMP9]], label [[EX]], label [[HD]]
@@ -1271,16 +1258,16 @@ define i32 @nonnull_exec_ctx_1b(i32* %a, i32 %b) {
 ;
 ; IS__TUNIT_OPM: Function Attrs: nounwind
 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b
-; IS__TUNIT_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR4]] {
+; IS__TUNIT_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR3]] {
 ; IS__TUNIT_OPM-NEXT:  en:
 ; IS__TUNIT_OPM-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[B]], 0
 ; IS__TUNIT_OPM-NEXT:    br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]]
 ; IS__TUNIT_OPM:       ex:
-; IS__TUNIT_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]]
+; IS__TUNIT_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]]
 ; IS__TUNIT_OPM-NEXT:    ret i32 [[TMP5]]
 ; IS__TUNIT_OPM:       hd:
 ; IS__TUNIT_OPM-NEXT:    [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ]
-; IS__TUNIT_OPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR4]]
+; IS__TUNIT_OPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR3]]
 ; IS__TUNIT_OPM-NEXT:    br label [[HD2]]
 ; IS__TUNIT_OPM:       hd2:
 ; IS__TUNIT_OPM-NEXT:    [[TMP8]] = add nuw i32 [[TMP7]], 1
@@ -1289,16 +1276,16 @@ define i32 @nonnull_exec_ctx_1b(i32* %a, i32 %b) {
 ;
 ; IS________NPM: Function Attrs: nounwind willreturn
 ; IS________NPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b
-; IS________NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] {
+; IS________NPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] {
 ; IS________NPM-NEXT:  en:
 ; IS________NPM-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[B]], 0
 ; IS________NPM-NEXT:    br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]]
 ; IS________NPM:       ex:
-; IS________NPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR6]]
+; IS________NPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]]
 ; IS________NPM-NEXT:    ret i32 [[TMP5]]
 ; IS________NPM:       hd:
 ; IS________NPM-NEXT:    [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ]
-; IS________NPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR6]]
+; IS________NPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR5]]
 ; IS________NPM-NEXT:    br label [[HD2]]
 ; IS________NPM:       hd2:
 ; IS________NPM-NEXT:    [[TMP8]] = add nuw i32 [[TMP7]], 1
@@ -1307,16 +1294,16 @@ define i32 @nonnull_exec_ctx_1b(i32* %a, i32 %b) {
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b
-; IS__CGSCC_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] {
+; IS__CGSCC_OPM-SAME: (i32* [[A:%.*]], i32 [[B:%.*]]) #[[ATTR4]] {
 ; IS__CGSCC_OPM-NEXT:  en:
 ; IS__CGSCC_OPM-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[B]], 0
 ; IS__CGSCC_OPM-NEXT:    br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]]
 ; IS__CGSCC_OPM:       ex:
-; IS__CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP5]]
 ; IS__CGSCC_OPM:       hd:
 ; IS__CGSCC_OPM-NEXT:    [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ]
-; IS__CGSCC_OPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    tail call void @h(i32* [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    br label [[HD2]]
 ; IS__CGSCC_OPM:       hd2:
 ; IS__CGSCC_OPM-NEXT:    [[TMP8]] = add nuw i32 [[TMP7]], 1
@@ -1346,32 +1333,32 @@ define i32 @nonnull_exec_ctx_2(i32* %a, i32 %b) willreturn nounwind {
 ;
 ; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2
-; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] {
+; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] {
 ; NOT_CGSCC_OPM-NEXT:  en:
 ; NOT_CGSCC_OPM-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[B]], 0
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]]
 ; NOT_CGSCC_OPM:       ex:
-; NOT_CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    ret i32 [[TMP5]]
 ; NOT_CGSCC_OPM:       hd:
 ; NOT_CGSCC_OPM-NEXT:    [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ]
-; NOT_CGSCC_OPM-NEXT:    tail call void @h(i32* nonnull [[A]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @h(i32* nonnull [[A]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    [[TMP8]] = add nuw i32 [[TMP7]], 1
 ; NOT_CGSCC_OPM-NEXT:    [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]]
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[TMP9]], label [[EX]], label [[HD]]
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2
-; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR7]] {
+; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] {
 ; IS__CGSCC_OPM-NEXT:  en:
 ; IS__CGSCC_OPM-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[B]], 0
 ; IS__CGSCC_OPM-NEXT:    br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]]
 ; IS__CGSCC_OPM:       ex:
-; IS__CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP5]]
 ; IS__CGSCC_OPM:       hd:
 ; IS__CGSCC_OPM-NEXT:    [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ]
-; IS__CGSCC_OPM-NEXT:    tail call void @h(i32* nonnull [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    tail call void @h(i32* nonnull [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    [[TMP8]] = add nuw i32 [[TMP7]], 1
 ; IS__CGSCC_OPM-NEXT:    [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]]
 ; IS__CGSCC_OPM-NEXT:    br i1 [[TMP9]], label [[EX]], label [[HD]]
@@ -1396,16 +1383,16 @@ define i32 @nonnull_exec_ctx_2b(i32* %a, i32 %b) willreturn nounwind {
 ;
 ; NOT_CGSCC_OPM: Function Attrs: nounwind willreturn
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b
-; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] {
+; NOT_CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR5]] {
 ; NOT_CGSCC_OPM-NEXT:  en:
 ; NOT_CGSCC_OPM-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[B]], 0
 ; NOT_CGSCC_OPM-NEXT:    br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]]
 ; NOT_CGSCC_OPM:       ex:
-; NOT_CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    ret i32 [[TMP5]]
 ; NOT_CGSCC_OPM:       hd:
 ; NOT_CGSCC_OPM-NEXT:    [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ]
-; NOT_CGSCC_OPM-NEXT:    tail call void @h(i32* nonnull [[A]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    tail call void @h(i32* nonnull [[A]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    br label [[HD2]]
 ; NOT_CGSCC_OPM:       hd2:
 ; NOT_CGSCC_OPM-NEXT:    [[TMP8]] = add nuw i32 [[TMP7]], 1
@@ -1414,16 +1401,16 @@ define i32 @nonnull_exec_ctx_2b(i32* %a, i32 %b) willreturn nounwind {
 ;
 ; IS__CGSCC_OPM: Function Attrs: nounwind willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b
-; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR7]] {
+; IS__CGSCC_OPM-SAME: (i32* nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR6]] {
 ; IS__CGSCC_OPM-NEXT:  en:
 ; IS__CGSCC_OPM-NEXT:    [[TMP3:%.*]] = icmp eq i32 [[B]], 0
 ; IS__CGSCC_OPM-NEXT:    br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]]
 ; IS__CGSCC_OPM:       ex:
-; IS__CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret i32 [[TMP5]]
 ; IS__CGSCC_OPM:       hd:
 ; IS__CGSCC_OPM-NEXT:    [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ]
-; IS__CGSCC_OPM-NEXT:    tail call void @h(i32* nonnull [[A]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    tail call void @h(i32* nonnull [[A]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    br label [[HD2]]
 ; IS__CGSCC_OPM:       hd2:
 ; IS__CGSCC_OPM-NEXT:    [[TMP8]] = add nuw i32 [[TMP7]], 1
@@ -1567,8 +1554,8 @@ declare i8* @strrchr(i8* %0, i32 %1) nofree nounwind readonly willreturn
 define i8* @mybasename(i8* nofree readonly %str) {
 ; NOT_CGSCC_OPM: Function Attrs: nofree nounwind readonly willreturn
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@mybasename
-; NOT_CGSCC_OPM-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR11:[0-9]+]] {
-; NOT_CGSCC_OPM-NEXT:    [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR14]]
+; NOT_CGSCC_OPM-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR10:[0-9]+]] {
+; NOT_CGSCC_OPM-NEXT:    [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR13]]
 ; NOT_CGSCC_OPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null
 ; NOT_CGSCC_OPM-NEXT:    [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1
 ; NOT_CGSCC_OPM-NEXT:    [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]]
@@ -1576,8 +1563,8 @@ define i8* @mybasename(i8* nofree readonly %str) {
 ;
 ; IS__CGSCC_OPM: Function Attrs: nofree nounwind readonly willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@mybasename
-; IS__CGSCC_OPM-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR12:[0-9]+]] {
-; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR15]]
+; IS__CGSCC_OPM-SAME: (i8* nofree readonly [[STR:%.*]]) #[[ATTR11:[0-9]+]] {
+; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call i8* @strrchr(i8* nofree readonly [[STR]], i32 noundef 47) #[[ATTR14]]
 ; IS__CGSCC_OPM-NEXT:    [[TOBOOL:%.*]] = icmp ne i8* [[CALL]], null
 ; IS__CGSCC_OPM-NEXT:    [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[CALL]], i64 1
 ; IS__CGSCC_OPM-NEXT:    [[COND:%.*]] = select i1 [[TOBOOL]], i8* [[ADD_PTR]], i8* [[STR]]
@@ -1600,15 +1587,15 @@ define void @nonnull_assume_pos(i8* %arg) {
 ;
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos
 ; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) {
-; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[ARG]]) ]
-; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nonnull"(i8* [[ARG]]) ]
+; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    [[TMP1:%.*]] = call i8* @unknown()
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_pos
 ; IS__CGSCC_OPM-SAME: (i8* nocapture nofree nonnull readnone [[ARG:%.*]]) {
-; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR13]] [ "nonnull"(i8* [[ARG]]) ]
-; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[ARG]]) ]
+; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = call i8* @unknown()
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
@@ -1633,25 +1620,25 @@ define void @nonnull_assume_neg(i8* %arg) {
 ; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_neg
 ; NOT_CGSCC_OPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) {
 ; NOT_CGSCC_OPM-NEXT:    [[TMP1:%.*]] = call i8* @unknown()
-; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ]
-; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    [[TMP2:%.*]] = call i8* @unknown()
-; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ]
-; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]]
+; NOT_CGSCC_OPM-NEXT:    call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR3]]
 ; NOT_CGSCC_OPM-NEXT:    ret void
 ;
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@nonnull_assume_neg
 ; IS__CGSCC_OPM-SAME: (i8* nocapture nofree readnone [[ARG:%.*]]) {
 ; IS__CGSCC_OPM-NEXT:    [[TMP1:%.*]] = call i8* @unknown()
-; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree readnone [[ARG]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ]
-; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    [[TMP2:%.*]] = call i8* @unknown()
-; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    call void @llvm.assume(i1 noundef true) [ "nonnull"(i8* [[ARG]]) ]
-; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    call void @use_i8_ptr_ret(i8* noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]]
 ; IS__CGSCC_OPM-NEXT:    ret void
 ;
   call i8* @unknown()
@@ -1721,49 +1708,46 @@ attributes #1 = { nounwind willreturn}
 ; IS__TUNIT____: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn }
 ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn }
 ; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone }
-; IS__TUNIT____: attributes #[[ATTR3]] = { noreturn }
-; IS__TUNIT____: attributes #[[ATTR4]] = { nounwind }
-; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly }
-; IS__TUNIT____: attributes #[[ATTR6]] = { nounwind willreturn }
-; IS__TUNIT____: attributes #[[ATTR7:[0-9]+]] = { nounwind readonly willreturn }
-; IS__TUNIT____: attributes #[[ATTR8]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn }
-; IS__TUNIT____: attributes #[[ATTR9]] = { naked }
-; IS__TUNIT____: attributes #[[ATTR10]] = { noinline optnone }
-; IS__TUNIT____: attributes #[[ATTR11]] = { nofree nounwind readonly willreturn }
-; IS__TUNIT____: attributes #[[ATTR12]] = { willreturn }
-; IS__TUNIT____: attributes #[[ATTR13]] = { nofree nosync nounwind readonly }
-; IS__TUNIT____: attributes #[[ATTR14]] = { readonly willreturn }
+; IS__TUNIT____: attributes #[[ATTR3]] = { nounwind }
+; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly }
+; IS__TUNIT____: attributes #[[ATTR5]] = { nounwind willreturn }
+; IS__TUNIT____: attributes #[[ATTR6:[0-9]+]] = { nounwind readonly willreturn }
+; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn }
+; IS__TUNIT____: attributes #[[ATTR8]] = { naked }
+; IS__TUNIT____: attributes #[[ATTR9]] = { noinline optnone }
+; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nounwind readonly willreturn }
+; IS__TUNIT____: attributes #[[ATTR11]] = { willreturn }
+; IS__TUNIT____: attributes #[[ATTR12]] = { nofree nosync nounwind readonly }
+; IS__TUNIT____: attributes #[[ATTR13]] = { readonly willreturn }
 ;.
 ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone }
 ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR4]] = { noreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nounwind }
-; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree nosync nounwind readonly }
-; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nounwind willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR8:[0-9]+]] = { nounwind readonly willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR10]] = { naked }
-; IS__CGSCC_OPM: attributes #[[ATTR11]] = { noinline optnone }
-; IS__CGSCC_OPM: attributes #[[ATTR12]] = { nofree nounwind readonly willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR13]] = { willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nofree nosync nounwind readonly }
-; IS__CGSCC_OPM: attributes #[[ATTR15]] = { readonly willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nounwind }
+; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly }
+; IS__CGSCC_OPM: attributes #[[ATTR6]] = { nounwind willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR7:[0-9]+]] = { nounwind readonly willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR9]] = { naked }
+; IS__CGSCC_OPM: attributes #[[ATTR10]] = { noinline optnone }
+; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nofree nounwind readonly willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR12]] = { willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR13]] = { nofree nosync nounwind readonly }
+; IS__CGSCC_OPM: attributes #[[ATTR14]] = { readonly willreturn }
 ;.
 ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone }
-; IS__CGSCC_NPM: attributes #[[ATTR3]] = { noreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nounwind }
-; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind readonly }
-; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nounwind willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR7:[0-9]+]] = { nounwind readonly willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR9]] = { naked }
-; IS__CGSCC_NPM: attributes #[[ATTR10]] = { noinline optnone }
-; IS__CGSCC_NPM: attributes #[[ATTR11]] = { nofree nounwind readonly willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR12]] = { willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR13]] = { nofree nosync nounwind readonly }
-; IS__CGSCC_NPM: attributes #[[ATTR14]] = { readonly willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nounwind }
+; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly }
+; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nounwind willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR6:[0-9]+]] = { nounwind readonly willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR8]] = { naked }
+; IS__CGSCC_NPM: attributes #[[ATTR9]] = { noinline optnone }
+; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nofree nounwind readonly willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR11]] = { willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind readonly }
+; IS__CGSCC_NPM: attributes #[[ATTR13]] = { readonly willreturn }
 ;.

diff  --git a/llvm/test/Transforms/Attributor/undefined_behavior.ll b/llvm/test/Transforms/Attributor/undefined_behavior.ll
index 57064af288f7c..930335fc37a4e 100644
--- a/llvm/test/Transforms/Attributor/undefined_behavior.ll
+++ b/llvm/test/Transforms/Attributor/undefined_behavior.ll
@@ -358,23 +358,23 @@ define void @atomiccmpxchg_null_propagated() {
 ; Note: The unreachable on %t and %e is _not_ from AAUndefinedBehavior
 
 define i32 @cond_br_on_undef() {
-; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef
-; IS__TUNIT____-SAME: () #[[ATTR5:[0-9]+]] {
+; IS__TUNIT____-SAME: () #[[ATTR0]] {
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       t:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    ret i32 1
 ; IS__TUNIT____:       e:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    ret i32 2
 ;
-; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn
+; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef
-; IS__CGSCC____-SAME: () #[[ATTR5:[0-9]+]] {
+; IS__CGSCC____-SAME: () #[[ATTR0]] {
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       t:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret i32 1
 ; IS__CGSCC____:       e:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret i32 2
 ;
   br i1 undef, label %t, label %e
 t:
@@ -394,9 +394,9 @@ define void @cond_br_on_undef2(i1 %cond) {
 ; IS__TUNIT____:       t1:
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       t2:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    ret void
 ; IS__TUNIT____:       e2:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    ret void
 ; IS__TUNIT____:       e1:
 ; IS__TUNIT____-NEXT:    ret void
 ;
@@ -407,9 +407,9 @@ define void @cond_br_on_undef2(i1 %cond) {
 ; IS__CGSCC____:       t1:
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       t2:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret void
 ; IS__CGSCC____:       e2:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret void
 ; IS__CGSCC____:       e1:
 ; IS__CGSCC____-NEXT:    ret void
 ;
@@ -439,23 +439,23 @@ define i1 @ret_undef() {
 }
 
 define void @cond_br_on_undef_interproc() {
-; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc
-; IS__TUNIT____-SAME: () #[[ATTR5]] {
+; IS__TUNIT____-SAME: () #[[ATTR0]] {
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       t:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    ret void
 ; IS__TUNIT____:       e:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    ret void
 ;
-; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn
+; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc
-; IS__CGSCC____-SAME: () #[[ATTR5]] {
+; IS__CGSCC____-SAME: () #[[ATTR0]] {
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       t:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret void
 ; IS__CGSCC____:       e:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret void
 ;
   %cond = call i1 @ret_undef()
   br i1 %cond, label %t, label %e
@@ -493,23 +493,23 @@ e:
 
 ; More complicated interproc deduction of undef
 define void @cond_br_on_undef_interproc2() {
-; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone willreturn
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2
-; IS__TUNIT____-SAME: () #[[ATTR5]] {
+; IS__TUNIT____-SAME: () #[[ATTR0]] {
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       t:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    ret void
 ; IS__TUNIT____:       e:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    ret void
 ;
-; IS__CGSCC____: Function Attrs: nofree norecurse noreturn nosync nounwind readnone willreturn
+; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@cond_br_on_undef_interproc2
-; IS__CGSCC____-SAME: () #[[ATTR5]] {
+; IS__CGSCC____-SAME: () #[[ATTR0]] {
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       t:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret void
 ; IS__CGSCC____:       e:
-; IS__CGSCC____-NEXT:    unreachable
+; IS__CGSCC____-NEXT:    ret void
 ;
   %cond = call i1 @ret_undef2()
   br i1 %cond, label %t, label %e
@@ -631,13 +631,13 @@ define i32 @foo() {
 define void @arg_nonnull_1(i32* nonnull %a) {
 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_1
-; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] {
+; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR5:[0-9]+]] {
 ; IS__TUNIT____-NEXT:    store i32 0, i32* [[A]], align 4
 ; IS__TUNIT____-NEXT:    ret void
 ;
 ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_1
-; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] {
+; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR5:[0-9]+]] {
 ; IS__CGSCC____-NEXT:    store i32 0, i32* [[A]], align 4
 ; IS__CGSCC____-NEXT:    ret void
 ;
@@ -648,13 +648,13 @@ define void @arg_nonnull_1(i32* nonnull %a) {
 define void @arg_nonnull_1_noundef_1(i32* nonnull noundef %a) {
 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1
-; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] {
+; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR5]] {
 ; IS__TUNIT____-NEXT:    store i32 0, i32* [[A]], align 4
 ; IS__TUNIT____-NEXT:    ret void
 ;
 ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_1_noundef_1
-; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6]] {
+; IS__CGSCC____-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR5]] {
 ; IS__CGSCC____-NEXT:    store i32 0, i32* [[A]], align 4
 ; IS__CGSCC____-NEXT:    ret void
 ;
@@ -665,7 +665,7 @@ define void @arg_nonnull_1_noundef_1(i32* nonnull noundef %a) {
 define void @arg_nonnull_12(i32* nonnull %a, i32* nonnull %b, i32* %c) {
 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_12
-; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] {
+; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR5]] {
 ; IS__TUNIT____-NEXT:    [[D:%.*]] = icmp eq i32* [[C]], null
 ; IS__TUNIT____-NEXT:    br i1 [[D]], label [[T:%.*]], label [[F:%.*]]
 ; IS__TUNIT____:       t:
@@ -679,7 +679,7 @@ define void @arg_nonnull_12(i32* nonnull %a, i32* nonnull %b, i32* %c) {
 ;
 ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_12
-; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] {
+; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR5]] {
 ; IS__CGSCC____-NEXT:    [[D:%.*]] = icmp eq i32* [[C]], null
 ; IS__CGSCC____-NEXT:    br i1 [[D]], label [[T:%.*]], label [[F:%.*]]
 ; IS__CGSCC____:       t:
@@ -706,7 +706,7 @@ ret:
 define void @arg_nonnull_12_noundef_2(i32* nonnull %a, i32* noundef nonnull %b, i32* %c) {
 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2
-; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] {
+; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR5]] {
 ; IS__TUNIT____-NEXT:    [[D:%.*]] = icmp eq i32* [[C]], null
 ; IS__TUNIT____-NEXT:    br i1 [[D]], label [[T:%.*]], label [[F:%.*]]
 ; IS__TUNIT____:       t:
@@ -720,7 +720,7 @@ define void @arg_nonnull_12_noundef_2(i32* nonnull %a, i32* noundef nonnull %b,
 ;
 ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2
-; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR6]] {
+; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull writeonly [[A:%.*]], i32* nocapture nofree noundef nonnull writeonly [[B:%.*]], i32* nofree writeonly [[C:%.*]]) #[[ATTR5]] {
 ; IS__CGSCC____-NEXT:    [[D:%.*]] = icmp eq i32* [[C]], null
 ; IS__CGSCC____-NEXT:    br i1 [[D]], label [[T:%.*]], label [[F:%.*]]
 ; IS__CGSCC____:       t:
@@ -818,8 +818,8 @@ define void @arg_nonnull_violation3_1(i1 %c) {
 ; IS__TUNIT____-NEXT:    [[PTR:%.*]] = alloca i32, align 4
 ; IS__TUNIT____-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
 ; IS__TUNIT____:       t:
-; IS__TUNIT____-NEXT:    call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]]
-; IS__TUNIT____-NEXT:    call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 536870912 null) #[[ATTR7]]
+; IS__TUNIT____-NEXT:    call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR6:[0-9]+]]
+; IS__TUNIT____-NEXT:    call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 536870912 null) #[[ATTR6]]
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       f:
 ; IS__TUNIT____-NEXT:    unreachable
@@ -832,8 +832,8 @@ define void @arg_nonnull_violation3_1(i1 %c) {
 ; IS__CGSCC____-NEXT:    [[PTR:%.*]] = alloca i32, align 4
 ; IS__CGSCC____-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
 ; IS__CGSCC____:       t:
-; IS__CGSCC____-NEXT:    call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]]
-; IS__CGSCC____-NEXT:    call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 536870912 null) #[[ATTR7]]
+; IS__CGSCC____-NEXT:    call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR6:[0-9]+]]
+; IS__CGSCC____-NEXT:    call void @arg_nonnull_12(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 536870912 null) #[[ATTR6]]
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       f:
 ; IS__CGSCC____-NEXT:    unreachable
@@ -865,8 +865,8 @@ define void @arg_nonnull_violation3_2(i1 %c) {
 ; IS__TUNIT____-NEXT:    [[PTR:%.*]] = alloca i32, align 4
 ; IS__TUNIT____-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
 ; IS__TUNIT____:       t:
-; IS__TUNIT____-NEXT:    call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]]
-; IS__TUNIT____-NEXT:    call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 536870912 null) #[[ATTR7]]
+; IS__TUNIT____-NEXT:    call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR6]]
+; IS__TUNIT____-NEXT:    call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 536870912 null) #[[ATTR6]]
 ; IS__TUNIT____-NEXT:    unreachable
 ; IS__TUNIT____:       f:
 ; IS__TUNIT____-NEXT:    unreachable
@@ -879,8 +879,8 @@ define void @arg_nonnull_violation3_2(i1 %c) {
 ; IS__CGSCC____-NEXT:    [[PTR:%.*]] = alloca i32, align 4
 ; IS__CGSCC____-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
 ; IS__CGSCC____:       t:
-; IS__CGSCC____-NEXT:    call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]]
-; IS__CGSCC____-NEXT:    call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 536870912 null) #[[ATTR7]]
+; IS__CGSCC____-NEXT:    call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR6]]
+; IS__CGSCC____-NEXT:    call void @arg_nonnull_12_noundef_2(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], i32* noalias nocapture nofree noundef writeonly align 536870912 null) #[[ATTR6]]
 ; IS__CGSCC____-NEXT:    unreachable
 ; IS__CGSCC____:       f:
 ; IS__CGSCC____-NEXT:    unreachable
@@ -1131,16 +1131,14 @@ define i32* @violate_noundef_pointer() {
 ; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind null_pointer_is_valid willreturn writeonly }
 ; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nounwind readnone willreturn }
 ; IS__TUNIT____: attributes #[[ATTR4]] = { nofree nounwind null_pointer_is_valid willreturn }
-; IS__TUNIT____: attributes #[[ATTR5]] = { nofree noreturn nosync nounwind readnone willreturn }
-; IS__TUNIT____: attributes #[[ATTR6]] = { argmemonly nofree nosync nounwind willreturn writeonly }
-; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly }
+; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn writeonly }
+; IS__TUNIT____: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly }
 ;.
 ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn }
 ; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly }
 ; IS__CGSCC____: attributes #[[ATTR3]] = { nofree norecurse nounwind readnone willreturn }
 ; IS__CGSCC____: attributes #[[ATTR4]] = { nofree norecurse nounwind null_pointer_is_valid willreturn }
-; IS__CGSCC____: attributes #[[ATTR5]] = { nofree norecurse noreturn nosync nounwind readnone willreturn }
-; IS__CGSCC____: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
-; IS__CGSCC____: attributes #[[ATTR7]] = { nounwind willreturn writeonly }
+; IS__CGSCC____: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
+; IS__CGSCC____: attributes #[[ATTR6]] = { nounwind willreturn writeonly }
 ;.

diff  --git a/llvm/test/Transforms/Attributor/value-simplify.ll b/llvm/test/Transforms/Attributor/value-simplify.ll
index 7c83a906e7d71..8659346720fda 100644
--- a/llvm/test/Transforms/Attributor/value-simplify.ll
+++ b/llvm/test/Transforms/Attributor/value-simplify.ll
@@ -331,6 +331,15 @@ define i32 @ipccp3() {
 }
 
 define internal i32 @ipccp4ia(i1 %c) {
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
+; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp4ia
+; IS__TUNIT____-SAME: () #[[ATTR1]] {
+; IS__TUNIT____-NEXT:    br label [[T:%.*]]
+; IS__TUNIT____:       t:
+; IS__TUNIT____-NEXT:    ret i32 0
+; IS__TUNIT____:       f:
+; IS__TUNIT____-NEXT:    ret i32 1
+;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp4ia
 ; IS__CGSCC____-SAME: () #[[ATTR1]] {
@@ -347,6 +356,16 @@ f:
   ret i32 1
 }
 define internal i32 @ipccp4ib(i32 %a) {
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
+; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp4ib
+; IS__TUNIT____-SAME: () #[[ATTR1]] {
+; IS__TUNIT____-NEXT:    br label [[T:%.*]]
+; IS__TUNIT____:       t:
+; IS__TUNIT____-NEXT:    [[R:%.*]] = call i32 @ipccp4ia() #[[ATTR1]]
+; IS__TUNIT____-NEXT:    ret i32 [[R]]
+; IS__TUNIT____:       f:
+; IS__TUNIT____-NEXT:    unreachable
+;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp4ib
 ; IS__CGSCC____-SAME: () #[[ATTR1]] {
@@ -366,14 +385,15 @@ f:
 }
 
 define i32 @ipccp4(i1 %c) {
-; IS__TUNIT____: Function Attrs: nofree noreturn nosync nounwind readnone
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone
 ; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp4
 ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] {
 ; IS__TUNIT____-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
 ; IS__TUNIT____:       t:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    br label [[F]]
 ; IS__TUNIT____:       f:
-; IS__TUNIT____-NEXT:    unreachable
+; IS__TUNIT____-NEXT:    [[R:%.*]] = call i32 @ipccp4ib() #[[ATTR1]]
+; IS__TUNIT____-NEXT:    ret i32 [[R]]
 ;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp4
@@ -418,13 +438,13 @@ define i32* @complicated_args_inalloca(i32* %arg) {
 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_inalloca
 ; IS__CGSCC_OPM-SAME: (i32* nofree noundef nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] {
-; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call i32* @test_inalloca(i32* noalias nofree noundef nonnull writeonly dereferenceable(4) "no-capture-maybe-returned" [[ARG]]) #[[ATTR6:[0-9]+]]
+; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call i32* @test_inalloca(i32* noalias nofree noundef nonnull writeonly dereferenceable(4) "no-capture-maybe-returned" [[ARG]]) #[[ATTR7:[0-9]+]]
 ; IS__CGSCC_OPM-NEXT:    ret i32* [[CALL]]
 ;
 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_inalloca
 ; IS__CGSCC_NPM-SAME: (i32* nofree noundef nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] {
-; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call i32* @test_inalloca(i32* noalias nofree noundef nonnull writeonly dereferenceable(4) "no-capture-maybe-returned" [[ARG]]) #[[ATTR5:[0-9]+]]
+; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call i32* @test_inalloca(i32* noalias nofree noundef nonnull writeonly dereferenceable(4) "no-capture-maybe-returned" [[ARG]]) #[[ATTR6:[0-9]+]]
 ; IS__CGSCC_NPM-NEXT:    ret i32* [[CALL]]
 ;
   %call = call i32* @test_inalloca(i32* %arg)
@@ -448,29 +468,29 @@ define i32* @complicated_args_preallocated() {
 ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
 ; IS__TUNIT_OPM-SAME: () #[[ATTR0:[0-9]+]] {
-; IS__TUNIT_OPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR7:[0-9]+]]
+; IS__TUNIT_OPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR6:[0-9]+]]
 ; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) #[[ATTR1]] [ "preallocated"(token [[C]]) ]
 ; IS__TUNIT_OPM-NEXT:    ret i32* [[CALL]]
 ;
 ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
 ; IS__TUNIT_NPM-SAME: () #[[ATTR0:[0-9]+]] {
-; IS__TUNIT_NPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR6:[0-9]+]]
+; IS__TUNIT_NPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR5:[0-9]+]]
 ; IS__TUNIT_NPM-NEXT:    [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) #[[ATTR1]] [ "preallocated"(token [[C]]) ]
 ; IS__TUNIT_NPM-NEXT:    ret i32* [[CALL]]
 ;
 ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
 ; IS__CGSCC_OPM-SAME: () #[[ATTR0:[0-9]+]] {
-; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR7:[0-9]+]]
-; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) #[[ATTR8:[0-9]+]] [ "preallocated"(token [[C]]) ]
+; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR8:[0-9]+]]
+; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) #[[ATTR9:[0-9]+]] [ "preallocated"(token [[C]]) ]
 ; IS__CGSCC_OPM-NEXT:    ret i32* [[CALL]]
 ;
 ; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
 ; IS__CGSCC_NPM-SAME: () #[[ATTR0:[0-9]+]] {
-; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR6:[0-9]+]]
-; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) #[[ATTR7:[0-9]+]] [ "preallocated"(token [[C]]) ]
+; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR7:[0-9]+]]
+; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 536870912 null) #[[ATTR8:[0-9]+]] [ "preallocated"(token [[C]]) ]
 ; IS__CGSCC_NPM-NEXT:    ret i32* [[CALL]]
 ;
   %c = call token @llvm.call.preallocated.setup(i32 1)
@@ -501,13 +521,13 @@ define void @complicated_args_sret(%struct.X** %b) {
 ; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
 ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_sret
 ; IS__TUNIT_OPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR3]] {
-; IS__TUNIT_OPM-NEXT:    call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR8:[0-9]+]]
+; IS__TUNIT_OPM-NEXT:    call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR7:[0-9]+]]
 ; IS__TUNIT_OPM-NEXT:    ret void
 ;
 ; IS__TUNIT_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
 ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_sret
 ; IS__TUNIT_NPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR3]] {
-; IS__TUNIT_NPM-NEXT:    call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR7:[0-9]+]]
+; IS__TUNIT_NPM-NEXT:    call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly align 536870912 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR6:[0-9]+]]
 ; IS__TUNIT_NPM-NEXT:    ret void
 ;
 ; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
@@ -542,13 +562,13 @@ define %struct.X* @complicated_args_nest() {
 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_nest
 ; IS__CGSCC_OPM-SAME: () #[[ATTR1]] {
-; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 536870912 null) #[[ATTR6]]
+; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 536870912 null) #[[ATTR7]]
 ; IS__CGSCC_OPM-NEXT:    ret %struct.X* [[CALL]]
 ;
 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_nest
 ; IS__CGSCC_NPM-SAME: () #[[ATTR1]] {
-; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 536870912 null) #[[ATTR5]]
+; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 536870912 null) #[[ATTR6]]
 ; IS__CGSCC_NPM-NEXT:    ret %struct.X* [[CALL]]
 ;
   %call = call %struct.X* @test_nest(%struct.X* null)
@@ -627,13 +647,13 @@ define i8* @complicated_args_byval2() {
 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_byval2
 ; IS__CGSCC_OPM-SAME: () #[[ATTR3]] {
-; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call i8* @test_byval2() #[[ATTR9:[0-9]+]]
+; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call i8* @test_byval2() #[[ATTR10:[0-9]+]]
 ; IS__CGSCC_OPM-NEXT:    ret i8* [[C]]
 ;
 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2
 ; IS__CGSCC_NPM-SAME: () #[[ATTR3]] {
-; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call i8* @test_byval2() #[[ATTR8:[0-9]+]]
+; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call i8* @test_byval2() #[[ATTR9:[0-9]+]]
 ; IS__CGSCC_NPM-NEXT:    ret i8* [[C]]
 ;
   %c = call i8* @test_byval2(%struct.X* @S)
@@ -855,18 +875,85 @@ define internal i8 @callee(i8 %a) {
 }
 
 
+define i1 @test_merge_with_undef_values_ptr(i1 %c) {
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone
+; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr
+; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
+; IS__TUNIT____-NEXT:    [[R1:%.*]] = call i1 @undef_then_null(i1 [[C]]) #[[ATTR2]]
+; IS__TUNIT____-NEXT:    ret i1 [[R1]]
+;
+; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone
+; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr
+; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR5:[0-9]+]] {
+; IS__CGSCC_OPM-NEXT:    [[R1:%.*]] = call noundef i1 @undef_then_null(i1 [[C]]) #[[ATTR11:[0-9]+]]
+; IS__CGSCC_OPM-NEXT:    ret i1 [[R1]]
+;
+; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone
+; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr
+; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] {
+; IS__CGSCC_NPM-NEXT:    [[R1:%.*]] = call noundef i1 @undef_then_null(i1 [[C]]) #[[ATTR10:[0-9]+]]
+; IS__CGSCC_NPM-NEXT:    ret i1 [[R1]]
+;
+  %r1 = call i1 @undef_then_null(i1 %c, i32* undef, i32* undef)
+  ret i1 %r1
+}
+define internal i1 @undef_then_null(i1 %c, i32* %i32Aptr, i32* %i32Bptr) {
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone
+; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_then_null
+; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
+; IS__TUNIT____-NEXT:    [[CMP1:%.*]] = icmp eq i32* null, null
+; IS__TUNIT____-NEXT:    [[CMP2:%.*]] = icmp eq i1 [[CMP1]], false
+; IS__TUNIT____-NEXT:    [[OR:%.*]] = or i1 [[CMP2]], [[C]]
+; IS__TUNIT____-NEXT:    br i1 [[OR]], label [[A:%.*]], label [[B:%.*]]
+; IS__TUNIT____:       a:
+; IS__TUNIT____-NEXT:    [[R2:%.*]] = call i1 @undef_then_null(i1 noundef false) #[[ATTR2]]
+; IS__TUNIT____-NEXT:    ret i1 [[R2]]
+; IS__TUNIT____:       b:
+; IS__TUNIT____-NEXT:    ret i1 [[CMP2]]
+;
+; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone
+; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@undef_then_null
+; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR5]] {
+; IS__CGSCC_OPM-NEXT:    [[CMP1:%.*]] = icmp eq i32* null, null
+; IS__CGSCC_OPM-NEXT:    [[CMP2:%.*]] = icmp eq i1 [[CMP1]], false
+; IS__CGSCC_OPM-NEXT:    [[OR:%.*]] = or i1 [[CMP2]], [[C]]
+; IS__CGSCC_OPM-NEXT:    br i1 [[OR]], label [[A:%.*]], label [[B:%.*]]
+; IS__CGSCC_OPM:       a:
+; IS__CGSCC_OPM-NEXT:    [[R2:%.*]] = call noundef i1 @undef_then_null(i1 noundef false) #[[ATTR5]]
+; IS__CGSCC_OPM-NEXT:    ret i1 [[R2]]
+; IS__CGSCC_OPM:       b:
+; IS__CGSCC_OPM-NEXT:    ret i1 [[CMP2]]
+;
+; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone
+; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@undef_then_null
+; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4]] {
+; IS__CGSCC_NPM-NEXT:    [[CMP1:%.*]] = icmp eq i32* null, null
+; IS__CGSCC_NPM-NEXT:    [[CMP2:%.*]] = icmp eq i1 [[CMP1]], false
+; IS__CGSCC_NPM-NEXT:    [[OR:%.*]] = or i1 [[CMP2]], [[C]]
+; IS__CGSCC_NPM-NEXT:    br i1 [[OR]], label [[A:%.*]], label [[B:%.*]]
+; IS__CGSCC_NPM:       a:
+; IS__CGSCC_NPM-NEXT:    [[R2:%.*]] = call noundef i1 @undef_then_null(i1 noundef false) #[[ATTR4]]
+; IS__CGSCC_NPM-NEXT:    ret i1 [[R2]]
+; IS__CGSCC_NPM:       b:
+; IS__CGSCC_NPM-NEXT:    ret i1 [[CMP2]]
+;
+  %cmp1 = icmp eq i32* %i32Aptr, %i32Bptr
+  %cmp2 = icmp eq i1 %cmp1, false
+  %or = or i1 %cmp2, %c
+  br i1 %or, label %a, label %b
+a:
+  %r2 = call i1 @undef_then_null(i1 false, i32* null, i32* null)
+  ret i1 %r2
+b:
+  ret i1 %cmp2
+}
+
 define i1 @test_merge_with_undef_values(i1 %c) {
-; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone
-; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values
-; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR6:[0-9]+]] {
-; IS__TUNIT_OPM-NEXT:    [[R1:%.*]] = call i1 @undef_then_1(i1 [[C]]) #[[ATTR6]]
-; IS__TUNIT_OPM-NEXT:    ret i1 [[R1]]
-;
-; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone
-; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values
-; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR5:[0-9]+]] {
-; IS__TUNIT_NPM-NEXT:    [[R1:%.*]] = call i1 @undef_then_1(i1 [[C]]) #[[ATTR5]]
-; IS__TUNIT_NPM-NEXT:    ret i1 [[R1]]
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone
+; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values
+; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
+; IS__TUNIT____-NEXT:    [[R1:%.*]] = call i1 @undef_then_1(i1 [[C]]) #[[ATTR2]]
+; IS__TUNIT____-NEXT:    ret i1 [[R1]]
 ;
 ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_merge_with_undef_values
@@ -877,33 +964,22 @@ define i1 @test_merge_with_undef_values(i1 %c) {
   ret i1 %r1
 }
 define internal i1 @undef_then_1(i1 %c, i32 %i32A, i32 %i32B) {
-; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone
-; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@undef_then_1
-; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR6]] {
-; IS__TUNIT_OPM-NEXT:    [[CMP2:%.*]] = icmp eq i1 true, false
-; IS__TUNIT_OPM-NEXT:    [[OR:%.*]] = or i1 [[CMP2]], [[C]]
-; IS__TUNIT_OPM-NEXT:    br i1 [[OR]], label [[A:%.*]], label [[B:%.*]]
-; IS__TUNIT_OPM:       a:
-; IS__TUNIT_OPM-NEXT:    [[R2:%.*]] = call i1 @undef_then_1(i1 noundef false) #[[ATTR6]]
-; IS__TUNIT_OPM-NEXT:    ret i1 [[R2]]
-; IS__TUNIT_OPM:       b:
-; IS__TUNIT_OPM-NEXT:    ret i1 [[CMP2]]
-;
-; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone
-; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@undef_then_1
-; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR5]] {
-; IS__TUNIT_NPM-NEXT:    [[CMP2:%.*]] = icmp eq i1 true, false
-; IS__TUNIT_NPM-NEXT:    [[OR:%.*]] = or i1 [[CMP2]], [[C]]
-; IS__TUNIT_NPM-NEXT:    br i1 [[OR]], label [[A:%.*]], label [[B:%.*]]
-; IS__TUNIT_NPM:       a:
-; IS__TUNIT_NPM-NEXT:    [[R2:%.*]] = call i1 @undef_then_1(i1 noundef false) #[[ATTR5]]
-; IS__TUNIT_NPM-NEXT:    ret i1 [[R2]]
-; IS__TUNIT_NPM:       b:
-; IS__TUNIT_NPM-NEXT:    ret i1 [[CMP2]]
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone
+; IS__TUNIT____-LABEL: define {{[^@]+}}@undef_then_1
+; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
+; IS__TUNIT____-NEXT:    [[CMP1:%.*]] = icmp eq i32 1, 1
+; IS__TUNIT____-NEXT:    [[CMP2:%.*]] = icmp eq i1 [[CMP1]], false
+; IS__TUNIT____-NEXT:    [[OR:%.*]] = or i1 [[CMP2]], [[C]]
+; IS__TUNIT____-NEXT:    br i1 [[OR]], label [[A:%.*]], label [[B:%.*]]
+; IS__TUNIT____:       a:
+; IS__TUNIT____-NEXT:    [[R2:%.*]] = call i1 @undef_then_1(i1 noundef false) #[[ATTR2]]
+; IS__TUNIT____-NEXT:    ret i1 [[R2]]
+; IS__TUNIT____:       b:
+; IS__TUNIT____-NEXT:    ret i1 [[CMP2]]
 ;
 ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@undef_then_1
-; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR5:[0-9]+]] {
+; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR6:[0-9]+]] {
 ; IS__CGSCC_OPM-NEXT:    [[OR:%.*]] = or i1 false, [[C]]
 ; IS__CGSCC_OPM-NEXT:    br i1 [[OR]], label [[A:%.*]], label [[B:%.*]]
 ; IS__CGSCC_OPM:       a:
@@ -913,7 +989,7 @@ define internal i1 @undef_then_1(i1 %c, i32 %i32A, i32 %i32B) {
 ;
 ; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@undef_then_1
-; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR4:[0-9]+]] {
+; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR5:[0-9]+]] {
 ; IS__CGSCC_NPM-NEXT:    [[OR:%.*]] = or i1 false, [[C]]
 ; IS__CGSCC_NPM-NEXT:    br i1 [[OR]], label [[A:%.*]], label [[B:%.*]]
 ; IS__CGSCC_NPM:       a:
@@ -949,41 +1025,43 @@ define i1 @icmp() {
 ;.
 ; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn }
-; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone }
+; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone }
 ; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn writeonly }
 ; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn }
 ; IS__TUNIT_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind writeonly }
-; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind readnone }
-; IS__TUNIT_OPM: attributes #[[ATTR7]] = { willreturn }
-; IS__TUNIT_OPM: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn writeonly }
+; IS__TUNIT_OPM: attributes #[[ATTR6]] = { willreturn }
+; IS__TUNIT_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly }
 ;.
 ; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn }
 ; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn }
-; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone }
+; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone }
 ; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn writeonly }
 ; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readonly willreturn }
-; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind readnone }
-; IS__TUNIT_NPM: attributes #[[ATTR6]] = { willreturn }
-; IS__TUNIT_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly }
+; IS__TUNIT_NPM: attributes #[[ATTR5]] = { willreturn }
+; IS__TUNIT_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly }
 ;.
 ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readonly willreturn }
 ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind writeonly }
-; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree nosync nounwind readnone willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR6]] = { readnone willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR7]] = { willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nounwind readnone willreturn }
-; IS__CGSCC_OPM: attributes #[[ATTR9]] = { readonly willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree nosync nounwind readnone }
+; IS__CGSCC_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind readnone willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR7]] = { readnone willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR8]] = { willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nounwind readnone willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR10]] = { readonly willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nounwind readnone }
 ;.
 ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
 ; IS__CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
 ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readonly willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readnone willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR5]] = { readnone willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR6]] = { willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nounwind readnone willreturn }
-; IS__CGSCC_NPM: attributes #[[ATTR8]] = { readonly willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind readnone }
+; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind readnone willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR6]] = { readnone willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR7]] = { willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nounwind readnone willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR9]] = { readonly willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nounwind readnone }
 ;.


        


More information about the llvm-commits mailing list