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

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 5 12:07:12 PDT 2024


nikic wrote:

> > The pipeline test changes here still look problematic. Can you make the ObjCARCContract pass preserve the DT?
> 
> ObjCARCContractPass can't preserve the DT at static time, it may alter CFG (See more in [this patch](https://reviews.llvm.org/D92808)). Unfortunately, legacy PM won't let us preserve the DT at runtime.

You don't need to dynamically preserve the DT, you should mark it as unconditionally preserved in AnalysisUsage. From a quick glance at the pass, the only CFG change it does is critical edge splitting, and DT is already passed while doing that, so it will be updated: https://github.com/llvm/llvm-project/blob/f1fd9d716decf3513c8ae54df1d60462eb878fb5/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp#L61 You're currently just not telling the pass managers that this is the case.

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


More information about the cfe-commits mailing list