|
1 | 1 | ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes |
2 | | -; RUN: opt -attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM |
3 | | -; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=4 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM |
| 2 | +; RUN: opt -attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM |
| 3 | +; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM |
4 | 4 | ; RUN: opt -attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM |
5 | 5 | ; 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 |
6 | 6 |
|
@@ -51,3 +51,113 @@ define internal void @g(i32* %a) { |
51 | 51 | } |
52 | 52 |
|
53 | 53 | declare void @z(i32) |
| 54 | + |
| 55 | +; Test2 |
| 56 | +; Different alignemnt privatizable arguments |
| 57 | +define internal i32 @test(i32* %X, i64* %Y) { |
| 58 | +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test |
| 59 | +; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree nonnull readonly align 4 dereferenceable(4) [[X:%.*]], i64* noalias nocapture nofree nonnull readonly align 8 dereferenceable(8) [[Y:%.*]]) |
| 60 | +; IS__TUNIT_OPM-NEXT: [[A:%.*]] = load i32, i32* [[X]], align 4 |
| 61 | +; IS__TUNIT_OPM-NEXT: [[B:%.*]] = load i64, i64* [[Y]], align 8 |
| 62 | +; IS__TUNIT_OPM-NEXT: [[C:%.*]] = add i32 [[A]], 1 |
| 63 | +; IS__TUNIT_OPM-NEXT: [[D:%.*]] = add i64 [[B]], 1 |
| 64 | +; IS__TUNIT_OPM-NEXT: [[COND:%.*]] = icmp sgt i64 [[D]], -1 |
| 65 | +; IS__TUNIT_OPM-NEXT: br i1 [[COND]], label [[RETURN1:%.*]], label [[RETURN2:%.*]] |
| 66 | +; IS__TUNIT_OPM: Return1: |
| 67 | +; IS__TUNIT_OPM-NEXT: ret i32 [[C]] |
| 68 | +; IS__TUNIT_OPM: Return2: |
| 69 | +; IS__TUNIT_OPM-NEXT: ret i32 [[A]] |
| 70 | +; |
| 71 | +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test |
| 72 | +; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]], i64 [[TMP1:%.*]]) |
| 73 | +; IS__TUNIT_NPM-NEXT: [[Y_PRIV:%.*]] = alloca i64 |
| 74 | +; IS__TUNIT_NPM-NEXT: store i64 [[TMP1]], i64* [[Y_PRIV]] |
| 75 | +; IS__TUNIT_NPM-NEXT: [[X_PRIV:%.*]] = alloca i32 |
| 76 | +; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[X_PRIV]] |
| 77 | +; IS__TUNIT_NPM-NEXT: [[A:%.*]] = load i32, i32* [[X_PRIV]], align 4 |
| 78 | +; IS__TUNIT_NPM-NEXT: [[B:%.*]] = load i64, i64* [[Y_PRIV]], align 8 |
| 79 | +; IS__TUNIT_NPM-NEXT: [[C:%.*]] = add i32 [[A]], 1 |
| 80 | +; IS__TUNIT_NPM-NEXT: [[D:%.*]] = add i64 [[B]], 1 |
| 81 | +; IS__TUNIT_NPM-NEXT: [[COND:%.*]] = icmp sgt i64 [[D]], -1 |
| 82 | +; IS__TUNIT_NPM-NEXT: br i1 [[COND]], label [[RETURN1:%.*]], label [[RETURN2:%.*]] |
| 83 | +; IS__TUNIT_NPM: Return1: |
| 84 | +; IS__TUNIT_NPM-NEXT: ret i32 [[C]] |
| 85 | +; IS__TUNIT_NPM: Return2: |
| 86 | +; IS__TUNIT_NPM-NEXT: ret i32 [[A]] |
| 87 | +; |
| 88 | +; IS__CGSCC____-LABEL: define {{[^@]+}}@test |
| 89 | +; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[X:%.*]], i64* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[Y:%.*]]) |
| 90 | +; IS__CGSCC____-NEXT: [[A:%.*]] = load i32, i32* [[X]], align 4 |
| 91 | +; IS__CGSCC____-NEXT: [[B:%.*]] = load i64, i64* [[Y]], align 8 |
| 92 | +; IS__CGSCC____-NEXT: [[C:%.*]] = add i32 [[A]], 1 |
| 93 | +; IS__CGSCC____-NEXT: [[D:%.*]] = add i64 [[B]], 1 |
| 94 | +; IS__CGSCC____-NEXT: [[COND:%.*]] = icmp sgt i64 [[D]], -1 |
| 95 | +; IS__CGSCC____-NEXT: br i1 [[COND]], label [[RETURN1:%.*]], label [[RETURN2:%.*]] |
| 96 | +; IS__CGSCC____: Return1: |
| 97 | +; IS__CGSCC____-NEXT: ret i32 [[C]] |
| 98 | +; IS__CGSCC____: Return2: |
| 99 | +; IS__CGSCC____-NEXT: ret i32 [[A]] |
| 100 | +; |
| 101 | + %A = load i32, i32* %X |
| 102 | + %B = load i64, i64* %Y |
| 103 | + %C = add i32 %A, 1 |
| 104 | + %D = add i64 %B, 1 |
| 105 | + %cond = icmp sgt i64 %D, -1 |
| 106 | + br i1 %cond, label %Return1, label %Return2 |
| 107 | +Return1: |
| 108 | + ret i32 %C |
| 109 | +Return2: |
| 110 | + ret i32 %A |
| 111 | +} |
| 112 | + |
| 113 | +define internal i32 @caller(i32* %A) { |
| 114 | +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@caller |
| 115 | +; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) |
| 116 | +; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i64 |
| 117 | +; IS__TUNIT_OPM-NEXT: store i64 1, i64* [[B]], align 8 |
| 118 | +; IS__TUNIT_OPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree nonnull readonly align 4 dereferenceable(4) [[A]], i64* noalias nocapture nofree nonnull readonly align 8 dereferenceable(8) [[B]]) |
| 119 | +; IS__TUNIT_OPM-NEXT: ret i32 [[C]] |
| 120 | +; |
| 121 | +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@caller |
| 122 | +; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) |
| 123 | +; IS__TUNIT_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32 |
| 124 | +; IS__TUNIT_NPM-NEXT: store i32 [[TMP0]], i32* [[A_PRIV]] |
| 125 | +; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i64 |
| 126 | +; IS__TUNIT_NPM-NEXT: store i64 1, i64* [[B]], align 8 |
| 127 | +; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_PRIV]], align 4 |
| 128 | +; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i64, i64* [[B]], align 8 |
| 129 | +; IS__TUNIT_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 [[TMP2]], i64 [[TMP3]]) |
| 130 | +; IS__TUNIT_NPM-NEXT: ret i32 [[C]] |
| 131 | +; |
| 132 | +; IS__CGSCC____-LABEL: define {{[^@]+}}@caller |
| 133 | +; IS__CGSCC____-SAME: (i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) |
| 134 | +; IS__CGSCC____-NEXT: [[B:%.*]] = alloca i64 |
| 135 | +; IS__CGSCC____-NEXT: store i64 1, i64* [[B]], align 8 |
| 136 | +; IS__CGSCC____-NEXT: [[C:%.*]] = call i32 @test(i32* nocapture nofree nonnull readonly align 4 dereferenceable(4) [[A]], i64* noalias nocapture nofree nonnull readonly align 8 dereferenceable(8) [[B]]) |
| 137 | +; IS__CGSCC____-NEXT: ret i32 [[C]] |
| 138 | +; |
| 139 | + %B = alloca i64 |
| 140 | + store i64 1, i64* %B |
| 141 | + %C = call i32 @test(i32* %A, i64* %B) |
| 142 | + ret i32 %C |
| 143 | +} |
| 144 | + |
| 145 | +define i32 @callercaller() { |
| 146 | +; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@callercaller() |
| 147 | +; NOT_TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32 |
| 148 | +; NOT_TUNIT_NPM-NEXT: store i32 2, i32* [[B]], align 4 |
| 149 | +; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree nonnull readonly align 4 dereferenceable(4) [[B]]) |
| 150 | +; NOT_TUNIT_NPM-NEXT: ret i32 [[X]] |
| 151 | +; |
| 152 | +; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callercaller() |
| 153 | +; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32 |
| 154 | +; IS__TUNIT_NPM-NEXT: store i32 2, i32* [[B]], align 4 |
| 155 | +; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4 |
| 156 | +; IS__TUNIT_NPM-NEXT: [[X:%.*]] = call i32 @caller(i32 [[TMP1]]) |
| 157 | +; IS__TUNIT_NPM-NEXT: ret i32 [[X]] |
| 158 | +; |
| 159 | + %B = alloca i32 |
| 160 | + store i32 2, i32* %B |
| 161 | + %X = call i32 @caller(i32* %B) |
| 162 | + ret i32 %X |
| 163 | +} |
0 commit comments