[PATCH] D46423: [WIP, RISCV] Support .option relax and .option norelax

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 04:42:36 PDT 2018


lewis-revill marked an inline comment as done.
lewis-revill added a comment.

I've looked into the options for that change with regards to the behaviour that we'd want for this patch, and I think that while it is a good idea to make that change, it would not help us with our sticky bit situation. The problem is that adding an MCSubtargetInfo parameter to `shouldForceRelocation` in the same manner of the patches culminating in https://reviews.llvm.org/D45962 (IE: passing the STI that was used at the point of encoding the instruction) would effectively mean that if we were to check the 'sticky bit', it would be false in the case where a branch instruction occurs **before** an `.option relax`, even if the target location occurs after the `.option relax`, meaning incorrect code could be generated. The behaviour that we're looking for is a two-pass type behaviour, whereby if relaxation was ever enabled during parsing, then the only safe option is to emit a relocation.

With this in mind, I would like to look into our other options for fixing the interface issues with this patch, and I will also update the test case to reflect the behaviour that I just discussed as its not clear at the moment.


Repository:
  rL LLVM

https://reviews.llvm.org/D46423





More information about the llvm-commits mailing list