-
-
Notifications
You must be signed in to change notification settings - Fork 15k
RISC-V LLVM feature +unaligned-scalar-mem not recognized by rustc #110883
Copy link
Copy link
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.O-riscvTarget: RISC-V architectureTarget: RISC-V architecture
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.O-riscvTarget: RISC-V architectureTarget: RISC-V architecture
Type
Fields
Give feedbackNo fields configured for issues without a type.
Example
Current output
Desired output
Background / Rationale
Some RISC-V cores support unaligned access to memory without trapping. On such cores, the compiler could significantly improve code-size and performance when using functions like core::ptr::read_unaligned by emitting a single load or store instruction with an unaligned address, rather than a long sequence of byte-sized load/store/bitmanip instructions.
I need to use the
unaligned-scalar-memtarget feature to improve code-size and performance. When I set the flag-C target-feature=+unaligned-scalar-mem, LLVM successfully recognizes the target feature and generates the desired machine code, but rustc prints out the warning above, and I can't figure out how to disable it.