mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Auto merge of #120368 - klensy:llvm-fixme, r=nikic
llvm-wrapper: remove llvm 12 hack
effectively reverts 9a8acea783
r? `@nikic`
This commit is contained in:
commit
037f515caf
@ -934,10 +934,8 @@ LLVMRustOptimize(
|
||||
} else {
|
||||
for (const auto &C : PipelineStartEPCallbacks)
|
||||
PB.registerPipelineStartEPCallback(C);
|
||||
if (OptStage != LLVMRustOptStage::PreLinkThinLTO) {
|
||||
for (const auto &C : OptimizerLastEPCallbacks)
|
||||
PB.registerOptimizerLastEPCallback(C);
|
||||
}
|
||||
for (const auto &C : OptimizerLastEPCallbacks)
|
||||
PB.registerOptimizerLastEPCallback(C);
|
||||
|
||||
switch (OptStage) {
|
||||
case LLVMRustOptStage::PreLinkNoLTO:
|
||||
@ -945,14 +943,7 @@ LLVMRustOptimize(
|
||||
break;
|
||||
case LLVMRustOptStage::PreLinkThinLTO:
|
||||
MPM = PB.buildThinLTOPreLinkDefaultPipeline(OptLevel);
|
||||
// The ThinLTOPreLink pipeline already includes ThinLTOBuffer passes. However, callback
|
||||
// passes may still run afterwards. This means we need to run the buffer passes again.
|
||||
// FIXME: In LLVM 13, the ThinLTOPreLink pipeline also runs OptimizerLastEPCallbacks
|
||||
// before the RequiredLTOPreLinkPasses, in which case we can remove these hacks.
|
||||
if (OptimizerLastEPCallbacks.empty())
|
||||
NeedThinLTOBufferPasses = false;
|
||||
for (const auto &C : OptimizerLastEPCallbacks)
|
||||
C(MPM, OptLevel);
|
||||
NeedThinLTOBufferPasses = false;
|
||||
break;
|
||||
case LLVMRustOptStage::PreLinkFatLTO:
|
||||
MPM = PB.buildLTOPreLinkDefaultPipeline(OptLevel);
|
||||
|
Loading…
Reference in New Issue
Block a user