[JITLink][RISCV] Support relaxable edges without relaxation pass
authorJob Noorman <jnoorman@igalia.com>
Mon, 26 Jun 2023 07:09:19 +0000 (09:09 +0200)
committerJob Noorman <jnoorman@igalia.com>
Mon, 26 Jun 2023 07:41:20 +0000 (09:41 +0200)
commitf4bb62e85c167c49dfc4027a684b230f75c39374
tree9a404af41acf9bc989e088cc8ac22941ff33792d
parent5eb8cb094981f17364d5e7689b9e284918598a11
[JITLink][RISCV] Support relaxable edges without relaxation pass

Relaxable edges are created unconditionally, even when the relaxation
pass will not run. However, they were not recognized by applyFixup
causing them to not be applied.

To support configurations without the relaxation pass, this patch adds
these relaxable edges to applyFixup:
- CallRelaxable: Can be treated as R_RISCV_CALL
- AlignRelaxable: Can simply be ignored

An alternative could be to unconditionally run the relaxation pass, even
in contexts where shouldAddDefaultTargetPasses returns false. However, I
could imagine there being use cases for disabling relaxation which
wouldn't be possible anymore then.

Reviewed By: StephenFan

Differential Revision: https://reviews.llvm.org/D153541
llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp