Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hack around comparisons of i1 values (fixes #40980) #50137

Merged
merged 1 commit into from
Apr 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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