Skip to content

Commit

Permalink
Remove hack around comparisons of i1 values (fixes #40980)
Browse files Browse the repository at this point in the history
The regression test still passes without that 2 years old hack. The underlying
LLVM bug has probably been fixed upstream since then.
  • Loading branch information
nox committed Apr 21, 2018
1 parent 65d201f commit 5d5fb97
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/librustc_trans/mir/rvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> {
let is_float = input_ty.is_fp();
let is_signed = input_ty.is_signed();
let is_nil = input_ty.is_nil();
let is_bool = input_ty.is_bool();
match op {
mir::BinOp::Add => if is_float {
bx.fadd(lhs, rhs)
Expand Down Expand Up @@ -564,15 +563,6 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> {
lhs, rhs
)
} else {
let (lhs, rhs) = if is_bool {
// FIXME(#36856) -- extend the bools into `i8` because
// LLVM's i1 comparisons are broken.
(bx.zext(lhs, Type::i8(bx.cx)),
bx.zext(rhs, Type::i8(bx.cx)))
} else {
(lhs, rhs)
};

bx.icmp(
base::bin_op_to_icmp_predicate(op.to_hir_binop(), is_signed),
lhs, rhs
Expand Down

0 comments on commit 5d5fb97

Please sign in to comment.