diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2019-07-01 13:20:56 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2019-07-01 13:20:56 +0000 |
| commit | c0121bf87415fbc913deabc2f59904dd95feb997 (patch) | |
| tree | 40a38b4d8306df60bc832f7f956452c5b0e8333f /llvm/lib | |
| parent | 3a10810b7ab0c2b54728427cccbbaa16837c093f (diff) | |
| download | bcm5719-llvm-c0121bf87415fbc913deabc2f59904dd95feb997.tar.gz bcm5719-llvm-c0121bf87415fbc913deabc2f59904dd95feb997.zip | |
[mips] Add missing schedinfo for atomic instructions
llvm-svn: 364756
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/Mips/MipsInstrInfo.td | 9 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsScheduleP5600.td | 16 |
2 files changed, 22 insertions, 3 deletions
diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.td b/llvm/lib/Target/Mips/MipsInstrInfo.td index eac4f1917c2..0245627441a 100644 --- a/llvm/lib/Target/Mips/MipsInstrInfo.td +++ b/llvm/lib/Target/Mips/MipsInstrInfo.td @@ -1851,7 +1851,9 @@ class InsBase<string opstr, RegisterOperand RO, Operand PosOpnd, // Atomic instructions with 2 source operands (ATOMIC_SWAP & ATOMIC_LOAD_*). class Atomic2Ops<PatFrag Op, RegisterClass DRC> : PseudoSE<(outs DRC:$dst), (ins PtrRC:$ptr, DRC:$incr), - [(set DRC:$dst, (Op iPTR:$ptr, DRC:$incr))]>; + [(set DRC:$dst, (Op iPTR:$ptr, DRC:$incr))]> { + let hasNoSchedulingInfo = 1; +} class Atomic2OpsPostRA<RegisterClass RC> : PseudoSE<(outs RC:$dst), (ins PtrRC:$ptr, RC:$incr), []> { @@ -1868,7 +1870,9 @@ class Atomic2OpsSubwordPostRA<RegisterClass RC> : // during ISelLowering, which produces the PostRA version of this instruction. class AtomicCmpSwap<PatFrag Op, RegisterClass DRC> : PseudoSE<(outs DRC:$dst), (ins PtrRC:$ptr, DRC:$cmp, DRC:$swap), - [(set DRC:$dst, (Op iPTR:$ptr, DRC:$cmp, DRC:$swap))]>; + [(set DRC:$dst, (Op iPTR:$ptr, DRC:$cmp, DRC:$swap))]> { + let hasNoSchedulingInfo = 1; +} class AtomicCmpSwapPostRA<RegisterClass RC> : PseudoSE<(outs RC:$dst), (ins PtrRC:$ptr, RC:$cmp, RC:$swap), []> { @@ -1883,7 +1887,6 @@ class AtomicCmpSwapSubwordPostRA<RegisterClass RC> : let mayStore = 1; } - class LLBase<string opstr, RegisterOperand RO, DAGOperand MO = mem> : InstSE<(outs RO:$rt), (ins MO:$addr), !strconcat(opstr, "\t$rt, $addr"), [], II_LL, FrmI, opstr> { diff --git a/llvm/lib/Target/Mips/MipsScheduleP5600.td b/llvm/lib/Target/Mips/MipsScheduleP5600.td index a0cd82a1fa2..f529fc41b45 100644 --- a/llvm/lib/Target/Mips/MipsScheduleP5600.td +++ b/llvm/lib/Target/Mips/MipsScheduleP5600.td @@ -593,4 +593,20 @@ def : InstRW<[P5600WriteFPUL], (instregex "^ROUND_(L|W)_(S|D32|D64)$")>; // Reason behind guess: rotr is in the same category and the two register forms // generally follow the immediate forms in this category def : InstRW<[P5600WriteEitherALU], (instrs ROTRV)>; + +// Atomic instructions + +// FIXME: Define `WriteAtomic` in the MipsSchedule.td and +// attach it to the Atomic2OpsPostRA, AtomicCmpSwapPostRA, ... +// classes. Then just define resources for the `WriteAtomic` in each +// machine models. +def P5600Atomic : ProcResource<1> { let BufferSize = 1; } +def P5600WriteAtomic : SchedWriteRes<[P5600Atomic]> { let Latency = 2; } + +def : InstRW<[P5600WriteAtomic], + (instregex "^ATOMIC_SWAP_I(8|16|32|64)_POSTRA$")>; +def : InstRW<[P5600WriteAtomic], + (instregex "^ATOMIC_CMP_SWAP_I(8|16|32|64)_POSTRA$")>; +def : InstRW<[P5600WriteAtomic], + (instregex "^ATOMIC_LOAD_(ADD|SUB|AND|OR|XOR|NAND)_I(8|16|32|64)_POSTRA$")>; } |

