@@ -776,6 +776,8 @@ void ReducerWorkItem::readBitcode(MemoryBufferRef Data, LLVMContext &Ctx,
776776}
777777
778778void ReducerWorkItem::writeBitcode (raw_ostream &OutStream) const {
779+ const bool ShouldPreserveUseListOrder = true ;
780+
779781 if (LTOInfo && LTOInfo->IsThinLTO && LTOInfo->EnableSplitLTOUnit ) {
780782 PassBuilder PB;
781783 LoopAnalysisManager LAM;
@@ -788,7 +790,8 @@ void ReducerWorkItem::writeBitcode(raw_ostream &OutStream) const {
788790 PB.registerLoopAnalyses (LAM);
789791 PB.crossRegisterProxies (LAM, FAM, CGAM, MAM);
790792 ModulePassManager MPM;
791- MPM.addPass (ThinLTOBitcodeWriterPass (OutStream, nullptr ));
793+ MPM.addPass (ThinLTOBitcodeWriterPass (OutStream, nullptr ,
794+ ShouldPreserveUseListOrder));
792795 MPM.run (*M, MAM);
793796 } else {
794797 std::unique_ptr<ModuleSummaryIndex> Index;
@@ -797,8 +800,8 @@ void ReducerWorkItem::writeBitcode(raw_ostream &OutStream) const {
797800 Index = std::make_unique<ModuleSummaryIndex>(
798801 buildModuleSummaryIndex (*M, nullptr , &PSI));
799802 }
800- WriteBitcodeToFile (getModule (), OutStream,
801- /* ShouldPreserveUseListOrder= */ true , Index.get ());
803+ WriteBitcodeToFile (getModule (), OutStream, ShouldPreserveUseListOrder,
804+ Index.get ());
802805 }
803806}
804807
0 commit comments