Repository: python/cpython
Pull request: GH-127154: Remove PGO from JIT CI
<!--
Thanks for your contribution!
Please read this comment in its entirety. It's quite important.

# Pull Request title

It should be in the following format:

```
gh-NNNNN: Summary of the changes made
```

Where: gh-NNNNN refers to the GitHub issue number.

Most PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue.

# Backport Pull Request title

If this is a backport PR (PR made against branches other than `main`),
please ensure that the PR title is in the following format:

```
[X.Y] <title from the original PR> (GH-NNNN)
```

Where: [X.Y] is the branch name, e.g. [3.6].

GH-NNNN refers to the PR number from `main`.

-->

@brandtbucher I'm assuming you still wanted to keep `--with-lto` wherever that's used but let me know if you'd also like to strip that out.

<!-- gh-issue-number: gh-127154 -->
* Issue: gh-127154
<!-- /gh-issue-number -->


Problem statement:
Turn off PGO for JIT CI
I don't think we need PGO turned on in JIT CI for non-debug jobs. It's mostly just a waste of time, and doesn't really give us any additional information.

@mdboom, I know that the Windows PGO builds were a nice canary for "breaking" ceval.c under MSVC (since it's not tested in CI or any buildbot), but I figure our weekly benchmarking runs are a good enough "buildbot" for that, so we don't need to run it all the time on PRs.

@savannahostrowski, want to take this?

<!-- gh-linked-prs -->
### Linked PRs
* gh-127212
<!-- /gh-linked-prs -->

Hints from issue discussion:
Yeah, I agree that PGO+JIT together doesn't add much value.

Historically, I don't think our benchmarking stuff has been a soon-enough canary for MSVC, so I'd still like to see a buildbot specifically test that configuration.  I think I'll file a separate bug for that -- python/buildmaster-config#560 -- no need for that to hold this up.

Commit message: Revert removing CC and CPP"

Patch to review:
diff --git a/.github/workflows/jit.yml b/.github/workflows/jit.yml
index 35d5d59b762660..53ce9834d0ac4c 100644
--- a/.github/workflows/jit.yml
+++ b/.github/workflows/jit.yml
@@ -54,9 +54,7 @@ jobs:
           - x86_64-apple-darwin/clang
           - aarch64-apple-darwin/clang
           - x86_64-unknown-linux-gnu/gcc
-          - x86_64-unknown-linux-gnu/clang
           - aarch64-unknown-linux-gnu/gcc
-          - aarch64-unknown-linux-gnu/clang
         debug:
           - true
           - false
@@ -87,18 +85,10 @@ jobs:
             architecture: x86_64
             runner: ubuntu-22.04
             compiler: gcc
-          - target: x86_64-unknown-linux-gnu/clang
-            architecture: x86_64
-            runner: ubuntu-22.04
-            compiler: clang
           - target: aarch64-unknown-linux-gnu/gcc
             architecture: aarch64
             runner: ubuntu-22.04
             compiler: gcc
-          - target: aarch64-unknown-linux-gnu/clang
-            architecture: aarch64
-            runner: ubuntu-22.04
-            compiler: clang
     env:
       CC: ${{ matrix.compiler }}
     steps:
@@ -111,7 +101,7 @@ jobs:
         if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
         run: |
           choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
-          ./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
+          ./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
           ./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
 
       # No PGO or tests (yet):
@@ -132,7 +122,7 @@ jobs:
           find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
           brew install llvm@${{ matrix.llvm }}
           export SDKROOT="$(xcrun --show-sdk-path)"
-          ./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
+          ./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
           make all --jobs 4
           ./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
 
@@ -141,7 +131,7 @@ jobs:
         run: |
           sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
           export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
-          ./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
+          ./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
           make all --jobs 4
           ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
 
@@ -156,13 +146,11 @@ jobs:
           make clean --jobs 4
           export HOST=${{ matrix.architecture }}-linux-gnu
           sudo apt install --yes "gcc-$HOST" qemu-user
-          ${{ !matrix.debug && matrix.compiler == 'clang' && './configure --enable-optimizations' || '' }}
-          ${{ !matrix.debug && matrix.compiler == 'clang' && 'make profile-run-stamp --jobs 4' || '' }}
           export QEMU_LD_PREFIX="/usr/$HOST"
-          CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
-            CPP="$CC --preprocess" \
+          CC="$HOST-gcc" \
+            CPP="$HOST-gcc --preprocess" \
             HOSTRUNNER=qemu-${{ matrix.architecture }} \
-            ./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--with-lto' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
+            ./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
           make all --jobs 4
           ./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3
 


Code review comments:
diff_hunk: @@ -87,18 +85,10 @@ jobs:
             architecture: x86_64
             runner: ubuntu-22.04
             compiler: gcc
-          - target: x86_64-unknown-linux-gnu/clang
-            architecture: x86_64
-            runner: ubuntu-22.04
-            compiler: clang
           - target: aarch64-unknown-linux-gnu/gcc
             architecture: aarch64
             runner: ubuntu-22.04
             compiler: gcc
-          - target: aarch64-unknown-linux-gnu/clang
-            architecture: aarch64
-            runner: ubuntu-22.04
-            compiler: clang
     env:
       CC: ${{ matrix.compiler }}
path: .github/workflows/jit.yml
text: @user1:
I don't think we need this anymore (in fact, do we need `compiler` in the matrix above at all?):

```suggestion
```