Revert r247278 "Disable support for modulo expressions"

This reverts commit 00c5b6ca8832439193036aadaaaee92a43236219.

  We can handle modulo expressions in the domain again.

llvm-svn: 247542
This commit is contained in:
Johannes Doerfert 2015-09-14 11:14:23 +00:00
parent fdaefe533b
commit 36255eecd8
9 changed files with 14 additions and 53 deletions

View File

@ -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) {

View File

@ -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:128-n8:16:32:64-S128"
; 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: }

View File

@ -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:

View File

@ -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;

View File

@ -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++) {

View File

@ -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++) {

View File

@ -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;

View File

@ -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++)

View File

@ -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++)