LLVM/llvm 366311clang-tools-extra/trunk/clangd/unittests TweakTests.cpp

[clangd] Fix error message in tweaktests to be useful. NFC

LLVM/llvm 366310zorg/trunk/zorg/jenkins monorepo_build.py

monorepo_build.py: Update artifact name

Incorporate the git sha and a sequentially increasing number (which can be
generated using "git describe" and an annotated tag).

LLVM/llvm 366309llvm/trunk/test/tools/llvm-ar replace-update.test replace.test

[llvm-ar][test] Add coverage for replace and update key letters

Some more tests to increase llvm-ar test coverage, this time for replace 'r' and update 
'u'.

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

LLVM/llvm 366308llvm/trunk/lib/Target/ARM ARMCallLowering.cpp ARMCallLowering.h

[ARM GlobalISel] Cleanup CallLowering. NFC

Migrate CallLowering::lowerReturnVal to use the same infrastructure as
lowerCall/FormalArguments and remove the now obsolete code path from
splitToValueTypes.

Forgot to push this earlier.

LLVM/llvm 366307lld/trunk/ELF Writer.cpp

[ELF] Delete redundant pageAlign at PT_GNU_RELRO boundaries after D58892

Summary:
After D58892 split the RW PT_LOAD on the PT_GNU_RELRO boundary, the new
layout is:

PT_LOAD(PT_GNU_RELRO(.data.rel.ro .bss.rel.ro)) PT_LOAD(.data. .bss)

The two pageAlign() calls at PT_GNU_RELRO boundaries are redundant due
to the existence of PT_LOAD.

Reviewers: grimar, peter.smith, ruiu, espindola

Reviewed By: ruiu

Subscribers: sfertile, atanasyan, emaste, arichardson, llvm-commits

Tags: #llvm

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

LLVM/llvm 366306cfe/trunk/lib/Sema SemaExprCXX.cpp

[OpenCL][Sema] Minor refactoring and constraint checking

Summary:
Simplify code a bit and add assertion to address post-landing comments
from D64083.

Subscribers: yaxunl, Anastasia, cfe-commits

Tags: #clang

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

LLVM/llvm 366305cfe/trunk/lib/Driver/ToolChains Clang.cpp, cfe/trunk/test/Driver cxa-atexit.cpp solaris-opts.c

[Driver] Enable __cxa_atexit on Solaris

Starting with Solaris 11.4 (which is now the required minimal version), Solaris does
support __cxa_atexit.  This patch reflects that.

One might consider removing the affected tests altogether instead of inverting them,
as is done on other targets.

Besides, this lets two ASan tests PASS:

  AddressSanitizer-i386-sunos :: TestCases/init-order-atexit.cc
  AddressSanitizer-i386-sunos-dynamic :: TestCases/init-order-atexit.cc

Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11.

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

LLVM/llvm 366304clang-tools-extra/trunk/unittests/clang-tidy ClangTidyDiagnosticConsumerTest.cpp

Replace CRLF with LF.

LLVM/llvm 366303llvm/trunk/test/CodeGen/Mips inlineasm64.ll

[mips] Remove redundant test case. NFC

The `inlineasm-constraint-reg64.ll` test checks the same functionality.

LLVM/llvm 366302llvm/trunk/test/CodeGen/Mips inlineasm-constraint-ZC-1.ll inlineasm_constraint_ZC.ll

[mips] Name inline asm constraint test cases in a uniform manner. NFC

LLVM/llvm 366301llvm/trunk/lib/Target/Mips Mips64InstrInfo.td, llvm/trunk/test/CodeGen/Mips/llvm-ir mul.ll

[mips] Use mult/mflo pattern on 64-bit targets prior to MIPS64

The `MUL` instruction is available starting from the MIPS32/MIPS64 targets.

LLVM/llvm 366300llvm/trunk/lib/Target/Mips MipsTargetStreamer.h, llvm/trunk/lib/Target/Mips/AsmParser MipsAsmParser.cpp

[mips] Implement .cplocal directive

This directive forces to use the alternate register for context pointer.
For example, this code:
  .cplocal $4
  jal foo
expands to:
  ld    $25, %call16(foo)($4)
  jalr  $25

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

LLVM/llvm 366299llvm/trunk/lib/Target/Mips MipsISelLowering.h MipsSEISelDAGToDAG.cpp, llvm/trunk/test/CodeGen/Mips inlineasm_constraint_o.ll

[mips] Support the "o" inline asm constraint

As well as other LLVM targets we do not handle "offsettable"
memory addresses in any special way. In other words, the "o" constraint
is an exact equivalent of the "m" one. But some existing code require
the "o" constraint support.

This fixes PR42589.

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

LLVM/llvm 366298zorg/trunk/test/jenkins test_monorepo_build.py, zorg/trunk/zorg/jenkins monorepo_build.py

Reland "[zorg] Add a new build script for use with monorepo"

Summary:
monorepo-build.py is similar in functionality to the current build.py, but
with changes to make it work with the monorepo.

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

LLVM/llvm 366297zorg/trunk/test/jenkins test_monorepo_build.py, zorg/trunk/zorg/jenkins monorepo_build.py

Revert "[zorg] Add a new build script for use with monorepo"

This reverts commit c842a5a3fa0d0d7d00e206c47d58fba7288111d1 (r365440).

LLVM/llvm 366296zorg/trunk/test/jenkins test_build.py

Fix typo

Buiilds -> Builds

LLVM/llvm 366295lldb/trunk/source/Target ThreadPlanTracer.cpp

[Target][NFCI] Remove commented out code

LLVM/llvm 366294llvm/trunk/include/llvm/Analysis LoopInfoImpl.h LoopInfo.h, llvm/trunk/unittests/Analysis LoopInfoTest.cpp

[LoopInfo] Fix getUniqueNonLatchExitBlocks

It is possible that exit block has two predecessors and one of them is a latch
block while another is not.

Current algorithm is based on the assumption that all exits are dedicated
and therefore we can check only first predecessor of loop exit to find all unique
exits.

However if we do not consider latch block and it is first predecessor of some
exit then this exit will be found.

Regression test is added.

As a side effect of algorithm re-writing, the restriction that all exits are dedicated
is eliminated.

Reviewers: reames, fhahn, efriedma
Reviewed By: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D64787

LLVM/llvm 366293lldb/trunk/source/Plugins/SymbolFile/NativePDB PdbAstBuilder.cpp PdbAstBuilder.h

[NativePDB] Make GetTranslationUnitDecl return an lldb CompilerDeclCtx

Summary:
We intend to make PdbAstBuilder abstract and implement
PdbAstBuilderClang along with any other languages that wish to use
PDBs. This is the first step.

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

LLVM/llvm 366292lldb/trunk/source/Target ABI.cpp

[Target][NFCI] Rename variable

This variable doesn't have anything to do with clang.

LLVM/llvm 366291llvm/trunk CREDITS.TXT

Update email address.

LLVM/llvm 366290test-suite/trunk/MultiSource/Applications/obsequi negamax.c

Fix more -Werror issues with obsequi.

LLVM/llvm 366289llvm/trunk/utils/gn/secondary/clang-tools-extra/clang-tidy/readability BUILD.gn

gn build: Merge r366265

LLVM/llvm 366288llvm/trunk/utils/gn/secondary/llvm/lib/Remarks BUILD.gn

gn build: Merge r366216

LLVM/llvm 366287test-suite/trunk/MultiSource/Applications/obsequi negamax.c

Obsequi: fix implicit declaration of a function, breaks -Werror builds.

LLVM/llvm 366286cfe/trunk/include/clang/Basic BuiltinsAMDGPU.def, cfe/trunk/lib/CodeGen CGBuiltin.cpp

AMDGPU: Add some missing builtins

LLVM/llvm 366285lldb/trunk/cmake/modules LLDBConfig.cmake

Don't require python exe and lib versions to match while crosscompiling

Summary:
While cross compiling, the python executable is used to run a handful
of scripts while the libraries are linked and headers are included.
Theoretically it's possible for the versions to match completely, but
requiring the build to match 2.7.10 to 2.7.15 is unnecessary.

Subscribers: mgorny

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

LLVM/llvm 366284cfe/trunk/test/SemaOpenCLCXX address-space-deduction.cl

Fix OpenCLCXX test on 32-bit Windows where thiscall is present

LLVM/llvm 366283llvm/trunk/lib/Target/AMDGPU AMDGPURegAsmNames.inc.cpp SIRegisterInfo.td, llvm/trunk/lib/Target/AMDGPU/MCTargetDesc AMDGPUInstPrinter.h

[AMDGPU] Autogenerate register asm names

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

LLVM/llvm 366282cfe/trunk/test/Driver darwin-ld.c

Fix darwin-ld.c if dsymutil.exe exists on PATH

LLVM/llvm 366281lldb/trunk/source/Core IOHandler.cpp

add a workaround in GetLine to account for ReadFile not reporintg error

Summary:
ReadFile on Windows is supposed to set ERROR_OPERATION_ABORTED according
to the docs on MSDN. However, this has evidently been a known bug since
Windows 8. Therefore, we can't detect if a signal interrupted in the
fgets. So pressing ctrl-c causes the repl to end and the process to
exit. A temporary workaround is just to attempt to fgets twice until
this bug is fixed.

A possible alternative would be to set a flag in the `sigint_handler`
and simply check that flag in the true part of the if statement.
However, signal handlers on Windows are asynchronous and this would
require sleeping on the repl loop thread while still not necessarily
guarnateeing that you caught the sigint.

Reviewers: jfb

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

LLVM/llvm 366280llvm/trunk/include/llvm/IR IntrinsicsARM.td, llvm/trunk/test/Verifier/ARM intrinsic-immarg.ll

ARM: Fix missing immarg for space intrinsic

LLVM/llvm 366279llvm/trunk/include/llvm/CodeGen/GlobalISel CallLowering.h, llvm/trunk/lib/CodeGen/GlobalISel CallLowering.cpp

GlobalISel: Add overload of handleAssignments with CCState

AMDGPU needs to allocate special argument registers separately from
the user function argument list, so needs direct control over the
CCState.

The ArgLocs argument is only really necessary because CCState doesn't
allow access to it.

LLVM/llvm 366278llvm/trunk/test/TableGen get-operand-type.td, llvm/trunk/utils/TableGen InstrInfoEmitter.cpp

[TableGen] Generate offsets into a flat array for getOperandType

Rather than an array of std::initializer_list, generate a table of
offsets and a flat array of the operands for getOperandType. This is a
bit more efficient on platforms that don't manage to get the array of
inintializer_lists initialized at link time (I'm looking at you
macOS). It's also quite quite a bit faster to compile.

LLVM/llvm 366277test-suite/trunk/MultiSource/Applications CMakeLists.txt

Enable the obsequi application for Darwin. It seems to run with no issues.

LLVM/llvm 366276cfe/trunk/lib/Driver/ToolChains/Arch X86.cpp, cfe/trunk/test/Driver clang-translation.c

Fix a typo in target features

There was a slight typo in r364352 that ended up causing our backend to
complain on some x86 Android builds. This CL fixes that.

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

LLVM/llvm 366275llvm/trunk/lib/Target/WebAssembly WebAssemblyISelDAGToDAG.cpp, llvm/trunk/test/CodeGen/WebAssembly tls-general-dynamic.ll tls-local-exec.ll

[WebAssembly] Compile all TLS on Emscripten as local-exec

Summary:
Currently, on Emscripten, dynamic linking is not supported with threads.
This means that if thread-local storage is used, it must be used in a
statically-linked executable. Hence, local-exec is the only possible model.

This diff compiles all TLS variables to use local-exec on Emscripten as a
temporary measure until dynamic linking is supported with threads.

The goal for this is to allow C++ types with constructors to be thread-local.

Currently, when `clang` compiles a `thread_local` variable with a constructor,
it generates `__tls_guard` variable:

    @__tls_guard = internal thread_local global i8 0, align 1

As no TLS model is specified, this is treated as general-dynamic, which we do
not support (and cannot support without implementing dynamic linking support
with threads in Emscripten). As a result, any C++ constructor in `thread_local`
variables would not compile.

By compiling all `thread_local` as local-exec, `__tls_guard` will compile and
we can support C++ constructors with TLS without implementing dynamic linking
with threads.

    [12 lines not shown]

LLVM/llvm 366274llvm/trunk/test/TableGen get-operand-type.td, llvm/trunk/utils/TableGen InstrInfoEmitter.cpp

[TableGen] Add "getOperandType" to get operand types from opcode/opidx

The InstrInfoEmitter outputs an enum called "OperandType" which gives
numerical IDs to each operand type. This patch makes use of this enum
to define a function called "getOperandType", which allows looking up
the type of an operand given its opcode and operand index.

Patch by Nicolas Guillemot. Thanks!

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

LLVM/llvm 366273lld/trunk/test/COFF safeseh-no.s

Add REQUIRES: x86 to safeseh-no.s test for x86

LLVM/llvm 366272lld/trunk/test/wasm tls.ll, lld/trunk/wasm Writer.cpp Driver.cpp

[WebAssembly] Implement thread-local storage (local-exec model)

Summary:
Thread local variables are placed inside a `.tdata` segment. Their symbols are
offsets from the start of the segment. The address of a thread local variable
is computed as `__tls_base` + the offset from the start of the segment.

`.tdata` segment is a passive segment and `memory.init` is used once per thread
to initialize the thread local storage.

`__tls_base` is a wasm global. Since each thread has its own wasm instance,
it is effectively thread local. Currently, `__tls_base` must be initialized
at thread startup, and so cannot be used with dynamic libraries.

`__tls_base` is to be initialized with a new linker-synthesized function,
`__wasm_init_tls`, which takes as an argument a block of memory to use as the
storage for thread locals. It then initializes the block of memory and sets
`__tls_base`. As `__wasm_init_tls` will handle the memory initialization,
the memory does not have to be zeroed.

To help allocating memory for thread-local storage, a new compiler intrinsic
is introduced: `__builtin_wasm_tls_size()`. This instrinsic function returns
the size of the thread-local storage for the current function.

The expected usage is to run something like the following upon thread startup:

    [10 lines not shown]

LLVM/llvm 366271llvm/trunk/include/llvm/IR IntrinsicsAMDGPU.td

AMDGPU: Partially revert r366250

GCCBuiltin doesn't work for these, because they have a mangled type
(although they arguably should not).

LLVM/llvm 366270llvm/trunk/docs ORCv2.rst

[ORC][docs] Fix an RST error: the code-block directive needs a newline after it.

LLVM/llvm 366269llvm/trunk/docs ORCv2.rst

[ORC][docs] Trim ORCv1 to ORCv2 transition section, add a how-to section.
DeltaFile
+283-116llvm/trunk/docs/ORCv2.rst
+283-1161 files

LLVM/llvm 366268llvm/trunk/lib/Target/X86 X86ISelLowering.cpp, llvm/trunk/test/CodeGen/X86 phaddsub-extract.ll vector-reduce-add-widen.ll

[x86] use more phadd for reductions

This is part of what is requested by PR42023:
https://bugs.llvm.org/show_bug.cgi?id=42023

There's an extension needed for FP add, but exactly how we would specify
that using flags is not clear to me, so I left that as a TODO.
We're still missing patterns for partial reductions when the input vector
is 256-bit or 512-bit, but I think that's a failure of vector narrowing.
If we can reduce the widths, then this matching should work on those tests.

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

LLVM/llvm 366267cfe/trunk/lib/Format TokenAnnotator.cpp, cfe/trunk/unittests/Format FormatTest.cpp

[clang-format] Don't detect call to ObjC class method as C++11 attribute specifier

Summary:
Previously, clang-format detected something like the following as a C++11 attribute 
specifier.

  @[[NSArray class]]

instead of an array with an Objective-C method call inside. In general, when the attribute 
specifier checking runs, if it sees 2 identifiers in a row, it decides that the square 
brackets represent an Objective-C method call. However, here, `class` is tokenized as a 
keyword instead of an identifier, so this check fails.

To fix this, the attribute specifier first checks whether the first square bracket has an 
"@" before it. If it does, then that square bracket is not the start of a attribute 
specifier because it is an Objective-C array literal. (The assumption is that @[[.*]] is 
not valid C/C++.)

Contributed by rkgibson2.

Reviewers: benhamilton

Reviewed By: benhamilton

Subscribers: aaron.ballman, cfe-commits

    [4 lines not shown]

LLVM/llvm 366266polly/trunk/include/polly ScopBuilder.h ScopInfo.h, polly/trunk/lib/Analysis ScopBuilder.cpp ScopInfo.cpp

[NFC][ScopBuilder] Move addUserContext to ScopBuilder

Scope of changes:
1) Moved addUserContext to ScopBuilder.
2) Moved command line option UserContextStr to ScopBuilder.

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

LLVM/llvm 366265clang-tools-extra/trunk/clang-tidy/readability ConvertMemberFunctionsToStatic.cpp ConvertMemberFunctionsToStatic.h, clang-tools-extra/trunk/docs ReleaseNotes.rst

[clang-tidy] initial version of readability-convert-member-functions-to-static

Summary:
Finds non-static member functions that can be made ``static``.

I have run this check (repeatedly) over llvm-project. It made 1708 member functions
``static``. Out of those, I had to exclude 22 via ``NOLINT`` because their address
was taken and stored in a variable of pointer-to-member type (e.g. passed to
llvm::StringSwitch).
It also made 243 member functions ``const``. (This is currently very conservative
to have no false-positives and can hopefully be extended in the future.)

You can find the results here: 
https://github.com/mgehre/llvm-project/commits/static_const_eval

Reviewers: alexfh, aaron.ballman

Subscribers: mgorny, xazax.hun, cfe-commits

Tags: #clang

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

LLVM/llvm 366264llvm/trunk/lib/CodeGen/AsmPrinter DwarfCompileUnit.cpp, llvm/trunk/test/DebugInfo/X86 fission-inline.ll

DWARF: Skip zero column for inline call sites

D64033 <https://reviews.llvm.org/D64033> added DW_AT_call_column for
inline sites. However, that change wasn't aware of "-gno-column-info".
To avoid adding column info when "-gno-column-info" is used, now
DW_AT_call_column is only added when we have non-zero column (when
"-gno-column-info" is used, column will be zero).

Patch by Wenlei He!

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

LLVM/llvm 366263libcxx/trunk/test/std/language.support/support.dynamic destroying_delete_t.pass.cpp

[libcxx] Rejigger test for destroying delete feature-test macros

In r361572, we introduced library support for C++20 destroying delete
and decided to only define the library feature-test macro when the
compiler supports the underlying language feature. This patch reworks
the tests to mirror that.

LLVM/llvm 366262polly/trunk/include/polly ScopInfo.h ScopBuilder.h, polly/trunk/lib/Analysis ScopInfo.cpp ScopBuilder.cpp

[NFC][ScopBuilder] Move buildAliasChecks and its implementing methods to ScopBuilder

Scope of changes:
1) Moved buildAliasChecks to ScopBuilder.
2) Moved buildAliasGroup to ScopBuilder.
3) Moved buildAliasGroups to ScopBuilder.
4) Moved buildAliasGroupsForAccesses to ScopBuilder.
5) Moved splitAliasGroupsByDomain to ScopBuilder.
6) Moved addNonEmptyDomainConstraints to ScopBuilder.
7) Moved buildMinMaxAccess to ScopBuilder.
8) Moved calculateMinMaxAccess to ScopBuilder.
9) Moved getAccessDomain to ScopBuilder.
10) Moved command line options used only by buildAliasChecks functions to ScopBuilder.
11) Refactored buildAliasGroup function. Added addAliasGroup function to Scop class for 
pushing back calculated min/max accesses.
12) Added function incrementNumberOfAliasingAssumptions which increments number of 
statistic variable AssumptionsAliasing. AssumptionsAliasing variable is defined by 
STATISTIC macro inside ScopInfo.cpp and it is also used by function trackAssumption from 
Scop class.
13) Added reference to OptimizationRemarkEmitter to ScopBuilder class.
14) Moved calculateMinMaxAccess function to ScopBuilder class.

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