@@ -628,12 +628,10 @@ LLVMRustOptimizeWithNewPassManager(
628
628
PTO.LoopVectorization = LoopVectorize;
629
629
PTO.SLPVectorization = SLPVectorize;
630
630
631
- // FIXME: What's this?
632
631
PassInstrumentationCallbacks PIC;
633
632
StandardInstrumentations SI;
634
633
SI.registerCallbacks (PIC);
635
634
636
- // FIXME: PGOOpt
637
635
Optional<PGOOptions> PGOOpt;
638
636
if (PGOGenPath) {
639
637
assert (!PGOUsePath);
@@ -736,14 +734,12 @@ LLVMRustOptimizeWithNewPassManager(
736
734
MPM.addPass (createModuleToFunctionPassAdaptor (std::move (FPM)));
737
735
738
736
MPM.addPass (AlwaysInlinerPass (/* InsertLifetimeIntrinsics=*/ false ));
739
- // FIXME: PGO?
740
737
} else {
741
738
for (const auto &C : PipelineStartEPCallbacks)
742
739
PB.registerPipelineStartEPCallback (C);
743
740
for (const auto &C : OptimizerLastEPCallbacks)
744
741
PB.registerOptimizerLastEPCallback (C);
745
742
746
- // FIXME: Sanitizers? PGO?
747
743
if (PrepareForThinLTO) {
748
744
MPM = PB.buildThinLTOPreLinkDefaultPipeline (OptLevel, DebugPassManager);
749
745
} else if (PrepareForLTO) {
@@ -759,6 +755,10 @@ LLVMRustOptimizeWithNewPassManager(
759
755
MPM.addPass (NameAnonGlobalPass ());
760
756
}
761
757
758
+ // Upgrade all calls to old intrinsics first.
759
+ for (Module::iterator I = TheModule->begin (), E = TheModule->end (); I != E;)
760
+ UpgradeCallsToIntrinsic (&*I++); // must be post-increment, as we remove
761
+
762
762
MPM.run (*TheModule, MAM);
763
763
}
764
764
0 commit comments