Skip to content

Commit

Permalink
Revert folding of zero/non-zero based on facts
Browse files Browse the repository at this point in the history
  • Loading branch information
titzer committed Feb 2, 2024
1 parent 13ad835 commit d86a361
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aeneas/src/main/Version.v3
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

// Updated by VCS scripts. DO NOT EDIT.
component Version {
def version: string = "III-7.1683";
def version: string = "III-7.1684";
var buildData: string;
}
3 changes: 2 additions & 1 deletion aeneas/src/ssa/SsaOptimizer.v3
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ class SsaInstrReducer(context: SsaContext) extends SsaInstrMatcher {
if (x == y) return graph.trueConst();
var and = x.facts & y.facts, or = x.facts | y.facts;
if (Facts.NONE != (and & Fact.V_ZERO)) return graph.trueConst(); // 0 == 0 == true
if (ZERO_NON_ZERO == (or & ZERO_NON_ZERO)) return graph.falseConst(); // 0 == nonzero == false
// TODO: facts about variants are incorrect (null/zero confusion)
//TODO if (ZERO_NON_ZERO == (or & ZERO_NON_ZERO)) return graph.falseConst(); // 0 == nonzero == false
if (ABOVE_BELOW_ZERO == (or & ABOVE_BELOW_ZERO)) return graph.falseConst(); // neg == pos == false
}
VariantEq => {
Expand Down

0 comments on commit d86a361

Please sign in to comment.