[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-11 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Should `objc` be in the attribute somewhere to avoid any future awkwardness? I don't remember what we've called similar attributes. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62831/new/ https://reviews.llvm.org/D62831 ___

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-10 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I agree. Something like `arc_inert` is probably a better name in this case for the reason you mentioned. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62831/new/ https://reviews.llvm.org/D62831 ___

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-10 Thread Michael Gottesman via Phabricator via cfe-commits
gottesmm added a comment. This is exactly what I was imagining! This will enable the frontend to opt into this optimization without having to touch the optimizer. One nit: can we use a different name than "arc_retain_agnostic". Have you considered something like "arc_inert"? My fear is that at

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-05 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. I think this looks good from a clang perspective. No reason to land it before the dust settles on D62433 though. Do you think we can also add this attribute (or something like it) onto allocas of `_NSConcreteStackBlock`s? They a

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: test/CodeGenObjC/local-static-block.m:5 +// CHECK: @{{.*}} = internal constant { i8**, i32, i32, i8*, %struct.__block_descriptor* } { i8** @_NSConcreteGlobalBlock, i32 1342177280, i32 0, i8* bitcast (%0* (i8*, %0*, i64)* @{{.*}} to

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak updated this revision to Diff 203247. ahatanak marked 5 inline comments as done. ahatanak added a comment. Address review comments. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62831/new/ https://reviews.llvm.org/D62831 Files: lib/CodeGen/CGBlocks.cp

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak marked 2 inline comments as done. ahatanak added inline comments. Comment at: test/CodeGenObjC/local-static-block.m:59-60 // CHECK-LABEL-LP64: define void @FUNC2( // CHECK: define internal void @_block_invoke{{.*}}( // CHECK: call void %{{.*}}(i8* bitcast ({ i8**, i32

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-05 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: lib/CodeGen/CGBlocks.cpp:1441 + cast(literal)->addAttribute("arc_retain_agnostic"); + Can't you just declare `literal` as a GlobalVariable instead of immediately casting it? Comment at: lib

[PATCH] D62831: [CodeGen][ObjC] Add attribute "arc_retain_agnostic" to ObjC globals that are retain-agnostic

2019-06-03 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision. ahatanak added reviewers: rjmccall, erik.pilkington, pete, gottesmm. ahatanak added a project: clang. Herald added subscribers: dexonsmith, jkorous. This is needed to enable the optimization in this patch: https://reviews.llvm.org/D62433 Repository: rC Clang h