Disable the asserts that check that normalization is perfectly
authorDan Gohman <gohman@apple.com>
Fri, 3 Sep 2010 22:12:56 +0000 (22:12 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 3 Sep 2010 22:12:56 +0000 (22:12 +0000)
invertible. ScalarEvolution's folding routines don't always succeed
in canonicalizing equal expressions to a single canonical form, and
this can cause these asserts to fail, even though there's no actual
correctness problem. This fixes PR8066.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113021 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolutionNormalization.cpp

index 498387af50eaa3390f22c857640f66fe324ccc40..ac36cef89ebb585cb46f8e9cba1a8bfd3fa26f5d 100644 (file)
@@ -108,7 +108,11 @@ const SCEV *llvm::TransformForPostIncUse(TransformKind Kind,
         Result = SE.getMinusSCEV(Result, TransformedStep);
         Loops.insert(L);
       }
-#ifdef XDEBUG
+#if 0
+      // This assert is conceptually correct, but ScalarEvolution currently
+      // sometimes fails to canonicalize two equal SCEVs to exactly the same
+      // form. It's possibly a pessimization when this happens, but it isn't a
+      // correctness problem, so disable this assert for now.
       assert(S == TransformForPostIncUse(Denormalize, Result,
                                          User, OperandValToReplace,
                                          Loops, SE, DT) &&
@@ -122,7 +126,8 @@ const SCEV *llvm::TransformForPostIncUse(TransformKind Kind,
                                  User, OperandValToReplace, Loops, SE, DT);
         Result = SE.getMinusSCEV(Result, TransformedStep);
       }
-#ifdef XDEBUG
+#if 0
+      // See the comment on the assert above.
       assert(S == TransformForPostIncUse(Denormalize, Result,
                                          User, OperandValToReplace,
                                          Loops, SE, DT) &&