[PATCH] D44887: [RISCV] Add shouldForceRelocationWithApplyFixup Target Hook to calculate fixup value but also leave relocation types

Shiva Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 22:43:13 PDT 2018


shiva0217 added a comment.

In https://reviews.llvm.org/D44887#1048628, @sabuasal wrote:

> Hi Shiva,
>
> Just a comment a
>
> > Quoted Text  "if we define shouldForceRelocation for branches, fixup calculation will be disabled"
>
> Implementing RISCVAsmBackend::shoulForceRelocation() will force  "MCAssembler::evaluateFixup()" to return false for IsResolved which  will cause the record of the relocation in "MCAssembler::handleFixup()" but the fixup value itself will still be computed.
>
> I think the side effect that is causing  relaxation to always be forced in other cases is because you don't have "fixupNeedsRelaxationAdvanced" overridden in RISCVAsmBackend. If you override it you can change the behavior of always having
>  the instruction relaxed if resolved is set to false. I was wondering if you took a look at implemeting the same thing you need by doing that!


Hi Sameer. Thanks for your valuable input. I'll drop the patch and create https://reviews.llvm.org/D44971 to override "fixupNeedsRelaxationAdvanced".


Repository:
  rL LLVM

https://reviews.llvm.org/D44887





More information about the llvm-commits mailing list