[RISCV] emit .option directive for functions with target features which differ from...
commit05041b78a73a3fe426e73c6ca78a64bca2587bfc
authorPiyou Chen <piyou.chen@sifive.com>
Thu, 3 Aug 2023 06:17:42 +0000 (2 23:17 -0700)
committerPiyou Chen <piyou.chen@sifive.com>
Thu, 3 Aug 2023 11:22:39 +0000 (3 04:22 -0700)
tree7ab8d854ed1d40fea652e2f595c5855dabdee87f
parentc7cacb2f6efe07fa4a1129bb7e2389312670b84a
[RISCV] emit .option directive for functions with target features which differ from module default

When function has different attributes from module, emit the .option <attribute> before the function body.  This allows non-integrated assemblers to properly assemble the functions (which may contain instructions dependent on the extra target features).

Reviewed By: craig.topper, reames

Differential Revision: https://reviews.llvm.org/D155155
llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
llvm/test/CodeGen/RISCV/riscv-func-target-feature.ll [new file with mode: 0644]