SuccessChanges

Summary

  1. Fix warning caused by ReductionTreePass class (details)
  2. [MachO] Add skeletal support for DriverKit platform (details)
  3. [lld-macho] Emit load command LC_BUILD_VERSION (details)
  4. [libc] Add restrict qualifiers to string library; give consistent naming scheme to TableGen files. (details)
  5. [StackSafety] Use ValueInfo in ParamAccess::Call (details)
  6. [libcxx/variant] Introduce `switch`-based mechanism for `std::visit`. (details)
  7. Split Preprocessor/init.c test (details)
  8. [x86] add tests for store merging (PR46662); NFC (details)
  9. [AIX] Generate unique module id based on Pid and timestamp (details)
  10. [MSAN] Reintroduce libatomic load/store instrumentation (details)
  11. [docs] Add missing semicolon to example. (details)
  12. [MSAN] Convert ActualFnStart to be a particular Instruction *, not BB (details)
  13. [TableGen] Allow mnemonics with uppercase letters to be matched (details)
  14. [SLC] sprintf(dst, "%s", str) -> strcpy(dst, str) (details)
  15. Temporarily revert "[SCEVExpander] Add helper to clean up instrs inserted while expanding." (details)
Commit c26ed5c9657a8cc4f97fde1b98e3762514bc3666 by sifontes
Fix warning caused by ReductionTreePass class

Explicitly declare ReductionTreeBase base class in ReductionTreePass copy constructor.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D85983
The file was modifiedmlir/include/mlir/Reducer/ReductionTreePass.h
Commit eef41efe0098814ba8445633c7bc6756d4228f8a by jezng
[MachO] Add skeletal support for DriverKit platform

Define the platform ID = 10, and simple mappings between platform ID & name.

Reviewed By: MaskRay, cishida

Differential Revision: https://reviews.llvm.org/D85594
The file was modifiedllvm/include/llvm/BinaryFormat/MachO.h
The file was modifiedllvm/lib/TextAPI/MachO/Platform.cpp
The file was modifiedllvm/lib/TextAPI/MachO/TextStubCommon.cpp
The file was modifiedllvm/lib/TextAPI/MachO/Target.cpp
The file was modifiedllvm/include/llvm/TextAPI/MachO/Platform.h
The file was modifiedllvm/lib/TextAPI/MachO/TextStub.cpp
The file was modifiedllvm/include/llvm/Object/MachO.h
The file was modifiedllvm/lib/MC/MCAsmStreamer.cpp
The file was modifiedllvm/lib/MC/MCParser/DarwinAsmParser.cpp
The file was modifiedllvm/unittests/TextAPI/TextStubV4Tests.cpp
Commit 537f5483fe4e09c39ffd7ac837c00b50dd13d676 by jezng
[lld-macho] Emit load command LC_BUILD_VERSION

Reviewed By: int3

Differential Revision: https://reviews.llvm.org/D85786
The file was modifiedlld/test/MachO/headerpad.s
The file was modifiedlld/test/MachO/relocations.s
The file was modifiedlld/test/MachO/local-got.s
The file was addedlld/test/MachO/lc-build-version.s
The file was modifiedlld/MachO/Writer.cpp
Commit 79ce64ea0872b81ca73e26c4c8ec1680439064bd by gyurgyikcp
[libc] Add restrict qualifiers to string library; give consistent naming scheme to TableGen files.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D85945
The file was modifiedlibc/src/string/strcat.h
The file was modifiedlibc/src/string/strtok_r.h
The file was modifiedlibc/src/string/strtok.h
The file was modifiedlibc/src/string/strcpy.cpp
The file was modifiedlibc/src/string/strcat.cpp
The file was modifiedlibc/src/string/strtok_r.cpp
The file was modifiedlibc/src/string/string_utils.h
The file was modifiedlibc/src/string/strtok.cpp
The file was modifiedlibc/src/string/strcpy.h
The file was modifiedlibc/spec/posix.td
Commit fc4fd898522afac2d54003f34a4656d898358b03 by Vitaly Buka
[StackSafety] Use ValueInfo in ParamAccess::Call

This avoid GUID lookup in Index.findSummaryInModule.
Follow up for D81242.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D85269
The file was modifiedllvm/include/llvm/IR/ModuleSummaryIndex.h
The file was modifiedllvm/lib/AsmParser/LLParser.cpp
The file was modifiedllvm/lib/Bitcode/Writer/BitcodeWriter.cpp
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp
The file was modifiedllvm/lib/Bitcode/Reader/BitcodeReader.cpp
The file was modifiedllvm/lib/IR/AsmWriter.cpp
The file was modifiedllvm/lib/AsmParser/LLParser.h
The file was modifiedllvm/test/Bitcode/thinlto-function-summary-paramaccess.ll
The file was modifiedllvm/lib/Analysis/ModuleSummaryAnalysis.cpp
The file was modifiedllvm/include/llvm/Analysis/StackSafetyAnalysis.h
Commit a175a96517c5d9dc05ba13a6481b1b031a53a22f by mcypark
[libcxx/variant] Introduce `switch`-based mechanism for `std::visit`.

This patch introduces mechanism for `std::visit` backed by `switch`.
The `switch` is structured such that it's a flattened manual vtable (an n-ary array).
The `switch` mechanism is enabled if `(1 * ... * vs.size()) < 1024`.

The following are performance numbers from the benchmarks added in D85419, tested on my 2017 Macbook Pro.

```
$ ./projects/libcxx/benchmarks/variant_visit_1.libcxx.out
2020-08-09 23:55:14
Running ./projects/libcxx/benchmarks/variant_visit_1.libcxx.out
Run on (8 X 3100 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 262K (x4)
  L3 Unified 8388K (x1)
Load Average: 2.03, 2.36, 2.43
------------------------------------------------------------
Benchmark                 Time             CPU   Iterations
------------------------------------------------------------
BM_Visit<1, 1>        0.260 ns        0.260 ns   1000000000
BM_Visit<1, 2>         1.56 ns         1.56 ns    435925220
BM_Visit<1, 3>         1.55 ns         1.55 ns    444416228
BM_Visit<1, 4>         1.57 ns         1.57 ns    427951336
BM_Visit<1, 5>         1.57 ns         1.56 ns    444766371
BM_Visit<1, 6>         1.70 ns         1.68 ns    446639358
BM_Visit<1, 7>         1.64 ns         1.64 ns    400441630
BM_Visit<1, 8>         1.56 ns         1.56 ns    430729471
BM_Visit<1, 9>         1.58 ns         1.58 ns    449894596
BM_Visit<1, 10>        1.54 ns         1.54 ns    449660506
BM_Visit<1, 20>        1.56 ns         1.56 ns    450813074
BM_Visit<1, 30>        1.59 ns         1.59 ns    440032940
BM_Visit<1, 40>        1.59 ns         1.59 ns    443731656
BM_Visit<1, 50>        1.56 ns         1.56 ns    444709859
BM_Visit<1, 60>        1.59 ns         1.58 ns    439527320
BM_Visit<1, 70>        1.57 ns         1.57 ns    438450890
BM_Visit<1, 80>        1.58 ns         1.58 ns    443001525
BM_Visit<1, 90>        1.63 ns         1.62 ns    448456349
BM_Visit<1, 100>       1.57 ns         1.57 ns    445740630

$ ./projects/libcxx/benchmarks/variant_visit_2.libcxx.out
2020-08-09 23:59:35
Running ./projects/libcxx/benchmarks/variant_visit_2.libcxx.out
Run on (8 X 3100 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 262K (x4)
  L3 Unified 8388K (x1)
Load Average: 1.40, 1.94, 2.22
-----------------------------------------------------------
Benchmark                Time             CPU   Iterations
-----------------------------------------------------------
BM_Visit<2, 1>       0.261 ns        0.260 ns   1000000000
BM_Visit<2, 2>        1.55 ns         1.54 ns    432844219
BM_Visit<2, 3>        1.30 ns         1.30 ns    532529974
BM_Visit<2, 4>        1.54 ns         1.54 ns    446055910
BM_Visit<2, 5>        1.31 ns         1.31 ns    531099680
BM_Visit<2, 6>        1.56 ns         1.56 ns    443203475
BM_Visit<2, 7>        1.29 ns         1.29 ns    526478087
BM_Visit<2, 8>        1.56 ns         1.56 ns    439000834
BM_Visit<2, 9>        1.30 ns         1.30 ns    528756817
BM_Visit<2, 10>       1.56 ns         1.55 ns    442923039
BM_Visit<2, 20>       1.35 ns         1.35 ns    517021072
BM_Visit<2, 30>       1.60 ns         1.59 ns    419724661
BM_Visit<2, 40>       1.45 ns         1.44 ns    472137163
BM_Visit<2, 50>       1.65 ns         1.65 ns    421389743

$ ./projects/libcxx/benchmarks/variant_visit_3.libcxx.out
2020-08-10 00:01:32
Running ./projects/libcxx/benchmarks/variant_visit_3.libcxx.out
Run on (8 X 3100 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 262K (x4)
  L3 Unified 8388K (x1)
Load Average: 2.20, 2.01, 2.21
-----------------------------------------------------------
Benchmark                Time             CPU   Iterations
-----------------------------------------------------------
BM_Visit<3, 1>       0.272 ns        0.271 ns   1000000000
BM_Visit<3, 2>        1.87 ns         1.86 ns    361858090
BM_Visit<3, 3>        1.77 ns         1.77 ns    391192579
BM_Visit<3, 4>        1.84 ns         1.84 ns    374694223
BM_Visit<3, 5>        1.75 ns         1.75 ns    408270392
BM_Visit<3, 6>        1.88 ns         1.88 ns    378759185
BM_Visit<3, 7>        1.79 ns         1.79 ns    395498102
BM_Visit<3, 8>        1.85 ns         1.85 ns    371660366
BM_Visit<3, 9>        1.80 ns         1.80 ns    386872851
BM_Visit<3, 10>       1.84 ns         1.84 ns    362367606
BM_Visit<3, 15>       1.77 ns         1.77 ns    392060220
BM_Visit<3, 20>       1.85 ns         1.85 ns    379157188
```

```
$ ./projects/libcxx/benchmarks/variant_visit_1.libcxx.out
2020-08-10 00:05:57
Running ./projects/libcxx/benchmarks/variant_visit_1.libcxx.out
Run on (8 X 3100 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 262K (x4)
  L3 Unified 8388K (x1)
Load Average: 2.27, 2.36, 2.34
------------------------------------------------------------
Benchmark                 Time             CPU   Iterations
------------------------------------------------------------
BM_Visit<1, 1>        0.271 ns        0.271 ns   1000000000
BM_Visit<1, 2>        0.269 ns        0.269 ns   1000000000
BM_Visit<1, 3>        0.271 ns        0.271 ns   1000000000
BM_Visit<1, 4>        0.270 ns        0.270 ns   1000000000
BM_Visit<1, 5>        0.269 ns        0.269 ns   1000000000
BM_Visit<1, 6>        0.270 ns        0.269 ns   1000000000
BM_Visit<1, 7>        0.265 ns        0.265 ns   1000000000
BM_Visit<1, 8>        0.269 ns        0.269 ns   1000000000
BM_Visit<1, 9>        0.268 ns        0.268 ns   1000000000
BM_Visit<1, 10>       0.269 ns        0.269 ns   1000000000
BM_Visit<1, 20>       0.267 ns        0.267 ns   1000000000
BM_Visit<1, 30>       0.272 ns        0.272 ns   1000000000
BM_Visit<1, 40>       0.268 ns        0.268 ns   1000000000
BM_Visit<1, 50>       0.268 ns        0.268 ns   1000000000
BM_Visit<1, 60>       0.268 ns        0.268 ns   1000000000
BM_Visit<1, 70>       0.269 ns        0.269 ns   1000000000
BM_Visit<1, 80>       0.266 ns        0.266 ns   1000000000
BM_Visit<1, 90>       0.268 ns        0.268 ns   1000000000
BM_Visit<1, 100>      0.267 ns        0.267 ns   1000000000

$ ./projects/libcxx/benchmarks/variant_visit_2.libcxx.out
2020-08-12 04:09:59
Running ./projects/libcxx/benchmarks/variant_visit_2.libcxx.out
Run on (8 X 3100 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 262K (x4)
  L3 Unified 8388K (x1)
Load Average: 2.17, 4.20, 4.78
-----------------------------------------------------------
Benchmark                Time             CPU   Iterations
-----------------------------------------------------------
BM_Visit<2, 1>       0.302 ns        0.301 ns   1000000000
BM_Visit<2, 2>       0.297 ns        0.295 ns   1000000000
BM_Visit<2, 3>       0.353 ns        0.351 ns   1000000000
BM_Visit<2, 4>       0.276 ns        0.276 ns   1000000000
BM_Visit<2, 5>       0.285 ns        0.283 ns   1000000000
BM_Visit<2, 6>       0.290 ns        0.287 ns   1000000000
BM_Visit<2, 7>       0.282 ns        0.280 ns   1000000000
BM_Visit<2, 8>       0.290 ns        0.287 ns   1000000000
BM_Visit<2, 9>       0.291 ns        0.285 ns   1000000000
BM_Visit<2, 10>      0.293 ns        0.287 ns   1000000000
BM_Visit<2, 20>       1.70 ns         1.68 ns    391400375
BM_Visit<2, 30>       1.64 ns         1.63 ns    418925874
BM_Visit<2, 40>       1.63 ns         1.62 ns    423623677
BM_Visit<2, 50>       1.68 ns         1.67 ns    411687212

$ ./projects/libcxx/benchmarks/variant_visit_3.libcxx.out
2020-08-12 04:10:43
Running ./projects/libcxx/benchmarks/variant_visit_3.libcxx.out
Run on (8 X 3100 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 262K (x4)
  L3 Unified 8388K (x1)
Load Average: 1.57, 3.76, 4.59
-----------------------------------------------------------
Benchmark                Time             CPU   Iterations
-----------------------------------------------------------
BM_Visit<3, 1>       0.271 ns        0.270 ns   1000000000
BM_Visit<3, 2>       0.344 ns        0.334 ns   1000000000
BM_Visit<3, 3>       0.347 ns        0.336 ns   1000000000
BM_Visit<3, 4>       0.300 ns        0.296 ns   1000000000
BM_Visit<3, 5>       0.290 ns        0.286 ns   1000000000
BM_Visit<3, 6>       0.272 ns        0.271 ns   1000000000
BM_Visit<3, 7>        1.72 ns         1.71 ns    415765841
BM_Visit<3, 8>        1.73 ns         1.72 ns    408909555
BM_Visit<3, 9>        2.16 ns         2.04 ns    380898485
BM_Visit<3, 10>       2.45 ns         2.40 ns    295714256
BM_Visit<3, 15>       1.92 ns         1.85 ns    375990332
BM_Visit<3, 20>       1.66 ns         1.65 ns    414456233
```

Differential Revision: https://reviews.llvm.org/D85420
The file was modifiedlibcxx/test/std/utilities/variant/variant.visit/visit.pass.cpp
The file was modifiedlibcxx/include/variant
Commit 1689c36b1aeb11c444cb7681ee41c77224487441 by tra
Split Preprocessor/init.c test

Some parts of the test had been extracted into separate files previously.
This patch continues the trend and extracts few more large blocks.

This reduces wall time for the test from a single 14s-long test into a set of
smaller tests that can be run in parallel.

Before/after state of the check-clang tests are here:
https://gist.github.com/Artem-B/d0b05c2e98a49158c02de23f7f4f0279

Differential Revision: https://reviews.llvm.org/D85798
The file was addedclang/test/Preprocessor/init-arm.c
The file was addedclang/test/Preprocessor/init-mips.c
The file was addedclang/test/Preprocessor/init-ppc.c
The file was modifiedclang/test/Preprocessor/init.c
The file was addedclang/test/Preprocessor/init-x86.c
Commit 4abcf7e81c9adcc7168825e21ab97ad93be0e83a by spatel
[x86] add tests for store merging (PR46662); NFC
The file was modifiedllvm/test/CodeGen/X86/stores-merging.ll
Commit f759b4e43be251ca29e4cd9cbf6af2ed08ff8253 by Xiangling.Liao
[AIX] Generate unique module id based on Pid and timestamp

A unique module id, which is a part of sinit and sterm function names, is
necessary to be unique. However, `getUniqueModuleId` will fail if there is
no strong external symbol within a module. We turn to use Pid and timestamp
when this happens.

Differential Revision: https://reviews.llvm.org/D85527
The file was modifiedllvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
The file was modifiedllvm/test/CodeGen/PowerPC/aix-static-init-no-unique-module-id.ll
Commit 97de0188dd5d845ff90c8ac779a2ea09688b17df by guiand
[MSAN] Reintroduce libatomic load/store instrumentation

Have the front-end use the `nounwind` attribute on atomic libcalls.
This prevents us from seeing `invoke __atomic_load` in MSAN, which
is problematic as it has no successor for instrumentation to be added.
The file was addedcompiler-rt/test/msan/libatomic_load_exceptions.cpp
The file was modifiedllvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
The file was addedcompiler-rt/test/msan/libatomic.c
The file was addedllvm/test/Instrumentation/MemorySanitizer/libatomic.ll
Commit e492f959e0e0930af3745c1e62b7ffc31f5bf29c by mascasa
[docs] Add missing semicolon to example.
The file was modifiedclang/docs/DataFlowSanitizer.rst
Commit 36ebabc153d44fc9b783fcb2f9ae5a4a7211b242 by guiand
[MSAN] Convert ActualFnStart to be a particular Instruction *, not BB

This allows us to add addtional instrumentation before the function start,
without splitting the first BB.

Differential Revision: https://reviews.llvm.org/D85985
The file was modifiedllvm/test/Instrumentation/MemorySanitizer/msan_kernel_basic.ll
The file was modifiedllvm/test/Instrumentation/MemorySanitizer/store-origin.ll
The file was modifiedllvm/test/Instrumentation/MemorySanitizer/masked-store-load.ll
The file was modifiedllvm/test/Instrumentation/MemorySanitizer/array_types.ll
The file was modifiedllvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
The file was modifiedllvm/test/Instrumentation/MemorySanitizer/clmul.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
The file was modifiedllvm/test/Instrumentation/MemorySanitizer/pr32842.ll
Commit 3cf7efec986da0e2e8812f83eb7507512475687d by nguillemot
[TableGen] Allow mnemonics with uppercase letters to be matched

The assembly parser "canonicalizes" the mnemonics it processes at an
early level by making them lowercase. The goal of this is presumably to
allow assembly to be case-insensitive. However, if one declares an
instruction with a mnemonic using uppercase letters, then it will
never get matched, since the generated lookup tables for the
AsmMatcherEmitter didn't lower() their inputs. This made it difficult to
have instructions that get printed using a mnemonic that includes
uppercase letters, since they could not be parsed.

To fix this problem, this patch adds a few calls to lower() to make the
lookup tables used in AsmMatcherEmitter be case-insensitive. This allows
instruction mnemonics with uppercase letters to be parsed.

Differential Revision: https://reviews.llvm.org/D85858
The file was addedllvm/test/TableGen/MixedCasedMnemonic.td
The file was modifiedllvm/utils/TableGen/AsmMatcherEmitter.cpp
Commit 6dbf0cfcf789365493f70ae69df8a7a59be41c75 by Dávid Bolvanský
[SLC] sprintf(dst, "%s", str) -> strcpy(dst, str)

Transform sprintf(dst, "%s", str) -> strcpy(dst, str) if result is unused
Avoid sprintf(dest, "%s", str) -> llvm.memcpy(align 1 dest, align 1 str, strlen(str)+1) if optimizing for size.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D85963
The file was modifiedllvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
The file was modifiedllvm/test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll
The file was modifiedllvm/test/Transforms/InstCombine/sprintf-1.ll
Commit 38884641f28e373ce291dc5ea93416756216e536 by rupprecht
Temporarily revert "[SCEVExpander] Add helper to clean up instrs inserted while expanding."

This reverts commit 7829c33084a7a5097533cf862daef521380c4e63. The assertion is triggering on some internal code. A reduced test case is in progress.
The file was modifiedllvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
The file was modifiedllvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h