cranelift: Remove redundant branch and select instructions (#5097)
As discussed in the 2022/10/19 meeting, this PR removes many of the branch and select instructions that used iflags, in favor if using brz/brnz and select in their place. Additionally, it reworks selectif_spectre_guard to take an i8 input instead of an iflags input. For reference, the removed instructions are: br_icmp, brif, brff, trueif, trueff, and selectif.
This commit is contained in:
@@ -8,8 +8,8 @@ use target_lexicon::Triple;
|
||||
|
||||
pub use super::MachLabel;
|
||||
pub use crate::ir::{
|
||||
condcodes, dynamic_to_fixed, ArgumentExtension, Constant, DynamicStackSlot, ExternalName,
|
||||
FuncRef, GlobalValue, Immediate, SigRef, StackSlot,
|
||||
condcodes, condcodes::CondCode, dynamic_to_fixed, ArgumentExtension, Constant,
|
||||
DynamicStackSlot, ExternalName, FuncRef, GlobalValue, Immediate, SigRef, StackSlot,
|
||||
};
|
||||
pub use crate::isa::unwind::UnwindInst;
|
||||
pub use crate::machinst::{
|
||||
@@ -570,6 +570,26 @@ macro_rules! isle_lower_prelude_methods {
|
||||
fn gen_move(&mut self, ty: Type, dst: WritableReg, src: Reg) -> MInst {
|
||||
MInst::gen_move(dst, src, ty)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn intcc_reverse(&mut self, cc: &IntCC) -> IntCC {
|
||||
cc.reverse()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn intcc_inverse(&mut self, cc: &IntCC) -> IntCC {
|
||||
cc.inverse()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn floatcc_reverse(&mut self, cc: &FloatCC) -> FloatCC {
|
||||
cc.reverse()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn floatcc_inverse(&mut self, cc: &FloatCC) -> FloatCC {
|
||||
cc.inverse()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user