Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14
This commit is contained in:
@@ -3,19 +3,6 @@
|
||||
use cranelift_codegen::ir::{condcodes::IntCC, InstructionData, Opcode, Value, ValueDef};
|
||||
use cranelift_frontend::FunctionBuilder;
|
||||
|
||||
/// If the given value was produced by a `bint` instruction, return it's input, otherwise return the
|
||||
/// given value.
|
||||
pub(crate) fn maybe_unwrap_bint(bcx: &mut FunctionBuilder<'_>, arg: Value) -> Value {
|
||||
if let ValueDef::Result(arg_inst, 0) = bcx.func.dfg.value_def(arg) {
|
||||
match bcx.func.dfg[arg_inst] {
|
||||
InstructionData::Unary { opcode: Opcode::Bint, arg } => arg,
|
||||
_ => arg,
|
||||
}
|
||||
} else {
|
||||
arg
|
||||
}
|
||||
}
|
||||
|
||||
/// If the given value was produced by the lowering of `Rvalue::Not` return the input and true,
|
||||
/// otherwise return the given value and false.
|
||||
pub(crate) fn maybe_unwrap_bool_not(bcx: &mut FunctionBuilder<'_>, arg: Value) -> (Value, bool) {
|
||||
@@ -48,13 +35,6 @@ pub(crate) fn maybe_known_branch_taken(
|
||||
};
|
||||
|
||||
match bcx.func.dfg[arg_inst] {
|
||||
InstructionData::UnaryBool { opcode: Opcode::Bconst, imm } => {
|
||||
if test_zero {
|
||||
Some(!imm)
|
||||
} else {
|
||||
Some(imm)
|
||||
}
|
||||
}
|
||||
InstructionData::UnaryImm { opcode: Opcode::Iconst, imm } => {
|
||||
if test_zero {
|
||||
Some(imm.bits() == 0)
|
||||
|
||||
Reference in New Issue
Block a user