diff options
Diffstat (limited to 'contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp')
-rw-r--r-- | contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp b/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp index 7edba92..81af4db 100644 --- a/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp +++ b/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp @@ -40,6 +40,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetRegisterInfo.h" @@ -199,10 +200,7 @@ static bool commonChecksToProhibitNewValueJump(bool afterRA, // of registers by individual passes in the backend. At this time, // we don't know the scope of usage and definitions of these // instructions. - if (MII->getOpcode() == Hexagon::TFR_condset_ii || - MII->getOpcode() == Hexagon::TFR_condset_ri || - MII->getOpcode() == Hexagon::TFR_condset_ir || - MII->getOpcode() == Hexagon::LDriw_pred || + if (MII->getOpcode() == Hexagon::LDriw_pred || MII->getOpcode() == Hexagon::STriw_pred) return false; } @@ -299,48 +297,48 @@ static unsigned getNewValueJumpOpcode(MachineInstr *MI, int reg, switch (MI->getOpcode()) { case Hexagon::C2_cmpeq: - return taken ? Hexagon::CMPEQrr_t_Jumpnv_t_V4 - : Hexagon::CMPEQrr_t_Jumpnv_nt_V4; + return taken ? Hexagon::J4_cmpeq_t_jumpnv_t + : Hexagon::J4_cmpeq_t_jumpnv_nt; case Hexagon::C2_cmpeqi: { if (reg >= 0) - return taken ? Hexagon::CMPEQri_t_Jumpnv_t_V4 - : Hexagon::CMPEQri_t_Jumpnv_nt_V4; + return taken ? Hexagon::J4_cmpeqi_t_jumpnv_t + : Hexagon::J4_cmpeqi_t_jumpnv_nt; else - return taken ? Hexagon::CMPEQn1_t_Jumpnv_t_V4 - : Hexagon::CMPEQn1_t_Jumpnv_nt_V4; + return taken ? Hexagon::J4_cmpeqn1_t_jumpnv_t + : Hexagon::J4_cmpeqn1_t_jumpnv_nt; } case Hexagon::C2_cmpgt: { if (secondRegNewified) - return taken ? Hexagon::CMPLTrr_t_Jumpnv_t_V4 - : Hexagon::CMPLTrr_t_Jumpnv_nt_V4; + return taken ? Hexagon::J4_cmplt_t_jumpnv_t + : Hexagon::J4_cmplt_t_jumpnv_nt; else - return taken ? Hexagon::CMPGTrr_t_Jumpnv_t_V4 - : Hexagon::CMPGTrr_t_Jumpnv_nt_V4; + return taken ? Hexagon::J4_cmpgt_t_jumpnv_t + : Hexagon::J4_cmpgt_t_jumpnv_nt; } case Hexagon::C2_cmpgti: { if (reg >= 0) - return taken ? Hexagon::CMPGTri_t_Jumpnv_t_V4 - : Hexagon::CMPGTri_t_Jumpnv_nt_V4; + return taken ? Hexagon::J4_cmpgti_t_jumpnv_t + : Hexagon::J4_cmpgti_t_jumpnv_nt; else - return taken ? Hexagon::CMPGTn1_t_Jumpnv_t_V4 - : Hexagon::CMPGTn1_t_Jumpnv_nt_V4; + return taken ? Hexagon::J4_cmpgtn1_t_jumpnv_t + : Hexagon::J4_cmpgtn1_t_jumpnv_nt; } case Hexagon::C2_cmpgtu: { if (secondRegNewified) - return taken ? Hexagon::CMPLTUrr_t_Jumpnv_t_V4 - : Hexagon::CMPLTUrr_t_Jumpnv_nt_V4; + return taken ? Hexagon::J4_cmpltu_t_jumpnv_t + : Hexagon::J4_cmpltu_t_jumpnv_nt; else - return taken ? Hexagon::CMPGTUrr_t_Jumpnv_t_V4 - : Hexagon::CMPGTUrr_t_Jumpnv_nt_V4; + return taken ? Hexagon::J4_cmpgtu_t_jumpnv_t + : Hexagon::J4_cmpgtu_t_jumpnv_nt; } case Hexagon::C2_cmpgtui: - return taken ? Hexagon::CMPGTUri_t_Jumpnv_t_V4 - : Hexagon::CMPGTUri_t_Jumpnv_nt_V4; + return taken ? Hexagon::J4_cmpgtui_t_jumpnv_t + : Hexagon::J4_cmpgtui_t_jumpnv_nt; default: llvm_unreachable("Could not find matching New Value Jump instruction."); @@ -355,19 +353,15 @@ bool HexagonNewValueJump::runOnMachineFunction(MachineFunction &MF) { << "********** Function: " << MF.getName() << "\n"); -#if 0 - // for now disable this, if we move NewValueJump before register - // allocation we need this information. - LiveVariables &LVs = getAnalysis<LiveVariables>(); -#endif + // If we move NewValueJump before register allocation we'll need live variable + // analysis here too. QII = static_cast<const HexagonInstrInfo *>(MF.getSubtarget().getInstrInfo()); QRI = static_cast<const HexagonRegisterInfo *>( MF.getSubtarget().getRegisterInfo()); MBPI = &getAnalysis<MachineBranchProbabilityInfo>(); - if (!QRI->Subtarget.hasV4TOps() || - DisableNewValueJumps) { + if (DisableNewValueJumps) { return false; } |