SuccessChanges

Summary

  1. [COFF] Free some memory used for chunks (details)
  2. Fix how cc1 command line options are mapped into FP options. (details)
  3. add debug code to chase down a rare crash in asan/lsan https://github.com/google/sanitizers/issues/1193 (details)
  4. [asan] fix a comment typo (details)
  5. [BrachProbablityInfo] Rename loop variables. NFC (details)
  6. [X86] Fix a few recursivelyDeleteUnusedNodes calls that were trying to delete nodes before their user was really gone. (details)
  7. Fix violations of [basic.class.scope]p2. (details)
  8. [BrachProbablityInfo] Proportional distribution of reachable probabilities (details)
  9. [ELF] --wrap: don't error `undefined reference to __real_foo` (--no-allow-shlib-undefined) if foo is a wrapped definition (details)
  10. [mlir][SCFToGPU] Remove conversions from scf.for to gpu.launch. (details)
  11. [ObjectYAML][DWARF] Let `dumpPubSection` return `DWARFYAML::PubSection`. (details)
  12. [NFC] Move vector unmerge(trunc) combine to function (details)
  13. [GlobalISel] Combine scalar unmerge(trunc) (details)
  14. [StatepointLowering] Handle UNDEF gc values. (details)
  15. Options for Basic Block Sections, enabled in D68063 and D73674. (details)
  16. [OpenMP][OMPT] Fix and add event callbacks for detached tasks (details)
  17. [NFC][ARM][AArch64] Test runs (details)
  18. [llvm-exegesis] Fix D80610. (details)
  19. [VE] Support I32/F32 registers in assembler parser (details)
  20. Run syntax tree tests in many language modes (details)
Commit 11d1aa0bcc1197f1b3010171b02c6e9662f34b75 by rnk
[COFF] Free some memory used for chunks

First, do not reserve numSections in the Chunks array. In cases where
there are many non-prevailing sections, this will overallocate memory
which will not be used.

Second, free the memory for sparseChunks after initializeSymbols. After
that, it is never used.

This saves 50MB of 627MB for my use case without affecting performance.
The file was modifiedlld/COFF/InputFiles.h
The file was modifiedlld/COFF/InputFiles.cpp
Commit 8a8d703be0986dd6785cba0b610c9c4708b83e89 by rjmccall
Fix how cc1 command line options are mapped into FP options.

Canonicalize on storing FP options in LangOptions instead of
redundantly in CodeGenOptions.  Incorporate -ffast-math directly
into the values of those LangOptions rather than considering it
separately when building FPOptions.  Build IR attributes from
those options rather than a mix of sources.

We should really simplify the driver/cc1 interaction here and have
the driver pass down options that cc1 directly honors.  That can
happen in a follow-up, though.

Patch by Michele Scandale!
https://reviews.llvm.org/D80315
The file was modifiedclang/lib/CodeGen/CGExprScalar.cpp
The file was addedclang/test/CodeGen/fp-options-to-fast-math-flags.c
The file was modifiedclang/test/CodeGen/complex-math.c
The file was modifiedclang/test/CodeGenOpenCL/relaxed-fpmath.cl
The file was modifiedclang/lib/CodeGen/CodeGenFunction.cpp
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/include/clang/Basic/LangOptions.h
The file was modifiedclang/lib/CodeGen/CodeGenFunction.h
The file was modifiedclang/lib/CodeGen/CGCall.cpp
The file was modifiedclang/test/CodeGen/builtins-nvptx-ptx60.cu
The file was modifiedclang/test/CodeGenCUDA/library-builtin.cu
The file was modifiedclang/include/clang/Basic/CodeGenOptions.def
The file was modifiedclang/test/CodeGenCUDA/builtins-amdgcn.cu
The file was modifiedclang/test/CodeGen/libcalls.c
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp
Commit 2e6c3e3e7b5eb46452b1819c69919fab820b4233 by kcc
add debug code to chase down a rare crash in asan/lsan https://github.com/google/sanitizers/issues/1193

Summary: add debug code to chase down a rare crash in asan/lsan https://github.com/google/sanitizers/issues/1193

Reviewers: vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D80967
The file was modifiedcompiler-rt/lib/asan/asan_allocator.cpp
The file was modifiedcompiler-rt/lib/lsan/lsan_common.cpp
Commit 801d823bdec182d3913aa0a27073229029359ad2 by kcc
[asan] fix a comment typo
The file was modifiedcompiler-rt/lib/asan/asan_allocator.cpp
Commit 3bb0d95fdc2fffd193d39d14f2ef421d4b468617 by yrouban
[BrachProbablityInfo] Rename loop variables. NFC
The file was modifiedllvm/lib/Analysis/BranchProbabilityInfo.cpp
Commit e51d5bc7a4fc967c8a99a75cfa9480eb6b3a4fae by craig.topper
[X86] Fix a few recursivelyDeleteUnusedNodes calls that were trying to delete nodes before their user was really gone.

We looked through a truncate to get to the load. So we should be
deleting the truncate first.

There is a check that the node is really unused before deleting
so this didn't cause a functional issue.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 4ccb6c36a9159809f4b98176325ae202753fe136 by richard
Fix violations of [basic.class.scope]p2.

These cases all follow the same pattern:

struct A {
  friend class X;
  //...
  class X {};
};

But 'friend class X;' injects 'X' into the surrounding namespace scope,
rather than introducing a class member. So the second 'class X {}' is a
completely different type, which changes the meaning of the earlier name
'X' from '::X' to 'A::X'.

Additionally, the friend declaration is pointless -- members of a class
don't need to be befriended to be able to access private members.
The file was modifiedclang/utils/TableGen/NeonEmitter.cpp
The file was modifiedclang/lib/Analysis/CFG.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
The file was modifiedllvm/lib/CodeGen/InterferenceCache.h
Commit 07239c736a5b664942551b82ffa660f2a3f14f41 by yrouban
[BrachProbablityInfo] Proportional distribution of reachable probabilities

When fixing probability of unreachable edges in
BranchProbabilityInfo::calcMetadataWeights() proportionally distribute
remainder probability over the reachable edges. The old implementation
distributes the remainder probability evenly.
See examples in the fixed tests.

Reviewers: yamauchi, ebrevnov
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80611
The file was modifiedllvm/test/Analysis/BranchProbabilityInfo/basic.ll
The file was modifiedllvm/lib/Analysis/BranchProbabilityInfo.cpp
Commit a6ae333a0c23fc9b0783ca45e2676abac00c6723 by maskray
[ELF] --wrap: don't error `undefined reference to __real_foo` (--no-allow-shlib-undefined) if foo is a wrapped definition

This is a regression after D51283.

Also, export `foo` if `__real_foo` is referenced by a shared object.
The file was modifiedlld/test/ELF/wrap-dynamic-undef.s
The file was modifiedlld/ELF/SymbolTable.cpp
The file was modifiedlld/test/ELF/wrap-no-real.s
The file was addedlld/test/ELF/wrap-shlib-undefined.s
Commit 2bcd1927dd9f3ffc12b990bb132995a4c68f998e by ravishankarm
[mlir][SCFToGPU] Remove conversions from scf.for to gpu.launch.

Keeping in the affine.for to gpu.launch conversions, which should
probably be the affine.parallel to gpu.launch conversion as well.

Differential Revision: https://reviews.llvm.org/D80747
The file was modifiedmlir/test/Conversion/SCFToGPU/step_positive.mlir
The file was removedmlir/test/Conversion/SCFToGPU/imperfect_2D.mlir
The file was removedmlir/test/Conversion/SCFToGPU/imperfect_linalg.mlir
The file was modifiedmlir/test/Conversion/SCFToGPU/step_one.mlir
The file was modifiedmlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp
The file was modifiedmlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp
The file was removedmlir/test/Conversion/SCFToGPU/perfect_1D_setlaunch.mlir
The file was removedmlir/test/Conversion/SCFToGPU/linalg_to_gpu.mlir
The file was removedmlir/test/Conversion/SCFToGPU/imperfect_4D.mlir
The file was modifiedmlir/include/mlir/Conversion/Passes.td
The file was removedmlir/test/Conversion/SCFToGPU/imperfect_3D.mlir
The file was modifiedmlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h
The file was modifiedmlir/include/mlir/Conversion/SCFToGPU/SCFToGPUPass.h
The file was modifiedmlir/test/Conversion/SCFToGPU/no_blocks_no_threads.mlir
Commit d3f49b8d378d0b7452f841d28db7b24e3fe9fcb6 by Xing
[ObjectYAML][DWARF] Let `dumpPubSection` return `DWARFYAML::PubSection`.

Summary: This patch addresses comments in [D80722](https://reviews.llvm.org/D80722#inline-742353)

Reviewers: grimar, jhenderson

Reviewed By: grimar, jhenderson

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80861
The file was modifiedllvm/tools/obj2yaml/dwarf2yaml.cpp
Commit b3c6a36dba569ee7f4353173cfa3e6264ba8d7af by dominik.montada
[NFC] Move vector unmerge(trunc) combine to function

In preparation of D79567, move arsenm's vector unmerge(trunc)
combine to a new function `tryFoldUnmergeCast`
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
Commit 052c962ced71c5130d709186b78c37a4adc59d66 by dominik.montada
[GlobalISel] Combine scalar unmerge(trunc)

Summary:
Combine unmerge(trunc) to enable other merge combines.
Without this combine, the scalar unmerge(trunc(merge))
pattern cannot be combined and easily lead to
hard-to-legalize merge/unmerge artifacts.

Reviewed By: arsenm

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79567
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/zextload.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-unmerge-values.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-unmerge-values.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/cvt_f32_ubyte.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-store-global.mir
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-bitcast.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-merge-values.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-freeze.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-unmerge-values.mir
Commit fa818ded24413c8b9722dd564b04d9ffc50743b5 by dantrushin
[StatepointLowering] Handle UNDEF gc values.

Do not spill UNDEF GC values. Instead, replace corresponding
gc.relocate intrinsic with an (arbitrary, but recognizable) constant.

Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D80714
The file was modifiedllvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/statepoint-uniqueing.ll
Commit e0bca46b0854143b2f93b60aac99e669c9776979 by tmsriram
Options for Basic Block Sections, enabled in D68063 and D73674.

This patch adds clang options:
-fbasic-block-sections={all,<filename>,labels,none} and
-funique-basic-block-section-names.
LLVM Support for basic block sections is already enabled.

+ -fbasic-block-sections={all, <file>, labels, none} : Enables/Disables basic
block sections for all or a subset of basic blocks. "labels" only enables
basic block symbols.
+ -funique-basic-block-section-names: Enables unique section names for
basic block sections, disabled by default.

Differential Revision: https://reviews.llvm.org/D68049
The file was addedclang/test/CodeGen/Inputs/basic-block-sections.funcnames
The file was modifiedllvm/lib/CodeGen/BBSectionsPrepare.cpp
The file was modifiedclang/include/clang/Basic/CodeGenOptions.def
The file was addedclang/test/CodeGen/basic-block-sections.c
The file was modifiedclang/docs/ClangCommandLineReference.rst
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedllvm/lib/CodeGen/MachineFunction.cpp
The file was modifiedllvm/include/llvm/CodeGen/CommandFlags.h
The file was modifiedllvm/include/llvm/Target/TargetMachine.h
The file was modifiedllvm/include/llvm/CodeGen/Passes.h
The file was modifiedlld/ELF/LTO.cpp
The file was modifiedlld/ELF/Driver.cpp
The file was modifiedclang/include/clang/Basic/CodeGenOptions.h
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticFrontendKinds.td
The file was modifiedllvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
The file was addedclang/test/Driver/funique-basic-block-section-names.c
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp
The file was modifiedllvm/lib/CodeGen/CommandFlags.cpp
The file was modifiedclang/docs/UsersManual.rst
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedlld/ELF/Config.h
The file was addedclang/test/Driver/fbasic-block-sections.c
The file was modifiedllvm/include/llvm/Target/TargetOptions.h
Commit 10995c77b4766ad2d416919854228fd7a03db5ef by protze
[OpenMP][OMPT] Fix and add event callbacks for detached tasks

The OpenMP spec has the task-fulfill event for a call to omp_fulfill_event.
If the task did not yet finish execution, ompt_task_early_fulfill is used,
otherwise ompt_task_late_fulfill.
If a task does not complete, when the execution finishes (i.e., the task goes
in detached mode), ompt_task_detach instead of ompt_task_complete must be
used, when the next task is scheduled.

A test for both cases is included, which only work with clang-11+

Reviewed By: hbae

Differential revision: https://reviews.llvm.org/D80843
The file was modifiedopenmp/runtime/test/ompt/callback.h
The file was modifiedopenmp/runtime/src/kmp_tasking.cpp
The file was addedopenmp/runtime/test/ompt/tasks/task_early_fulfill.c
The file was addedopenmp/runtime/test/ompt/tasks/task_late_fulfill.c
Commit e70cf280f80c0933dd500ff18c7a17af8057b28c by sam.parker
[NFC][ARM][AArch64] Test runs

Add code size tests runs for memory ops for both architectures.
The file was modifiedllvm/test/Analysis/CostModel/AArch64/store.ll
The file was modifiedllvm/test/Analysis/CostModel/ARM/load_store.ll
Commit 5b8c1ed2c802d3ae016363bab6d1e117b09ecdc9 by courbet
[llvm-exegesis] Fix D80610.

Summary:
Using a .data() member on a StringRef was discarding the StringRef
size, breaking llvm-exegesis on machines with counter sums (e.g.
Zen2).

Reviewers: oontvoo

Subscribers: mstojanovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80982
The file was modifiedllvm/tools/llvm-exegesis/lib/Target.cpp
The file was modifiedllvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
The file was modifiedllvm/tools/llvm-exegesis/lib/Target.h
Commit ec2e9ce73e6c2d70523f7e51a23bf07f998ebecd by simon.moll
[VE] Support I32/F32 registers in assembler parser

Summary:
Support I32/F32 registers in assembler parser and add regression tests of LD/ST
instructions.

Differential Revision: https://reviews.llvm.org/D80777
The file was addedllvm/test/MC/VE/ST.s
The file was modifiedllvm/lib/Target/VE/AsmParser/VEAsmParser.cpp
The file was addedllvm/test/MC/VE/LD.s
Commit 44f989e7809633f13bd0420cc1d79660ad982173 by gribozavr
Run syntax tree tests in many language modes

Reviewers: hlopko, eduucaldas

Reviewed By: hlopko, eduucaldas

Subscribers: gribozavr2, mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80822
The file was modifiedclang/unittests/Tooling/Syntax/CMakeLists.txt
The file was modifiedclang/unittests/Tooling/Syntax/TreeTest.cpp