|
---
|
|
pretty_name: "ComBack++"
|
|
language:
|
|
- code
|
|
pipeline_tag: Compiler Backend
|
|
tags:
|
|
- C++/TableGen/Machine Description Code
|
|
- Compiler Backend
|
|
license: "cc-by-4.0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
# ComBack++: A Multi-Language Dataset Providing End-to-End Support for Compiler Backend Development
|
|
|
|
ComBack++ is a large-scale, multi-platform and multi-language compiler backend code dataset. It is sourced from GCC and LLVM backends corresponding to 183 target platforms.
|
|
|
|
## Dataset Information
|
|
|
|
- Source Data
|
|
- GCC
|
|
|
|
| Category | Target Platform | C++ Function | C++ KLoC | Machine Description KLoC |
|
|
| ---- | ---- | ---- | ---- | ---- |
|
|
| CPU | 30 | 56,211 | 858.2 | 228.5 |
|
|
| MPU | 35 | 8,713 | 243.8 | 87.1 |
|
|
| GPU | 2 | 731 | 12.7 | 3.0 |
|
|
| VLIW | 5 | 1,323 | 32.8 | 17.8 |
|
|
| DSP | 4 | 542 | 17.2 | 6.1 |
|
|
| Virtual | 5 | 558 | 10.5 | 0.1 |
|
|
| **SUM** | **81** | **68,078** | **1175.2** | **342.6** |
|
|
|
|
|
|
- LLVM
|
|
|
|
| Category | Target Platform | C++ Function | C++ KLoC | TableGen KLoC |
|
|
| ---- | ---- | ---- | ---- | ---- |
|
|
| CPU | 43 | 97,972 | 3,768.4 | 1,157.7 |
|
|
| MPU | 30 | 12,552 | 190.7 | 24.8 |
|
|
| GPU | 5 | 28,267 | 886.8 | 168.5 |
|
|
| VLIW | 5 | 2,386 | 27.4 | 0.8 |
|
|
| DSP | 7 | 11,584 | 296.8 | 129.4 |
|
|
| Virtual | 12 | 10,538 | 199.4 | 12.9 |
|
|
| **SUM** | **102** | **163,299** | **5,369.5** | **1,494.1** |
|
|
|
|
|
|
- Tasks
|
|
- Statement-Level Completion: complete current statement.
|
|
```c++
|
|
//Inputs:
|
|
...
|
|
adjustReg(MBB,LastFrameDestroy, DL, SPReg, FPReg, -StackSize+RVFI->getVarArgsSaveSize()
|
|
//Ground Truth:
|
|
MachineInstr::FrameDestroy);
|
|
```
|
|
|
|
- Next-Statement Suggestion: predict the next statement.
|
|
|
|
```c++
|
|
//Inputs:
|
|
...
|
|
maxCallFrameSize = (maxCallFrameSize + AlignMask) & ~AlignMask;
|
|
//Ground Truth:
|
|
MFI -> setMaxCallFrameSize(maxCallFrameSize);
|
|
```
|
|
|
|
|
|
- Code Generation: generate a function template with function description in natrual language.
|
|
|
|
```c++
|
|
//Inputs:
|
|
getPointerRegClass: Returns a TargetRegisterClass used for pointer values.
|
|
//Ground Truth:
|
|
TargetRegisterClass *RegisterInfo::getPointerRegClass(MachineFunction &MF ,unsigned Kind) {
|
|
return Subtarget.is64Bit() ? <ISA_LIT> : <ISA_LIT>;
|
|
}
|
|
```
|
|
|
|
- Program Repair: automatically fixing bugs at identified locations.
|
|
|
|
```c++
|
|
//Inputs:
|
|
int64_t Imm; <BUGS> MCExpr::VariantKind VK; <BUGE> ...
|
|
//Ground Truth:
|
|
<FIXS> MCExpr::VariantKind VK = MCExpr::VK_None; <FIXE>
|
|
```
|
|
|
|
## Organization
|
|
|
|
|
|
|
|
- `./*.jsonl`: **Take data of RISC-V,ARC,NVPTX both in GCC and LLVM as test set, split train/valid set in the ratio of 90%:10% of other targets excluding RI5CY(RI5CY is custmoized based on RISCV)**
|
|
|
|
|
|
|
|
| Task | Programming Language | Train | Valid | Test |
|
|
|---------------------------- |---------------------- |------------------ |---------------- |--------------- |
|
|
| Statement-Level Completion | C++ | 149,368 (16.41M) | 16,480 (1.84M) | 7,897 (0.82M) |
|
|
| Statement-Level Completion | TableGen/MD | 120,460 (4.46M) | 13,295 (0.50M) | 7,090 (0.25M) |
|
|
| Next-Statement Suggestion | C++ | 137,155 (20.55M) | 15,218 (2.32M) | 8,109 (1.09M) |
|
|
| Next-Statement Suggestion | TableGen/MD | 124,528 (6.71M) | 14,009 (0.76M) | 2,726 (0.14M) |
|
|
| Code Generation | C++ | 37,805 (10.69M) | 4,137 (1.16M) | 2,944 (0.73M) |
|
|
| Program Repair | C++ | 40,578 (4.33M) | 4,539 (0.48M) | 2,623 (0.29M) |
|
|
| Program Repair | TableGen/MD | 25,983 (2.95M) | 2,975 (0.33M) | 1,814 (0.24M) | |