[all-commits] [llvm/llvm-project] 98117f: [RISCV] MC relaxation for out-of-range conditional...

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Feb 3 12:34:16 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 98117f1a743cbddefa3dd1c678ce01478fa98454
      https://github.com/llvm/llvm-project/commit/98117f1a743cbddefa3dd1c678ce01478fa98454
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfo.td
    M llvm/test/MC/RISCV/fixups-diagnostics.s
    A llvm/test/MC/RISCV/long-conditional-jump.s
    M llvm/test/MC/RISCV/rv64-relax-all.s

  Log Message:
  -----------
  [RISCV] MC relaxation for out-of-range conditional branch.

If .L1 is not within +-4KiB range,

convert

```
bge a0, a1, .L1
```

to

```
blt a0, a1, 8
j   .L1
```

In this patch, if the symbol is unresolved at assembly time, do not do
this relaxation.

Fix the bug reported in https://bugs.llvm.org/show_bug.cgi?id=47910

Co-authored-by: Hsiangkai Wang

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D108961




More information about the All-commits mailing list