Skip to content

Commit 23a7792

Browse files
committed
Add quickfuzz
1 parent 760cc4c commit 23a7792

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838

3939
- name: Run Fuzzing
4040
run: ${{ github.workspace }}/fuzz.sh
41+
env:
42+
FUZZ_MODE: ${{ github.event.label.name }}
4143

4244
- name: Artifact
4345
uses: actions/upload-artifact@v4

fuzz.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
cost_bin = os.path.join(tool_bin, 'cost')
1818
patch_file = sys.argv[5]
1919
work_dir = "fuzz"
20+
fuzz_mode = os.environ['FUZZ_MODE']
2021

2122
keywords = [
2223
('test/Transforms/InstCombine', 'instcombine'),
@@ -77,6 +78,7 @@ def collect_seeds():
7778
if len(seeds) == 0:
7879
print('No seeds found')
7980
exit(0)
81+
seeds_count = len(seeds)
8082

8183
cnt = 0
8284
for file, func in seeds:
@@ -182,14 +184,15 @@ def check(recipe_arg, time_budget):
182184
def print_check(name, res):
183185
print(" ", "\u274c" if res else "\u2705", name)
184186

187+
print("Seeds: {}".format(seeds_count))
188+
print("Pass: `opt -passes={}`".format(pass_name))
185189
print("Baseline: https://github.com/llvm/llvm-project/commit/{}".format(os.environ["LLVM_REVISION"]))
186190
print("Patch URL: {}".format(os.environ["COMMIT_URL"]))
187191
print("Patch SHA256: {}".format(os.environ["PATCH_SHA256"]))
188192
start = time.time()
189193

190194
print("Checklist:")
191-
#scale = 1.0
192-
scale = 0.01
195+
scale = 0.01 if fuzz_mode == 'quickfuzz' else 1.0
193196
# Correctness check
194197
print_check("Correctness", check("correctness", 3600 * scale))
195198

0 commit comments

Comments
 (0)