Page MenuHomePhabricator

[LoopUnroll] allow customization of threshold for new-pm
Needs ReviewPublic

Authored by wenju on Apr 24 2022, 7:58 PM.

Details

Summary

Legacy createLoopUnrollPass provides threshold parameter. This patch
brings the support to new-pm LoopUnrollPass.

Our downstream uses LoopUnroll pass with small threshold for fine tuning, so we want the support for new pm.

Diff Detail

Unit TestsFailed

TimeTest
410 msx64 debian > HWAddressSanitizer-x86_64.TestCases::hwasan_symbolize.cpp
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -fsanitize-hwaddress-experimental-aliasing -mllvm -hwasan-generate-tags-with-calls=1 -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions -Wl,--build-id -g /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/hwasan/TestCases/hwasan_symbolize.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/hwasan_symbolize.cpp.tmp
60,160 msx64 debian > LLVM.CodeGen/NVPTX::wmma.py
Script: -- : 'RUN: at line 5'; "/usr/bin/python3.9" /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/NVPTX/wmma.py --ptx=60 --gpu-arch=70 > /var/lib/buildkite-agent/builds/llvm-project/build/test/CodeGen/NVPTX/Output/wmma.py.tmp-ptx60-sm_70.ll
60,020 msx64 debian > libFuzzer.libFuzzer::large.test
Script: -- : 'RUN: at line 3'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/lib/fuzzer -m64 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/fuzzer/LargeTest.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/large.test.tmp-LargeTest

Event Timeline

wenju created this revision.Apr 24 2022, 7:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2022, 7:58 PM
wenju requested review of this revision.Apr 24 2022, 7:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2022, 7:58 PM
fhahn added a subscriber: fhahn.Apr 25 2022, 1:14 AM

Do you have any plans to add a user of the new Threshold option upstream

wenju added a comment.Apr 25 2022, 1:38 AM

Do you have any plans to add a user of the new Threshold option upstream

I don't have this plan. createLoopUnrollPass in standard pipeline uses default threshold parameter.

Can you just have getUnrollingPreferences override the UP.Threshold for your target? Or is it that you want a specific run of the unroll pass to have a lower threshold than other runs?

wenju added a comment.Apr 25 2022, 2:34 AM

Can you just have getUnrollingPreferences override the UP.Threshold for your target?

Thanks for the suggestion.

Or is it that you want a specific run of the unroll pass to have a lower threshold than other runs?

Yes, our pipeline contains several calls of LoopUnroll pass with different thresholds, so I think getUnrollingPreferences or overriding command line option wouldn't work.

wenju updated this revision to Diff 427513.May 5 2022, 7:40 PM
wenju added reviewers: dmgreen, fhahn.

rebase