Issue 56448
Summary [RISCV] BranchRelaxation calculates overly conservative size when a branch branches over compressible branch instructions
Labels backend:RISC-V
Assignees
Reporter topperc
    The BranchFolding pass tries to determine if a branch target is too far away for the 12-bit immediate of a conditional branch. If the offset is too large it inverts the branch uses a short branch over an unconditional jump to have a larger offset.

To do this it calls getInstSize to calculate the size of all of the instructions that are branched over. If there are any compressible branches (c.bez, c.bnez), getInstSize will not calculate the compressed size for them because their offset is inherently dependent on the relaxation process. This leads to a more conservative estimate of size and can lead to more relaxation than needed.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to