minor optimization of boolean comparisons

This commit is contained in:
Vern Paxson 2024-07-23 15:31:59 -07:00
parent e960c29acb
commit ff7466df6e
2 changed files with 28 additions and 4 deletions

View file

@ -245,6 +245,12 @@ StmtPtr IfStmt::DoReduce(Reducer* c) {
red_e_stmt = cond_red_stmt;
}
// Check again for negation given above reductions/replacements.
if ( e->Tag() == EXPR_NOT ) {
std::swap(s1, s2);
e = e->GetOp1();
}
StmtPtr sl;
if ( e->IsConst() ) {