From d86a361e54b39f477a155d5141a9e1cdc4729a24 Mon Sep 17 00:00:00 2001 From: "Ben L. Titzer" Date: Fri, 2 Feb 2024 10:09:24 -0500 Subject: [PATCH] Revert folding of zero/non-zero based on facts --- aeneas/src/main/Version.v3 | 2 +- aeneas/src/ssa/SsaOptimizer.v3 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/aeneas/src/main/Version.v3 b/aeneas/src/main/Version.v3 index 47d4a529f..6c93b8216 100644 --- a/aeneas/src/main/Version.v3 +++ b/aeneas/src/main/Version.v3 @@ -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; } diff --git a/aeneas/src/ssa/SsaOptimizer.v3 b/aeneas/src/ssa/SsaOptimizer.v3 index 194ac1b57..8a2d5f8a1 100644 --- a/aeneas/src/ssa/SsaOptimizer.v3 +++ b/aeneas/src/ssa/SsaOptimizer.v3 @@ -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 => {