Explain side-effects from simplify_operand.
This commit is contained in:
parent
22ed51e136
commit
166fe54eba
1 changed files with 4 additions and 0 deletions
|
@ -794,6 +794,8 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
let ty = lhs.ty(self.local_decls, self.tcx);
|
||||
let lhs = self.simplify_operand(lhs, location);
|
||||
let rhs = self.simplify_operand(rhs, location);
|
||||
// Only short-circuit options after we called `simplify_operand`
|
||||
// on both operands for side effect.
|
||||
let lhs = lhs?;
|
||||
let rhs = rhs?;
|
||||
if let Some(value) = self.simplify_binary(op, false, ty, lhs, rhs) {
|
||||
|
@ -805,6 +807,8 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
let ty = lhs.ty(self.local_decls, self.tcx);
|
||||
let lhs = self.simplify_operand(lhs, location);
|
||||
let rhs = self.simplify_operand(rhs, location);
|
||||
// Only short-circuit options after we called `simplify_operand`
|
||||
// on both operands for side effect.
|
||||
let lhs = lhs?;
|
||||
let rhs = rhs?;
|
||||
if let Some(value) = self.simplify_binary(op, true, ty, lhs, rhs) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue