mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Enable early if conversion on PPC
On cores for which we know the misprediction penalty, and we have the isel instruction, we can profitably perform early if conversion. This enables us to replace some small branch sequences with selects and avoid the potential stalls from mispredicting the branches. Enabling this feature required implementing canInsertSelect and insertSelect in PPCInstrInfo; isel code in PPCISelLowering was refactored to use these functions as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178926 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -86,7 +86,12 @@ public:
|
||||
return getTM<PPCTargetMachine>();
|
||||
}
|
||||
|
||||
const PPCSubtarget &getPPCSubtarget() const {
|
||||
return *getPPCTargetMachine().getSubtargetImpl();
|
||||
}
|
||||
|
||||
virtual bool addPreRegAlloc();
|
||||
virtual bool addILPOpts();
|
||||
virtual bool addInstSelector();
|
||||
virtual bool addPreEmitPass();
|
||||
};
|
||||
@@ -103,6 +108,15 @@ bool PPCPassConfig::addPreRegAlloc() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PPCPassConfig::addILPOpts() {
|
||||
if (getPPCSubtarget().hasISEL()) {
|
||||
addPass(&EarlyIfConverterID);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PPCPassConfig::addInstSelector() {
|
||||
// Install an instruction selector.
|
||||
addPass(createPPCISelDag(getPPCTargetMachine()));
|
||||
|
||||
Reference in New Issue
Block a user