-
Notifications
You must be signed in to change notification settings - Fork 420
[CI] add LLVM IR bloat regression check #1083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+113
−0
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7448fd2
ci: add LLVM IR bloat regression check
728ee52
Add --features "$DISKANN_FEATURES"
arrayka 023108d
Potential fix for pull request finding
arrayka b9f51aa
Fixing issues
878d415
Minor fixes
f31a6d9
Fixes Compare LLVM lines
d9434d2
Use pr instead of diskann_rust
c139f9c
Run with --all-features
498e134
Do full outer join
a957ad5
Minor fix
f9296de
Delta and Current columns sort numerically
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #!/usr/bin/env bash | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT license. | ||
| # | ||
| # Compare two cargo-llvm-lines output files and produce a markdown regression report. | ||
| # | ||
| # Usage: | ||
| # ./compare-llvm-lines.sh <baseline.txt> <current.txt> | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| if [ $# -lt 2 ]; then | ||
| echo "Usage: $0 <baseline.txt> <current.txt>" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| baseline_file="$1" | ||
| current_file="$2" | ||
|
|
||
| baseline_total=$(awk '/\(TOTAL\)/{print $1}' "$baseline_file") | ||
| current_total=$(awk '/\(TOTAL\)/{print $1}' "$current_file") | ||
|
|
||
| if [ "$baseline_total" -eq 0 ]; then | ||
| echo "Error: baseline total is 0, cannot compute growth." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| delta_total=$(( current_total - baseline_total )) | ||
|
|
||
| # Parse llvm-lines output into "lines\tfunction_name" format. | ||
| # Skip header (3 lines) and TOTAL row. Extract the first number (lines count) | ||
| # and the function name (everything after the second parenthesized group). | ||
| parse() { | ||
| awk 'NR>3 && !/TOTAL/{ | ||
| lines = $1 | ||
| sub(/^[^)]*\)[^)]*\) */, "") | ||
| print lines "\t" $0 | ||
| }' "$1" | sort -t$'\t' -k2 | ||
| } | ||
|
|
||
| tmpdir=$(mktemp -d) | ||
| trap 'rm -rf "$tmpdir"' EXIT | ||
| baseline_parsed_file="$tmpdir/llvm_baseline_parsed.txt" | ||
| current_parsed_file="$tmpdir/llvm_current_parsed.txt" | ||
|
|
||
| parse "$baseline_file" > "$baseline_parsed_file" | ||
| parse "$current_file" > "$current_parsed_file" | ||
|
|
||
| echo "| Delta | Current | Baseline | Function |" | ||
| echo "|-------|---------|----------|----------|" | ||
| printf "| %+d | %s | %s | (TOTAL) |\n" "$delta_total" "$current_total" "$baseline_total" | ||
| join -t$'\t' -j 2 -a1 -a2 -e 0 -o 0,1.1,2.1 \ | ||
| "$current_parsed_file" "$baseline_parsed_file" | \ | ||
| awk -F'\t' '{delta=$2-$3; printf "%d\t%s\t%s\t%s\n", delta, $2, $3, $1}' | \ | ||
| sort -t$'\t' -k1,1rn -k2,2rn | \ | ||
| awk -F'\t' '{printf "| %+d | %s | %s | %s |\n", $1, $2, $3, $4}' | ||
| echo "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.