Skip to content

Commit 5d5fb97

Browse files
committed
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.
1 parent 65d201f commit 5d5fb97

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
@@ -514,7 +514,6 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> {
514514
let is_float = input_ty.is_fp();
515515
let is_signed = input_ty.is_signed();
516516
let is_nil = input_ty.is_nil();
517-
let is_bool = input_ty.is_bool();
518517
match op {
519518
mir::BinOp::Add => if is_float {
520519
bx.fadd(lhs, rhs)
@@ -564,15 +563,6 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> {
564563
lhs, rhs
565564
)
566565
} else {
567-
let (lhs, rhs) = if is_bool {
568-
// FIXME(#36856) -- extend the bools into `i8` because
569-
// LLVM's i1 comparisons are broken.
570-
(bx.zext(lhs, Type::i8(bx.cx)),
571-
bx.zext(rhs, Type::i8(bx.cx)))
572-
} else {
573-
(lhs, rhs)
574-
};
575-
576566
bx.icmp(
577567
base::bin_op_to_icmp_predicate(op.to_hir_binop(), is_signed),
578568
lhs, rhs

0 commit comments

Comments
 (0)