aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ObjectFile.cpp
diff options
context:
space:
mode:
authorWang Pengcheng <wangpengcheng.pp@bytedance.com>2024-01-05 22:44:04 +0800
committerGitHub <noreply@github.com>2024-01-05 22:44:04 +0800
commita0e6b7c0429204ac42095be09bd1d5dcad4a052a (patch)
treed8a4c14ff6bf4194bc7f222f95e01f39d42e65a6 /llvm/lib/Object/ObjectFile.cpp
parent65df69619c49717da64140baddda0f04ed62ffdf (diff)
downloadllvm-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