aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/libclang/LibclangTest.cpp
diff options
context:
space:
mode:
authorMikael Holmen <mikael.holmen@ericsson.com>2022-09-02 10:56:11 +0200
committerMikael Holmen <mikael.holmen@ericsson.com>2022-09-02 12:29:44 +0200
commit51d4c7ceea61b5d83ba52398b5ca6d58d7551044 (patch)
tree2d2f3efe58093469d401cf93dd4f5eebcd98825b /clang/unittests/libclang/LibclangTest.cpp
parentbe37caca0055df77c9e3ca0a63d4b2ccefe94f7d (diff)
downloadllvm-51d4c7ceea61b5d83ba52398b5ca6d58d7551044.zip
llvm-51d4c7ceea61b5d83ba52398b5ca6d58d7551044.tar.gz
llvm-51d4c7ceea61b5d83ba52398b5ca6d58d7551044.tar.bz2
[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
Diffstat (limited to 'clang/unittests/libclang/LibclangTest.cpp')
0 files changed, 0 insertions, 0 deletions