Polly 22.0.0git
ISLTools.cpp File Reference
#include "polly/Support/ISLTools.h"
#include "polly/Support/GICHelper.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <vector>

Go to the source code of this file.

Functions

static void foreachPoint (const isl::set &Set, const std::function< void(isl::point P)> &F)
static void foreachPoint (isl::basic_set BSet, const std::function< void(isl::point P)> &F)
static int flatCompare (const isl::basic_set &A, const isl::basic_set &B)
 Determine the sorting order of the sets A and B without considering the space structure.
static int structureCompare (const isl::space &ASpace, const isl::space &BSpace, bool ConsiderTupleLen)
 Compare the sets A and B according to their nested space structure.
static bool orderComparer (const isl::basic_set &A, const isl::basic_set &B)
 Compare the sets A and B according to their nested space structure.
static void printSortedPolyhedra (isl::union_set USet, llvm::raw_ostream &OS, bool Simplify, bool IsMap)
 Print a string representation of USet to OS.
static void recursiveExpand (isl::basic_set BSet, unsigned Dim, isl::set &Expanded)
static isl::set expand (const isl::set &Set)
 Make each point of a set explicit.
static isl::union_set expand (const isl::union_set &USet)
 Expand all points of a union set explicit.

Function Documentation

◆ expand() [1/2]

isl::set expand ( const isl::set & Set)
static

Make each point of a set explicit.

"Expanding" makes each point a set contains explicit. That is, the result is a set of singleton polyhedra. Unbounded dimensions are not expanded.

Example: { [i] : 0 <= i < 2 } is expanded to: { [0]; [1] }

Definition at line 838 of file ISLTools.cpp.

References isl::set::empty(), isl::set::get_basic_set_list(), isl::set::get_space(), and recursiveExpand().

Referenced by polly::dumpExpanded(), polly::dumpExpanded(), polly::dumpExpanded(), polly::dumpExpanded(), and expand().

◆ expand() [2/2]

isl::union_set expand ( const isl::union_set & USet)
static

Expand all points of a union set explicit.

See also
expand(const isl::set)

Definition at line 848 of file ISLTools.cpp.

References isl::union_set::ctx(), isl::union_set::empty(), expand(), isl::union_set::get_set_list(), and isl::union_set::unite().

◆ flatCompare()

int flatCompare ( const isl::basic_set & A,
const isl::basic_set & B )
static

Determine the sorting order of the sets A and B without considering the space structure.

Ordering is based on the lower bounds of the set's dimensions. First dimensions are considered first.

Definition at line 621 of file ISLTools.cpp.

References A(), B(), isl::basic_set::convex_hull(), polly::getConstant(), isl::param, isl::set, isl::val::sgn(), isl::val::sub(), and unsignedFromIslSize().

Referenced by orderComparer().

◆ foreachPoint() [1/2]

void foreachPoint ( const isl::set & Set,
const std::function< void(isl::point P)> & F )
static

Definition at line 603 of file ISLTools.cpp.

References isl::set::foreach_point(), and isl::stat::ok().

Referenced by foreachPoint(), and recursiveExpand().

◆ foreachPoint() [2/2]

void foreachPoint ( isl::basic_set BSet,
const std::function< void(isl::point P)> & F )
static

Definition at line 611 of file ISLTools.cpp.

References foreachPoint().

◆ orderComparer()

bool orderComparer ( const isl::basic_set & A,
const isl::basic_set & B )
static

Compare the sets A and B according to their nested space structure.

If the structure is the same, sort using the dimension lower bounds. Returns an std::sort compatible bool.

Definition at line 721 of file ISLTools.cpp.

References A(), B(), flatCompare(), and structureCompare().

Referenced by printSortedPolyhedra().

◆ printSortedPolyhedra()

void printSortedPolyhedra ( isl::union_set USet,
llvm::raw_ostream & OS,
bool Simplify,
bool IsMap )
static

Print a string representation of USet to OS.

The pieces of USet are printed in a sorted order. Spaces with equal or similar nesting structure are printed together. Compared to isl's own printing function the uses the structure itself as base of the sorting, not a hash of it. It ensures that e.g. maps spaces with same domain structure are printed together. Set pieces with same structure are printed in order of their lower bounds.

Parameters
USetPolyhedra to print.
OSTarget stream.
SimplifyWhether to simplify the polyhedron before printing.
IsMapWhether USet is a wrapped map. If true, sets are unwrapped before printing to again appear as a map.

Definition at line 752 of file ISLTools.cpp.

References assert, isl::set::get_basic_set_list(), isl::union_set::get_set_list(), isl::union_set::is_null(), orderComparer(), Simplify, simplify, Str, and isl::basic_set::unwrap().

Referenced by polly::dumpExpanded(), polly::dumpExpanded(), polly::dumpExpanded(), polly::dumpExpanded(), polly::dumpPw(), polly::dumpPw(), polly::dumpPw(), and polly::dumpPw().

◆ recursiveExpand()

◆ structureCompare()

int structureCompare ( const isl::space & ASpace,
const isl::space & BSpace,
bool ConsiderTupleLen )
static

Compare the sets A and B according to their nested space structure.

Returns 0 if the structure is considered equal. If ConsiderTupleLen is false, the number of dimensions in a tuple are ignored, i.e. a tuple with the same name but different number of dimensions are considered equal.

Definition at line 678 of file ISLTools.cpp.

References isl::space::dim(), isl::space::domain(), isl::space::get_tuple_name(), isl::space::has_tuple_name(), isl::space::is_params(), isl::space::is_wrapping(), isl::space::range(), isl::set, structureCompare(), unsignedFromIslSize(), and isl::space::unwrap().

Referenced by orderComparer(), and structureCompare().