[PATCH] D46423: [WIP, RISCV] Support .option relax and .option norelax
Lewis Revill via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 20 08:55:33 PDT 2018
lewis-revill updated this revision to Diff 161490.
lewis-revill added a comment.
I've updated this revision to reflect the current state of what we're working with. The relax and norelax options work as intended with regards to enabling and disabling `R_RISCV_RELAX`. With this current patch, the behaviour of relocations is that if `.option relax` was ever parsed, then relocations are always generated. This is a safe approach which avoids incorrect codegen. Using the approach of only saving the STI state back to the backend when `.option relax` is parsed enables this behaviour. Other approaches might be a better fit, especially if any other future options need to save the state of the STI back to the backend, since this would invalidate the 'sticky bit' behaviour that we're looking for. I'll look into using the additional feature bit as you've suggested for this @shiva0217.
https://reviews.llvm.org/D46423
Files:
include/llvm/MC/MCAsmBackend.h
lib/MC/MCAsmStreamer.cpp
lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp
lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.h
test/MC/RISCV/option-invalid.s
test/MC/RISCV/option-relax.s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46423.161490.patch
Type: text/x-patch
Size: 8442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180820/9ba5a1a2/attachment.bin>
More information about the llvm-commits
mailing list