Giter VIP home page Giter VIP logo

xoc's Introduction

xoc

Welcome to use XOC

What does XOC mean? eXtremely Optimizing Compiler. We build XOC compiler that intent to be a finely honed tool to squeezing the last performance out of ordinary code.

Contribution and License Agreement. If you contribute code to this project, you are implicitly allowing your code to be distributed under the BSD license.

Your ideas have no limits. Surprisingly powerful. Why let programming tools shackle your mind? XOC was designed for extensibility. Tailoring and retargeting the compiler is easy, and fun.

Truly open. XOC is not just open-source, it is open from end to end. You can tune its syntax, add new instructions, integrate arbitrary system capabilities, enforce custom policies, add specific optimizations ...

XOC is a compiler infrastructure that provides multi-level IR operations, flexibility, and the capability of representing almost all popular languages. There are two level IR representations used throughout all phases of the compilation. You can use XOC to perform optimization, program analysis or build diagnostic tools.

Build : cd xoc & make all

How to Contribute : All contributors must sign a contributor license agreement (CLA). A CLA basically says that you own the rights to any code you contribute, and that you give us permission to use that code in XOC. You maintain the copyright on that code. Submit a pull request for your changes. A project developer will review your work and then merge your request into the project.

xoc's People

Contributors

jinderek avatar stevenknown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xoc's Issues

Lack of unit tests for the project

I am not sure wether this is the right place to ask, my questions is: why there are not any unit tests for this project, how to ensure the correctness of the ir??

Fixes to build

I just cloned this project (actually https://github.com/stevenknown/xoc but it has not enabled issues there) and tried to build but got some warnings and an error related to try use of HeapSort::HeapValVector<T> hdata(data); with clang++ (6 and 11) and g++9.

Here is the output of git diff -u of my changes to be able to build it:

diff --git a/com/flty.cpp b/com/flty.cpp
index 0a44cbf..5f02c1b 100644
--- a/com/flty.cpp
+++ b/com/flty.cpp
@@ -129,7 +129,7 @@ void Float::dump() const
 {
     StrBuf buf(16);
     format(buf);
-    fprintf(stdout, buf.buf);
+    fprintf(stdout, "%s", buf.buf);
 }
 
 } //namespace xcom
diff --git a/com/rational.cpp b/com/rational.cpp
index 4464267..8b8911f 100644
--- a/com/rational.cpp
+++ b/com/rational.cpp
@@ -139,7 +139,7 @@ void Rational::dump() const
 {
     StrBuf buf(16);
     format(buf);
-    fprintf(stdout, buf.buf);
+    fprintf(stdout, "%s", buf.buf);
 }
 
 
diff --git a/com/sort.cpp b/com/sort.cpp
index 8c2acc7..b37a75c 100644
--- a/com/sort.cpp
+++ b/com/sort.cpp
@@ -54,7 +54,7 @@ public:
     DumpHeap(Vector<T> & data)
     {
         if (data.get_last_idx() < 0) { return; }
-        HeapSort::HeapValVector<T> hdata(data);
+        HeapSort<int>::HeapValVector<T> hdata(data);
         m_pool = smpoolCreate(64, MEM_COMM);
         UINT node_count = 1;
         for (UINT i = hdata.get_begin_idx(); i <= hdata.get_end_idx(); i++) {
diff --git a/com/sort.h b/com/sort.h
index a2ea8cd..3659dda 100644
--- a/com/sort.h
+++ b/com/sort.h
@@ -120,7 +120,7 @@ void Bucket<T>::dump()
     INT j = 0;
     printf("\nBUCKET");
     for (UINT i = 0; i < Hash<T>::m_bucket_size; i++) {
-        printf("\n\tB%d:", i);
+        printf("\n\tB%ud:", i);
         HC<T> * elemhc = (HC<T>*)HB_member(Hash<T>::m_bucket[i]);
         while (elemhc != nullptr) {
             printf("%f,", HC_val(elemhc));
diff --git a/dex/dex_const_info.h b/dex/dex_const_info.h
index d006707..91351f1 100644
--- a/dex/dex_const_info.h
+++ b/dex/dex_const_info.h
@@ -110,7 +110,13 @@ author: Su Zhenyu
 #define HAS_PREDICATE_REGISTER false
 
 //Define the max/min integer value range of target machine.
+#ifdef MIN_HOST_INT_VALUE
+#undef MIN_HOST_INT_VALUE
+#endif
 #define MIN_HOST_INT_VALUE 0x80000000
+#ifdef MAX_HOST_INT_VALUE
+#undef MAX_HOST_INT_VALUE
+#endif
 #define MAX_HOST_INT_VALUE 0x7fffFFFF
 #define EPSILON 0.000001

Allow targets to be added at runtime

Hey @stevenknown. I've been working on a Conan package for XOC.

One issue I see is that XOC builds with its targets at compile time (by default it supports DEX). This makes it hard to make a package because the XOC binary that gets installed by a package manager will only support DEX.

This design is ok for LLVM because it comes with many targets and most users won't make their own target. But XOC only supports DEX so most users will have to implement their own target, which means they cannot use a precompiled package.

I don't know much about the XOC design, but I'm wondering if it's possible to support something like this:

Library header in XOC

// A target interface that users can implement.
class XocTarget {
  virtual void func1() = 0;
  virtual void func2() = 0;
  virtual void func3() = 0;
  ...
};

Application code using XOC

// Implementing our own target.
class CustomTarget : public XocTarget {
  void func1() override;
  ...
};

...

// Now passing it into XOC so the library can use it.
int main(int argc, char** argv) {
  CustomTarget target;
  xoc_register_target(&target);

  REGION_MGR rm;
  rm.init_var_mgr();
  ...
}

If we can't support adding targets at runtime, then I don't think XOC can be packaged. I'm happy to help with the development work.

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.