llvm-project/llvm
Mikael Holmen 51d4c7ceea [GlobalOpt] Fix debug variance problem in hasOnlyColdCalls
hasOnlyColdCalls skipped over calls to intrinsics, but it did so after
checking the linkage of the called function. This meant that the presence
of a call to a debug intrinsic could affect the outcome of the
optimization.

In my original reproducer (for an out of tree target) it was particularly
interesting, because the actual IR after GlobalOpt was not different with
debug instrinsics present, so -print-after-all printouts didn't show
anything there.

However, without debuginfo, GlobalOpt went further and ran
BlockFrequencyAnalysis and (more importanly) LoopAnalysis, and later on in
the pipeline, instcombine behaved in different ways when LoopInfo was
present.

So a call to a dbg.declare prevented running LoopAnalysis in
GlobalOpt, which later prevented InstCombine from doing an optimization.

The dbg-intrinsic-loopanalysis.ll testcase tries to expose this.

Then I also noted that adding a dbg.declare actually made the existing
testcase colccc_coldsites.ll generate different code, so I modified that
to now test it behaves the same way with and without the dbg.declare.

Reviewed By: nikic, fhahn

Differential Revision: https://reviews.llvm.org/D133193
2022-09-02 12:29:44 +02:00
..
benchmarks
bindings
cmake tweak zstd behavior in cmake and llvm config for better testing 2022-09-01 07:49:43 -07:00
docs [Symbolizer] Handle {{{bt}}} symbolizer markup element. 2022-08-31 09:49:32 -07:00
examples [llvm] LLVM_FALLTHROUGH => [[fallthrough]]. NFC 2022-08-08 11:24:15 -07:00
include [TTI] Improve description of TargetCostKind enums to aid targets in choosing cost values 2022-09-02 11:09:06 +01:00
lib [GlobalOpt] Fix debug variance problem in hasOnlyColdCalls 2022-09-02 12:29:44 +02:00
projects
resources
runtimes Revert "[runtimes] Use a response file for runtimes test suites" 2022-08-29 11:25:29 -07:00
test [GlobalOpt] Fix debug variance problem in hasOnlyColdCalls 2022-09-02 12:29:44 +02:00
tools [llvm-objdump][COFF] Correctly decode `UOP_Epilog` opcodes 2022-09-01 14:05:14 -07:00
unittests [llvm][Testing/ADT] Implement `IsStringMapEntry` testing matcher for verifying the entries in a `StringMap`. 2022-09-01 17:30:41 +00:00
utils [gn build] Port f6b66cbc7d 2022-09-01 18:01:38 +00:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt tweak zstd behavior in cmake and llvm config for better testing 2022-09-01 07:49:43 -07:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.