about summary refs log tree commit diff
path: root/src/optimize
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2022-12-14 19:30:46 +0100
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2022-12-14 19:30:46 +0100
commit98a276b5895697a862b48bcaf07b423de0b0deef (patch)
tree5ecf0b879e0e8f95ec7d00951b767c59d9ac7205 /src/optimize
parentf7c76ad6624118c96717298fb0a8e6f84b5a9265 (diff)
downloadrust-98a276b5895697a862b48bcaf07b423de0b0deef.tar.gz
rust-98a276b5895697a862b48bcaf07b423de0b0deef.zip
Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14
Diffstat (limited to 'src/optimize')
-rw-r--r--src/optimize/peephole.rs20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/optimize/peephole.rs b/src/optimize/peephole.rs
index d637b4d8929..7f45bbd8f28 100644
--- a/src/optimize/peephole.rs
+++ b/src/optimize/peephole.rs
@@ -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)