Skip to content

Commit

Permalink
Merging main branch changes to this branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Soumyaworks committed Aug 15, 2024
2 parents 9765c01 + a068436 commit 8529971
Show file tree
Hide file tree
Showing 333 changed files with 91,695 additions and 80,884 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BasedOnStyle: LLVM
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "LLVM Manylinux",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "ghcr.io/iith-compilers/manylinux2014-llvm/manylinux2014-llvm:x86-llvm17"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
39 changes: 39 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This is a basic workflow to help you get started with Actions

name: Doxygen Action

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]



# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Doxygen Action
uses: mattnotmitt/[email protected]
with:
# Path to Doxyfile
doxyfile-path: "./Doxyfile" # default is ./Doxyfile
# Working directory
working-directory: "." # default is .

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
# Default Doxyfile build documentation to html directory.
# Change the directory if changes in Doxyfile
publish_dir: ./html
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].3
41 changes: 41 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: GitHub Wiki upload

on:
push:
branches:
- main
paths: [docs/**, .github/workflows/publish-docs.yml]

concurrency:
group: wiki
cancel-in-progress: true

permissions:
contents: write

jobs:
wiki:
name: Publish to GitHub Wiki
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
repository: ${{github.repository}}
path: ${{github.repository}}

- name: Checkout Wiki
uses: actions/checkout@v4
with:
repository: ${{github.repository}}.wiki
path: ${{github.repository}}.wiki

- name: Push to wiki
run: |
set -e
cd $GITHUB_WORKSPACE/${{github.repository}}.wiki
cp -r $GITHUB_WORKSPACE/${{github.repository}}/docs/* .
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git diff-index --quiet HEAD || git commit -m "action: wiki sync" && git push
16 changes: 11 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Install LLVM-10.0.1
- name: Install libzstd-dev
run: sudo apt-get install -y libzstd-dev
- name: Install LIT and Filecheck
run: |
wget https://apt.llvm.org/llvm.sh
sudo bash llvm.sh 10
sudo python3 -m pip install lit
sudo python3 -m pip install filecheck
- name: Install LLVM-17
run: |
wget https://apt.llvm.org/llvm.sh
sudo bash llvm.sh 17
- uses: actions/checkout@v2
- name: Eigen-setup
run: |
Expand All @@ -32,7 +38,7 @@ jobs:
cmake ../eigen-3.3.7
make -j4 && cd ..
- name: cmake
run: cd build && cmake -DEigen3_DIR=./eigen-build ../src
run: cd build && cmake -DEigen3_DIR=./eigen-build ..
- name: make
run: cd build && make -j8
- uses: actions/upload-artifact@v2
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Install LLVM-10.0.1
- name: Install libzstd-dev
run: sudo apt-get install libzstd-dev
- name: Install LIT and Filecheck
run: |
wget https://apt.llvm.org/llvm.sh
sudo bash llvm.sh 10
sudo python3 -m pip install lit
sudo python3 -m pip install filecheck
- name: Install LLVM-17
run: |
wget https://apt.llvm.org/llvm.sh
sudo bash llvm.sh 17
- uses: actions/checkout@v2
- name: Eigen-setup
run: |
Expand All @@ -35,8 +41,8 @@ jobs:
cmake ../eigen-3.3.7
make -j4 && cd ..
- name: cmake
run: cd build && cmake -DEigen3_DIR=./eigen-build ../src
run: cd build && cmake -DEigen3_DIR=./eigen-build ..
- name: make
run: cd build && make -j8
- name: Run-tests
run: cd build && ulimit -s unlimited && make verify-all
run: cd build && ulimit -s unlimited && make check
61 changes: 61 additions & 0 deletions .github/workflows/upload-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Upload to PyPI

on:
release:
types:
- published
workflow_dispatch:
inputs:
pypi_repo:
description: 'Repo to upload to (testpypi or pypi)'
default: 'pypi'
required: true
type: choice
options:
- testpypi
- pypi

jobs:
build_wheels:
uses: ./.github/workflows/wheel.yml


build_sdist:
runs-on: ubuntu-latest
container: ghcr.io/iith-compilers/manylinux2014-llvm/manylinux2014-llvm:x86-llvm17
steps:
- uses: actions/checkout@v3

- name: Build IR2Vec
run: bash Manylinux2014_Compliant_Source/pkg/build.sh

- name: Build sdist
run: cd Manylinux2014_Compliant_Source/pkg && pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: Manylinux2014_Compliant_Source/pkg/dist/*.tar.gz


upload_pypi:
permissions:
id-token: write
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Publish package to TestPyPI
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
if: ${{ github.event.inputs.pypi_repo != 'pypi' }}

- name: Publish package to PyPI
uses: pypa/[email protected]
with:
repository-url: https://upload.pypi.org/legacy/
if: ${{ github.event.inputs.pypi_repo == 'pypi' }}
30 changes: 30 additions & 0 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build wheels

on: [push, workflow_dispatch, workflow_call]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/[email protected]
with:
package-dir: Manylinux2014_Compliant_Source/pkg
env:
CIBW_SKIP: "pp* *-musllinux_*"
CIBW_ARCHS: "x86_64"
CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/iith-compilers/manylinux2014-llvm/manylinux2014-llvm:x86-llvm17"
CIBW_BEFORE_ALL: "bash Manylinux2014_Compliant_Source/pkg/build.sh"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/Manylinux2014_Compliant_Source/pkg/tests"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ build/
__pycache__/
.vscode
experiments/*/output
seed_embeddings/triplets.txt
seed_embeddings/preprocessed/*
.cache/

html
latex
sqlite3.ll
28 changes: 11 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.0.1
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: test-suite/oracle
- repo: https://github.com/psf/black
rev: 19.3b0
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pocc/pre-commit-hooks
rev: python
rev: v1.1.1
hooks:
- id: clang-format
args: [-i]
- repo: https://github.com/dfm/black_nbconvert
rev: stable
hooks:
- id: black_nbconvert
- repo: local
hooks:
- id: shfmt
name: shfmt
minimum_pre_commit_version: 2.4.0
language: golang
additional_dependencies: [mvdan.cc/sh/v3/cmd/[email protected]]
entry: shfmt
args: [-w]
types: [shell]
# - repo: https://github.com/dfm/black_nbconvert
# rev: v0.4.0
# hooks:
# - id: black_nbconvert
- repo: https://github.com/maxwinterstein/shfmt-py
rev: v3.4.3.1
hooks:
- id: shfmt
25 changes: 21 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
cmake_minimum_required(VERSION 3.13)
project(IR2Vec VERSION 1.1.0)
project(ir2vec VERSION 2.1.2)

include(AddLLVM)
include(HandleLLVMOptions)
include(LLVMDistributionSupport)
set(IR2VEC_LIB "IR2Vec")
set(IR2VEC_LIB_STATIC "IR2Vec_Static")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

find_package (Eigen3 3.3.7 QUIET NO_MODULE)

if (Eigen3_FOUND)
message(STATUS "Found Eigen3: ${Eigen3_DIR}")
add_definitions(-DEIGEN_FOUND)
endif()

set(CMAKE_CXX_STANDARD 17 CACHE STRING "")

# LLVM is normally built without RTTI. Be consistent with that.
if(NOT LLVM_ENABLE_RTTI)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
endif()

add_subdirectory(src)
Loading

0 comments on commit 8529971

Please sign in to comment.