[polly] r247542 - Revert r247278 "Disable support for modulo expressions"

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 04:14:23 PDT 2015


Author: jdoerfert
Date: Mon Sep 14 06:14:23 2015
New Revision: 247542

URL: http://llvm.org/viewvc/llvm-project?rev=247542&view=rev
Log:
Revert r247278 "Disable support for modulo expressions"

  This reverts commit 00c5b6ca8832439193036aadaaaee92a43236219.

  We can handle modulo expressions in the domain again.

Modified:
    polly/trunk/lib/Support/SCEVValidator.cpp
    polly/trunk/test/Isl/CodeGen/if-conditions-in-vector-code.ll
    polly/trunk/test/Isl/CodeGen/inner_scev_sdiv_in_rtc.ll
    polly/trunk/test/Isl/CodeGen/srem-in-other-bb.ll
    polly/trunk/test/ScopInfo/NonAffine/modulo_backedge.ll
    polly/trunk/test/ScopInfo/NonAffine/modulo_domain.ll
    polly/trunk/test/ScopInfo/NonAffine/non_affine_but_srem.ll
    polly/trunk/test/ScopInfo/multidim_srem.ll
    polly/trunk/test/ScopInfo/reduction_alternating_base.ll

Modified: polly/trunk/lib/Support/SCEVValidator.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/SCEVValidator.cpp?rev=247542&r1=247541&r2=247542&view=diff
==============================================================================
--- polly/trunk/lib/Support/SCEVValidator.cpp (original)
+++ polly/trunk/lib/Support/SCEVValidator.cpp Mon Sep 14 06:14:23 2015
@@ -350,23 +350,17 @@ public:
   }
 
   ValidatorResult visitSRemInstruction(Instruction *SRem, const SCEV *S) {
-    // TODO: FIXME: SRem instructions in the domain description are currently
-    //              not compatible with the domain generation. Once this is
-    //              fixed we need to enable this handling again.
-    return ValidatorResult(SCEVType::INVALID);
-#if 0
-        assert(SRem->getOpcode() == Instruction::SRem &&
-               "Assumed SRem instruction!");
+    assert(SRem->getOpcode() == Instruction::SRem &&
+           "Assumed SRem instruction!");
 
-        auto *Divisor = SRem->getOperand(1);
-        auto *CI = dyn_cast<ConstantInt>(Divisor);
-        if (!CI)
-          return visitGenericInst(SRem, S);
+    auto *Divisor = SRem->getOperand(1);
+    auto *CI = dyn_cast<ConstantInt>(Divisor);
+    if (!CI)
+      return visitGenericInst(SRem, S);
 
-        auto *Dividend = SRem->getOperand(0);
-        auto *DividendSCEV = SE.getSCEV(Dividend);
-        return visit(DividendSCEV);
-#endif
+    auto *Dividend = SRem->getOperand(0);
+    auto *DividendSCEV = SE.getSCEV(Dividend);
+    return visit(DividendSCEV);
   }
 
   ValidatorResult visitUnknown(const SCEVUnknown *Expr) {

Modified: polly/trunk/test/Isl/CodeGen/if-conditions-in-vector-code.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/if-conditions-in-vector-code.ll?rev=247542&r1=247541&r2=247542&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/if-conditions-in-vector-code.ll (original)
+++ polly/trunk/test/Isl/CodeGen/if-conditions-in-vector-code.ll Mon Sep 14 06:14:23 2015
@@ -4,12 +4,6 @@
 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-codegen -polly-vectorizer=polly -S < %s | \
 ; RUN:     FileCheck %s
 ;
-; TODO: The new domain generation cannot handle modulo domain constraints,
-;       hence modulo handling has been disabled completely. Once this is
-;       resolved this test should work again. Until then we approximate the
-;       whole loop body.
-; XFAIL: *
-
 ;    void foo(float *A) {
 ;      for (long i = 0; i < 16; i++) {
 ;        if (i % 2)
@@ -23,10 +17,10 @@ target datalayout = "e-m:e-i64:64-f80:12
 
 ; AST: #pragma simd
 ; AST: #pragma known-parallel
-; AST: for (int c0 = 0; c0 <= 16; c0 += 1) {
+; AST: for (int c0 = 0; c0 <= 15; c0 += 1) {
 ; AST:   if ((c0 - 1) % 2 == 0)
 ; AST:     Stmt_bb4(c0);
-; AST:   if (c0 <= 15 && c0 % 3 >= 1)
+; AST:   if (c0 % 3 >= 1)
 ; AST:     Stmt_bb11(c0);
 ; AST: }
 

Modified: polly/trunk/test/Isl/CodeGen/inner_scev_sdiv_in_rtc.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/inner_scev_sdiv_in_rtc.ll?rev=247542&r1=247541&r2=247542&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/inner_scev_sdiv_in_rtc.ll (original)
+++ polly/trunk/test/Isl/CodeGen/inner_scev_sdiv_in_rtc.ll Mon Sep 14 06:14:23 2015
@@ -1,11 +1,6 @@
 ; RUN: opt %loadPolly -polly-codegen -polly-no-early-exit \
 ; RUN:     -polly-detect-unprofitable -S < %s | FileCheck %s
 ;
-; TODO: The new domain generation cannot handle modulo domain constraints,
-;       hence modulo handling has been disabled completely. Once this is
-;       resolved this test should work again.
-; XFAIL: *
-;
 ; This will just check that we generate valid code here.
 ;
 ; CHECK: polly.start:

Modified: polly/trunk/test/Isl/CodeGen/srem-in-other-bb.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/srem-in-other-bb.ll?rev=247542&r1=247541&r2=247542&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/srem-in-other-bb.ll (original)
+++ polly/trunk/test/Isl/CodeGen/srem-in-other-bb.ll Mon Sep 14 06:14:23 2015
@@ -1,11 +1,6 @@
 ; RUN: opt %loadPolly -polly-codegen -S -polly-no-early-exit \
 ; RUN:     -polly-detect-unprofitable < %s | FileCheck %s
 ;
-; TODO: The new domain generation cannot handle modulo domain constraints,
-;       hence modulo handling has been disabled completely. Once this is
-;       resolved this test should work again.
-; XFAIL: *
-;
 ;    void pos(float *A, long n) {
 ;      for (long i = 0; i < 100; i++)
 ;        A[n % 42] += 1;

Modified: polly/trunk/test/ScopInfo/NonAffine/modulo_backedge.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/modulo_backedge.ll?rev=247542&r1=247541&r2=247542&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/modulo_backedge.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/modulo_backedge.ll Mon Sep 14 06:14:23 2015
@@ -1,9 +1,7 @@
 ; RUN: opt %loadPolly -polly-scops -polly-detect-unprofitable -analyze < %s | FileCheck %s
 ;
-; TODO: The new domain generation cannot handle modulo domain constraints,
-;       hence modulo handling has been disabled completely. Once this is
-;       resolved this test should work again.
-; CHECK-NOT: Access
+; CHECK: Domain :=
+; CHECK:   { Stmt_for_body[i0] : i0 <= 6 and i0 >= 0 };
 ;
 ;    void foo(float *A) {
 ;      for (long i = 1;; i++) {

Modified: polly/trunk/test/ScopInfo/NonAffine/modulo_domain.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/modulo_domain.ll?rev=247542&r1=247541&r2=247542&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/modulo_domain.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/modulo_domain.ll Mon Sep 14 06:14:23 2015
@@ -6,8 +6,7 @@
 ;       whole loop body.
 ;
 ; CHECK:   Domain :=
-; CHECK:       { Stmt_for_body__TO__if_end[i0] : i0 <= 15 and i0 >= 0 };
-;
+; CHECK:       { Stmt_for_body[i0] : i0 <= 15 and i0 >= 0 };
 ;
 ;    void foo(float *A) {
 ;      for (long i = 0; i < 16; i++) {

Modified: polly/trunk/test/ScopInfo/NonAffine/non_affine_but_srem.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non_affine_but_srem.ll?rev=247542&r1=247541&r2=247542&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non_affine_but_srem.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non_affine_but_srem.ll Mon Sep 14 06:14:23 2015
@@ -1,11 +1,6 @@
 ; RUN: opt %loadPolly -polly-scops -polly-detect-unprofitable \
 ; RUN:                -analyze < %s | FileCheck %s
 ;
-; TODO: The new domain generation cannot handle modulo domain constraints,
-;       hence modulo handling has been disabled completely. Once this is
-;       resolved this test should work again.
-; XFAIL: *
-;
 ;    void pos(float *A, long n) {
 ;      for (long i = 0; i < 100; i++)
 ;        A[n % 42] += 1;

Modified: polly/trunk/test/ScopInfo/multidim_srem.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/multidim_srem.ll?rev=247542&r1=247541&r2=247542&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/multidim_srem.ll (original)
+++ polly/trunk/test/ScopInfo/multidim_srem.ll Mon Sep 14 06:14:23 2015
@@ -1,10 +1,5 @@
 ; RUN: opt %loadPolly -analyze -polly-scops -S < %s | FileCheck %s
 ;
-; TODO: The new domain generation cannot handle modulo domain constraints,
-;       hence modulo handling has been disabled completely. Once this is
-;       resolved this test should work again.
-; XFAIL: *
-;
 ;    void foo(long n, float A[][n][n]) {
 ;      for (long i = 0; i < 200; i++)
 ;        for (long j = 0; j < n; j++)

Modified: polly/trunk/test/ScopInfo/reduction_alternating_base.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/reduction_alternating_base.ll?rev=247542&r1=247541&r2=247542&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/reduction_alternating_base.ll (original)
+++ polly/trunk/test/ScopInfo/reduction_alternating_base.ll Mon Sep 14 06:14:23 2015
@@ -1,9 +1,5 @@
 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-scops -analyze < %s | FileCheck %s
 ;
-; TODO: The new domain generation cannot handle modulo domain constraints,
-;       hence modulo handling has been disabled completely. Once this is
-;       resolved this test should work again.
-; XFAIL: *
 ;
 ;    void f(int *A) {
 ;      for (int i = 0; i < 1024; i++)




More information about the llvm-commits mailing list