Skip to content

Commit 6e83046

Browse files
committedApr 13, 2025·
Auto merge of rust-lang#131203 - clubby789:jumpthreading-not, r=compiler-errors
JumpThreading: fix bitwise not on non-booleans Fixes rust-lang#131195 Alternative to rust-lang#131201
2 parents 092a284 + 41a5d8e commit 6e83046

6 files changed

+207
-90
lines changed
 

‎compiler/rustc_mir_transform/src/jump_threading.rs

+98-81
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ impl<'tcx> crate::MirPass<'tcx> for JumpThreading {
9090
};
9191

9292
for bb in body.basic_blocks.indices() {
93-
finder.start_from_switch(bb);
93+
let old_len = finder.opportunities.len();
94+
// If we have any const-eval errors discard any opportunities found
95+
if finder.start_from_switch(bb).is_none() {
96+
finder.opportunities.truncate(old_len);
97+
}
9498
}
9599

96100
let opportunities = finder.opportunities;
@@ -150,14 +154,6 @@ impl Condition {
150154
fn matches(&self, value: ScalarInt) -> bool {
151155
(self.value == value) == (self.polarity == Polarity::Eq)
152156
}
153-
154-
fn inv(mut self) -> Self {
155-
self.polarity = match self.polarity {
156-
Polarity::Eq => Polarity::Ne,
157-
Polarity::Ne => Polarity::Eq,
158-
};
159-
self
160-
}
161157
}
162158

163159
#[derive(Copy, Clone, Debug)]
@@ -180,8 +176,21 @@ impl<'a> ConditionSet<'a> {
180176
self.iter().filter(move |c| c.matches(value))
181177
}
182178

183-
fn map(self, arena: &'a DroplessArena, f: impl Fn(Condition) -> Condition) -> ConditionSet<'a> {
184-
ConditionSet(arena.alloc_from_iter(self.iter().map(f)))
179+
fn map(
180+
self,
181+
arena: &'a DroplessArena,
182+
f: impl Fn(Condition) -> Option<Condition>,
183+
) -> Option<ConditionSet<'a>> {
184+
let mut all_ok = true;
185+
let set = arena.alloc_from_iter(self.iter().map_while(|c| {
186+
if let Some(c) = f(c) {
187+
Some(c)
188+
} else {
189+
all_ok = false;
190+
None
191+
}
192+
}));
193+
all_ok.then_some(ConditionSet(set))
185194
}
186195
}
187196

@@ -192,28 +201,28 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
192201

193202
/// Recursion entry point to find threading opportunities.
194203
#[instrument(level = "trace", skip(self))]
195-
fn start_from_switch(&mut self, bb: BasicBlock) {
204+
fn start_from_switch(&mut self, bb: BasicBlock) -> Option<()> {
196205
let bbdata = &self.body[bb];
197206
if bbdata.is_cleanup || self.loop_headers.contains(bb) {
198-
return;
207+
return Some(());
199208
}
200-
let Some((discr, targets)) = bbdata.terminator().kind.as_switch() else { return };
201-
let Some(discr) = discr.place() else { return };
209+
let Some((discr, targets)) = bbdata.terminator().kind.as_switch() else { return Some(()) };
210+
let Some(discr) = discr.place() else { return Some(()) };
202211
debug!(?discr, ?bb);
203212

204213
let discr_ty = discr.ty(self.body, self.tcx).ty;
205214
let Ok(discr_layout) = self.ecx.layout_of(discr_ty) else {
206-
return;
215+
return Some(());
207216
};
208217

209-
let Some(discr) = self.map.find(discr.as_ref()) else { return };
218+
let Some(discr) = self.map.find(discr.as_ref()) else { return Some(()) };
210219
debug!(?discr);
211220

212221
let cost = CostChecker::new(self.tcx, self.typing_env, None, self.body);
213222
let mut state = State::new_reachable();
214223

215224
let conds = if let Some((value, then, else_)) = targets.as_static_if() {
216-
let Some(value) = ScalarInt::try_from_uint(value, discr_layout.size) else { return };
225+
let value = ScalarInt::try_from_uint(value, discr_layout.size)?;
217226
self.arena.alloc_from_iter([
218227
Condition { value, polarity: Polarity::Eq, target: then },
219228
Condition { value, polarity: Polarity::Ne, target: else_ },
@@ -227,7 +236,7 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
227236
let conds = ConditionSet(conds);
228237
state.insert_value_idx(discr, conds, &self.map);
229238

230-
self.find_opportunity(bb, state, cost, 0);
239+
self.find_opportunity(bb, state, cost, 0)
231240
}
232241

233242
/// Recursively walk statements backwards from this bb's terminator to find threading
@@ -239,27 +248,27 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
239248
mut state: State<ConditionSet<'a>>,
240249
mut cost: CostChecker<'_, 'tcx>,
241250
depth: usize,
242-
) {
251+
) -> Option<()> {
243252
// Do not thread through loop headers.
244253
if self.loop_headers.contains(bb) {
245-
return;
254+
return Some(());
246255
}
247256

248257
debug!(cost = ?cost.cost());
249258
for (statement_index, stmt) in
250259
self.body.basic_blocks[bb].statements.iter().enumerate().rev()
251260
{
252261
if self.is_empty(&state) {
253-
return;
262+
return Some(());
254263
}
255264

256265
cost.visit_statement(stmt, Location { block: bb, statement_index });
257266
if cost.cost() > MAX_COST {
258-
return;
267+
return Some(());
259268
}
260269

261270
// Attempt to turn the `current_condition` on `lhs` into a condition on another place.
262-
self.process_statement(bb, stmt, &mut state);
271+
self.process_statement(bb, stmt, &mut state)?;
263272

264273
// When a statement mutates a place, assignments to that place that happen
265274
// above the mutation cannot fulfill a condition.
@@ -271,7 +280,7 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
271280
}
272281

273282
if self.is_empty(&state) || depth >= MAX_BACKTRACK {
274-
return;
283+
return Some(());
275284
}
276285

277286
let last_non_rec = self.opportunities.len();
@@ -284,9 +293,9 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
284293
match term.kind {
285294
TerminatorKind::SwitchInt { ref discr, ref targets } => {
286295
self.process_switch_int(discr, targets, bb, &mut state);
287-
self.find_opportunity(pred, state, cost, depth + 1);
296+
self.find_opportunity(pred, state, cost, depth + 1)?;
288297
}
289-
_ => self.recurse_through_terminator(pred, || state, &cost, depth),
298+
_ => self.recurse_through_terminator(pred, || state, &cost, depth)?,
290299
}
291300
} else if let &[ref predecessors @ .., last_pred] = &predecessors[..] {
292301
for &pred in predecessors {
@@ -311,12 +320,13 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
311320
let first = &mut new_tos[0];
312321
*first = ThreadingOpportunity { chain: vec![bb], target: first.target };
313322
self.opportunities.truncate(last_non_rec + 1);
314-
return;
323+
return Some(());
315324
}
316325

317326
for op in self.opportunities[last_non_rec..].iter_mut() {
318327
op.chain.push(bb);
319328
}
329+
Some(())
320330
}
321331

322332
/// Extract the mutated place from a statement.
@@ -430,23 +440,23 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
430440
lhs: PlaceIndex,
431441
rhs: &Operand<'tcx>,
432442
state: &mut State<ConditionSet<'a>>,
433-
) {
443+
) -> Option<()> {
434444
match rhs {
435445
// If we expect `lhs ?= A`, we have an opportunity if we assume `constant == A`.
436446
Operand::Constant(constant) => {
437-
let Some(constant) =
438-
self.ecx.eval_mir_constant(&constant.const_, constant.span, None).discard_err()
439-
else {
440-
return;
441-
};
447+
let constant = self
448+
.ecx
449+
.eval_mir_constant(&constant.const_, constant.span, None)
450+
.discard_err()?;
442451
self.process_constant(bb, lhs, constant, state);
443452
}
444453
// Transfer the conditions on the copied rhs.
445454
Operand::Move(rhs) | Operand::Copy(rhs) => {
446-
let Some(rhs) = self.map.find(rhs.as_ref()) else { return };
455+
let Some(rhs) = self.map.find(rhs.as_ref()) else { return Some(()) };
447456
state.insert_place_idx(rhs, lhs, &self.map);
448457
}
449458
}
459+
Some(())
450460
}
451461

452462
#[instrument(level = "trace", skip(self))]
@@ -456,22 +466,26 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
456466
lhs_place: &Place<'tcx>,
457467
rhs: &Rvalue<'tcx>,
458468
state: &mut State<ConditionSet<'a>>,
459-
) {
460-
let Some(lhs) = self.map.find(lhs_place.as_ref()) else { return };
469+
) -> Option<()> {
470+
let Some(lhs) = self.map.find(lhs_place.as_ref()) else {
471+
return Some(());
472+
};
461473
match rhs {
462-
Rvalue::Use(operand) => self.process_operand(bb, lhs, operand, state),
474+
Rvalue::Use(operand) => self.process_operand(bb, lhs, operand, state)?,
463475
// Transfer the conditions on the copy rhs.
464-
Rvalue::CopyForDeref(rhs) => self.process_operand(bb, lhs, &Operand::Copy(*rhs), state),
476+
Rvalue::CopyForDeref(rhs) => {
477+
self.process_operand(bb, lhs, &Operand::Copy(*rhs), state)?
478+
}
465479
Rvalue::Discriminant(rhs) => {
466-
let Some(rhs) = self.map.find_discr(rhs.as_ref()) else { return };
480+
let Some(rhs) = self.map.find_discr(rhs.as_ref()) else { return Some(()) };
467481
state.insert_place_idx(rhs, lhs, &self.map);
468482
}
469483
// If we expect `lhs ?= A`, we have an opportunity if we assume `constant == A`.
470484
Rvalue::Aggregate(box kind, operands) => {
471485
let agg_ty = lhs_place.ty(self.body, self.tcx).ty;
472486
let lhs = match kind {
473487
// Do not support unions.
474-
AggregateKind::Adt(.., Some(_)) => return,
488+
AggregateKind::Adt(.., Some(_)) => return Some(()),
475489
AggregateKind::Adt(_, variant_index, ..) if agg_ty.is_enum() => {
476490
if let Some(discr_target) = self.map.apply(lhs, TrackElem::Discriminant)
477491
&& let Some(discr_value) = self
@@ -484,30 +498,31 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
484498
if let Some(idx) = self.map.apply(lhs, TrackElem::Variant(*variant_index)) {
485499
idx
486500
} else {
487-
return;
501+
return Some(());
488502
}
489503
}
490504
_ => lhs,
491505
};
492506
for (field_index, operand) in operands.iter_enumerated() {
493507
if let Some(field) = self.map.apply(lhs, TrackElem::Field(field_index)) {
494-
self.process_operand(bb, field, operand, state);
508+
self.process_operand(bb, field, operand, state)?;
495509
}
496510
}
497511
}
498-
// Transfer the conditions on the copy rhs, after inversing polarity.
512+
// Transfer the conditions on the copy rhs, after inverting the value of the condition.
499513
Rvalue::UnaryOp(UnOp::Not, Operand::Move(place) | Operand::Copy(place)) => {
500-
if !place.ty(self.body, self.tcx).ty.is_bool() {
501-
// Constructing the conditions by inverting the polarity
502-
// of equality is only correct for bools. That is to say,
503-
// `!a == b` is not `a != b` for integers greater than 1 bit.
504-
return;
505-
}
506-
let Some(conditions) = state.try_get_idx(lhs, &self.map) else { return };
507-
let Some(place) = self.map.find(place.as_ref()) else { return };
508-
// FIXME: I think This could be generalized to not bool if we
509-
// actually perform a logical not on the condition's value.
510-
let conds = conditions.map(self.arena, Condition::inv);
514+
let layout = self.ecx.layout_of(place.ty(self.body, self.tcx).ty).unwrap();
515+
let Some(conditions) = state.try_get_idx(lhs, &self.map) else { return Some(()) };
516+
let Some(place) = self.map.find(place.as_ref()) else { return Some(()) };
517+
let conds = conditions.map(self.arena, |mut cond| {
518+
cond.value = self
519+
.ecx
520+
.unary_op(UnOp::Not, &ImmTy::from_scalar_int(cond.value, layout))
521+
.discard_err()?
522+
.to_scalar_int()
523+
.discard_err()?;
524+
Some(cond)
525+
})?;
511526
state.insert_value_idx(place, conds, &self.map);
512527
}
513528
// We expect `lhs ?= A`. We found `lhs = Eq(rhs, B)`.
@@ -517,34 +532,34 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
517532
box (Operand::Move(place) | Operand::Copy(place), Operand::Constant(value))
518533
| box (Operand::Constant(value), Operand::Move(place) | Operand::Copy(place)),
519534
) => {
520-
let Some(conditions) = state.try_get_idx(lhs, &self.map) else { return };
521-
let Some(place) = self.map.find(place.as_ref()) else { return };
535+
let Some(conditions) = state.try_get_idx(lhs, &self.map) else { return Some(()) };
536+
let Some(place) = self.map.find(place.as_ref()) else { return Some(()) };
522537
let equals = match op {
523538
BinOp::Eq => ScalarInt::TRUE,
524539
BinOp::Ne => ScalarInt::FALSE,
525-
_ => return,
540+
_ => return Some(()),
526541
};
527542
if value.const_.ty().is_floating_point() {
528543
// Floating point equality does not follow bit-patterns.
529544
// -0.0 and NaN both have special rules for equality,
530545
// and therefore we cannot use integer comparisons for them.
531546
// Avoid handling them, though this could be extended in the future.
532-
return;
547+
return Some(());
533548
}
534-
let Some(value) = value.const_.try_eval_scalar_int(self.tcx, self.typing_env)
535-
else {
536-
return;
537-
};
538-
let conds = conditions.map(self.arena, |c| Condition {
539-
value,
540-
polarity: if c.matches(equals) { Polarity::Eq } else { Polarity::Ne },
541-
..c
542-
});
549+
let value = value.const_.try_eval_scalar_int(self.tcx, self.typing_env)?;
550+
let conds = conditions.map(self.arena, |c| {
551+
Some(Condition {
552+
value,
553+
polarity: if c.matches(equals) { Polarity::Eq } else { Polarity::Ne },
554+
..c
555+
})
556+
})?;
543557
state.insert_value_idx(place, conds, &self.map);
544558
}
545559

546560
_ => {}
547561
}
562+
Some(())
548563
}
549564

550565
#[instrument(level = "trace", skip(self))]
@@ -553,7 +568,7 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
553568
bb: BasicBlock,
554569
stmt: &Statement<'tcx>,
555570
state: &mut State<ConditionSet<'a>>,
556-
) {
571+
) -> Option<()> {
557572
let register_opportunity = |c: Condition| {
558573
debug!(?bb, ?c.target, "register");
559574
self.opportunities.push(ThreadingOpportunity { chain: vec![bb], target: c.target })
@@ -566,30 +581,32 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
566581
// If we expect `discriminant(place) ?= A`,
567582
// we have an opportunity if `variant_index ?= A`.
568583
StatementKind::SetDiscriminant { box place, variant_index } => {
569-
let Some(discr_target) = self.map.find_discr(place.as_ref()) else { return };
584+
let Some(discr_target) = self.map.find_discr(place.as_ref()) else {
585+
return Some(());
586+
};
570587
let enum_ty = place.ty(self.body, self.tcx).ty;
571588
// `SetDiscriminant` guarantees that the discriminant is now `variant_index`.
572589
// Even if the discriminant write does nothing due to niches, it is UB to set the
573590
// discriminant when the data does not encode the desired discriminant.
574-
let Some(discr) =
575-
self.ecx.discriminant_for_variant(enum_ty, *variant_index).discard_err()
576-
else {
577-
return;
578-
};
591+
let discr =
592+
self.ecx.discriminant_for_variant(enum_ty, *variant_index).discard_err()?;
579593
self.process_immediate(bb, discr_target, discr, state);
580594
}
581595
// If we expect `lhs ?= true`, we have an opportunity if we assume `lhs == true`.
582596
StatementKind::Intrinsic(box NonDivergingIntrinsic::Assume(
583597
Operand::Copy(place) | Operand::Move(place),
584598
)) => {
585-
let Some(conditions) = state.try_get(place.as_ref(), &self.map) else { return };
599+
let Some(conditions) = state.try_get(place.as_ref(), &self.map) else {
600+
return Some(());
601+
};
586602
conditions.iter_matches(ScalarInt::TRUE).for_each(register_opportunity);
587603
}
588604
StatementKind::Assign(box (lhs_place, rhs)) => {
589-
self.process_assign(bb, lhs_place, rhs, state);
605+
self.process_assign(bb, lhs_place, rhs, state)?;
590606
}
591607
_ => {}
592608
}
609+
Some(())
593610
}
594611

595612
#[instrument(level = "trace", skip(self, state, cost))]
@@ -600,7 +617,7 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
600617
state: impl FnOnce() -> State<ConditionSet<'a>>,
601618
cost: &CostChecker<'_, 'tcx>,
602619
depth: usize,
603-
) {
620+
) -> Option<()> {
604621
let term = self.body.basic_blocks[bb].terminator();
605622
let place_to_flood = match term.kind {
606623
// We come from a target, so those are not possible.
@@ -615,9 +632,9 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
615632
| TerminatorKind::FalseUnwind { .. }
616633
| TerminatorKind::Yield { .. } => bug!("{term:?} invalid"),
617634
// Cannot reason about inline asm.
618-
TerminatorKind::InlineAsm { .. } => return,
635+
TerminatorKind::InlineAsm { .. } => return Some(()),
619636
// `SwitchInt` is handled specially.
620-
TerminatorKind::SwitchInt { .. } => return,
637+
TerminatorKind::SwitchInt { .. } => return Some(()),
621638
// We can recurse, no thing particular to do.
622639
TerminatorKind::Goto { .. } => None,
623640
// Flood the overwritten place, and progress through.
@@ -632,7 +649,7 @@ impl<'a, 'tcx> TOFinder<'a, 'tcx> {
632649
if let Some(place_to_flood) = place_to_flood {
633650
state.flood_with(place_to_flood.as_ref(), &self.map, ConditionSet::BOTTOM);
634651
}
635-
self.find_opportunity(bb, state, cost.clone(), depth + 1);
652+
self.find_opportunity(bb, state, cost.clone(), depth + 1)
636653
}
637654

638655
#[instrument(level = "trace", skip(self))]

‎tests/mir-opt/jump_threading.bitwise_not.JumpThreading.panic-abort.diff

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
fn bitwise_not() -> i32 {
55
let mut _0: i32;
6-
let mut _1: i32;
6+
let _1: i32;
77
let mut _2: bool;
88
let mut _3: i32;
99
let mut _4: i32;
@@ -13,7 +13,6 @@
1313

1414
bb0: {
1515
StorageLive(_1);
16-
_1 = const 0_i32;
1716
_1 = const 1_i32;
1817
StorageLive(_2);
1918
StorageLive(_3);
@@ -22,7 +21,8 @@
2221
_3 = Not(move _4);
2322
StorageDead(_4);
2423
_2 = Eq(move _3, const 0_i32);
25-
switchInt(move _2) -> [0: bb2, otherwise: bb1];
24+
- switchInt(move _2) -> [0: bb2, otherwise: bb1];
25+
+ goto -> bb2;
2626
}
2727

2828
bb1: {

‎tests/mir-opt/jump_threading.bitwise_not.JumpThreading.panic-unwind.diff

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
fn bitwise_not() -> i32 {
55
let mut _0: i32;
6-
let mut _1: i32;
6+
let _1: i32;
77
let mut _2: bool;
88
let mut _3: i32;
99
let mut _4: i32;
@@ -13,7 +13,6 @@
1313

1414
bb0: {
1515
StorageLive(_1);
16-
_1 = const 0_i32;
1716
_1 = const 1_i32;
1817
StorageLive(_2);
1918
StorageLive(_3);
@@ -22,7 +21,8 @@
2221
_3 = Not(move _4);
2322
StorageDead(_4);
2423
_2 = Eq(move _3, const 0_i32);
25-
switchInt(move _2) -> [0: bb2, otherwise: bb1];
24+
- switchInt(move _2) -> [0: bb2, otherwise: bb1];
25+
+ goto -> bb2;
2626
}
2727

2828
bb1: {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
- // MIR for `logical_not` before JumpThreading
2+
+ // MIR for `logical_not` after JumpThreading
3+
4+
fn logical_not() -> i32 {
5+
let mut _0: i32;
6+
let _1: bool;
7+
let mut _2: bool;
8+
let mut _3: bool;
9+
let mut _4: bool;
10+
scope 1 {
11+
debug a => _1;
12+
}
13+
14+
bb0: {
15+
StorageLive(_1);
16+
_1 = const false;
17+
StorageLive(_2);
18+
StorageLive(_3);
19+
StorageLive(_4);
20+
_4 = copy _1;
21+
_3 = Not(move _4);
22+
StorageDead(_4);
23+
_2 = Eq(move _3, const true);
24+
- switchInt(move _2) -> [0: bb2, otherwise: bb1];
25+
+ goto -> bb1;
26+
}
27+
28+
bb1: {
29+
StorageDead(_3);
30+
_0 = const 1_i32;
31+
goto -> bb3;
32+
}
33+
34+
bb2: {
35+
StorageDead(_3);
36+
_0 = const 0_i32;
37+
goto -> bb3;
38+
}
39+
40+
bb3: {
41+
StorageDead(_2);
42+
StorageDead(_1);
43+
return;
44+
}
45+
}
46+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
- // MIR for `logical_not` before JumpThreading
2+
+ // MIR for `logical_not` after JumpThreading
3+
4+
fn logical_not() -> i32 {
5+
let mut _0: i32;
6+
let _1: bool;
7+
let mut _2: bool;
8+
let mut _3: bool;
9+
let mut _4: bool;
10+
scope 1 {
11+
debug a => _1;
12+
}
13+
14+
bb0: {
15+
StorageLive(_1);
16+
_1 = const false;
17+
StorageLive(_2);
18+
StorageLive(_3);
19+
StorageLive(_4);
20+
_4 = copy _1;
21+
_3 = Not(move _4);
22+
StorageDead(_4);
23+
_2 = Eq(move _3, const true);
24+
- switchInt(move _2) -> [0: bb2, otherwise: bb1];
25+
+ goto -> bb1;
26+
}
27+
28+
bb1: {
29+
StorageDead(_3);
30+
_0 = const 1_i32;
31+
goto -> bb3;
32+
}
33+
34+
bb2: {
35+
StorageDead(_3);
36+
_0 = const 0_i32;
37+
goto -> bb3;
38+
}
39+
40+
bb3: {
41+
StorageDead(_2);
42+
StorageDead(_1);
43+
return;
44+
}
45+
}
46+

‎tests/mir-opt/jump_threading.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -532,14 +532,19 @@ fn floats() -> u32 {
532532

533533
pub fn bitwise_not() -> i32 {
534534
// CHECK-LABEL: fn bitwise_not(
535-
// CHECK: switchInt(
536535

537536
// Test for #131195, which was optimizing `!a == b` into `a != b`.
538-
let mut a: i32 = 0;
539-
a = 1;
537+
let a = 1;
540538
if !a == 0 { 1 } else { 0 }
541539
}
542540

541+
pub fn logical_not() -> i32 {
542+
// CHECK-LABEL: fn logical_not(
543+
544+
let a = false;
545+
if !a == true { 1 } else { 0 }
546+
}
547+
543548
fn main() {
544549
// CHECK-LABEL: fn main(
545550
too_complex(Ok(0));
@@ -555,6 +560,8 @@ fn main() {
555560
aggregate(7);
556561
assume(7, false);
557562
floats();
563+
bitwise_not();
564+
logical_not();
558565
}
559566

560567
// EMIT_MIR jump_threading.too_complex.JumpThreading.diff
@@ -572,3 +579,4 @@ fn main() {
572579
// EMIT_MIR jump_threading.aggregate_copy.JumpThreading.diff
573580
// EMIT_MIR jump_threading.floats.JumpThreading.diff
574581
// EMIT_MIR jump_threading.bitwise_not.JumpThreading.diff
582+
// EMIT_MIR jump_threading.logical_not.JumpThreading.diff

0 commit comments

Comments
 (0)
Please sign in to comment.