AbortedChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [ARM] Fix non-determenistic behaviour (details)
  2. [cmake] Fix clang builds with BUILD_SHARED=ON and CLANG_LINK_CLANG_DYLIB=ON (details)
  3. [analyzer] Fix a couple of bugs in HTML report generation. (details)
  4. [BPF] disable ReduceLoadWidth during SelectionDag phase (details)
  5. [X86] Use MVT::i8 instead of MVT::i64 for shift amount in BuildSDIVPow2 (details)
  6. [clang-tidy] Fix false positive for cppcoreguidelines-init-variables (details)
  7. AMDGPU/EG,CM: Implement fsqrt using recip(rsqrt(x)) instead of x * rsqrt(x) (details)
  8. [AArch64] Add option to enable/disable load-store renaming. (details)
  9. [Clang] Remove unused #pragma clang __debug handle_crash (details)
  10. [analyzer] Add 10.0.0 release notes. (details)
  11. [Support] When using SEH, create a impl instance for CrashRecoveryContext. NFCI. (details)
  12. Re-land "[Clang][Driver] Remove -M group options ..." and "[Clang] Avoid crashing when generating crash diagnostics when '#pragma clang __debug ..." (details)
  13. ReleaseNotes / external projects: Zig (details)
Commit a124bebdd5ff5cf49480956258c322ed9204943c by hans
[ARM] Fix non-determenistic behaviour

Summary:
ARM Type Promotion pass does not clear
the container that defines if one variable
was visited or not, missing optimization
opportunities by luck when two llvm:Values
from different functions  are allocated at
the same memory address.

Also fixes a comment and uses existing
method to pop and obtain last element
of the worklist.

Reviewers: samparker

Reviewed By: samparker

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73970

(cherry picked from commit 8ba2b6281075c65c1a47abed57810e1201942533)
The file was modifiedllvm/lib/CodeGen/TypePromotion.cpp
Commit e2c0c70101ae4419917b232beae37b3d3a713b0c by hans
[cmake] Fix clang builds with BUILD_SHARED=ON and CLANG_LINK_CLANG_DYLIB=ON

Summary:
We were linking all the clang objects and shared libraries into
libclang-cpp.so, which was causing the command line options to be
registered twice.

Reviewers: beanz, mgorny

Reviewed By: beanz, mgorny

Subscribers: merge_guards_bot, mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68520

(cherry picked from commit ebcf25ea8100fc9987fd1edd1975194addc2fc05)
The file was modifiedclang/tools/clang-shlib/CMakeLists.txt
Commit 720870ee60a2cf5259bdc5e9b2a5336381a165fc by hans
[analyzer] Fix a couple of bugs in HTML report generation.

It should now produce valid HTML again.

Differential Revision: https://reviews.llvm.org/D73993

(cherry picked from commit 482e236e569e8324f70778af1eb756923cd490dc)
The file was addedclang/test/Analysis/html_diagnostics/variable-popups-multiple.c
The file was addedclang/test/Analysis/html_diagnostics/td-hotfix.c
The file was addedclang/test/Analysis/html_diagnostics/variable-popups-simple.c
The file was modifiedclang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
The file was addedclang/test/Analysis/html_diagnostics/variable-popups-macro.c
Commit 3f4ba96a59a9329ce819f735550882519a4f6cb5 by hans
[BPF] disable ReduceLoadWidth during SelectionDag phase

The compiler may transform the following code
  ctx = ctx + reloc_offset
  ... (*(u32 *)ctx) & 0x8000 ...
to
  ctx = ctx + reloc_offset
  ... (*(u8 *)(ctx + 1)) & 0x80 ...
where reloc_offset will be replaced with a constant during
AsmPrinter phase.

The above transformed code will be rejected the kernel verifier
as it does not allow
  *(type *)((ctx + non_zero_offset1) + non_zero_offset2)
style access pattern.

It is hard at SelectionDag phase to identify whether a load
is related to context or not. Sometime, interprocedure analysis
may be needed. So let us simply prevent such optimization
from happening.

Differential Revision: https://reviews.llvm.org/D73997

(cherry picked from commit d96c1bbaa03574daf759e5e9a6c75047c5e3af64)
The file was modifiedllvm/lib/Target/BPF/BPFISelLowering.h
The file was addedllvm/test/CodeGen/BPF/CORE/no-narrow-load.ll
Commit 8b8a4834a4b8aaff751c95e458d7a01ceae081a2 by hans
[X86] Use MVT::i8 instead of MVT::i64 for shift amount in BuildSDIVPow2

X86 uses i8 for shift amounts. This code can fail on a 32-bit target
if it runs after type legalization.

This code was copied from AArch64 and modified for X86, but the
shift amount wasn't changed to the correct type for X86.

Fixes PR44812

(cherry picked from commit ec9a94af4d5fb3270f2451fcbec5a3a99f4ac03a)
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was addedllvm/test/CodeGen/X86/pr44812.ll
Commit 84cda4cceabdfec4f130bfafe7bbd050aa65b2ec by hans
[clang-tidy] Fix false positive for cppcoreguidelines-init-variables

Summary: Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44746 | False positive for cppcoreguidelines-init-variables in range based for loop in template function ]]

Reviewers: aaron.ballman, alexfh, hokein, JonasToth, gribozavr2

Reviewed By: aaron.ballman

Subscribers: merge_guards_bot, xazax.hun, wuzish, nemanjai, kbarton, cfe-commits

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D73843

(cherry picked from commit efcd09cea9a51c522954aa24e4b5513266daf6c3)
The file was modifiedclang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-init-variables.cpp
Commit b73942dbc144c11dc94fd32a7d8025a22e7e1d6b by hans
AMDGPU/EG,CM: Implement fsqrt using recip(rsqrt(x)) instead of x * rsqrt(x)

The old version might be faster on EG (RECIP_IEEE is Trans only),
but it'd need extra corner case checks.
This gives correct corner case behaviour and saves a register.
Fixes OCL CTS sqrt test (1-thread, scalar) on Turks.

Reviewer: arsenm
Differential Revision: https://reviews.llvm.org/D74017

(cherry picked from commit e6686adf8a743564f0c455c34f04752ab08cf642)
The file was modifiedllvm/lib/Target/AMDGPU/CaymanInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/EvergreenInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/R600Instructions.td
The file was modifiedllvm/test/CodeGen/AMDGPU/fsqrt.ll
Commit b8fead783fa19d48a2e2c3162fba5271360f57b5 by hans
[AArch64] Add option to enable/disable load-store renaming.

This patch adds a new option to enable/disable register renaming in the
load-store optimizer. Defaults to disabled, as there is a potential
mis-compile caused by this.

(cherry picked from commit 8e3f59b45ae185cc9b4e3a817d7ac958f1d55976)
The file was modifiedllvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
The file was modifiedllvm/test/CodeGen/AArch64/stp-opt-with-renaming-reserved-regs.mir
The file was modifiedllvm/test/CodeGen/AArch64/stp-opt-with-renaming.mir
The file was modifiedllvm/test/CodeGen/AArch64/arm64-abi-varargs.ll
The file was modifiedllvm/test/CodeGen/AArch64/stp-opt-with-renaming-debug.mir
The file was modifiedllvm/test/CodeGen/AArch64/machine-outliner.ll
The file was modifiedllvm/test/CodeGen/AArch64/arm64-abi_align.ll
The file was modifiedllvm/test/CodeGen/AArch64/arm64-variadic-aapcs.ll
The file was modifiedllvm/test/CodeGen/AArch64/machine-outliner-remarks.ll
Commit 793d643f6d69e6908a6ece4aacb07b6573e33e18 by hans
[Clang] Remove unused #pragma clang __debug handle_crash

As discussed in D70568, remove this because it isn't used anywhere, and I think it's better to go through real crashes for testing (#pragma clang __debug crash).
Also remove the support function llvm::CrashRecoveryContext::HandleCrash() which was added at the same time by @ddunbar.

Differential Revision: https://reviews.llvm.org/D74063

(cherry picked from commit 8ecde3ac34bbb5a8d53d8ec5cd32867658646df1)
The file was modifiedllvm/lib/Support/CrashRecoveryContext.cpp
The file was modifiedllvm/include/llvm/Support/CrashRecoveryContext.h
The file was modifiedclang/lib/Lex/Pragma.cpp
Commit 64515b35844b925bdb76821d03ad4d7ddebe06e7 by hans
[analyzer] Add 10.0.0 release notes.

Differential revision: https://reviews.llvm.org/D73966

By Kristóf Umann!
The file was modifiedclang/docs/ReleaseNotes.rst
Commit 4759c6ef8b4ab8d17be3a5e6c96e890944bc515d by hans
[Support] When using SEH, create a impl instance for CrashRecoveryContext. NFCI.

Previously, the SEH codepath in CrashRecoveryContext didn't create a CrashRecoveryContextImpl. The other codepaths (VEH and Unix) were creating it.

When running with -fintegrated-cc1, this is needed to handle exit() as a jump to CrashRecoveryContext's exception filter, through a call to RaiseException. In that situation, we need a user-defined exception code, which is later interpreted as an exit() by the exception filter. This in turn needs to set RetCode accordingly, *inside* the exception filter, and *before* calling HandleCrash().

Differential Revision: https://reviews.llvm.org/D74078

(cherry picked from commit 2a3fa0fc5cd7d3398c0293915b0e569eaa0be24b)
The file was modifiedllvm/lib/Support/CrashRecoveryContext.cpp
Commit 0e1c734fa5b88ec7efc2bcf8d45ed58f6ba48b91 by hans
Re-land "[Clang][Driver] Remove -M group options ..." and "[Clang] Avoid crashing when generating crash diagnostics when '#pragma clang __debug ..."

This re-lands commits f41ec709d9d388dc43469e6ac7f51b6313f7e4af (https://reviews.llvm.org/D74076)
and commit 5fedc2b410853a6aef05e8edf19ebfc4e071e28f (https://reviews.llvm.org/D74070)

The previous build break was caused by '#pragma clang __debug llvm_unreachable' used in a non-assert build. Move it to a separate test in crash-report-with-asserts.c.

(cherry picked from commit 75f09b54429bee17a96e2ba7a2ac0f0a8a7f7e74)
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/lib/Lex/Pragma.cpp
The file was modifiedclang/include/clang/Lex/PreprocessorOptions.h
The file was addedclang/test/Driver/crash-report-with-asserts.c
The file was modifiedclang/lib/Driver/Compilation.cpp
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/include/clang/Driver/CC1Options.td
The file was modifiedclang/test/Driver/crash-report.c
Commit f23caecc0901d930203874ebeb8361a6c297f539 by hans
ReleaseNotes / external projects: Zig
The file was modifiedllvm/docs/ReleaseNotes.rst