chore: Update build configurations to enable AVX optimization for different architectures

This commit is contained in:
Mauro Balades
2024-08-02 13:27:02 +02:00
parent 33d2954e93
commit c55fadc889
5 changed files with 50 additions and 33 deletions

View File

@@ -179,26 +179,26 @@ jobs:
name: zen.source.tar.gz
path: ./zen.source.tar.gz
#windows-step-1:
# name: Windows build step 1 (PGO build)
# uses: ./.github/workflows/windows-alpha-build.yml
# needs: [build-data]
# permissions:
# contents: write
# with:
# build-version: ${{ needs.build-data.outputs.version }}
# generate-gpo: true
# profile-data-path-archive: zen-windows-x86_64-profile-data-and-jarlog.zip
windows-step-1:
name: Windows build step 1 (PGO build)
uses: ./.github/workflows/windows-alpha-build.yml
needs: [build-data]
permissions:
contents: write
with:
build-version: ${{ needs.build-data.outputs.version }}
generate-gpo: true
profile-data-path-archive: zen-windows-x86_64-profile-data-and-jarlog.zip
#windows-step-2:
# name: Windows build step 2 (Generate profile data)
# uses: ./.github/workflows/windows-profile-build.yml
# permissions:
# contents: write
# needs: [windows-step-1, build-data]
# with:
# build-version: ${{ needs.build-data.outputs.version }}
# profile-data-path-archive: zen.win64-pgo-stage-1.zip
windows-step-2:
name: Windows build step 2 (Generate profile data)
uses: ./.github/workflows/windows-profile-build.yml
permissions:
contents: write
needs: [windows-step-1, build-data]
with:
build-version: ${{ needs.build-data.outputs.version }}
profile-data-path-archive: zen.win64-pgo-stage-1.zip
windows-step-3:
name: Windows build step 3 (build with profile data)
@@ -229,7 +229,7 @@ jobs:
build-version: ${{ needs.build-data.outputs.version }}
appimage:
name: AppImage build - Linux ${{ matrix.generic == 'true' && 'generic' || 'specific' }}
name: AppImage build - Linux ${{ matrix.generic == true && 'generic' || 'specific' }}
permissions:
contents: write
runs-on: ubuntu-latest
@@ -254,7 +254,7 @@ jobs:
- name: Download linux build
uses: actions/download-artifact@v4
with:
name: zen.linux-${{ matrix.generic == 'true' && 'generic' || 'specific' }}.tar.bz2
name: zen.linux-${{ matrix.generic == true && 'generic' || 'specific' }}.tar.bz2
- name: Execute AppImage build
run: |
@@ -280,7 +280,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: zen-${{ matrix.generic == 'true' && 'generic' || 'specific' }}.AppImage
name: zen-${{ matrix.generic == true && 'generic' || 'specific' }}.AppImage
path: ./dist/zen.AppImage
release:

View File

@@ -148,9 +148,9 @@ jobs:
dos2unix configs/windows/mozconfig
export SURFER_PLATFORM="win32"
export ZEN_CROSS_COMPILING=1
# if test ${{ inputs.generate-gpo }}; then
# export ZEN_GA_GENERATE_PROFILE=1
# fi
if test ${{ inputs.generate-gpo }} = true; then
export ZEN_GA_GENERATE_PROFILE=1
fi
sh .github/workflows/src/alpha-build.sh
- name: Package
@@ -182,7 +182,7 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ inputs.generate-gpo }}
with:
name: ${{ inputs.profile-data-path-archive }}
name: ${{ matrix.generic == true && 'generic' || 'specific' }}-${{ inputs.profile-data-path-archive }}
path: ./zen.win64-pgo-stage-1.zip
- name: Upload mar

View File

@@ -13,6 +13,10 @@ on:
jobs:
windows-profile-build:
strategy:
fail-fast: false
matrix:
generic: [true, false]
runs-on: windows-latest
# Script edited from https://github.com/Floorp-Projects/Floorp/blob/ESR115/.github/workflows/window-generate-profile-data-and-jarlog.yml
steps:
@@ -40,7 +44,7 @@ jobs:
name: Download artifact
with:
path: C:\artifact
name: zen-windows-x86_64-profile-data-and-jarlog.zip
name: ${{ matrix.generic == true && 'generic' || 'specific' }}-zen-windows-x86_64-profile-data-and-jarlog.zip
- name: Unpack artifact
run: |
@@ -82,10 +86,10 @@ jobs:
- name: Publish merged.profdata
uses: actions/upload-artifact@v4
with:
path: merged.profdata
path: merged-${{ matrix.generic == true && 'generic' || 'specific' }}.profdata
- name: Publish en-US.log
uses: actions/upload-artifact@v4
with:
path: en-US.log
path: en-US-${{ matrix.generic == true && 'generic' || 'specific' }}.log

View File

@@ -26,9 +26,7 @@ if test "$SURFER_COMPAT" = "true"; then
export LDFLAGS="-Wl,-O3 -march=x86-64-v3"
export RUSTFLAGS="-C target-feature=+avx2 -C codegen-units=1"
ac_add_options --enable-install-strip
ac_add_options --enable-strip
export STRIP_FLAGS="--strip-debug --strip-unneeded"
ac_add_options --enable-linker=ld64
else
ac_add_options --target=aarch64-apple-darwin

View File

@@ -49,7 +49,22 @@ else
export CPPFLAGS="-O2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes /clang:-O3 /arch:AVX"
export CXXFLAGS="-O2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes /clang:-O3 /arch:AVX"
export LDFLAGS="-Wl,-O3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes"
POLLY="-mllvm -polly -mllvm -polly-2nd-level-tiling -mllvm -polly-loopfusion-greedy -mllvm -polly-pattern-matching-based-opts -mllvm -polly-position=before-vectorizer -mllvm -polly-vectorizer=stripmine"
export RUSTFLAGS="-C target-feature=+avx -C codegen-units=1"
fi
export POLLY="-mllvm -polly -mllvm -polly-2nd-level-tiling -mllvm -polly-loopfusion-greedy -mllvm -polly-pattern-matching-based-opts -mllvm -polly-position=before-vectorizer -mllvm -polly-vectorizer=stripmine"
export VERBOSE=1
if test "$ZEN_GA_GENERATE_PROFILE"; then
mk_add_options "export MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES=0"
ac_add_options --enable-profile-generate=cross
else
ac_add_options --enable-profile-use=cross
if test "$SURFER_COMPAT" = "true"; then
ac_add_options --with-pgo-profile-path=$(echo ~)/artifact/merged-generic.profdata
ac_add_options --with-pgo-jarlog=$(echo ~)/artifact/en-US-generic.log
else
ac_add_options --with-pgo-profile-path=$(echo ~)/artifact/merged-specific.profdata
ac_add_options --with-pgo-jarlog=$(echo ~)/artifact/en-US-specific.log
fi
fi