LLVM/llvm 361284llvm/trunk/lib/CodeGen/SelectionDAG SelectionDAGBuilder.cpp

[SelectionDAG] remove redundant code; NFCI

getNode() squashes concatenation of undefs via FoldCONCAT_VECTORS():
  // Concat of UNDEFs is UNDEF.
  if (llvm::all_of(Ops, [](SDValue Op) { return Op.isUndef(); }))
    return DAG.getUNDEF(VT);

LLVM/llvm 361283cfe/trunk/lib/CodeGen CodeGenModule.cpp, cfe/trunk/test/OpenMP nvptx_declare_target_var_ctor_dtor_codegen.cpp nvptx_allocate_codegen.cpp

[OPENMP]Use the attributes for dso locality when building for device.

Currently, we ignore all dso locality attributes/info when building for
the device and thus all symblos are externally visible and can be
preemted at the runtime. It may lead to incorrect results. We need to
follow the same logic, compiler uses for static/pie builds.

LLVM/llvm 361282llvm/trunk/cmake config-ix.cmake

[cmake] Bug in r361281: make include optional and fix typo which might make a difference 
on some systems.

LLVM/llvm 361281llvm/trunk/lib/Transforms/Scalar MergeICmps.cpp

[MergeICmps] Make sorting strongly stable on the rhs.

Summary:
Because the sort order was not strongly stable on the RHS, whether the
chain could merge would depend on the order of the blocks in the Phi.

EXPENSIVE_CHECKS would shuffle the blocks before sorting, resulting in
non-deterministic merging.

Reviewers: gchatelet

Subscribers: hiraditya, llvm-commits, RKSimon

Tags: #llvm

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

LLVM/llvm 361280llvm/trunk/cmake config-ix.cmake, llvm/trunk/cmake/modules AddLLVM.cmake

[cmake] Add custom command to touch archives on Darwin so ninja won't rebuild them.

Summary:
clang and newer versions of ninja use high-resolutions timestamps, but
older versions of libtool on Darwin don't, so the archive will often
get an older timestamp than the last object that was added or updated.
To fix this, we add a custom command to touch the archive after it's
been built so that ninja won't rebuild it unnecessarily the next time
it's run.

Reviewed By: beanz

Tags: #llvm

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

LLVM/llvm 361279llvm/trunk/tools/bugpoint Miscompilation.cpp

[Bugpoint] fix use-after-move. NFC

Summary:
This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
6".

Note that author also states:
"Note that the loop doesn't actually execute at all."

This is not true, but the author can be forgiven; there's two distinct
variables with very similar identifiers:

MiscompiledFunctions
MisCompFunctions

Reviewers: echristo, srhines, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

Tags: #llvm

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

LLVM/llvm 361278cfe/trunk/lib/Driver/ToolChains Darwin.cpp, cfe/trunk/lib/Frontend InitHeaderSearch.cpp

[clang][Darwin] Refactor header search path logic into the driver

Summary:
This commit moves the logic for determining system, resource and C++
header search paths from CC1 to the driver. This refactor has already
been made for several platforms, but Darwin had been left behind.

This refactor tries to implement the previous search path logic with
perfect accuracy. In particular, the order of all include paths inside
CC1 and all paths that were skipped because nonexistent are conserved
after the refactor. This change was also tested against a code base
of significant size and revealed no problems.

Reviewers: jfb, arphaman

Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, jsji, 
cfe-commits

Tags: #clang

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

LLVM/llvm 361277lldb/trunk/source/Plugins/SymbolFile/DWARF DWARFDebugInfoEntry.cpp DWARFDebugInfoEntry.h

Remove `SymbolFileDWARF *` when there is already `DWARFUnit *`

In D61502#1503247 @clayborg suggested that SymbolFileDWARF *dwarf2Data is
really redundant in all the calls with also having DWARFUnit *cu. So remove it.

One `SymbolFileDWARF *` nullptr check
(DWARFDebugInfoEntry::GetDIENamesAndRanges) could be removed, other two nullptr
checks (DWARFDebugInfoEntry::GetName and DWARFDebugInfoEntry::AppendTypeName)
need to stay in place (now for `DWARFUnit *`).

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

LLVM/llvm 361276llvm/trunk/tools/dsymutil DwarfLinker.cpp DwarfStreamer.cpp

[Dsymutil] Remove redundant argument (NFC)

The dwarf streamer already holds a copy of the link options, so there's
no need to pass them as an argument.

LLVM/llvm 361275cfe/trunk/tools/clang-shlib CMakeLists.txt

[CMake] One more stab at fixing BUILD_SHARED_LIBS

If clang's libraries are build SHARED, we need to grab their `PRIVATE_LINK_LIBRARIES` 
properties and add those to clang_shared's interface.

LLVM/llvm 361274cfe/trunk/lib/Sema SemaDeclAttr.cpp, cfe/trunk/test/AST ast-print-no-sanitize.cpp

Do not use the incorrect attribute spelling list index when translating a no_sanitize_foo 
attribute into a no_sanitize("foo") attribute.

This fixes a crash when AST pretty printing declarations marked with no_sanitize_memory.

LLVM/llvm 361273lld/trunk/test/wasm startstop.ll, lld/trunk/wasm Writer.cpp SymbolTable.cpp

Revert "[WebAssembly] Add __start_/_stop_ symbols for data sections"

This reverts commit 7804dbddccba412087a15cab8db4412939700952.

This change broke a bunch of tests of the WebAssembly waterfall.
Will hopefully reland with increased test coverage.

LLVM/llvm 361272llvm/trunk/docs BuildingADistribution.rst index.rst

[docs] Add new document on building distributions

Summary:
This document is an attempt to provide a guide for best practices for using the LLVM build 
system to generate distributable LLVM-based tools.

Most of the document is geared toward distributions of LLVM-based toolchains, but much of 
it also applies to distributing other LLVM-based tools and libraries.

Reviewers: tstellar, phosek, jroelofs, hans, sylvestre.ledru

Reviewed By: tstellar

Subscribers: smeenai, dschuff, arphaman, winksaville, llvm-commits

Tags: #llvm

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

LLVM/llvm 361271cfe/trunk/cmake/modules AddClang.cmake

Fix BUILD_SHARED_LIBS for clang which broke in D61909

llvm_add_library ignores `BUILD_SHARED_LIBS` `STATIC` is explicitly specified. This 
restores the `BUILD_SHARED_LIBS` behavior to the clang build.

LLVM/llvm 361270llvm/trunk/lib/Target/X86 X86ISelLowering.cpp, llvm/trunk/test/CodeGen/X86 vec_saddo.ll vec_ssubo.ll

[X86][SSE] computeKnownBitsForTargetNode - add X86ISD::ANDNP support

Fixes PACKSS-PSHUFB shuffle regressions mentioned on D61692

LLVM/llvm 361269cfe/trunk/test/OpenMP for_reduction_codegen_UDR.cpp nvptx_teams_codegen.cpp

[OPENMP][NVPTX]Mark more functions as always_inline for better
performance.

Internally generated functions must be marked as always_inlines in most
cases. Patch marks some extra reduction function + outlined parallel
functions as always_inline for better performance, but only if the
optimization is requested.

LLVM/llvm 361268llvm/trunk/lib/CodeGen/SelectionDAG DAGCombiner.cpp

[DAGCombiner] prevent unsafe reassociation of FP ops

There are no FP callers of DAGCombiner::reassociateOps() currently,
but we can add a fast-math check to make sure this API is not being
misused.

This was noted as a potential risk (and that risk might increase) with:
D62191

LLVM/llvm 361267llvm/trunk/utils/gn/secondary/clang/unittests BUILD.gn, llvm/trunk/utils/gn/secondary/clang/unittests/Tooling/Syntax BUILD.gn

gn build: Merge r361264

LLVM/llvm 361266lld/trunk/ELF SymbolTable.h

[ELF] Deleted unused ComdatGroups member variable left by D61854

LLVM/llvm 361265cfe/trunk/include/clang/AST JSONNodeDumper.h, cfe/trunk/lib/AST JSONNodeDumper.cpp ASTDumper.cpp

Add support for dumping AST comment nodes to JSON.

LLVM/llvm 361264cfe/trunk/unittests/Tooling/Syntax CMakeLists.txt

[Syntax] Rename TokensTest to SyntaxTests. NFC

To be more consistent with conventions used in the codebase. The new
name will be a better fit when more bits of the syntax library land.

LLVM/llvm 361263llvm/trunk/lib/Transforms/Scalar MergeICmps.cpp

Revert r361257 "[MergeICmps][NFC] Make BCEAtom move-only."

Broke some bots.

LLVM/llvm 361262llvm/trunk/utils/gn/secondary/clang/unittests/Tooling BUILD.gn

gn build: Run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`

LLVM/llvm 361261cfe/trunk/include/clang/Basic Attr.td, cfe/trunk/include/clang/Driver Options.td

[ARM][CMSE] Add commandline option and feature macro

Defines macro ARM_FEATURE_CMSE to 1 for v8-M targets and introduces
-mcmse option which for v8-M targets sets ARM_FEATURE_CMSE to 3.
A diagnostic is produced when the option is given on architectures
without support for Security Extensions.
Reviewed By: dmgreen, snidertm
Differential Revision: https://reviews.llvm.org/D59879

LLVM/llvm 361260llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/refactor/tweaks BUILD.gn

gn build: Merge r361252

LLVM/llvm 361259llvm/trunk/utils/gn/secondary/lld/wasm BUILD.gn

gn build: Merge r361233

LLVM/llvm 361258clang-tools-extra/trunk/clangd CodeComplete.h ClangdServer.cpp, clang-tools-extra/trunk/clangd/tool ClangdMain.cpp

[clangd] Turn no-parse-completion on by when preamble isn't ready. Add flag to force it.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

LLVM/llvm 361257llvm/trunk/lib/Transforms/Scalar MergeICmps.cpp

[MergeICmps][NFC] Make BCEAtom move-only.

And handle for self-move. This is required so that llvm::sort can work
with EXPENSIVE_CHECKS, as it will do a random shuffle of the input
which can result in self-moves.

LLVM/llvm 361256llvm/trunk/test/MC/MachO gen-dwarf-cpp.s

Fix typo in r361251.

LLVM/llvm 361255lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data TestMiData.py, lldb/trunk/tools/lldb-mi MICmdCmdData.cpp

[lldb-mi] Include full path in the -data-disassemble response

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

Patch by Anton Kolesov <Anton.Kolesov at synopsys.com>

LLVM/llvm 361254llvm/trunk/test/CodeGen/AArch64 shift-amount-mod.ll, llvm/trunk/test/CodeGen/X86 shift-amount-mod.ll

[NFC][X86][AArch64] Shift amount masking: tests that show that 'neg' doesn't last

Meaning if we were to produce 'neg' in dagcombine, we will get an
endless cycle; some inverse transform would need to be guarded somehow.

Also, the 'and (sub 0, x), 31' variant is sticky,
doesn't get optimized in any way.

https://bugs.llvm.org/show_bug.cgi?id=41952

LLVM/llvm 361253llvm/trunk/lib/CodeGen ScheduleDAGInstrs.cpp

[ScheduleDAGInstrs] Compute topological ordering on demand.

In most cases, the topological ordering does not get changed in
ScheduleDAGInstrs. We can compute the ordering on demand, similar to
D60125.

This drastically cuts down the number of times we need to compute the
topological ordering, e.g. for SPEC2006, SPEC2k and MultiSource, we get
the following stats for -O3 -flto on X86 (showing the top reductions,
with small absolute values filtered). The smallest reduction is -50%.

Slightly positive impact on compile-time (-0.1 % geomean speedup for
test-suite + SPEC & co, with -O1 on X86)

Tests: 243
Metric: pre-RA-sched.NumTopoInits

Program                                        base       patch  diff
 test-suite...ngs-C/fixoutput/fixoutput.test   115.00      3.00   -97.4%
 test-suite...ks/Prolangs-C/cdecl/cdecl.test   957.00     26.00   -97.3%
 test-suite...math/automotive-basicmath.test   107.00      3.00   -97.2%
 test-suite...rolangs-C++/deriv2/deriv2.test   144.00      6.00   -95.8%
 test-suite...lowfish/security-blowfish.test   410.00     18.00   -95.6%
 test-suite...frame_layout/frame_layout.test   441.00     23.00   -94.8%
 test-suite...rolangs-C++/employ/employ.test   159.00     11.00   -93.1%

    [29 lines not shown]

LLVM/llvm 361252clang-tools-extra/trunk/clangd/refactor/tweaks RawStringLiteral.cpp CMakeLists.txt, clang-tools-extra/trunk/clangd/unittests TweakTests.cpp

[clangd] Add tweak to convert normal to raw string literal, when it contains escapes.

Reviewers: ilya-biryukov

Subscribers: mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

LLVM/llvm 361251llvm/trunk/test/DebugInfo/X86 asm-macro-line-number.s, llvm/trunk/test/MC/MachO gen-dwarf-cpp.s gen-dwarf-macro-cpp.s

[DebugInfo] Fix tests missed by r362148

LLVM/llvm 361250llvm/trunk/test/MC/ELF debug-main-file.s

De-Window-ize a test

LLVM/llvm 361249lld/trunk/test/wasm reproduce.ll

Fix test failure.

I forgot to submit a last-minute change to the last patch.

LLVM/llvm 361248llvm/trunk/lib/MC/MCParser AsmParser.cpp, llvm/trunk/test/MC/ELF debug-hash-file.s

[DebugInfo] Handle '# line "file"' correctly for asm source.
This provides the correct file path for the original source, rather
than the preprocessed source.

Part of the fix for PR41839.

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

LLVM/llvm 361247zorg/trunk/buildbot/osuosl/master/config builders.py

builder lldb-x86_64-fedora: more verbosity

Patch by: Konrad Kleine

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

LLVM/llvm 361246llvm/trunk/lib/Transforms/Utils Local.cpp, llvm/trunk/test/DebugInfo salvage-cast-debug-info.ll

Revert r360902 "Resubmit: [Salvage] Change salvage debug info ..."

This reverts commit rr360902. It caused an assertion failure in
lib/IR/DebugInfoMetadata.cpp: Assertion `(OffsetInBits + SizeInBits <=
FragmentSizeInBits) && "new fragment outside of original fragment"'
failed.

PR41931.

LLVM/llvm 361245llvm/trunk/lib/MC MCContext.cpp, llvm/trunk/test/DebugInfo/X86 main-file-name.s

[DebugInfo] Handle -main-file-name correctly for asm source.
This option provides only the base filename, not a full relative path.

Part of the fix for PR41839.

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

LLVM/llvm 361244lld/trunk/test/wasm reproduce.ll, lld/trunk/wasm Driver.cpp InputFiles.h

[WebAssembly] Add --reproduce.

--reproduce is a convenient option for debugging. If you invoke lld
with `--reproduce=repro.tar`, it creates `repro.tar` with all input
files and the command line options given to the linker, so that it is
very easy to run lld with the exact same inputs.

ELF and Windows lld have this option.

This patch add that option to lld/wasm.

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

LLVM/llvm 361243llvm/trunk/test/CodeGen/X86 oddshuffles.ll

[X86][SSE] Add shuffle tests for 'splat3' patterns.

Test codegen from shuffles for { dst[0] = dst[1] = dst[2] = *src++; dst += 3 } 'splatting' 
memcpy patterns generated by loop-vectorizer.

LLVM/llvm 361242cfe/trunk/lib/CodeGen CodeGenModule.h

[CodeGenModule] BlockByrefHelpers - add missing uninitialized variables to constructor. 
NFCI.

LLVM/llvm 361241llvm/trunk/test/CodeGen/AArch64 shift-amount-mod.ll, llvm/trunk/test/CodeGen/X86 shift-amount-mod.ll

[NFC][X86][AArch64] Add some more tests for shift amount masking

The negation creation should be more eager:
https://bugs.llvm.org/show_bug.cgi?id=41952

LLVM/llvm 361240llvm/trunk/test/tools/llvm-objdump/X86 disassemble-implied-by-disassemble-functions.test, llvm/trunk/tools/llvm-objdump llvm-objdump.cpp

[llvm-objdump] Make --disassemble-functions imply -d

Fixes https://bugs.llvm.org/show_bug.cgi?id=41903

Patch by Mike Pozulp!

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

LLVM/llvm 361239llvm/trunk/lib/Transforms/Scalar MergeICmps.cpp, llvm/trunk/test/Transforms/MergeICmps/X86 pair-int32-int32.ll gep-used-outside.ll

[MergeICmps] Preserve the dominator tree.

Summary: In preparation for D60318 .

Reviewers: gchatelet, efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

LLVM/llvm 361238cfe/trunk/lib/CodeGen CGBuiltin.cpp

[CGBuiltin] dumpRecord - remove unused field offset. NFCI.

LLVM/llvm 361237llvm/trunk/lib/Target/PowerPC/MCTargetDesc PPCMCTargetDesc.cpp, llvm/trunk/test/MC/PowerPC ppc64-localentry-symbols.s ppc64-localentry-symver.s

[PPC64] Update LocalEntry from assigned symbols

On PowerPC64 ELFv2 ABI, functions may have 2 entry points: global and local.
The local entry point location of a function is stored in the st_other field of the 
symbol, as an offset relative to the global entry point.

In order to make symbol assignments (e.g. .equ/.set) work properly with this, 
PPCTargetELFStreamer already copies the local entry bits from the source symbol to the 
destination one, on emitAssignment(). The problem is that this copy is performed only at 
the assignment location, where the source symbol may not yet have processed the 
.localentry directive, that sets the local entry. This may cause the destination symbol to 
end up with wrong local entry information. Other symbol info is not affected by this 
because, in this case, the destination symbol value is actually a symbol reference.

This change keeps track of these assignments, and update all needed st_other fields when 
finish() is called.

Patch by Leandro Lupori!

Reviewed By: MaskRay

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

LLVM/llvm 361236lld/trunk/test/wasm startstop.ll, lld/trunk/wasm Writer.cpp SymbolTable.cpp

[WebAssembly] Add __start_/_stop_ symbols for data sections

Fixes https://bugs.llvm.org/show_bug.cgi?id=41565

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

LLVM/llvm 361235llvm/trunk/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/trunk/test/CodeGen/AArch64 arm64-neon-vector-shuffle-extract.ll

[AArch64] Skip mask checks for masks with an odd number of elements.

Some checks in isShuffleMaskLegal expect an even number of elements,
e.g. isTRN_v_undef_Mask or isUZP_v_undef_Mask, otherwise they access
invalid elements and crash. This patch adds checks to the impacted
functions.

Fixes PR41951

Reviewers: t.p.northover, dmgreen, samparker

Reviewed By: dmgreen

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