[PATCH] D77851: [X86][MC] Make -x86-pad-max-prefix-size compatible with --mc-relax-all

Robert Schilling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 01:03:05 PDT 2020


Razer6 added a comment.

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).


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