Implement SIMD latest opcodes and update LLVM to 13.0 (#758)

Implement the latest SIMD opcodes and update LLVM 13.0,
update the llvm build scripts, update the sample workloads‘ build scripts,
and build customized wasi-sdk to build some workloads.
Also refine the CI rules.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Wenyong Huang
2021-09-17 19:12:57 +08:00
committed by GitHub
parent 7e60a5db8d
commit 7be0d385a6
82 changed files with 5266 additions and 4698 deletions

View File

@ -1,112 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: Android
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# 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: Build iwasm [default]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake ..
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [classic interp]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_BUILD_FAST_INTERP=0
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [multi module]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_BUILD_MULTI_MODULE=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [lib-pthread]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_BUILD_LIB_PTHREAD=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [aot only]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [interp only]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_BUILD_AOT=0
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [memory profiling]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_BUILD_MEMORY_PROFILING=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [tail call]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_BUILD_TAIL_CALL=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [custom name section]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_BUILD_CUSTOM_NAME_SECTION=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [disable hardware boundary check]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_DISABLE_HW_BOUND_CHECK=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [reference types]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_BUILD_REF_TYPES=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [128-bit SIMD]
run: |
cd product-mini/platforms/android
mkdir build && cd build
cmake .. -DWAMR_BUILD_SIMD=1
make -j $(nproc)
cd .. && rm -rf build

View File

@ -16,119 +16,154 @@ on:
- 'doc/**'
jobs:
build:
build_llvm_libraries:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- name: Build iwasm [default]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake ..
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [classic interp]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_BUILD_FAST_INTERP=0
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [multi module]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_BUILD_MULTI_MODULE=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [lib-pthread]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_BUILD_LIB_PTHREAD=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [aot only]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_INTERP=0
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [interp only]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_BUILD_AOT=0
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [memory profiling]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_BUILD_MEMORY_PROFILING=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [tail call]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_BUILD_TAIL_CALL=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [custom name section]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_BUILD_CUSTOM_NAME_SECTION=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [disable hardware boundary check]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_DISABLE_HW_BOUND_CHECK=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [reference types]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_BUILD_REF_TYPES=1
make -j $(nproc)
cd .. && rm -rf build
- name: Build iwasm [128-bit SIMD]
run: |
cd product-mini/platforms/linux
mkdir build && cd build
cmake .. -DWAMR_BUILD_SIMD=1
make -j $(nproc)
cd .. && rm -rf build
- name: checkout
uses: actions/checkout@v2
- name: Cache LLVM libraries
uses: actions/cache@v2
id: cache_llvm
uses: actions/cache@v2
env:
cache-name: llvm_libraries
with:
path: ./core/deps/llvm
key: ${{ runner.os }}-build-${{env.cache-name}}
restore-keys: ${{ runner.os }}-build-${{env.cache-name}}
path: ./core/deps/llvm/build/LLVM-13.0.0-Linux.tar.gz
key: ${{ matrix.os }}-build-${{env.cache-name}}
restore-keys: ${{ matrix.os }}-build-${{env.cache-name}}
- name: Build llvm and clang from source
id: build_llvm
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: |
cd wamr-compiler
./build_llvm.sh
cd ../core/deps/llvm/build/
make package
build_wamrc:
needs: build_llvm_libraries
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
uses: actions/cache@v2
env:
cache-name: llvm_libraries
with:
path: ./core/deps/llvm/build/LLVM-13.0.0-Linux.tar.gz
key: ${{ matrix.os }}-build-${{env.cache-name}}
restore-keys: ${{ matrix.os }}-build-${{env.cache-name}}
- name: Quit if cache miss
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: exit 1
- name: Extract the LLVM package
run: tar xf LLVM-13.0.0-Linux.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: Build wamrc
run: |
cd wamr-compiler
mkdir build && cd build
cmake ..
make -j $(nproc)
cd ..
cmake .. && make -j $(nproc)
working-directory: wamr-compiler
- name: Upload Wamrc
uses: actions/upload-artifact@v2
with:
name: wamrc_bin-${{ matrix.os }}
path: ./wamr-compiler/build/wamrc
retention-days: 1
build_iwasm:
needs: build_llvm_libraries
runs-on: ${{ matrix.os }}
strategy:
matrix:
make_options: [
# Running mode
"-DWAMR_BUILD_INERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1",
"-DWAMR_BUILD_INERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0",
"-DWAMR_BUILD_INERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=0",
"-DWAMR_BUILD_INERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=1",
# Features
"-DWAMR_BUILD_CUSTOM_NAME_SECTION=1",
"-DWAMR_BUILD_LIB_PTHREAD=1",
"-DWAMR_BUILD_MEMORY_PROFILING=1",
"-DWAMR_BUILD_MULTI_MODULE=1",
"-DWAMR_BUILD_REF_TYPES=1",
"-DWAMR_BUILD_SIMD=1",
"-DWAMR_BUILD_TAIL_CALL=1",
"-DWAMR_DISABLE_HW_BOUND_CHECK=1",
]
os: [ubuntu-18.04, ubuntu-20.04]
platform: [linux, android]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
uses: actions/cache@v2
env:
cache-name: llvm_libraries
with:
path: ./core/deps/llvm/build/LLVM-13.0.0-Linux.tar.gz
key: ${{ matrix.os }}-build-${{env.cache-name}}
restore-keys: ${{ matrix.os }}-build-${{env.cache-name}}
- name: Quit if cache miss
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: exit 1
- name: Extract the LLVM package
run: tar xf LLVM-13.0.0-Linux.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: Build iwasm
run: |
mkdir build && cd build
cmake .. ${{ matrix.make_options }} && make -j $(nproc)
cd .. && rm -rf build
working-directory: product-mini/platforms/${{ matrix.platform }}
build_samples:
needs: [build_llvm_libraries, build_wamrc]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
make_options: [
# Running mode
"-DWAMR_BUILD_INERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1",
"-DWAMR_BUILD_INERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0",
"-DWAMR_BUILD_INERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=0",
"-DWAMR_BUILD_INERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=1",
]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Get LLVM libraries
id: cache_llvm
uses: actions/cache@v2
env:
cache-name: llvm_libraries
with:
path: ./core/deps/llvm/build/LLVM-13.0.0-Linux.tar.gz
key: ${{ matrix.os }}-build-${{env.cache-name}}
restore-keys: ${{ matrix.os }}-build-${{env.cache-name}}
- name: Quit if cache miss
if: steps.cache_llvm.outputs.cache-hit != 'true'
run: exit 1
- name: Extract the LLVM package
run: tar xf LLVM-13.0.0-Linux.tar.gz --strip-components=1
working-directory: ./core/deps/llvm/build
- name: Download Wamrc
uses: actions/download-artifact@v2
with:
name: wamrc_bin-${{ matrix.os }}
path: ./wamr-compiler/build
- name: Give execution rights
run: chmod a+x ./wamr-compiler/build/wamrc
- name: download and install wasi-sdk
run: |
cd /opt
@ -147,39 +182,7 @@ jobs:
run: |
cd samples/wasm-c-api
mkdir build && cd build
cmake ..
make -j $(nproc)
./callback
./callback_chain
./global
./hello
./hostref
./memory
./reflect
./table
./trap
cd .. && rm -r build
- name: Build Sample [wasm-c-api] [Jit]
run: |
cd samples/wasm-c-api
mkdir build && cd build
cmake -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_AOT=1 ..
make -j $(nproc)
./callback
./callback_chain
./global
./hello
./hostref
./memory
./reflect
./table
./trap
cd .. && rm -r build
- name: Build Sample [wasm-c-api] [Aot]
run: |
cd samples/wasm-c-api
mkdir build && cd build
cmake -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_AOT=1 ..
cmake .. ${{ matrix.make_options }}
make -j $(nproc)
./callback
./callback_chain