Remove ancient register allocation (#3401)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//! Naming well-known routines in the runtime library.
|
||||
|
||||
use crate::ir::{
|
||||
types, AbiParam, ArgumentPurpose, ExtFuncData, ExternalName, FuncRef, Function, Inst, Opcode,
|
||||
types, AbiParam, ArgumentPurpose, ExtFuncData, ExternalName, FuncRef, Function, Opcode,
|
||||
Signature, Type,
|
||||
};
|
||||
use crate::isa::{CallConv, RegUnit, TargetIsa};
|
||||
@@ -166,21 +166,6 @@ impl LibCall {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a function reference for `libcall` in `func`, following the signature
|
||||
/// for `inst`.
|
||||
///
|
||||
/// If there is an existing reference, use it, otherwise make a new one.
|
||||
pub(crate) fn get_libcall_funcref(
|
||||
libcall: LibCall,
|
||||
call_conv: CallConv,
|
||||
func: &mut Function,
|
||||
inst: Inst,
|
||||
isa: &dyn TargetIsa,
|
||||
) -> FuncRef {
|
||||
find_funcref(libcall, func)
|
||||
.unwrap_or_else(|| make_funcref_for_inst(libcall, call_conv, func, inst, isa))
|
||||
}
|
||||
|
||||
/// Get a function reference for the probestack function in `func`.
|
||||
///
|
||||
/// If there is an existing reference, use it, otherwise make a new one.
|
||||
@@ -227,33 +212,6 @@ fn make_funcref_for_probestack(
|
||||
make_funcref(LibCall::Probestack, func, sig, isa)
|
||||
}
|
||||
|
||||
/// Create a funcref for `libcall` with a signature matching `inst`.
|
||||
fn make_funcref_for_inst(
|
||||
libcall: LibCall,
|
||||
call_conv: CallConv,
|
||||
func: &mut Function,
|
||||
inst: Inst,
|
||||
isa: &dyn TargetIsa,
|
||||
) -> FuncRef {
|
||||
let mut sig = Signature::new(call_conv);
|
||||
for &v in func.dfg.inst_args(inst) {
|
||||
sig.params.push(AbiParam::new(func.dfg.value_type(v)));
|
||||
}
|
||||
for &v in func.dfg.inst_results(inst) {
|
||||
sig.returns.push(AbiParam::new(func.dfg.value_type(v)));
|
||||
}
|
||||
|
||||
if call_conv.extends_baldrdash() {
|
||||
// Adds the special VMContext parameter to the signature.
|
||||
sig.params.push(AbiParam::special(
|
||||
isa.pointer_type(),
|
||||
ArgumentPurpose::VMContext,
|
||||
));
|
||||
}
|
||||
|
||||
make_funcref(libcall, func, sig, isa)
|
||||
}
|
||||
|
||||
/// Create a funcref for `libcall`.
|
||||
fn make_funcref(
|
||||
libcall: LibCall,
|
||||
|
||||
Reference in New Issue
Block a user