SuccessChanges

Summary

  1. Fix android sanitizer tests for multiple devices (details)
Commit edd8be8a469b4e1e075f5210f7b88b0da8e983eb by Vitaly Buka
Fix android sanitizer tests for multiple devices
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_android_functions.sh (diff)

Summary

  1. [Coverage] Store compilation dir separately in coverage mapping (details)
  2. [MLIR] Make structured op tests permutation invariant (details)
  3. AMDGPU: Add regression testcase for bundle pressure issue (details)
  4. [CSSPGO] Use callsite sample counts to annotate indirect call sites. (details)
  5. [gn build] assert that goma_dir and sysroot are set for goma builds (details)
  6. [llvm][IR] Do not place constants with static relocations in a mergeable section (details)
  7. [dfsan] Instrument origin variable and function definitions (details)
  8. [Polly] Update IslAstInfo::getNodePayload to use isl C++ interface. NFC. (details)
  9. MIR: Fix parser crash on syntax error on first character (details)
  10. [lldb] Check that files exists before handing them off to FileCollector (details)
  11. Revert "[MLIR] Make structured op tests permutation invariant" (details)
  12. Add DivOp to the Shape dialect (details)
  13. [SampleFDO] Stop repeated indirect call promotion for the same target. (details)
  14. Detect diagnostic groups that are defined in multiple 'def's. (details)
  15. Switch to using LEB encoding for key and data lengths in on-disk hash (details)
  16. [android] Fix testing adb call (details)
Commit 5fbd1a333aa1a0b70903d036b98ea56c51ae5224 by phosek
[Coverage] Store compilation dir separately in coverage mapping

We currently always store absolute filenames in coverage mapping.  This
is problematic for several reasons. It poses a problem for distributed
compilation as source location might vary across machines.  We are also
duplicating the path prefix potentially wasting space.

This change modifies how we store filenames in coverage mapping. Rather
than absolute paths, it stores the compilation directory and file paths
as given to the compiler, either relative or absolute. Later when
reading the coverage mapping information, we recombine relative paths
with the working directory. This approach is similar to handling
ofDW_AT_comp_dir in DWARF.

Finally, we also provide a new option, -fprofile-compilation-dir akin
to -fdebug-compilation-dir which can be used to manually override the
compilation directory which is useful in distributed compilation cases.

Differential Revision: https://reviews.llvm.org/D95753
The file was addedclang/test/CodeGen/profile-compilation-dir.c
The file was modifiedllvm/include/llvm/ProfileData/InstrProfData.inc
The file was modifiedllvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
The file was modifiedllvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h
The file was modifiedclang/lib/CodeGen/CoverageMappingGen.cpp
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedllvm/docs/CoverageMappingFormat.rst
The file was modifiedllvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
The file was modifiedclang/test/CoverageMapping/abspath.cpp
The file was modifiedllvm/unittests/ProfileData/CoverageMappingTest.cpp
The file was modifiedclang/lib/CodeGen/CoverageMappingGen.h
The file was modifiedcompiler-rt/include/profile/InstrProfData.inc
The file was modifiedllvm/test/tools/llvm-cov/binary-formats.c
The file was modifiedclang/test/Profile/profile-prefix-map.c
The file was addedllvm/test/tools/llvm-cov/Inputs/binary-formats.v6.linux64l
The file was modifiedllvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/include/clang/Basic/CodeGenOptions.h
The file was modifiedllvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
Commit b9ff67099ad6da931976e66f1510c5af2558a86e by gcmn
[MLIR] Make structured op tests permutation invariant

Extracts the relevant dimensions from the map under test to build up the
maps to test against in a permutation-invariant way.

This also includes a fix to the indexing maps used by
isColumnMajorMatmul. The maps as currently written do not describe a
column-major matmul. The linalg named op column_major_matmul has the
correct maps (and notably fails the current test).

If `C = matmul(A, B)` we want an operation that given A in column major
format and B in column major format produces C in column major format.
Given that for a matrix, faux column major is just transpose.
`column_major_matmul(transpose(A), transpose(B)) = transpose(C)`. If
`A` is `NxK` and `B` is `KxM`, then `C` is `NxM`, so `transpose(A)` is
`KxN`, `transpose(B)` is `MxK` and `transpose(C)` is `MxN`, not `NxM`
as these maps currently have.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D96984
The file was modifiedmlir/lib/Dialect/CMakeLists.txt
The file was addedmlir/unittests/Dialect/Utils/CMakeLists.txt
The file was addedmlir/lib/Dialect/Utils/StructuredOpsUtils.cpp
The file was modifiedmlir/lib/Dialect/Vector/CMakeLists.txt
The file was addedmlir/unittests/Dialect/Utils/StructuredOpsUtilsTest.cpp
The file was modifiedmlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h
The file was addedmlir/lib/Dialect/Utils/CMakeLists.txt
Commit 27093f1a94e2bb95400dfc5407b581aacb401951 by Matthew.Arsenault
AMDGPU: Add regression testcase for bundle pressure issue

This is a somewhat reduced testcase that regressed, causing the revert
in 477e3fe4f874b1c4d5896f3bfaf7b3b8a6d38103.

This was producing a bundle that could not be allocated. This is a
tricky one to reduce/reproduce, but I do like having some sanity check
for this.
The file was addedllvm/test/CodeGen/AMDGPU/unallocatable-bundle-regression.mir
Commit e87b1b1d4e789d2350a07873998c992c08152ee6 by hoy
[CSSPGO] Use callsite sample counts to annotate indirect call sites.

With CSSPGO all indirect call targets are counted torwards the original indirect call site in the profile, including both inlined and non-inlined targets. Therefore no need to look for callee entry counts. This also fixes the issue where callee entry count doesn't match callsite count due to the nature of CS sampling.

I'm also cleaning up the orginal code that called `findIndirectCallFunctionSamples` just to compute the sum, the return value of which was disgarded.

Reviewed By: wmi, wenlei

Differential Revision: https://reviews.llvm.org/D96990
The file was modifiedllvm/lib/Transforms/IPO/SampleProfile.cpp
Commit afdfdc4bcf1e3d9d8596b701da69f2309e7bf697 by thakis
[gn build] assert that goma_dir and sysroot are set for goma builds
The file was modifiedllvm/utils/gn/build/BUILD.gn
The file was modifiedllvm/utils/gn/build/toolchain/BUILD.gn
Commit c77659e5494e4aa942bf0bc709b1779931dd30a8 by leonardchan
[llvm][IR] Do not place constants with static relocations in a mergeable section

This patch provides two major changes:

1. Add getRelocationInfo to check if a constant will have static, dynamic, or
   no relocations. (Also rename the original needsRelocation to needsDynamicRelocation.)
2. Only allow a constant with no relocations (static or dynamic) to be placed
   in a mergeable section.

This will allow unused symbols that contain static relocations and happen to
fit in mergeable constant sections (.rodata.cstN) to instead be placed in
unique-named sections if -fdata-sections is used and subsequently garbage collected
by --gc-sections.

See https://lists.llvm.org/pipermail/llvm-dev/2021-February/148281.html.

Differential Revision: https://reviews.llvm.org/D95960
The file was modifiedllvm/lib/Target/TargetLoweringObjectFile.cpp
The file was modifiedllvm/lib/IR/Constants.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp
The file was modifiedllvm/include/llvm/IR/Constant.h
The file was modifiedllvm/test/CodeGen/X86/relptr-rodata.ll
The file was modifiedllvm/lib/CodeGen/MachineFunction.cpp
The file was modifiedllvm/lib/Target/ARM/ARMTargetTransformInfo.h
The file was modifiedllvm/lib/Target/ARM/ARMISelLowering.cpp
Commit 7e658b2fdcccb5bbedef3f90c4d5ea5ca7de9268 by jianzhouzh
[dfsan] Instrument origin variable and function definitions

This is a part of https://reviews.llvm.org/D95835.

Reviewed-by: morehouse, gbalats

Differential Revision: https://reviews.llvm.org/D96977
The file was addedllvm/test/Instrumentation/DataFlowSanitizer/basic.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
Commit ea37ee5bc40fccb7e226f669fe7b6cc4041025cb by llvm-project
[Polly] Update IslAstInfo::getNodePayload to use isl C++ interface. NFC.
The file was modifiedpolly/lib/CodeGen/IslAst.cpp
The file was modifiedpolly/include/polly/CodeGen/IslAst.h
Commit 2d3d2e78d08578f4699cc268b7c292c3ff97e7fe by Matthew.Arsenault
MIR: Fix parser crash on syntax error on first character

This was calling the diagnostic printer before the context member was
initialized.
The file was addedllvm/test/CodeGen/MIR/Generic/first-character-parse-error.mir
The file was modifiedllvm/lib/CodeGen/MIRParser/MIRParser.cpp
Commit 31fa76fd24adea755e4368674a59385d2c5b0cc7 by Jonas Devlieghere
[lldb] Check that files exists before handing them off to FileCollector

The FileCollector asserts that paths passed to addDirectory are indeed
directories. For that to work, the file needs to actually exist. In the
downstream Swift fork we have tests that remove files during testing,
which resulted in this assertion getting triggered.
The file was modifiedlldb/source/Utility/Reproducer.cpp
Commit cd8cc00b9e2b2b2b10270f7485eb47759bc54cc1 by joker.eph
Revert "[MLIR] Make structured op tests permutation invariant"

This reverts commit b9ff67099ad6da931976e66f1510c5af2558a86e.
The build is broken with -DBUILD_SHARED_LIBS=ON
The file was modifiedmlir/lib/Dialect/CMakeLists.txt
The file was removedmlir/lib/Dialect/Utils/StructuredOpsUtils.cpp
The file was modifiedmlir/lib/Dialect/Vector/CMakeLists.txt
The file was removedmlir/lib/Dialect/Utils/CMakeLists.txt
The file was removedmlir/unittests/Dialect/Utils/CMakeLists.txt
The file was modifiedmlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h
The file was removedmlir/unittests/Dialect/Utils/StructuredOpsUtilsTest.cpp
Commit d690cbf821f1d4e13bdf97779ffb332624890fcb by jpienaar
Add DivOp to the Shape dialect

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D96907
The file was modifiedmlir/test/Dialect/Shape/ops.mlir
The file was modifiedmlir/test/Dialect/Shape/canonicalize.mlir
The file was modifiedmlir/lib/Dialect/Shape/IR/Shape.cpp
The file was modifiedmlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
Commit 5fb65c02ca5e91e7e1a00e0efdb8edc899f3e4b9 by wmi
[SampleFDO] Stop repeated indirect call promotion for the same target.

Found a problem in indirect call promotion in sample loader pass. Currently
if an indirect call is promoted for a target, and if the parent function is
inlined into some other function, the indirect call can be promoted for the
same target again. That is redundent which can harm performance and can cause
excessive compile time in some extreme case.

The patch fixes the issue. If a target is promoted for an indirect call, the
patch will write ICP metadata with the target call count being set to 0.
In the later ICP in sample profile loader, if it sees a target has 0 count
for an indirect call, it knows the target has been promoted and won't do
indirect call promotion for the indirect call.

The fix brings 0.1~0.2% performance on our search benchmark.

Differential Revision: https://reviews.llvm.org/D96806
The file was addedllvm/test/Transforms/SampleProfile/Inputs/norepeated-icp.prof
The file was modifiedllvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp
The file was modifiedllvm/lib/ProfileData/InstrProf.cpp
The file was modifiedllvm/test/Transforms/SampleProfile/indirect-call.ll
The file was modifiedllvm/include/llvm/ProfileData/InstrProf.h
The file was modifiedllvm/lib/Transforms/IPO/SampleProfile.cpp
The file was addedllvm/test/Transforms/SampleProfile/norepeated-icp.ll
Commit 3cd70fc59d2a1a907d14bbf3f2dfe53d2c2be9d1 by richard
Detect diagnostic groups that are defined in multiple 'def's.

Remove the three such groups that we've accumulated. These were causing
duplicated output to appear in generated the diagnostic reference.
The file was removedclang/test/TableGen/tg-fixits.td
The file was modifiedclang/include/clang/Basic/DiagnosticGroups.td
The file was removedclang/test/TableGen/anonymous-groups.td
The file was addedclang/test/TableGen/redefined-group.td
The file was modifiedclang/utils/TableGen/ClangDiagnosticsEmitter.cpp
Commit e0589d70fb8e29842fab228df716f73b378710a6 by richard
Switch to using LEB encoding for key and data lengths in on-disk hash
tables.

This gives a modest AST file size reduction, while also fixing crashes
in cases where the key or data length doesn't fit into 16 bits.
Unfortunately, such situations tend to require huge test cases (such as
more than 16K modules or an overload set with 16K entries), and I
couldn't get a testcase to finish in a reasonable amount of time, so no
test is included for that bugfix.

No functionality change intended (other than the bugfix).
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was modifiedclang/include/clang/Serialization/ModuleFile.h
The file was modifiedclang/lib/Serialization/ASTReader.cpp
Commit df2940aa85f0265c5f718cb23546404246667b99 by Vitaly Buka
[android] Fix testing adb call

Looks like some debug leftover which force another retry.
The file was modifiedcompiler-rt/test/sanitizer_common/android_commands/android_common.py