[RuntimeDebugBuilder] Do not break for 64 bit integers
[polly-mirror.git] / unittests / ScheduleOptimizer / ScheduleOptimizerTest.cpp
blobd23766dd066e89f5dd7073ca5db6dfb24fcb611e
1 //===- ScheduleOptimizerTest.cpp ------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 #include "polly/ScheduleOptimizer.h"
11 #include "gtest/gtest.h"
12 #include "isl/stream.h"
13 #include "isl/val.h"
15 using namespace isl;
16 namespace {
18 TEST(ScheduleOptimizer, getPartialTilePrefixes) {
20 isl_ctx *ctx = isl_ctx_alloc();
23 // Verify that for a loop with 3 iterations starting at 0 that is
24 // pre-vectorized (strip-mined with a factor of 2), we correctly identify
25 // that only the first two iterations are full vector iterations.
26 isl::map Schedule(
27 ctx, "{[i] -> [floor(i/2), i - 2 * floor(i/2)] : 0 <= i < 3 }");
28 isl::set ScheduleRange = Schedule.range();
29 isl::set Result = getPartialTilePrefixes(ScheduleRange, 2);
31 EXPECT_TRUE(Result.is_equal(isl::set(ctx, "{[0]}")));
35 // Verify that for a loop with 3 iterations starting at 1 that is
36 // pre-vectorized (strip-mined with a factor of 2), we correctly identify
37 // that only the last two iterations are full vector iterations.
38 isl::map Schedule(
39 ctx, "{[i] -> [floor(i/2), i - 2 * floor(i/2)] : 1 <= i < 4 }");
40 isl::set ScheduleRange = Schedule.range();
41 isl::set Result = getPartialTilePrefixes(ScheduleRange, 2);
43 EXPECT_TRUE(Result.is_equal(isl::set(ctx, "{[1]}")));
47 // Verify that for a loop with 6 iterations starting at 1 that is
48 // pre-vectorized (strip-mined with a factor of 2), we correctly identify
49 // that all but the first and the last iteration are full vector iterations.
50 isl::map Schedule(
51 ctx, "{[i] -> [floor(i/2), i - 2 * floor(i/2)] : 1 <= i < 6 }");
52 isl::set ScheduleRange = Schedule.range();
53 isl::set Result = getPartialTilePrefixes(ScheduleRange, 2);
55 EXPECT_TRUE(Result.is_equal(isl::set(ctx, "{[1]; [2]}")));
58 isl_ctx_free(ctx);
60 } // anonymous namespace