Skip to content

Commit 0830103

Browse files
committed
[Attributor] Ensure to use the proper liveness AA
When determining liveness via Attributor::isAssumedDead(...) we might end up without a liveness AA or with one pointing into another function. Neither is helpful and we will avoid both from now on. Reapplied after fixing the ASAN error which caused the revert: llvm@db68a25
1 parent 20b2d32 commit 0830103

File tree

6 files changed

+84
-111
lines changed

6 files changed

+84
-111
lines changed

llvm/include/llvm/Transforms/IPO/Attributor.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,9 +1424,10 @@ struct Attributor {
14241424
return AA;
14251425
}
14261426

1427-
// If this is queried in the manifest stage, we force the AA to indicate
1428-
// pessimistic fixpoint immediately.
1429-
if (Phase == AttributorPhase::MANIFEST) {
1427+
// If this is queried in the manifest or cleanup stage, we force the AA to
1428+
// indicate pessimistic fixpoint immediately.
1429+
if (Phase == AttributorPhase::MANIFEST ||
1430+
Phase == AttributorPhase::CLEANUP) {
14301431
AA.getState().indicatePessimisticFixpoint();
14311432
return AA;
14321433
}

llvm/lib/Transforms/IPO/Attributor.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,16 +1188,14 @@ bool Attributor::isAssumedDead(const Instruction &I,
11881188
if (ManifestAddedBlocks.contains(I.getParent()))
11891189
return false;
11901190

1191-
if (!FnLivenessAA)
1192-
FnLivenessAA =
1193-
lookupAAFor<AAIsDead>(IRPosition::function(*I.getFunction(), CBCtx),
1194-
QueryingAA, DepClassTy::NONE);
1191+
if (!FnLivenessAA || FnLivenessAA->getAnchorScope() != I.getFunction())
1192+
FnLivenessAA = &getOrCreateAAFor<AAIsDead>(
1193+
IRPosition::function(*I.getFunction(), CBCtx), QueryingAA,
1194+
DepClassTy::NONE);
11951195

11961196
// If we have a context instruction and a liveness AA we use it.
1197-
if (FnLivenessAA &&
1198-
FnLivenessAA->getIRPosition().getAnchorScope() == I.getFunction() &&
1199-
(CheckBBLivenessOnly ? FnLivenessAA->isAssumedDead(I.getParent())
1200-
: FnLivenessAA->isAssumedDead(&I))) {
1197+
if (CheckBBLivenessOnly ? FnLivenessAA->isAssumedDead(I.getParent())
1198+
: FnLivenessAA->isAssumedDead(&I)) {
12011199
if (QueryingAA)
12021200
recordDependence(*FnLivenessAA, *QueryingAA, DepClass);
12031201
if (!FnLivenessAA->isKnownDead(&I))
@@ -1268,9 +1266,9 @@ bool Attributor::isAssumedDead(const BasicBlock &BB,
12681266
const AbstractAttribute *QueryingAA,
12691267
const AAIsDead *FnLivenessAA,
12701268
DepClassTy DepClass) {
1271-
if (!FnLivenessAA)
1272-
FnLivenessAA = lookupAAFor<AAIsDead>(IRPosition::function(*BB.getParent()),
1273-
QueryingAA, DepClassTy::NONE);
1269+
if (!FnLivenessAA || FnLivenessAA->getAnchorScope() != BB.getParent())
1270+
FnLivenessAA = &getOrCreateAAFor<AAIsDead>(
1271+
IRPosition::function(*BB.getParent()), QueryingAA, DepClassTy::NONE);
12741272
if (FnLivenessAA->isAssumedDead(&BB)) {
12751273
if (QueryingAA)
12761274
recordDependence(*FnLivenessAA, *QueryingAA, DepClass);

llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2-
; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -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=2 -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 -enable-new-pm=0 -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
44
; RUN: opt -attributor-cgscc -enable-new-pm=0 -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
55
; 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
66

llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2-
; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -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=2 -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 -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=8 -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=8 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
44
; RUN: opt -attributor-cgscc -enable-new-pm=0 -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
55
; 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
66

llvm/test/Transforms/Attributor/align.ll

Lines changed: 63 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ define i32* @test6_2() #0 {
138138
define internal i8* @f1(i8* readnone %0) local_unnamed_addr #0 {
139139
; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone willreturn uwtable
140140
; IS__CGSCC____-LABEL: define {{[^@]+}}@f1
141-
; IS__CGSCC____-SAME: (i8* noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] {
142-
; IS__CGSCC____-NEXT: br label [[TMP3:%.*]]
143-
; IS__CGSCC____: 2:
141+
; IS__CGSCC____-SAME: () local_unnamed_addr #[[ATTR0]] {
142+
; IS__CGSCC____-NEXT: br label [[TMP2:%.*]]
143+
; IS__CGSCC____: 1:
144144
; IS__CGSCC____-NEXT: unreachable
145-
; IS__CGSCC____: 3:
146-
; IS__CGSCC____-NEXT: ret i8* [[TMP0]]
145+
; IS__CGSCC____: 2:
146+
; IS__CGSCC____-NEXT: ret i8* @a1
147147
;
148148
%2 = icmp eq i8* %0, null
149149
br i1 %2, label %3, label %5
@@ -163,32 +163,24 @@ define internal i8* @f2(i8* readnone %0) local_unnamed_addr #0 {
163163
; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable
164164
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2
165165
; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
166-
; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null
167-
; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP5:%.*]], label [[TMP3:%.*]]
166+
; IS__CGSCC_OPM-NEXT: unreachable
167+
; IS__CGSCC_OPM: 2:
168+
; IS__CGSCC_OPM-NEXT: unreachable
168169
; IS__CGSCC_OPM: 3:
169-
; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = tail call i8* @f1(i8* noalias noundef nonnull readnone align 4294967296 dereferenceable(4294967295) [[TMP0]])
170-
; IS__CGSCC_OPM-NEXT: br label [[TMP7:%.*]]
171-
; IS__CGSCC_OPM: 5:
172-
; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = tail call i8* @f3(i8* nonnull @a2)
173-
; IS__CGSCC_OPM-NEXT: br label [[TMP7]]
174-
; IS__CGSCC_OPM: 7:
175-
; IS__CGSCC_OPM-NEXT: [[TMP8:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ [[TMP6]], [[TMP5]] ]
176-
; IS__CGSCC_OPM-NEXT: ret i8* [[TMP8]]
170+
; IS__CGSCC_OPM-NEXT: unreachable
171+
; IS__CGSCC_OPM: 4:
172+
; IS__CGSCC_OPM-NEXT: unreachable
177173
;
178174
; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable
179175
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2
180176
; IS__CGSCC_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] {
181-
; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null
182-
; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP5:%.*]], label [[TMP3:%.*]]
177+
; IS__CGSCC_NPM-NEXT: unreachable
178+
; IS__CGSCC_NPM: 2:
179+
; IS__CGSCC_NPM-NEXT: unreachable
183180
; IS__CGSCC_NPM: 3:
184-
; IS__CGSCC_NPM-NEXT: [[TMP4:%.*]] = tail call i8* @f1(i8* noalias noundef nonnull readnone align 4294967296 dereferenceable(4294967295) [[TMP0]])
185-
; IS__CGSCC_NPM-NEXT: br label [[TMP7:%.*]]
186-
; IS__CGSCC_NPM: 5:
187-
; IS__CGSCC_NPM-NEXT: [[TMP6:%.*]] = tail call i8* @f3()
188-
; IS__CGSCC_NPM-NEXT: br label [[TMP7]]
189-
; IS__CGSCC_NPM: 7:
190-
; IS__CGSCC_NPM-NEXT: [[TMP8:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ [[TMP6]], [[TMP5]] ]
191-
; IS__CGSCC_NPM-NEXT: ret i8* [[TMP8]]
181+
; IS__CGSCC_NPM-NEXT: unreachable
182+
; IS__CGSCC_NPM: 4:
183+
; IS__CGSCC_NPM-NEXT: unreachable
192184
;
193185
%2 = icmp eq i8* %0, null
194186
br i1 %2, label %5, label %3
@@ -212,23 +204,20 @@ define internal i8* @f3(i8* readnone %0) local_unnamed_addr #0 {
212204
; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable
213205
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3
214206
; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] {
215-
; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null
216-
; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]]
207+
; IS__CGSCC_OPM-NEXT: unreachable
208+
; IS__CGSCC_OPM: 2:
209+
; IS__CGSCC_OPM-NEXT: unreachable
217210
; IS__CGSCC_OPM: 3:
218-
; IS__CGSCC_OPM-NEXT: [[TMP4:%.*]] = tail call i8* @f1(i8* noalias noundef nonnull readnone align 16 dereferenceable(1) @a2)
219-
; IS__CGSCC_OPM-NEXT: br label [[TMP5]]
220-
; IS__CGSCC_OPM: 5:
221-
; IS__CGSCC_OPM-NEXT: [[TMP6:%.*]] = phi i8* [ [[TMP4]], [[TMP3]] ], [ @a1, [[TMP1:%.*]] ]
222-
; IS__CGSCC_OPM-NEXT: ret i8* [[TMP6]]
211+
; IS__CGSCC_OPM-NEXT: unreachable
223212
;
224-
; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone willreturn uwtable
213+
; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable
225214
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f3
226-
; IS__CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR0]] {
227-
; IS__CGSCC_NPM-NEXT: br label [[TMP2:%.*]]
228-
; IS__CGSCC_NPM: 1:
215+
; IS__CGSCC_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
229216
; IS__CGSCC_NPM-NEXT: unreachable
230217
; IS__CGSCC_NPM: 2:
231-
; IS__CGSCC_NPM-NEXT: ret i8* @a1
218+
; IS__CGSCC_NPM-NEXT: unreachable
219+
; IS__CGSCC_NPM: 3:
220+
; IS__CGSCC_NPM-NEXT: unreachable
232221
;
233222
%2 = icmp eq i8* %0, null
234223
br i1 %2, label %3, label %5
@@ -253,12 +242,14 @@ define align 4 i8* @test7() #0 {
253242
; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone willreturn uwtable
254243
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test7
255244
; IS__CGSCC_OPM-SAME: () #[[ATTR1]] {
256-
; IS__CGSCC_OPM-NEXT: ret i8* @a1
245+
; IS__CGSCC_OPM-NEXT: [[C:%.*]] = tail call noundef nonnull align 8 dereferenceable(1) i8* @f1() #[[ATTR13:[0-9]+]]
246+
; IS__CGSCC_OPM-NEXT: ret i8* [[C]]
257247
;
258248
; IS__CGSCC_NPM: Function Attrs: nofree noinline nosync nounwind readnone willreturn uwtable
259249
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test7
260250
; IS__CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] {
261-
; IS__CGSCC_NPM-NEXT: ret i8* @a1
251+
; IS__CGSCC_NPM-NEXT: [[C:%.*]] = tail call noundef nonnull align 8 dereferenceable(1) i8* @f1() #[[ATTR13:[0-9]+]]
252+
; IS__CGSCC_NPM-NEXT: ret i8* [[C]]
262253
;
263254
%c = tail call i8* @f1(i8* align 8 dereferenceable(1) @a1)
264255
ret i8* %c
@@ -267,23 +258,14 @@ define align 4 i8* @test7() #0 {
267258
; TEST 7b
268259
; Function Attrs: nounwind readnone ssp uwtable
269260
define internal i8* @f1b(i8* readnone %0) local_unnamed_addr #0 {
270-
; IS__CGSCC_OPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone willreturn uwtable
271-
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1b
272-
; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(1) [[TMP0:%.*]]) local_unnamed_addr #[[ATTR0]] {
273-
; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]]
274-
; IS__CGSCC_OPM: 2:
275-
; IS__CGSCC_OPM-NEXT: unreachable
276-
; IS__CGSCC_OPM: 3:
277-
; IS__CGSCC_OPM-NEXT: ret i8* undef
278-
;
279-
; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone willreturn uwtable
280-
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1b
281-
; IS__CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR0]] {
282-
; IS__CGSCC_NPM-NEXT: br label [[TMP2:%.*]]
283-
; IS__CGSCC_NPM: 1:
284-
; IS__CGSCC_NPM-NEXT: unreachable
285-
; IS__CGSCC_NPM: 2:
286-
; IS__CGSCC_NPM-NEXT: ret i8* undef
261+
; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone willreturn uwtable
262+
; IS__CGSCC____-LABEL: define {{[^@]+}}@f1b
263+
; IS__CGSCC____-SAME: () local_unnamed_addr #[[ATTR0]] {
264+
; IS__CGSCC____-NEXT: br label [[TMP2:%.*]]
265+
; IS__CGSCC____: 1:
266+
; IS__CGSCC____-NEXT: unreachable
267+
; IS__CGSCC____: 2:
268+
; IS__CGSCC____-NEXT: ret i8* undef
287269
;
288270
%2 = icmp eq i8* %0, null
289271
br i1 %2, label %3, label %5
@@ -305,30 +287,24 @@ define internal i8* @f2b(i8* readnone %0) local_unnamed_addr #0 {
305287
; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable
306288
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2b
307289
; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] {
308-
; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null
309-
; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP4:%.*]], label [[TMP3:%.*]]
290+
; IS__CGSCC_OPM-NEXT: unreachable
291+
; IS__CGSCC_OPM: 2:
292+
; IS__CGSCC_OPM-NEXT: unreachable
310293
; IS__CGSCC_OPM: 3:
311-
; IS__CGSCC_OPM-NEXT: br label [[TMP6:%.*]]
294+
; IS__CGSCC_OPM-NEXT: unreachable
312295
; IS__CGSCC_OPM: 4:
313-
; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = tail call i8* @f3b(i8* nonnull @a2)
314-
; IS__CGSCC_OPM-NEXT: br label [[TMP6]]
315-
; IS__CGSCC_OPM: 6:
316-
; IS__CGSCC_OPM-NEXT: [[TMP7:%.*]] = phi i8* [ undef, [[TMP3]] ], [ [[TMP5]], [[TMP4]] ]
317-
; IS__CGSCC_OPM-NEXT: ret i8* [[TMP7]]
296+
; IS__CGSCC_OPM-NEXT: unreachable
318297
;
319298
; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable
320299
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2b
321300
; IS__CGSCC_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
322-
; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null
323-
; IS__CGSCC_NPM-NEXT: br i1 [[TMP2]], label [[TMP4:%.*]], label [[TMP3:%.*]]
301+
; IS__CGSCC_NPM-NEXT: unreachable
302+
; IS__CGSCC_NPM: 2:
303+
; IS__CGSCC_NPM-NEXT: unreachable
324304
; IS__CGSCC_NPM: 3:
325-
; IS__CGSCC_NPM-NEXT: br label [[TMP6:%.*]]
305+
; IS__CGSCC_NPM-NEXT: unreachable
326306
; IS__CGSCC_NPM: 4:
327-
; IS__CGSCC_NPM-NEXT: [[TMP5:%.*]] = tail call i8* @f3b()
328-
; IS__CGSCC_NPM-NEXT: br label [[TMP6]]
329-
; IS__CGSCC_NPM: 6:
330-
; IS__CGSCC_NPM-NEXT: [[TMP7:%.*]] = phi i8* [ undef, [[TMP3]] ], [ [[TMP5]], [[TMP4]] ]
331-
; IS__CGSCC_NPM-NEXT: ret i8* [[TMP7]]
307+
; IS__CGSCC_NPM-NEXT: unreachable
332308
;
333309
%2 = icmp eq i8* %0, null
334310
br i1 %2, label %5, label %3
@@ -353,22 +329,20 @@ define internal i8* @f3b(i8* readnone %0) local_unnamed_addr #0 {
353329
; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable
354330
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3b
355331
; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] {
356-
; IS__CGSCC_OPM-NEXT: [[TMP2:%.*]] = icmp eq i8* [[TMP0]], null
357-
; IS__CGSCC_OPM-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP4:%.*]]
332+
; IS__CGSCC_OPM-NEXT: unreachable
333+
; IS__CGSCC_OPM: 2:
334+
; IS__CGSCC_OPM-NEXT: unreachable
358335
; IS__CGSCC_OPM: 3:
359-
; IS__CGSCC_OPM-NEXT: br label [[TMP4]]
360-
; IS__CGSCC_OPM: 4:
361-
; IS__CGSCC_OPM-NEXT: [[TMP5:%.*]] = phi i8* [ @a2, [[TMP3]] ], [ @a1, [[TMP1:%.*]] ]
362-
; IS__CGSCC_OPM-NEXT: ret i8* [[TMP5]]
336+
; IS__CGSCC_OPM-NEXT: unreachable
363337
;
364-
; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone willreturn uwtable
338+
; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable
365339
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f3b
366-
; IS__CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR0]] {
367-
; IS__CGSCC_NPM-NEXT: br label [[TMP2:%.*]]
368-
; IS__CGSCC_NPM: 1:
340+
; IS__CGSCC_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR1]] {
369341
; IS__CGSCC_NPM-NEXT: unreachable
370342
; IS__CGSCC_NPM: 2:
371-
; IS__CGSCC_NPM-NEXT: ret i8* @a1
343+
; IS__CGSCC_NPM-NEXT: unreachable
344+
; IS__CGSCC_NPM: 3:
345+
; IS__CGSCC_NPM-NEXT: unreachable
372346
;
373347
%2 = icmp eq i8* %0, null
374348
br i1 %2, label %3, label %5
@@ -1042,7 +1016,7 @@ define i32 @musttail_caller_1(i32* %p) {
10421016
; IS__CGSCC____-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1
10431017
; IS__CGSCC____-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]]
10441018
; IS__CGSCC____: mt:
1045-
; IS__CGSCC____-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]]
1019+
; IS__CGSCC____-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR14:[0-9]+]]
10461020
; IS__CGSCC____-NEXT: ret i32 [[V]]
10471021
; IS__CGSCC____: exit:
10481022
; IS__CGSCC____-NEXT: ret i32 0
@@ -1180,7 +1154,7 @@ define i8* @aligned_8_return_caller(i8* align(16) %a, i1 %c1, i1 %c2) {
11801154
; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn
11811155
; IS__CGSCC____-LABEL: define {{[^@]+}}@aligned_8_return_caller
11821156
; IS__CGSCC____-SAME: (i8* nofree readnone align 16 [[A:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR12:[0-9]+]] {
1183-
; IS__CGSCC____-NEXT: [[R:%.*]] = call align 8 i8* @aligned_8_return(i8* noalias nofree readnone align 16 [[A]], i1 [[C1]], i1 [[C2]]) #[[ATTR14:[0-9]+]]
1157+
; IS__CGSCC____-NEXT: [[R:%.*]] = call align 8 i8* @aligned_8_return(i8* noalias nofree readnone align 16 [[A]], i1 [[C1]], i1 [[C2]]) #[[ATTR13:[0-9]+]]
11841158
; IS__CGSCC____-NEXT: ret i8* [[R]]
11851159
;
11861160
%r = call i8* @aligned_8_return(i8* %a, i1 %c1, i1 %c2)
@@ -1218,8 +1192,8 @@ attributes #2 = { null_pointer_is_valid }
12181192
; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readnone willreturn }
12191193
; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nofree nosync nounwind readonly willreturn }
12201194
; IS__CGSCC_OPM: attributes #[[ATTR12]] = { nofree nosync nounwind readnone willreturn }
1221-
; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readonly willreturn }
1222-
; IS__CGSCC_OPM: attributes #[[ATTR14]] = { readnone willreturn }
1195+
; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readnone willreturn }
1196+
; IS__CGSCC_OPM: attributes #[[ATTR14]] = { readonly willreturn }
12231197
;.
12241198
; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone willreturn uwtable }
12251199
; IS__CGSCC_NPM: attributes #[[ATTR1]] = { noinline nounwind uwtable }
@@ -1234,6 +1208,6 @@ attributes #2 = { null_pointer_is_valid }
12341208
; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readnone willreturn }
12351209
; IS__CGSCC_NPM: attributes #[[ATTR11]] = { nofree nosync nounwind readonly willreturn }
12361210
; IS__CGSCC_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind readnone willreturn }
1237-
; IS__CGSCC_NPM: attributes #[[ATTR13]] = { readonly willreturn }
1238-
; IS__CGSCC_NPM: attributes #[[ATTR14]] = { readnone willreturn }
1211+
; IS__CGSCC_NPM: attributes #[[ATTR13]] = { readnone willreturn }
1212+
; IS__CGSCC_NPM: attributes #[[ATTR14]] = { readonly willreturn }
12391213
;.

0 commit comments

Comments
 (0)