1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00

[Hexagon] Adding change of flow max 1 (cofMax1) TS flag for marking this restriction rather than implying it from TypeJR.

llvm-svn: 283665
This commit is contained in:
Colin LeMahieu 2016-10-08 17:18:51 +00:00
parent 7c2fc64206
commit 6f13f69e9a
5 changed files with 16 additions and 4 deletions

View File

@ -179,6 +179,9 @@ class InstHexagon<dag outs, dag ins, string asmstr, list<dag> pattern,
bits<1> isAccumulator = 0;
let TSFlags{54} = isAccumulator;
bit cofMax1 = 0;
let TSFlags{60} = cofMax1;
// Fields used for relation models.
bit isNonTemporal = 0;
string isNT = ""; // set to "true" for non-temporal vector stores.

View File

@ -204,6 +204,9 @@ namespace HexagonII {
// Complex XU, prevent xu competition by prefering slot3
PrefersSlot3Pos = 55,
PrefersSlot3Mask = 0x1,
CofMax1Pos = 60,
CofMax1Mask = 0x1
};
// *** The code above must match HexagonInstrFormat*.td *** //

View File

@ -431,6 +431,11 @@ bool HexagonMCInstrInfo::isCanon(MCInstrInfo const &MCII, MCInst const &MCI) {
HexagonMCInstrInfo::getType(MCII, MCI) != HexagonII::TypeENDLOOP);
}
bool HexagonMCInstrInfo::isCofMax1(MCInstrInfo const &MCII, MCInst const &MCI) {
const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
return ((F >> HexagonII::CofMax1Pos) & HexagonII::CofMax1Mask);
}
bool HexagonMCInstrInfo::isCompound(MCInstrInfo const &MCII,
MCInst const &MCI) {
return (getType(MCII, MCI) == HexagonII::TypeCOMPOUND);

View File

@ -170,6 +170,7 @@ bool isBundle(MCInst const &MCI);
// Return whether the insn is an actual insn.
bool isCanon(MCInstrInfo const &MCII, MCInst const &MCI);
bool isCofMax1(MCInstrInfo const &MCII, MCInst const &MCI);
bool isCompound(MCInstrInfo const &MCII, MCInst const &MCI);
// Return the duplex iclass given the two duplex classes

View File

@ -171,7 +171,7 @@ bool HexagonShuffler::check() {
unsigned slotJump = slotFirstJump;
unsigned slotLoadStore = slotFirstLoadStore;
// Number of branches, solo branches, indirect branches.
unsigned jumps = 0, jump1 = 0, jumpr = 0;
unsigned jumps = 0, jump1 = 0;
// Number of memory operations, loads, solo loads, stores, solo stores, single
// stores.
unsigned memory = 0, loads = 0, load0 = 0, stores = 0, store0 = 0, store1 = 0;
@ -207,6 +207,8 @@ bool HexagonShuffler::check() {
++pSlot3Cnt;
slot3ISJ = ISJ;
}
if (HexagonMCInstrInfo::isCofMax1(MCII, *ID))
++jump1;
switch (HexagonMCInstrInfo::getType(MCII, *ID)) {
case HexagonII::TypeXTYPE:
@ -214,8 +216,6 @@ bool HexagonShuffler::check() {
++xtypeFloat;
break;
case HexagonII::TypeJR:
++jumpr;
LLVM_FALLTHROUGH;
case HexagonII::TypeJ:
++jumps;
break;
@ -304,7 +304,7 @@ bool HexagonShuffler::check() {
if (HexagonMCInstrInfo::getDesc(MCII, *ID).isBranch() ||
HexagonMCInstrInfo::getDesc(MCII, *ID).isCall())
if (jumps > 1) {
if (jumpr || slotJump < slotLastJump) {
if (slotJump < slotLastJump) {
// Error if indirect branch with another branch or
// no more slots available for branches.
Error = SHUFFLE_ERROR_BRANCHES;