Successfully identified regression in *llvm* in CI configuration tcwg_bmk_llvm_tx1/llvm-release-aarch64-spec2k6-O3_LTO. So far, this commit has regressed CI configurations: - tcwg_bmk_llvm_tx1/llvm-release-aarch64-spec2k6-O3_LTO
Culprit: <cut> commit 0237dbfdd38053cc190f814b6f92e311ae3509c6 Author: Chuanqi Xu yedeng.yd@linux.alibaba.com Date: Tue Jul 27 13:13:39 2021 +0800
[Coroutine] Record the elided coroutines
Reviewed By: lxfind
Differential Revision: https://reviews.llvm.org/D105606 </cut>
Results regressed to (for first_bad == 0237dbfdd38053cc190f814b6f92e311ae3509c6) # reset_artifacts: -10 # build_abe binutils: -9 # build_abe stage1 -- --set gcc_override_configure=--disable-libsanitizer: -8 # build_abe linux: -7 # build_abe glibc: -6 # build_abe stage2 -- --set gcc_override_configure=--disable-libsanitizer: -5 # build_llvm true: -3 # true: 0 # benchmark -- -O3_LTO artifacts/build-0237dbfdd38053cc190f814b6f92e311ae3509c6/results_id: 1 # 458.sjeng,sjeng_base.default regressed by 104
from (for last_good == dbefcde6da1b58eb181dcbd8d7913175b2ec8350) # reset_artifacts: -10 # build_abe binutils: -9 # build_abe stage1 -- --set gcc_override_configure=--disable-libsanitizer: -8 # build_abe linux: -7 # build_abe glibc: -6 # build_abe stage2 -- --set gcc_override_configure=--disable-libsanitizer: -5 # build_llvm true: -3 # true: 0 # benchmark -- -O3_LTO artifacts/build-dbefcde6da1b58eb181dcbd8d7913175b2ec8350/results_id: 1
Artifacts of last_good build: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... Results ID of last_good: tx1_64/tcwg_bmk_llvm_tx1/bisect-llvm-release-aarch64-spec2k6-O3_LTO/4264 Artifacts of first_bad build: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... Results ID of first_bad: tx1_64/tcwg_bmk_llvm_tx1/bisect-llvm-release-aarch64-spec2k6-O3_LTO/4262 Build top page/logs: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-...
Configuration details:
Reproduce builds: <cut> mkdir investigate-llvm-0237dbfdd38053cc190f814b6f92e311ae3509c6 cd investigate-llvm-0237dbfdd38053cc190f814b6f92e311ae3509c6
git clone https://git.linaro.org/toolchain/jenkins-scripts
mkdir -p artifacts/manifests curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... --fail curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... --fail chmod +x artifacts/test.sh
# Reproduce the baseline build (build all pre-requisites) ./jenkins-scripts/tcwg_bmk-build.sh @@ artifacts/manifests/build-baseline.sh
# Save baseline build state (which is then restored in artifacts/test.sh) mkdir -p ./bisect rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /llvm/ ./ ./bisect/baseline/
cd llvm
# Reproduce first_bad build git checkout --detach 0237dbfdd38053cc190f814b6f92e311ae3509c6 ../artifacts/test.sh
# Reproduce last_good build git checkout --detach dbefcde6da1b58eb181dcbd8d7913175b2ec8350 ../artifacts/test.sh
cd .. </cut>
History of pending regressions and results: https://git.linaro.org/toolchain/ci/base-artifacts.git/log/?h=linaro-local/c...
Artifacts: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-... Build log: https://ci.linaro.org/job/tcwg_bmk_ci_llvm-bisect-tcwg_bmk_tx1-llvm-release-...
Full commit (up to 1000 lines): <cut> commit 0237dbfdd38053cc190f814b6f92e311ae3509c6 Author: Chuanqi Xu yedeng.yd@linux.alibaba.com Date: Tue Jul 27 13:13:39 2021 +0800
[Coroutine] Record the elided coroutines
Reviewed By: lxfind
Differential Revision: https://reviews.llvm.org/D105606 --- llvm/lib/Transforms/Coroutines/CoroElide.cpp | 28 ++++++++++++++++++++++ .../{coro-elide-count.ll => coro-elide-stat.ll} | 7 ++++++ 2 files changed, 35 insertions(+)
diff --git a/llvm/lib/Transforms/Coroutines/CoroElide.cpp b/llvm/lib/Transforms/Coroutines/CoroElide.cpp index d35a5de6d4bd..84bebb7bf42d 100644 --- a/llvm/lib/Transforms/Coroutines/CoroElide.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroElide.cpp @@ -17,6 +17,7 @@ #include "llvm/InitializePasses.h" #include "llvm/Pass.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/FileSystem.h"
using namespace llvm;
@@ -24,6 +25,12 @@ using namespace llvm;
STATISTIC(NumOfCoroElided, "The # of coroutine get elided.");
+#ifndef NDEBUG +static cl::optstd::string CoroElideInfoOutputFilename( + "coro-elide-info-output-file", cl::value_desc("filename"), + cl::desc("File to record the coroutines got elided"), cl::Hidden); +#endif + namespace { // Created on demand if the coro-elide pass has work to do. struct Lowerer : coro::LowererBase { @@ -121,6 +128,21 @@ static Instruction *getFirstNonAllocaInTheEntryBlock(Function *F) { llvm_unreachable("no terminator in the entry block"); }
+#ifndef NDEBUG +static std::unique_ptr<raw_fd_ostream> getOrCreateLogFile() { + assert(!CoroElideInfoOutputFilename.empty() && + "coro-elide-info-output-file shouldn't be empty"); + std::error_code EC; + auto Result = std::make_unique<raw_fd_ostream>(CoroElideInfoOutputFilename, + EC, sys::fs::OF_Append); + if (!EC) + return Result; + llvm::errs() << "Error opening coro-elide-info-output-file '" + << CoroElideInfoOutputFilename << " for appending!\n"; + return std::make_unique<raw_fd_ostream>(2, false); // stderr. +} +#endif + // To elide heap allocations we need to suppress code blocks guarded by // llvm.coro.alloc and llvm.coro.free instructions. void Lowerer::elideHeapAllocations(Function *F, uint64_t FrameSize, @@ -344,6 +366,12 @@ bool Lowerer::processCoroId(CoroIdInst *CoroId, AAResults &AA, FrameSizeAndAlign.second, AA); coro::replaceCoroFree(CoroId, /*Elide=*/true); NumOfCoroElided++; +#ifndef NDEBUG + if (!CoroElideInfoOutputFilename.empty()) + *getOrCreateLogFile() + << "Elide " << CoroId->getCoroutine()->getName() << " in " + << CoroId->getFunction()->getName() << "\n"; +#endif }
return true; diff --git a/llvm/test/Transforms/Coroutines/coro-elide-count.ll b/llvm/test/Transforms/Coroutines/coro-elide-stat.ll similarity index 92% rename from llvm/test/Transforms/Coroutines/coro-elide-count.ll rename to llvm/test/Transforms/Coroutines/coro-elide-stat.ll index ae40a74f41d5..e92d484786c5 100644 --- a/llvm/test/Transforms/Coroutines/coro-elide-count.ll +++ b/llvm/test/Transforms/Coroutines/coro-elide-stat.ll @@ -4,8 +4,15 @@ ; RUN: opt < %s -S \ ; RUN: -passes='cgscc(repeat<2>(inline,function(coro-elide,dce)))' -stats 2>&1 \ ; RUN: | FileCheck %s +; RUN: opt < %s --disable-output \ +; RUN: -passes='cgscc(repeat<2>(inline,function(coro-elide,dce)))' \ +; RUN: -coro-elide-info-output-file=%t && \ +; RUN: cat %t \ +; RUN: | FileCheck %s --check-prefix=FILE
; CHECK: 2 coro-elide - The # of coroutine get elided. +; FILE: Elide f in callResume +; FILE: Elide f in callResumeMultiRetDommmed
declare void @print(i32) nounwind
</cut>