[clang] [lld] [llvm] [LTO] enable `ObjCARCContractPass` only on optimized build (PR #101114)

Nuri Amari via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 29 20:47:15 PDT 2024


================
@@ -588,12 +588,6 @@ bool EmitAssemblyHelper::AddEmitPasses(legacy::PassManager &CodeGenPasses,
   // this also adds codegenerator level optimization passes.
   CodeGenFileType CGFT = getCodeGenFileType(Action);
 
-  // Add ObjC ARC final-cleanup optimizations. This is done as part of the
----------------
NuriAmari wrote:

@cachemeifyoucan As far as I can tell, it's already the case that for non-LTO builds, this pass is only added for optimization level > 0. Is that ok to do for all builds?

I checked and directly providing clang with IR that contains `llvm.objc.clang.arc.use` and compiling it with `-O0` fails instruction selection as a result of not running this pass, so I'm assuming these intrinsics are only introduced at `-O1` or higher.

https://github.com/llvm/llvm-project/pull/101114


More information about the cfe-commits mailing list