@@ -1531,6 +1531,49 @@ void Compiler::optValnumCSE_Availability()
1531
1531
// This is the first time visited, so record this defs exception set
1532
1532
desc->defExcSetCurrent = theLiberalExcSet;
1533
1533
}
1534
+ else if (desc->defExcSetCurrent != theLiberalExcSet)
1535
+ {
1536
+ // We will change the value of desc->defExcSetCurrent to be the intersection of
1537
+ // these two sets.
1538
+ // This is the set of exceptions that all CSE defs have (that we have visited so
1539
+ // far)
1540
+ //
1541
+ ValueNum intersectionExcSet =
1542
+ vnStore->VNExcSetIntersection (desc->defExcSetCurrent , theLiberalExcSet);
1543
+ #ifdef DEBUG
1544
+ if (this ->verbose )
1545
+ {
1546
+ VNFuncApp excSeq;
1547
+
1548
+ vnStore->GetVNFunc (desc->defExcSetCurrent , &excSeq);
1549
+ printf (" >>> defExcSetCurrent is " );
1550
+ vnStore->vnDumpExcSeq (this , &excSeq, true );
1551
+ printf (" \n " );
1552
+
1553
+ vnStore->GetVNFunc (theLiberalExcSet, &excSeq);
1554
+ printf (" >>> theLiberalExcSet is " );
1555
+ vnStore->vnDumpExcSeq (this , &excSeq, true );
1556
+ printf (" \n " );
1557
+
1558
+ if (intersectionExcSet == vnStore->VNForEmptyExcSet ())
1559
+ {
1560
+ printf (" >>> the intersectionExcSet is the EmptyExcSet\n " );
1561
+ }
1562
+ else
1563
+ {
1564
+ vnStore->GetVNFunc (intersectionExcSet, &excSeq);
1565
+ printf (" >>> the intersectionExcSet is " );
1566
+ vnStore->vnDumpExcSeq (this , &excSeq, true );
1567
+ printf (" \n " );
1568
+ }
1569
+ }
1570
+ #endif // DEBUG
1571
+
1572
+ // Change the defExcSetCurrent to be a subset of its prior value
1573
+ //
1574
+ assert (vnStore->VNExcIsSubset (desc->defExcSetCurrent , intersectionExcSet));
1575
+ desc->defExcSetCurrent = intersectionExcSet;
1576
+ }
1534
1577
1535
1578
// Have we seen a CSE use and made a promise of an exception set?
1536
1579
//
@@ -1543,51 +1586,6 @@ void Compiler::optValnumCSE_Availability()
1543
1586
// This new def still satisfies any promise made to all the CSE uses that we have
1544
1587
// encountered
1545
1588
//
1546
-
1547
- // no update is needed when these are the same VN
1548
- if (desc->defExcSetCurrent != theLiberalExcSet)
1549
- {
1550
- // We will change the value of desc->defExcSetCurrent to be the intersection of
1551
- // these two sets.
1552
- // This is the set of exceptions that all CSE defs have (that we have visited so
1553
- // far)
1554
- //
1555
- ValueNum intersectionExcSet =
1556
- vnStore->VNExcSetIntersection (desc->defExcSetCurrent , theLiberalExcSet);
1557
- #ifdef DEBUG
1558
- if (this ->verbose )
1559
- {
1560
- VNFuncApp excSeq;
1561
-
1562
- vnStore->GetVNFunc (desc->defExcSetCurrent , &excSeq);
1563
- printf (" >>> defExcSetCurrent is " );
1564
- vnStore->vnDumpExcSeq (this , &excSeq, true );
1565
- printf (" \n " );
1566
-
1567
- vnStore->GetVNFunc (theLiberalExcSet, &excSeq);
1568
- printf (" >>> theLiberalExcSet is " );
1569
- vnStore->vnDumpExcSeq (this , &excSeq, true );
1570
- printf (" \n " );
1571
-
1572
- if (intersectionExcSet == vnStore->VNForEmptyExcSet ())
1573
- {
1574
- printf (" >>> the intersectionExcSet is the EmptyExcSet\n " );
1575
- }
1576
- else
1577
- {
1578
- vnStore->GetVNFunc (intersectionExcSet, &excSeq);
1579
- printf (" >>> the intersectionExcSet is " );
1580
- vnStore->vnDumpExcSeq (this , &excSeq, true );
1581
- printf (" \n " );
1582
- }
1583
- }
1584
- #endif // DEBUG
1585
-
1586
- // Change the defExcSetCurrent to be a subset of its prior value
1587
- //
1588
- assert (vnStore->VNExcIsSubset (desc->defExcSetCurrent , intersectionExcSet));
1589
- desc->defExcSetCurrent = intersectionExcSet;
1590
- }
1591
1589
}
1592
1590
else // This CSE def doesn't satisfy one of the exceptions already promised to a CSE use
1593
1591
{
0 commit comments