SuccessChanges

Summary

  1. [lit] Port googletest lit tests to Windows Summary: The technique of directly calling subprocess.Popen on a python script doesn't work on Windows. The executable path of the command must refer to a valid win32 executable. Instead, rename all the python scripts masquerading as gtest executables to have .py extensions, so we can easily detect then and call the python executable for them. Do this on Linux as well as Windows for consistency. The test suite directory names also come out in lower-case on Windows. We can consider removing that in a later patch. This change just updates the FileCheck lines to match on Windows. Fixes PR33933 Reviewers: modocache, mgorny Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35909
  2. Changing the default MaxNumPromotions from 2 to 3. Summary: In performance tuning, we see performance benefits when enlarge the maximum num promotion targets to 3. This is safe as soon as we have total percentage threshold properly setup (https://reviews.llvm.org/D35962) Reviewers: davidxl, tejohnson Reviewed By: tejohnson Subscribers: llvm-commits, sanjoy Differential Revision: https://reviews.llvm.org/D35966
  3. Separate the ICP total threshold and remaining threshold. Summary: In the current implementation, isPromotionProfitable only checks if the call count to a direct target is no less than a certain percentage threshold of the remaining call counts that have not been promoted. This causes code size problems when the target count is small but greater than a large portion of remaining counts. E.g. target1 takes 99.9%, while target2 takes 0.1%. Both targets will be promoted and inlined, makes the function size too large, which potentially prevents it from further inlining into its callers. This patch adds another percentage threshold against the total indirect call count. If the target count needs to be no less than both thresholds in order to be promoted speculatively. Reviewers: davidxl, tejohnson Reviewed By: tejohnson Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D35962
  4. Increase the ImportHotMultiplier to 10.0 Summary: The original 3.0 hot mupltiplier is too small, and would prevent hot callsites from being inline. This patch increases the hot multilier to 10.0 Reviewers: davidxl, tejohnson Reviewed By: tejohnson Subscribers: llvm-commits, sanjoy Differential Revision: https://reviews.llvm.org/D35969
  5. [X86] Fix latent bug in sibcall eligibility logic The X86 tail call eligibility logic was correct when it was written, but the addition of inalloca and argument copy elision broke its assumptions. It was assuming that fixed stack objects were immutable. Currently, we aim to emit a tail call if no arguments have to be re-arranged in memory. This code would trace the outgoing argument values back to check if they are loads from an incoming stack object. If the stack argument is immutable, then we won't need to store it back to the stack when we tail call. Fortunately, stack objects track their mutability, so we can just make the obvious check to fix the bug. This was http://crbug.com/749826
  6. [sanitizers] Sanitizer tests CMake clean up: try #2 This patch addresses two issues: Most of the time, hacks with `if/else` in order to get support for multi-configuration builds are superfluous. The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it expands to `.` on all single-configuration builds, and to a configuration name otherwise. The `if/else` hacks for the library name generation should also not be done, as CMake has `TARGET_FILE` generator expression precisely for this purpose, as it expands to the exact filename of the resulting target. Differential Revision: https://reviews.llvm.org/D35952
  7. [sancov] Add missing line breaks in test. NFC.
  8. [sanitizer-coverage] clang flags pumbing for -fsanitize-coverage=pc-table
  9. [sanitizer-coverage] rename sanitizer-coverage-create-pc-table into sanitizer-coverage-pc-table and add plumbing for a clang flag
  10. Remove unused function from AArch64 backend (NFC)
  11. [sanitizer-coverage] add a feature sanitizer-coverage-create-pc-table=1 (works with trace-pc-guard and inline-8bit-counters) that adds a static table of instrumented PCs to be used at run-time
  12. [MachineOutliner] Cleanup: move findCandidates out of suffix tree Doing some cleanup in preparation for some functional changes. This commit moves findCandidates out of the suffix tree and into the MachineOutliner class. This is much easier to follow, and removes the burden of candidate choice from the suffix tree. It also adds a couple FIXMEs and simplifies building outlined function names.
  13. [sancov] Implement __sanitizer_cov_reset. Summary: Clears all collected coverage. Reviewers: kcc Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D35958
  14. [llvm-pdbutil] Clean up ExitOnError usage to add ": " to our errors The banner parameter is supposed to end in a separator, like ": ". Otherwise, we get ugly errors like: Error while reading publics streamNative error: blah blah
  15. [PDB] Initialize the std::array<ulittle32_t> used for the gsi bitmap With ASan, we would write about 512 bytes of malloc fill value to the PDB, with some random bits ORed in here and there. Dumping the PDB would always fail reliably.
  16. [ConstantFolder] Don't try to fold gep when the idx is a vector. The code in ConstantFoldGetElementPtr() assumes integers, and therefore it crashes trying to get the integer bidwith of a vector type (in this case <4 x i32>. I just changed the code to prevent the folding in case of vectors and I didn't bother to generalize as this doesn't seem to me something that really happens in practice, but I'm willing to change the patch if you think it's worth it. This is hard to trigger from -instsimplify or -instcombine only as the second instruction is dead, so the test uses loop-unroll. Differential Revision: https://reviews.llvm.org/D35956
Revision 309347 by rnk:
[lit] Port googletest lit tests to Windows

Summary:
The technique of directly calling subprocess.Popen on a python script
doesn't work on Windows. The executable path of the command must refer
to a valid win32 executable.

Instead, rename all the python scripts masquerading as gtest executables
to have .py extensions, so we can easily detect then and call the python
executable for them. Do this on Linux as well as Windows for
consistency.

The test suite directory names also come out in lower-case on Windows.
We can consider removing that in a later patch. This change just updates
the FileCheck lines to match on Windows.

Fixes PR33933

Reviewers: modocache, mgorny

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D35909
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/utils/lit/lit/formats/googletest.pyllvm.src/utils/lit/lit/formats/googletest.py
The file was removed/llvm/trunk/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTestllvm.src/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest
The file was added/llvm/trunk/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.pyllvm.src/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py
The file was removed/llvm/trunk/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTestllvm.src/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest
The file was added/llvm/trunk/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.pyllvm.src/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py
The file was removed/llvm/trunk/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTestllvm.src/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest
The file was added/llvm/trunk/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest.pyllvm.src/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest.py
The file was modified/llvm/trunk/utils/lit/tests/googletest-format.pyllvm.src/utils/lit/tests/googletest-format.py
The file was modified/llvm/trunk/utils/lit/tests/googletest-timeout.pyllvm.src/utils/lit/tests/googletest-timeout.py
The file was modified/llvm/trunk/utils/lit/tests/googletest-upstream-format.pyllvm.src/utils/lit/tests/googletest-upstream-format.py
Revision 309346 by dehao:
Changing the default MaxNumPromotions from 2 to 3.

Summary: In performance tuning, we see performance benefits when enlarge the maximum num promotion targets to 3. This is safe as soon as we have total percentage threshold properly setup (https://reviews.llvm.org/D35962)

Reviewers: davidxl, tejohnson

Reviewed By: tejohnson

Subscribers: llvm-commits, sanjoy

Differential Revision: https://reviews.llvm.org/D35966
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Analysis/IndirectCallPromotionAnalysis.cppllvm.src/lib/Analysis/IndirectCallPromotionAnalysis.cpp
Revision 309345 by dehao:
Separate the ICP total threshold and remaining threshold.

Summary: In the current implementation, isPromotionProfitable only checks if the call count to a direct target is no less than a certain percentage threshold of the remaining call counts that have not been promoted. This causes code size problems when the target count is small but greater than a large portion of remaining counts. E.g. target1 takes 99.9%, while target2 takes 0.1%. Both targets will be promoted and inlined, makes the function size too large, which potentially prevents it from further inlining into its callers. This patch adds another percentage threshold against the total indirect call count. If the target count needs to be no less than both thresholds in order to be promoted speculatively.

Reviewers: davidxl, tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits

Differential Revision: https://reviews.llvm.org/D35962
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/Analysis/IndirectCallPromotionAnalysis.hllvm.src/include/llvm/Analysis/IndirectCallPromotionAnalysis.h
The file was modified/llvm/trunk/lib/Analysis/IndirectCallPromotionAnalysis.cppllvm.src/lib/Analysis/IndirectCallPromotionAnalysis.cpp
The file was modified/llvm/trunk/test/Transforms/PGOProfile/indirect_call_promotion.llllvm.src/test/Transforms/PGOProfile/indirect_call_promotion.ll
Revision 309344 by dehao:
Increase the ImportHotMultiplier to 10.0

Summary: The original 3.0 hot mupltiplier is too small, and would prevent hot callsites from being inline. This patch increases the hot multilier to 10.0

Reviewers: davidxl, tejohnson

Reviewed By: tejohnson

Subscribers: llvm-commits, sanjoy

Differential Revision: https://reviews.llvm.org/D35969
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/IPO/FunctionImport.cppllvm.src/lib/Transforms/IPO/FunctionImport.cpp
Revision 309343 by rnk:
[X86] Fix latent bug in sibcall eligibility logic

The X86 tail call eligibility logic was correct when it was written, but
the addition of inalloca and argument copy elision broke its
assumptions. It was assuming that fixed stack objects were immutable.

Currently, we aim to emit a tail call if no arguments have to be
re-arranged in memory. This code would trace the outgoing argument
values back to check if they are loads from an incoming stack object.
If the stack argument is immutable, then we won't need to store it back
to the stack when we tail call.

Fortunately, stack objects track their mutability, so we can just make
the obvious check to fix the bug.

This was http://crbug.com/749826
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/X86/X86ISelLowering.cppllvm.src/lib/Target/X86/X86ISelLowering.cpp
The file was added/llvm/trunk/test/CodeGen/X86/tail-call-mutable-memarg.llllvm.src/test/CodeGen/X86/tail-call-mutable-memarg.ll
Revision 309341 by George Karpenkov:
[sanitizers] Sanitizer tests CMake clean up: try #2

This patch addresses two issues:

Most of the time, hacks with `if/else` in order to get support for
multi-configuration builds are superfluous.
The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it
expands to `.`  on all single-configuration builds, and to a configuration
name otherwise.
The `if/else` hacks for the library name generation should also not be
done, as CMake has `TARGET_FILE` generator expression precisely for this
purpose, as it expands to the exact filename of the resulting target.

Differential Revision: https://reviews.llvm.org/D35952
Change TypePath in RepositoryPath in Workspace
The file was modified/compiler-rt/trunk/CMakeLists.txtcompiler-rt.src/CMakeLists.txt
The file was modified/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmakecompiler-rt.src/cmake/Modules/AddCompilerRT.cmake
The file was modified/compiler-rt/trunk/lib/asan/tests/CMakeLists.txtcompiler-rt.src/lib/asan/tests/CMakeLists.txt
The file was modified/compiler-rt/trunk/lib/interception/tests/CMakeLists.txtcompiler-rt.src/lib/interception/tests/CMakeLists.txt
The file was modified/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txtcompiler-rt.src/lib/sanitizer_common/tests/CMakeLists.txt
Revision 309339 by eugenis:
[sancov] Add missing line breaks in test. NFC.
Change TypePath in RepositoryPath in Workspace
The file was modified/compiler-rt/trunk/test/asan/TestCases/Posix/coverage-reset.cccompiler-rt.src/test/asan/TestCases/Posix/coverage-reset.cc
Revision 309338 by kcc:
[sanitizer-coverage] clang flags pumbing for -fsanitize-coverage=pc-table
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/include/clang/Driver/CC1Options.tdclang.src/include/clang/Driver/CC1Options.td
The file was modified/cfe/trunk/include/clang/Frontend/CodeGenOptions.defclang.src/include/clang/Frontend/CodeGenOptions.def
The file was modified/cfe/trunk/lib/CodeGen/BackendUtil.cppclang.src/lib/CodeGen/BackendUtil.cpp
The file was modified/cfe/trunk/lib/Driver/SanitizerArgs.cppclang.src/lib/Driver/SanitizerArgs.cpp
The file was modified/cfe/trunk/lib/Frontend/CompilerInvocation.cppclang.src/lib/Frontend/CompilerInvocation.cpp
The file was modified/cfe/trunk/test/Driver/fsanitize-coverage.cclang.src/test/Driver/fsanitize-coverage.c
Revision 309337 by kcc:
[sanitizer-coverage] rename sanitizer-coverage-create-pc-table into sanitizer-coverage-pc-table and add plumbing for a clang flag
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/Transforms/Instrumentation.hllvm.src/include/llvm/Transforms/Instrumentation.h
The file was modified/llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cppllvm.src/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
The file was modified/llvm/trunk/test/Instrumentation/SanitizerCoverage/pc-table.llllvm.src/test/Instrumentation/SanitizerCoverage/pc-table.ll
Revision 309336 by Adrian Prantl:
Remove unused function from AArch64 backend (NFC)
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cppllvm.src/lib/Target/AArch64/AArch64InstrInfo.cpp
The file was modified/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.hllvm.src/lib/Target/AArch64/AArch64InstrInfo.h
Revision 309335 by kcc:
[sanitizer-coverage] add a feature sanitizer-coverage-create-pc-table=1 (works with trace-pc-guard and inline-8bit-counters) that adds a static table of instrumented PCs to be used at run-time
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cppllvm.src/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
The file was added/llvm/trunk/test/Instrumentation/SanitizerCoverage/pc-table.llllvm.src/test/Instrumentation/SanitizerCoverage/pc-table.ll
Revision 309334 by paquette:
[MachineOutliner] Cleanup: move findCandidates out of suffix tree

Doing some cleanup in preparation for some functional changes.
This commit moves findCandidates out of the suffix tree and into the
MachineOutliner class. This is much easier to follow, and removes
the burden of candidate choice from the suffix tree.

It also adds a couple FIXMEs and simplifies building outlined function
names.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/CodeGen/MachineOutliner.cppllvm.src/lib/CodeGen/MachineOutliner.cpp
Revision 309333 by eugenis:
[sancov] Implement __sanitizer_cov_reset.

Summary: Clears all collected coverage.

Reviewers: kcc

Subscribers: srhines, kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D35958
Change TypePath in RepositoryPath in Workspace
The file was modified/compiler-rt/trunk/include/sanitizer/coverage_interface.hcompiler-rt.src/include/sanitizer/coverage_interface.h
The file was modified/compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_interface.inccompiler-rt.src/lib/sanitizer_common/sanitizer_coverage_interface.inc
The file was modified/compiler-rt/trunk/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cccompiler-rt.src/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
The file was added/compiler-rt/trunk/test/asan/TestCases/Posix/coverage-reset.cccompiler-rt.src/test/asan/TestCases/Posix/coverage-reset.cc
Revision 309332 by rnk:
[llvm-pdbutil] Clean up ExitOnError usage to add ": " to our errors

The banner parameter is supposed to end in a separator, like ": ".
Otherwise, we get ugly errors like:

Error while reading publics streamNative error: blah blah
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cppllvm.src/tools/llvm-pdbutil/DumpOutputStyle.cpp
Revision 309331 by rnk:
[PDB] Initialize the std::array<ulittle32_t> used for the gsi bitmap

With ASan, we would write about 512 bytes of malloc fill value to the
PDB, with some random bits ORed in here and there. Dumping the PDB would
always fail reliably.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cppllvm.src/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp
Revision 309330 by davide:
[ConstantFolder] Don't try to fold gep when the idx is a vector.

The code in ConstantFoldGetElementPtr() assumes integers, and
therefore it crashes trying to get the integer bidwith of a vector
type (in this case <4 x i32>. I just changed the code to prevent
the folding in case of vectors and I didn't bother to generalize
as this doesn't seem to me something that really happens in
practice, but I'm willing to change the patch if you think
it's worth it.
This is hard to trigger from -instsimplify or -instcombine
only as the second instruction is dead, so the test uses loop-unroll.

Differential Revision:  https://reviews.llvm.org/D35956
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/IR/ConstantFold.cppllvm.src/lib/IR/ConstantFold.cpp
The file was added/llvm/trunk/test/Transforms/InstSimplify/pr33957.llllvm.src/test/Transforms/InstSimplify/pr33957.ll