Files
FEX-Emu--FEX/External/FEXCore/Source/Interface/IR/PassManager.cpp
T
Stefanos Kornilios Mitsis Poiitidis 2fb68583a0 IR: Add DeadFlagStoreElimination
Mutlblock pass that eliminates flag stores that are never read.

This is a sibling to RCLSE and will likely be absorbed by it when we add MB support there.
2020-09-02 21:57:39 +03:00

44 lines
1.3 KiB
C++

#include "Interface/IR/Passes.h"
#include "Interface/IR/Passes/RegisterAllocationPass.h"
#include "Interface/IR/PassManager.h"
namespace FEXCore::IR {
void PassManager::AddDefaultPasses() {
InsertPass(CreateContextLoadStoreElimination());
InsertPass(CreateConstProp());
////// InsertPass(CreateDeadFlagCalculationEliminination());
InsertPass(CreateDeadFlagStoreElimination());
InsertPass(CreateSyscallOptimization());
InsertPass(CreatePassDeadCodeElimination());
// If the IR is compacted post-RA then the node indexing gets messed up and the backend isn't able to find the register assigned to a node
// Compact before IR, don't worry about RA generating spills/fills
InsertPass(CreateIRCompaction());
}
void PassManager::AddDefaultValidationPasses() {
#if defined(ASSERTIONS_ENABLED) && ASSERTIONS_ENABLED
InsertValidationPass(Validation::CreatePhiValidation());
InsertValidationPass(Validation::CreateIRValidation());
InsertValidationPass(Validation::CreateValueDominanceValidation());
#endif
}
bool PassManager::Run(IREmitter *IREmit) {
bool Changed = false;
for (auto const &Pass : Passes) {
Changed |= Pass->Run(IREmit);
}
#if defined(ASSERTIONS_ENABLED) && ASSERTIONS_ENABLED
for (auto const &Pass : ValidationPasses) {
Changed |= Pass->Run(IREmit);
}
#endif
return Changed;
}
}