I think we're missing support for compressed cmv in the RISC-V backend:
|
//===----------------------------------------------------------------------===// |
|
// Compress Instruction tablegen backend. |
|
//===----------------------------------------------------------------------===// |
|
|
|
// Quadrant 0 |
|
let Predicates = [HasZCheriPurecap, HasCheriRVC, HasStdExtC, IsCapMode] in { |
|
def : CompressPat<(CADDI GPCRC:$rd, CSP:$rs1, uimm10_lsb00nonzero:$imm), |
|
(C_CIncOffsetImm4CSPN GPCRC:$rd, CSP:$rs1, uimm10_lsb00nonzero:$imm)>; |
|
} // Predicates = [HasZCheriPurecap, HasCheriRVC, HasStdExtC, IsCapMode] |
|
|
|
// Quadrant 1 |
|
let Predicates = [HasZCheriPurecap, HasCheriRVC, HasStdExtC, IsCapMode] in { |
|
def : CompressPat<(CADDI C2, C2, simm10_lsb0000nonzero:$imm), |
|
(C_CIncOffsetImm16CSP C2, simm10_lsb0000nonzero:$imm)>; |
|
} // Predicates = [HasCheri, HasCheriRVC, HasStdExtC, IsCapMode] |
|
|
|
//===----------------------------------------------------------------------===// |
I'm seeing a lot of uncompressed cmvs in the generated code from compiling FreeBSD, which is probably hurting code size a good amount. Some unscientific sampling of random blocks in objdumps looks like it's mostly about 3%, but can be up to 10% code size growth because of it in some cases.
I think we're missing support for compressed
cmvin the RISC-V backend:llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoZCheriPurecap.td
Lines 332 to 348 in 2f07835
I'm seeing a lot of uncompressed
cmvs in the generated code from compiling FreeBSD, which is probably hurting code size a good amount. Some unscientific sampling of random blocks in objdumps looks like it's mostly about 3%, but can be up to 10% code size growth because of it in some cases.