Giter VIP home page Giter VIP logo

superty / llvm-project Goto Github PK

View Code? Open in Web Editor NEW

This project forked from llvm/llvm-project

6.0 6.0 0.0 1.28 GB

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Note: the repository does not accept github pull requests at this moment. Please submit your patches at http://reviews.llvm.org.

Home Page: http://llvm.org

CMake 0.37% C++ 45.73% C# 0.01% Python 1.35% Batchfile 0.01% Emacs Lisp 0.01% C 11.03% Objective-C 0.69% Objective-C++ 0.18% HTML 0.32% LLVM 29.65% Assembly 10.35% Cuda 0.11% Rust 0.01% M 0.01% Cool 0.01% Roff 0.01% Shell 0.04% Fortran 0.15% RenderScript 0.01%

llvm-project's People

Contributors

akyrtzi avatar arsenm avatar chandlerc avatar chapuni avatar d0k avatar ddunbar avatar douggregor avatar dwblaikie avatar echristo avatar eefriedman avatar ericwf avatar espindola avatar isanbard avatar kcc avatar labath avatar lattner avatar majnemer avatar nico avatar pcc avatar resistor avatar rjmccall avatar rksimon avatar rnk avatar rotateright avatar rui314 avatar stoklund avatar tkremenek avatar tobiasgrosser avatar topperc avatar zygoloid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

llvm-project's Issues

Bug in PresburgerSet::equals

Running the following snippet, results in a crash on my machine:

TEST(CoalesceTest, failing) {
 PresburgerSet curr =
       setFromString("(d0, d1, d2)[] : (d0 >= 0 and d1 >= 0 and -d0 + -d1 + "
                   "1199 >= 0 and d2 + -1400 >= 0  or d0  >= 0 and d1  >= 0 "
                     "and -d0 + -d1 + 1199 >= 0 and -d2 + 1398 >= 0 )");
   PresburgerSet newSet =
       setFromString("(d0, d1, d2)[] : (d0 >= 0 and d1 >= 0 and -d0 - d1 + 1199 "
                     ">= 0 and d2 - 1400 >= 0 or d0 >= 0 and d1 >= 0 and -d0 - "
                     "d1 + 1199 >= 0 and -d2 + 1398 >= 0)");
   EXPECT_TRUE(PresburgerSet::equal(newSet, curr));
}

Those are actually the same set.

Ensure that all valid IR can be lowered

All of the simplification and lowering passes need access to the operation that define the Presburger sets in play. As this cannot be done if sets are passed as function parameters, we have to add verification steps that ensure all set definitions are accessible.

Integrate a CI

I think a CI would be great.

We should definitely consider using cashing of the build as it otherwise takes a very long time.

warning in compilation of current version of Parser.cpp

I got the following warning, when compiling the current patch of @Dinistro :

home/webmiche/Desktop/ETH/llvm-project/mlir/lib/Dialect/Presburger/Parser.cpp: In member function ‘mlir::LogicalResult mlir::presburger::PresburgerSetParser::parseFlatAffineConstraints(mlir::presburger::Expr*, mlir::FlatAffineConstraints&)’:
/home/webmiche/Desktop/ETH/llvm-project/mlir/lib/Dialect/Presburger/Parser.cpp:543:74: warning: implicitly-declared ‘mlir::FlatAffineConstraints& mlir::FlatAffineConstraints::operator=(const mlir::FlatAffineConstraints&)’ is deprecated [-Wdeprecated-copy]
543 | cs = FlatAffineConstraints(dimNameToIndex.size(), symNameToIndex.size());
| ^
In file included from /home/webmiche/Desktop/ETH/llvm-project/mlir/include/mlir/Dialect/Presburger/Parser.h:9,
from /home/webmiche/Desktop/ETH/llvm-project/mlir/lib/Dialect/Presburger/Parser.cpp:6:
/home/webmiche/Desktop/ETH/llvm-project/mlir/include/mlir/Analysis/AffineStructures.h:110:3: note: because ‘mlir::FlatAffineConstraints’ has user-provided ‘mlir::FlatAffineConstraints::FlatAffineConstraints(const mlir::FlatAffineConstraints&)’
110 | FlatAffineConstraints(const FlatAffineConstraints &other);
| ^~~~~~~~~~~~~~~~~~~~~

Failing Unit Tests after rebase

As I already informed @Superty, the following test are failing on feature-expr-from-set :

MLIR-Unit :: Analysis/./MLIRAnalysisTests/FlatAffineConstraintsTest.FindSampleTest
MLIR-Unit :: Analysis/./MLIRAnalysisTests/FlatAffineConstraintsTest.IsIntegerEmptyTest

Both of them are violating the same assertion:

mlir/lib/Analysis/Presburger/Simplex.cpp:929: 
mlir::Fraction mlir::GBRSimplex::computeWidthAndDuals(ArrayRef<int64_t>, SmallVectorImpl<int64_t> &, int64_t &): 
Assertion `maybeWidth.hasValue() && "Width should not be unbounded!"' failed.

The problem started appearing after the commit "feature: Simplex::killCol and Simplex::closeRow": 8110c33

This commit introduces not only killCol and closeRow but also changes in makeProduct that I wasn't able to understand. Actually I'm even somewhat sure that this is the place where we / I broke it.
Note that makeProduct is executed in the constructor of GBRSimplex and there is not much more functionality that could break with this commit.

How to handle symbols in Presburger sets

When the prototype was created I blindly ported the symbols from FlatAffineConstraints to the PresburgerSet without much thought. Now that this prototype is growing, we should think about the semantics of symbols. Therefore I list all the facts I know of yet:

  • Symbols are used to make constraints dependent on specified SSA values, e.g. memref sizes. They are constant in a region of interest.
  • From the previous, we get that we cannot eliminate the symbols during compile time as their values might be unknown.
  • They can currently only appear as constant in constraints. Changing this might complicate transformations.
  • Sampling is in general impossible if we have symbols. Consider the set (x)[s] : x >= s and assume we do not know s during compile time. Note that this might also be a problem for the MLIR patch.

Questions / Unclarities:

  • Do we need symbols at all? I don't know now that I wrote all of this down.
  • How should we treat symbols in operations? Currently, we assert that the count of symbols for both participating sets is equal and we do not add new once to the result.
    It would perhaps make sense to have union with to following type:
    (!presburger.set<d, s1>, !presburger.set<d,s2>) -> !presburger.set<d, s1 + s2>

Some inputs of you @tobiasgrosser and @Superty would be much appreciated.

Better parsing error messages

There are still some parsing errors that do not point to the exact point of failure.

I need to investigate all messages and make sure that they point to the correct location.

Additional failing testcase

In my PR 3 testcases, which are not from me, fail. 2 of which are the ones we already know of, the third one comes from the dialect i think. Maybe @Dinistro can take a look at it :)

Speed up Presburger test execution

I think it would be a good idea to just be able to run the presburger related tests. Currently I have to build mutliple mlir binarys that are huge if I want to execute tests. Additionally always all tests FileCheck tests are executed. Overall this takes 5 to 10 minutes.

If we can split the tests into multiple targets, this would be nice for development speed.

[Discussion] Piecewise Presburger Expressions syntax

As we already have a presburger.contains lowering I started working on a design for piecewise presburger expressions.
Before I show my different ideas, lets recap the pw_aff syntax used in ISL and the one for affine_map in MLIR:

ISL:

[n] -> { [x] → [x + 1] : 0 ≤ x < n − 1; [x] → [0] : x = n − 1 }

MLIR:

(d0, d1)[s0] -> (d0, d0 + d1 + s0)

First of all, I think that sticking to the dimension and symbol list syntax (the (d0, d1)[s0] in the above example) would be great, as this was consistently done till now. Therefore we should base the design on the MLIR example and extend the affine_map with informations about the different domains.

(x)[n] -> (x + 1) : (0 <= x and x < n - 1); (x)[n] -> (0) : (x = n - 1)

Alternatively with additional parenthesis:

((x)[n] -> (x + 1) : (0 <= x and x < n - 1)); ((x)[n] -> (0) : (x = n - 1))

Or with just one dimension and symbol list:

(x)[n] -> (x + 1) : (0 <= x and x < n - 1) ; (0) : (x = n - 1)

// Or

(x)[n] -> ((x + 1) : (0 <= x and x < n - 1)) ; ((0) : (x = n - 1))

I know that all these approaches are kind of hard to read, but I'm not sure if there is any representation thats really great for so much information. As we didn't use {} for Presburger sets and the usage of them outside of sets could be confusing, I decided to not use them in the above drafts.
In my opinion the second last option would be my preferred approach for now, but what do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.