[llvm] [LoongArch] Allow delayed decision for ADD/SUB relocations (PR #72960)

WÁNG Xuěruì via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 26 07:21:03 PST 2023


xen0n wrote:

> Follow RISCV [1df5ea2](https://github.com/llvm/llvm-project/commit/1df5ea29b43690b6622db2cad7b745607ca4de6a), we can fix it by the diff. I'll add some test cases.

Thanks for volunteering to fix the problem. It's blocking integration work right now.

> 
> ```diff
> diff --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
> index 6d8ef1bf96cb..9c080aba2c96 100644
> --- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
> +++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
> <snip>
> ```

FYI `adjustFixupValue` also needs adaptation: add `case FK_Data_leb128:` to the `FK_Data_[1248]` cases (that just straight `return Value`). Otherwise the crash still occurs with a different reason (the unreachable "Unknown fixup kind" branch).

https://github.com/llvm/llvm-project/pull/72960


More information about the llvm-commits mailing list