[PATCH] D77851: [X86][MC] Make -x86-pad-max-prefix-size compatible with --mc-relax-all
Kan Shengchen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 17 02:40:36 PDT 2020
skan added a comment.
In D77851#1988272 <https://reviews.llvm.org/D77851#1988272>, @Razer6 wrote:
> In D77851#1988191 <https://reviews.llvm.org/D77851#1988191>, @MaskRay wrote:
>
> > > Which way do you think is better? Personally, I prefer the second one, since `getAssembler().getBackend().relaxInstruction(Relaxed, STI, Relaxed)` is called in a loop, the assumption that third argument of `relaxInstruction` is a fresh uninitialized `MCInst` is very strange.
> >
> > Special casing RISC-V looks good to me.
>
>
> A special case is probably also needed for the Hexagon and AMDGPU backend, which does similar stuff in their `relaxInstruction` implementation than the RISC-V backend.
>
> Is their any reason why `relaxInstruction` takes three argurments? Since `relaxed` is given in two arguments which are aliased to the same variable, I would drop the third argument and let `relaxInstruction` to either modify the given instruction or assign it to a fresh one (RISC-V, Hexagon, AMDGPU case).
Droppng the third argument looks good to me.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77851/new/
https://reviews.llvm.org/D77851
More information about the llvm-commits
mailing list