From 9a7318e621fc5d99dd1be47240d7daad7b576ad1 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 6 Dec 2023 10:40:28 +0300 Subject: [PATCH] Eliminate useless BITCAST --- ir_fold.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ir_fold.h b/ir_fold.h index 26cf321..561f836 100644 --- a/ir_fold.h +++ b/ir_fold.h @@ -1187,6 +1187,14 @@ IR_FOLD(COND(C_FLOAT, _)) } } +IR_FOLD(BITCAST(_)) +{ + if (IR_OPT_TYPE(opt) == op1_insn->type) { + IR_FOLD_COPY(op1); + } + IR_FOLD_NEXT; +} + /* Algebraic simplifications */ IR_FOLD(ABS(ABS)) {