Optimize DFG De Morgan patterns (#6090)
It's ok if the replaced vertex has multiple sinks, this pattern cannot increase the size of logic even then.
This commit is contained in:
parent
47f5a6a52b
commit
bca2e2c16e
|
|
@ -895,8 +895,8 @@ class V3DfgPeephole final : public DfgVisitor {
|
||||||
DfgVertex* const rhsp = vtxp->rhsp();
|
DfgVertex* const rhsp = vtxp->rhsp();
|
||||||
FileLine* const flp = vtxp->fileline();
|
FileLine* const flp = vtxp->fileline();
|
||||||
|
|
||||||
// Bubble pushing
|
// Bubble pushing (De Morgan)
|
||||||
if (!vtxp->hasMultipleSinks() && !lhsp->hasMultipleSinks() && !rhsp->hasMultipleSinks()) {
|
if (!lhsp->hasMultipleSinks() && !rhsp->hasMultipleSinks()) {
|
||||||
if (DfgNot* const lhsNotp = lhsp->cast<DfgNot>()) {
|
if (DfgNot* const lhsNotp = lhsp->cast<DfgNot>()) {
|
||||||
if (DfgNot* const rhsNotp = rhsp->cast<DfgNot>()) {
|
if (DfgNot* const rhsNotp = rhsp->cast<DfgNot>()) {
|
||||||
APPLYING(REPLACE_AND_OF_NOT_AND_NOT) {
|
APPLYING(REPLACE_AND_OF_NOT_AND_NOT) {
|
||||||
|
|
@ -964,8 +964,8 @@ class V3DfgPeephole final : public DfgVisitor {
|
||||||
DfgVertex* const rhsp = vtxp->rhsp();
|
DfgVertex* const rhsp = vtxp->rhsp();
|
||||||
FileLine* const flp = vtxp->fileline();
|
FileLine* const flp = vtxp->fileline();
|
||||||
|
|
||||||
// Bubble pushing
|
// Bubble pushing (De Morgan)
|
||||||
if (!vtxp->hasMultipleSinks() && !lhsp->hasMultipleSinks() && !rhsp->hasMultipleSinks()) {
|
if (!lhsp->hasMultipleSinks() && !rhsp->hasMultipleSinks()) {
|
||||||
if (DfgNot* const lhsNotp = lhsp->cast<DfgNot>()) {
|
if (DfgNot* const lhsNotp = lhsp->cast<DfgNot>()) {
|
||||||
if (DfgNot* const rhsNotp = rhsp->cast<DfgNot>()) {
|
if (DfgNot* const rhsNotp = rhsp->cast<DfgNot>()) {
|
||||||
APPLYING(REPLACE_OR_OF_NOT_AND_NOT) {
|
APPLYING(REPLACE_OR_OF_NOT_AND_NOT) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue