diff options
author | Wang Pengcheng <wangpengcheng.pp@bytedance.com> | 2024-01-05 22:44:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-05 22:44:04 +0800 |
commit | a0e6b7c0429204ac42095be09bd1d5dcad4a052a (patch) | |
tree | d8a4c14ff6bf4194bc7f222f95e01f39d42e65a6 /llvm/lib/Object/ObjectFile.cpp | |
parent | 65df69619c49717da64140baddda0f04ed62ffdf (diff) | |
download | llvm-a0e6b7c0429204ac42095be09bd1d5dcad4a052a.zip llvm-a0e6b7c0429204ac42095be09bd1d5dcad4a052a.tar.gz llvm-a0e6b7c0429204ac42095be09bd1d5dcad4a052a.tar.bz2 |
[TableGen] Add a backend to generate MacroFusion predicators (#72222)
`FusionPredicate` is used to predicate if target instruction matches
the requirement. The targets can be firstMI, secondMI or both.
The `Fusion` contains a list of `FusionPredicate`. The generated code
will be like:
```
bool isNAME(const TargetInstrInfo &TII,
const TargetSubtargetInfo &STI,
const MachineInstr *FirstMI,
const MachineInstr &SecondMI) {
auto &MRI = SecondMI.getMF()->getRegInfo();
/* Predicates */
return true;
}
```
A boilerplate class called `SimpleFusion` is added. `SimpleFusion` has
a predefined structure of predicates and accepts predicate for
`firstMI`, predicate for `secondMI` and epilog/prolog as arguments.
The generated code for `SimpleFusion` will be like:
```
bool isNAME(const TargetInstrInfo &TII,
const TargetSubtargetInfo &STI,
const MachineInstr *FirstMI,
const MachineInstr &SecondMI) {
auto &MRI = SecondMI.getMF()->getRegInfo();
/* Prolog */
/* Predicate for `SecondMI` */
/* Wildcard */
/* Predicate for `FirstMI` */
/* Check One Use */
/* Tie registers */
/* Epilog */
return true;
}
```
Diffstat (limited to 'llvm/lib/Object/ObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions