On ARM, use relocation_model to detect whether r9 should be reserved

The previous approach of checking for the reserve-r9 target feature
didn't actually work because LLVM only sets this feature very late when
initializing the per-function subtarget.
This commit is contained in:
Amanieu d'Antras
2022-02-17 14:16:52 +00:00
parent 2e8a7663b4
commit 1ceb104851
9 changed files with 67 additions and 47 deletions

View File

@@ -1,5 +1,5 @@
use super::{InlineAsmArch, InlineAsmType};
use crate::spec::Target;
use crate::spec::{Target, RelocModel};
use rustc_data_structures::stable_set::FxHashSet;
use rustc_macros::HashStable_Generic;
use rustc_span::{sym, Symbol};
@@ -54,6 +54,7 @@ impl RiscVInlineAsmRegClass {
fn not_e(
_arch: InlineAsmArch,
_reloc_model: RelocModel,
target_features: &FxHashSet<Symbol>,
_target: &Target,
_is_clobber: bool,