[RISCV] relaxDwarfCallFrameFragment: remove unneeded relocations for relaxation
authorFangrui Song <i@maskray.me>
Fri, 16 Jun 2023 06:26:25 +0000 (23:26 -0700)
committerFangrui Song <i@maskray.me>
Fri, 16 Jun 2023 06:26:25 +0000 (23:26 -0700)
commit11ebe3d906558d93a607347de472e7718127f409
treef2f7ac4c631674cb1fc69886ae28c665172f5a42
parent07b9e6ed0db206912b99c153a6bcfcb41f792cc5
[RISCV] relaxDwarfCallFrameFragment: remove unneeded relocations for relaxation

If `evaluateAsAbsolute(Value, Layout.getAssembler())` returns true, we
know the address delta is a constant and can suppress relocations
(usually SET6/SUB6).

While here, replace two evaluateKnownAbsolute calls (subtle; avoid if possible)
with evaluateAsAbsolute.
llvm/lib/MC/MCAssembler.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
llvm/test/DebugInfo/RISCV/relax-debug-frame.ll
llvm/test/MC/ELF/RISCV/gen-dwarf.s