Skip to content

Commit a997525

Browse files
committed
Auto merge of #50137 - nox:rm-bool-cmp-hack, r=eddyb
Remove hack around comparisons of i1 values (fixes #40980) The regression test still passes without that 2 years old hack. The underlying LLVM bug has probably been fixed upstream since then.
2 parents 3c43aa5 + 5d5fb97 commit a997525

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/librustc_trans/mir/rvalue.rs

-10
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,6 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> {
536536
let is_float = input_ty.is_fp();
537537
let is_signed = input_ty.is_signed();
538538
let is_nil = input_ty.is_nil();
539-
let is_bool = input_ty.is_bool();
540539
match op {
541540
mir::BinOp::Add => if is_float {
542541
bx.fadd(lhs, rhs)
@@ -586,15 +585,6 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> {
586585
lhs, rhs
587586
)
588587
} else {
589-
let (lhs, rhs) = if is_bool {
590-
// FIXME(#36856) -- extend the bools into `i8` because
591-
// LLVM's i1 comparisons are broken.
592-
(bx.zext(lhs, Type::i8(bx.cx)),
593-
bx.zext(rhs, Type::i8(bx.cx)))
594-
} else {
595-
(lhs, rhs)
596-
};
597-
598588
bx.icmp(
599589
base::bin_op_to_icmp_predicate(op.to_hir_binop(), is_signed),
600590
lhs, rhs

0 commit comments

Comments
 (0)