Rollup merge of #127105 - scottmcm:issue-127089, r=cjgillot
Only update `Eq` operands in GVN if it can update both sides Otherwise the types might not match Fixes #127089 r? mir-opt
This commit is contained in:
commit
6938b4b640
6 changed files with 132 additions and 5 deletions
|
@ -1074,11 +1074,11 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
{
|
||||
lhs = *lhs_value;
|
||||
rhs = *rhs_value;
|
||||
if let Some(op) = self.try_as_operand(lhs, location) {
|
||||
*lhs_operand = op;
|
||||
}
|
||||
if let Some(op) = self.try_as_operand(rhs, location) {
|
||||
*rhs_operand = op;
|
||||
if let Some(lhs_op) = self.try_as_operand(lhs, location)
|
||||
&& let Some(rhs_op) = self.try_as_operand(rhs, location)
|
||||
{
|
||||
*lhs_operand = lhs_op;
|
||||
*rhs_operand = rhs_op;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue