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

James Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 24 05:37:09 PDT 2018


jrtc27 added a comment.

In https://reviews.llvm.org/D46423#1268188, @lewis-revill wrote:

> Apologies for the delay, I was away for the week. The solution is to simply not bother updating the backend when the assembler pointer is null, since getAssemblerPtr returning nullptr implies that we are emitting textual assembly, not an object stream, so we don't need to worry about relaxation or relocation anyway.


I don't think that's true? The implementation of `getAssemblerPtr` is gated on `getUseAssemblerInfoForParsing`, which is only ever set to true by llvm-mc. Thus, if you have a `-mno-relax` C file that sets `.option relax` in inline assembly, the sticky flag won't be set, so things may break with `-integrated-as`. Now maybe we don't care about that case, but it's not so simple. Perhaps we could avoid this altogether by moving this flag to the RISCV subtarget instance (which will be copied just fine on push/pop as that's done via a clone-and-restore-feature-bits)?



================
Comment at: lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp:1182
+    }
+  }
   // First operand is token for instruction
----------------
Missing newline.


Repository:
  rL LLVM

https://reviews.llvm.org/D46423





More information about the llvm-commits mailing list