[RISCV] relaxDwarfCallFrameFragment: remove unneeded relocations for relaxation
authorFangrui Song <i@maskray.me>
Fri, 16 Jun 2023 19:15:06 +0000 (12:15 -0700)
committerFangrui Song <i@maskray.me>
Fri, 16 Jun 2023 19:15:06 +0000 (12:15 -0700)
commit2ef56d16adbe888a7e8c20684aa98d3f07c0eb98
treec5a8264a0f26f016d233a70027611b2eff748d21
parentd663da07e39f5c694f58949cd32d0fcceeb66b1f
[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 one evaluateKnownAbsolute call (subtle for Mach-O
workarounds; avoid if possible) with evaluateAsAbsolute.
llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
llvm/test/DebugInfo/RISCV/relax-debug-frame.ll
llvm/test/MC/ELF/RISCV/gen-dwarf.s