Skip to content

Commit 5d20243

Browse files
nikicmemfrob
authored andcommitted
[IR] Mark assume/annotation as InaccessibleMemOnly
These intrinsics don't need to be marked as arbitrary writing, it's sufficient to write inaccessible memory (aka "side effect") to preserve control dependencies. This means less special-casing in BasicAA. This is intended as an alternative to D98925. Differential Revision: https://reviews.llvm.org/D99022
1 parent 88f1a2f commit 5d20243

File tree

7 files changed

+44
-57
lines changed

7 files changed

+44
-57
lines changed

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,10 @@ def int_pcmarker : DefaultAttrsIntrinsic<[], [llvm_i32_ty]>;
541541

542542
def int_readcyclecounter : DefaultAttrsIntrinsic<[llvm_i64_ty]>;
543543

544-
// The assume intrinsic is marked as arbitrarily writing so that proper
545-
// control dependencies will be maintained.
546-
def int_assume : DefaultAttrsIntrinsic<[], [llvm_i1_ty], [IntrWillReturn,
547-
NoUndef<ArgIndex<0>>]>;
544+
// The assume intrinsic is marked InaccessibleMemOnly so that proper control
545+
// dependencies will be maintained.
546+
def int_assume : DefaultAttrsIntrinsic<
547+
[], [llvm_i1_ty], [IntrInaccessibleMemOnly, NoUndef<ArgIndex<0>>]>;
548548

549549
// 'llvm.experimental.noalias.scope.decl' intrinsic: Inserted at the location of
550550
// noalias scope declaration. Makes it possible to identify that a noalias scope
@@ -972,18 +972,19 @@ def int_eh_sjlj_setup_dispatch : Intrinsic<[], []>;
972972

973973
//===---------------- Generic Variable Attribute Intrinsics----------------===//
974974
//
975-
def int_var_annotation : DefaultAttrsIntrinsic<[],
976-
[llvm_ptr_ty, llvm_ptr_ty,
977-
llvm_ptr_ty, llvm_i32_ty, llvm_ptr_ty],
978-
[IntrWillReturn], "llvm.var.annotation">;
979-
def int_ptr_annotation : DefaultAttrsIntrinsic<[LLVMAnyPointerType<llvm_anyint_ty>],
980-
[LLVMMatchType<0>, llvm_ptr_ty, llvm_ptr_ty,
981-
llvm_i32_ty, llvm_ptr_ty],
982-
[IntrWillReturn], "llvm.ptr.annotation">;
983-
def int_annotation : DefaultAttrsIntrinsic<[llvm_anyint_ty],
984-
[LLVMMatchType<0>, llvm_ptr_ty,
985-
llvm_ptr_ty, llvm_i32_ty],
986-
[IntrWillReturn], "llvm.annotation">;
975+
def int_var_annotation : DefaultAttrsIntrinsic<
976+
[], [llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty, llvm_i32_ty, llvm_ptr_ty],
977+
[IntrInaccessibleMemOnly], "llvm.var.annotation">;
978+
979+
def int_ptr_annotation : DefaultAttrsIntrinsic<
980+
[LLVMAnyPointerType<llvm_anyint_ty>],
981+
[LLVMMatchType<0>, llvm_ptr_ty, llvm_ptr_ty, llvm_i32_ty, llvm_ptr_ty],
982+
[IntrInaccessibleMemOnly], "llvm.ptr.annotation">;
983+
984+
def int_annotation : DefaultAttrsIntrinsic<
985+
[llvm_anyint_ty],
986+
[LLVMMatchType<0>, llvm_ptr_ty, llvm_ptr_ty, llvm_i32_ty],
987+
[IntrInaccessibleMemOnly], "llvm.annotation">;
987988

988989
// Annotates the current program point with metadata strings which are emitted
989990
// as CodeView debug info records. This is expensive, as it disables inlining

llvm/lib/Analysis/BasicAliasAnalysis.cpp

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -939,15 +939,9 @@ ModRefInfo BasicAAResult::getModRefInfo(const CallBase *Call,
939939
return rv;
940940
}
941941

942-
// While the assume intrinsic is marked as arbitrarily writing so that
943-
// proper control dependencies will be maintained, it never aliases any
944-
// particular memory location.
945-
if (isIntrinsicCall(Call, Intrinsic::assume))
946-
return ModRefInfo::NoModRef;
947-
948-
// Like assumes, guard intrinsics are also marked as arbitrarily writing so
949-
// that proper control dependencies are maintained but they never mods any
950-
// particular memory location.
942+
// Guard intrinsics are marked as arbitrarily writing so that proper control
943+
// dependencies are maintained but they never mods any particular memory
944+
// location.
951945
//
952946
// *Unlike* assumes, guard intrinsics are modeled as reading memory since the
953947
// heap state at the point the guard is issued needs to be consistent in case
@@ -991,16 +985,9 @@ ModRefInfo BasicAAResult::getModRefInfo(const CallBase *Call,
991985
ModRefInfo BasicAAResult::getModRefInfo(const CallBase *Call1,
992986
const CallBase *Call2,
993987
AAQueryInfo &AAQI) {
994-
// While the assume intrinsic is marked as arbitrarily writing so that
995-
// proper control dependencies will be maintained, it never aliases any
996-
// particular memory location.
997-
if (isIntrinsicCall(Call1, Intrinsic::assume) ||
998-
isIntrinsicCall(Call2, Intrinsic::assume))
999-
return ModRefInfo::NoModRef;
1000-
1001-
// Like assumes, guard intrinsics are also marked as arbitrarily writing so
1002-
// that proper control dependencies are maintained but they never mod any
1003-
// particular memory location.
988+
// Guard intrinsics are marked as arbitrarily writing so that proper control
989+
// dependencies are maintained but they never mods any particular memory
990+
// location.
1004991
//
1005992
// *Unlike* assumes, guard intrinsics are modeled as reading memory since the
1006993
// heap state at the point the guard is issued needs to be consistent in case

llvm/test/Transforms/Attributor/dereferenceable-1.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ declare void @llvm.assume(i1)
11541154
; IS__TUNIT_OPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly }
11551155
; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind writeonly }
11561156
; IS__TUNIT_OPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind }
1157-
; IS__TUNIT_OPM: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind willreturn }
1157+
; IS__TUNIT_OPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
11581158
; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind writeonly }
11591159
; IS__TUNIT_OPM: attributes #[[ATTR7]] = { willreturn }
11601160
; IS__TUNIT_OPM: attributes #[[ATTR8]] = { nounwind }
@@ -1164,7 +1164,7 @@ declare void @llvm.assume(i1)
11641164
; IS__TUNIT_NPM: attributes #[[ATTR2]] = { argmemonly nofree nosync nounwind willreturn writeonly }
11651165
; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree nosync nounwind willreturn }
11661166
; IS__TUNIT_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly }
1167-
; IS__TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind willreturn }
1167+
; IS__TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
11681168
; IS__TUNIT_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly }
11691169
; IS__TUNIT_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly }
11701170
; IS__TUNIT_NPM: attributes #[[ATTR8]] = { willreturn }
@@ -1176,7 +1176,7 @@ declare void @llvm.assume(i1)
11761176
; IS__CGSCC_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind writeonly }
11771177
; IS__CGSCC_OPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind }
11781178
; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind writeonly }
1179-
; IS__CGSCC_OPM: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind willreturn }
1179+
; IS__CGSCC_OPM: attributes #[[ATTR6:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
11801180
; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nosync nounwind writeonly }
11811181
; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree nosync nounwind writeonly }
11821182
; IS__CGSCC_OPM: attributes #[[ATTR9]] = { willreturn }
@@ -1187,7 +1187,7 @@ declare void @llvm.assume(i1)
11871187
; IS__CGSCC_NPM: attributes #[[ATTR2]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
11881188
; IS__CGSCC_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn }
11891189
; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind writeonly }
1190-
; IS__CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { nofree nosync nounwind willreturn }
1190+
; IS__CGSCC_NPM: attributes #[[ATTR5:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
11911191
; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nosync nounwind willreturn writeonly }
11921192
; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree nosync nounwind writeonly }
11931193
; IS__CGSCC_NPM: attributes #[[ATTR8]] = { willreturn }

llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,22 +320,22 @@ declare void @dummy(i1) nounwind
320320
declare void @llvm.experimental.guard(i1, ...)
321321
;.
322322
; IS__TUNIT_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone }
323-
; IS__TUNIT_OPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind willreturn }
323+
; IS__TUNIT_OPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
324324
; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nounwind }
325325
; IS__TUNIT_OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn }
326326
;.
327327
; IS__TUNIT_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind readnone willreturn }
328-
; IS__TUNIT_NPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind willreturn }
328+
; IS__TUNIT_NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
329329
; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nounwind }
330330
; IS__TUNIT_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn }
331331
;.
332332
; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone }
333-
; IS__CGSCC_OPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind willreturn }
333+
; IS__CGSCC_OPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
334334
; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nounwind }
335335
; IS__CGSCC_OPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn }
336336
;.
337337
; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn }
338-
; IS__CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { nofree nosync nounwind willreturn }
338+
; IS__CGSCC_NPM: attributes #[[ATTR1:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
339339
; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nounwind }
340340
; IS__CGSCC_NPM: attributes #[[ATTR3:[0-9]+]] = { nofree nosync willreturn }
341341
;.

llvm/test/Transforms/Attributor/nofree.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ attributes #2 = { nobuiltin nounwind }
478478
; IS__TUNIT____: attributes #[[ATTR6:[0-9]+]] = { nofree nosync nounwind readnone speculatable willreturn }
479479
; IS__TUNIT____: attributes #[[ATTR7]] = { nofree nounwind }
480480
; IS__TUNIT____: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind }
481-
; IS__TUNIT____: attributes #[[ATTR9:[0-9]+]] = { nofree nosync nounwind willreturn }
481+
; IS__TUNIT____: attributes #[[ATTR9:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
482482
; IS__TUNIT____: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn }
483483
; IS__TUNIT____: attributes #[[ATTR11]] = { readnone willreturn }
484484
; IS__TUNIT____: attributes #[[ATTR12]] = { willreturn }
@@ -493,7 +493,7 @@ attributes #2 = { nobuiltin nounwind }
493493
; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree noinline nosync nounwind readnone uwtable willreturn }
494494
; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree nounwind }
495495
; IS__CGSCC_OPM: attributes #[[ATTR9:[0-9]+]] = { nobuiltin nofree nounwind }
496-
; IS__CGSCC_OPM: attributes #[[ATTR10:[0-9]+]] = { nofree nosync nounwind willreturn }
496+
; IS__CGSCC_OPM: attributes #[[ATTR10:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
497497
; IS__CGSCC_OPM: attributes #[[ATTR11:[0-9]+]] = { nounwind willreturn }
498498
; IS__CGSCC_OPM: attributes #[[ATTR12]] = { readnone willreturn }
499499
; IS__CGSCC_OPM: attributes #[[ATTR13]] = { willreturn }
@@ -508,7 +508,7 @@ attributes #2 = { nobuiltin nounwind }
508508
; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree noinline nosync nounwind readnone uwtable willreturn }
509509
; IS__CGSCC_NPM: attributes #[[ATTR8]] = { nofree nounwind }
510510
; IS__CGSCC_NPM: attributes #[[ATTR9:[0-9]+]] = { nobuiltin nofree nounwind }
511-
; IS__CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { nofree nosync nounwind willreturn }
511+
; IS__CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { inaccessiblememonly nofree nosync nounwind willreturn }
512512
; IS__CGSCC_NPM: attributes #[[ATTR11:[0-9]+]] = { nounwind willreturn }
513513
; IS__CGSCC_NPM: attributes #[[ATTR12]] = { readnone willreturn }
514514
; IS__CGSCC_NPM: attributes #[[ATTR13]] = { willreturn }

llvm/test/Transforms/Attributor/nonnull.ll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ define i8* @test2(i8* nonnull %p) {
3737

3838
define i8* @test2A(i1 %c, i8* %ret) {
3939
; ATTRIBUTOR: define nonnull i8* @test2A(i1 %c, i8* nofree nonnull readnone returned %ret)
40-
; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
40+
; NOT_CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
4141
; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test2A
4242
; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] {
4343
; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
@@ -48,7 +48,7 @@ define i8* @test2A(i1 %c, i8* %ret) {
4848
; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nonnull"(i8* [[RET]]) ]
4949
; NOT_CGSCC_OPM-NEXT: ret i8* [[RET]]
5050
;
51-
; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
51+
; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
5252
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2A
5353
; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0:[0-9]+]] {
5454
; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
@@ -70,7 +70,7 @@ B:
7070

7171
define i8* @test2B(i1 %c, i8* %ret) {
7272
; ATTRIBUTOR: define nonnull dereferenceable(4) i8* @test2B(i1 %c, i8* nofree nonnull readnone returned dereferenceable(4) %ret)
73-
; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
73+
; NOT_CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
7474
; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test2B
7575
; NOT_CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] {
7676
; NOT_CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
@@ -81,7 +81,7 @@ define i8* @test2B(i1 %c, i8* %ret) {
8181
; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "dereferenceable"(i8* [[RET]], i32 4) ]
8282
; NOT_CGSCC_OPM-NEXT: ret i8* [[RET]]
8383
;
84-
; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
84+
; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
8585
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2B
8686
; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i8* nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR0]] {
8787
; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
@@ -335,14 +335,14 @@ define i8* @test9(i8* %a, i64 %n) {
335335
; ATTRIBUTOR_OPM: define i8* @test10
336336
; ATTRIBUTOR_NPM: define nonnull i8* @test10
337337
define i8* @test10(i8* %a, i64 %n) {
338-
; NOT_CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
338+
; NOT_CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
339339
; NOT_CGSCC_OPM-LABEL: define {{[^@]+}}@test10
340340
; NOT_CGSCC_OPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] {
341341
; NOT_CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]]
342342
; NOT_CGSCC_OPM-NEXT: [[B:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 [[N]]
343343
; NOT_CGSCC_OPM-NEXT: ret i8* [[B]]
344344
;
345-
; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
345+
; IS__CGSCC_OPM: Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
346346
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10
347347
; IS__CGSCC_OPM-SAME: (i8* nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] {
348348
; IS__CGSCC_OPM-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR13]]
@@ -1718,7 +1718,7 @@ declare void @nonnull_callee(i8* nonnull %p)
17181718
attributes #0 = { null_pointer_is_valid }
17191719
attributes #1 = { nounwind willreturn}
17201720
;.
1721-
; IS__TUNIT____: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn }
1721+
; IS__TUNIT____: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn }
17221722
; IS__TUNIT____: attributes #[[ATTR1]] = { nofree nosync nounwind readnone willreturn }
17231723
; IS__TUNIT____: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone }
17241724
; IS__TUNIT____: attributes #[[ATTR3]] = { noreturn }
@@ -1734,7 +1734,7 @@ attributes #1 = { nounwind willreturn}
17341734
; IS__TUNIT____: attributes #[[ATTR13]] = { nofree nosync nounwind readonly }
17351735
; IS__TUNIT____: attributes #[[ATTR14]] = { readonly willreturn }
17361736
;.
1737-
; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn }
1737+
; IS__CGSCC_OPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn }
17381738
; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
17391739
; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone }
17401740
; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn }
@@ -1751,7 +1751,7 @@ attributes #1 = { nounwind willreturn}
17511751
; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nofree nosync nounwind readonly }
17521752
; IS__CGSCC_OPM: attributes #[[ATTR15]] = { readonly willreturn }
17531753
;.
1754-
; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree nosync nounwind willreturn }
1754+
; IS__CGSCC_NPM: attributes #[[ATTR0]] = { inaccessiblememonly nofree nosync nounwind willreturn }
17551755
; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
17561756
; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree noreturn nosync nounwind readnone }
17571757
; IS__CGSCC_NPM: attributes #[[ATTR3]] = { noreturn }

llvm/test/Transforms/InstCombine/annotation-intrinsic.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ define dso_local i32 @annotated(i32* %c) local_unnamed_addr #0 {
1313
; CHECK-NEXT: entry:
1414
; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[C:%.*]], align 4
1515
; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.annotation.i32(i32 [[TMP0]], i8* undef, i8* undef, i32 undef)
16-
; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* [[C]], align 4
17-
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]]
16+
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP0]]
1817
; CHECK-NEXT: ret i32 [[ADD]]
1918
;
2019
entry:

0 commit comments

Comments
 (0)