LLVM/llvm 358845llvm/trunk/lib/Target/ARM ARMISelLowering.cpp, llvm/trunk/test/Analysis/CostModel/ARM gep.ll

[ARM] Rewrite isLegalT2AddressImmediate

This does two main things, firstly adding some at least basic addressing modes
for i64 types, and secondly treats floats and doubles sensibly when there is no
fpu. The floating point change can help codesize in some cases, especially with

Most backends seems to not consider the exact VT in isLegalAddressingMode,
instead switching on type size. That is now what this does when the target does
not have an fpu (as the float data will be loaded using LDR's). i64's currently
use the address range of an LDRD (even though they may be legalised and loaded
with an LDR). This is at least better than marking them all as illegal
addressing modes.

I have not attempted to do much with vectors yet. That will need changing once
MVE is added.

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

LLVM/llvm 358844llvm/trunk/lib/Target/X86 X86InstrAVX512.td, llvm/trunk/test/CodeGen/X86 avx512-fma-intrinsics.ll avx512-intrinsics-fast-isel.ll

[X86] Add the rounding control operand to the printing for some scalar FMA instructions.

LLVM/llvm 358843llvm/trunk/lib/Support CachePruning.cpp

[CachePruning] Simplify comparator

LLVM/llvm 358842llvm/trunk/unittests/ExecutionEngine/JITLink CMakeLists.txt

[JITLink] Add dependency on MCParser to unit test after rL358818

This is required by -DBUILD_SHARED_LIBS=on builds for createMCAsmParser.

LLVM/llvm 358841llvm/trunk/lib/Target/X86 X86InstrAVX512.td

[X86] Don't form masked vfpclass instruction from and+vfpclass unless the fpclass only has 
a single use.

LLVM/llvm 358840llvm/trunk/lib/ExecutionEngine/JITLink JITLink_EHFrameSupport.cpp JITLink_EHFrameSupportImpl.h

[JITLink] Remove an overly strict error check in JITLink's eh-frame parser.

The error check required FDEs to refer to the most recent CIE, but the eh-frame
spec allows them to refer to any previously seen CIE. This patch removes the
offending check.

LLVM/llvm 358839llvm/trunk/include/llvm/BinaryFormat MachO.h

[BinaryFormat] Fix bitfield-ordering of MachO::relocation_info on big-endian.

Hopefully this will fix the JITLink regression test failures on big-endian
testers (e.g.

LLVM/llvm 358838llvm/trunk/lib/ExecutionEngine/JITLink JITLink_MachO_x86_64.cpp BasicGOTAndStubsBuilder.h

[JITLink] Factor basic common GOT and stub creation code into its own class.

LLVM/llvm 358837llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd BUILD.gn, llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool BUILD.gn

[gn] Move Features.inc to clangd, create a config for it

ClangdLSPServer and clangd unittests now include Features.inc so we
need to append the target_gen_dir that contains it to their
include_dirs. To do so, we use a public config that's applied to
any target that depends on the features one.

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

LLVM/llvm 358836llvm/trunk/unittests/ExecutionEngine/JITLink CMakeLists.txt

[JITLink] Add dependencies on MCDissassembler and Target to unit test.

LLVM/llvm 358835llvm/trunk/lib/Demangle MicrosoftDemangle.cpp, llvm/trunk/test/Demangle ms-string-literals.test

llvm-undname: Improve string literal demangling with embedded \0 chars

- Don't assert when a string looks like a u32 string to the heuristic
  but doesn't have a length that's 0 mod 4.  Instead, classify those
  as u16 with embedded \0 chars. Found by oss-fuzz.
- Print embedded nul bytes as \0 instead of \x00.

LLVM/llvm 358834llvm/trunk/lib/IR LegacyPassManager.cpp

ftime-trace: Trace the name of the currently active pass as well.

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

LLVM/llvm 358833llvm/trunk/lib/ExecutionEngine/JITLink JITLink_MachO_x86_64.cpp

[JITLink] Add yet more detail to MachO/x86-64 unsupported relocation errors.

Knowing the address/symbolnum field values makes it easier to identify the
unsupported relocation, and provides enough information for the full bit
pattern of the relocation to be reconstructed.

LLVM/llvm 358832llvm/trunk/lib/ExecutionEngine/Orc LLVMBuild.txt

[JITLink][ORC] Add JITLink to the list of dependencies for ORC.

The new ObjectLinkingLayer in ORC depends on JITLink.

This should fix the build error at

LLVM/llvm 358831llvm/trunk/lib/ExecutionEngine/JITLink JITLink_MachO_x86_64.cpp

[JITLink] Fix a bad formatv format string.

LLVM/llvm 358830llvm/trunk/test/ExecutionEngine/JITLink MachO_x86-64_relocations.s X86, llvm/trunk/test/ExecutionEngine/JITLink/X86 MachO_x86-64_relocations.s lit.local.cfg

[JITLink] Disable MachO/x86-64 regression test if the X86 target is not built.

LLVM/llvm 358829llvm/trunk/include/llvm/CodeGen/GlobalISel LegalizerInfo.h, llvm/trunk/lib/CodeGen/GlobalISel LegalizerHelper.cpp

Revert r358800. Breaks Obsequi from the test suite.

The last attempt fixed gcc and consumer-typeset, but Obsequi seems to fail with
a different issue.

LLVM/llvm 358828llvm/trunk/test lit.cfg.py

[JITLink] Add llvm-jitlink to the list of available tools in lit.

Should fix the 'llvm-jitlink command not found' errors that are appearing on
some builders.

LLVM/llvm 358827llvm/trunk/lib/ExecutionEngine/JITLink LLVMBuild.txt, llvm/trunk/tools/llvm-jitlink LLVMBuild.txt CMakeLists.txt

[JITLink] Add BinaryFormat to JITLink's dependencies.

Hopefully this will fix the missing dependence on llvm::identify_magic that is
showing up on some PPC bots. E.g.


LLVM/llvm 358826llvm/trunk/lib/ExecutionEngine/JITLink JITLink_MachO_x86_64.cpp

[JITLink] Add more detail to MachO/x86-64 "unsupported relocation" errors.

The extra information here will be helpful in diagnosing errors, like the
ones currently occuring on the PPC big-endian bots. :)

LLVM/llvm 358825llvm/trunk/unittests/ExecutionEngine/JITLink JITLinkTestCommon.cpp JITLinkTestCommon.h

[JITLink] Add check to JITLink unit test to bail out for unsupported targets.

This should prevent spurious JITLink unit test failures for builds that do not
support the target(s) required by the tests.

LLVM/llvm 358824llvm/trunk/lib/ExecutionEngine/JITLink JITLink_MachO_x86_64.cpp

[JITLink] Silence some MSVC implicit cast warnings.

LLVM/llvm 358823llvm/trunk/tools LLVMBuild.txt

[JITLink] Add llvm-jitlink subdirectory to tools/LLVMBuild.txt

LLVM/llvm 358822llvm/trunk/lib/ExecutionEngine/JITLink JITLink.cpp

[JITLink] Use memset instead of bzero.

LLVM/llvm 358821llvm/trunk/include/llvm/ExecutionEngine/JITLink JITLink.h

[JITLink] Silence a narrowing conversion warning.

LLVM/llvm 358820llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter1 KaleidoscopeJIT.h, llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter2 KaleidoscopeJIT.h

[JITLink] Update BuildingAJIT tutorials to account for API changes in r358818.

DynamicLibrarySearchGenerator::GetForCurrentProcess now takes a char (the global
prefix) rather than a DataLayout reference.

LLVM/llvm 358819llvm/trunk/lib/ExecutionEngine/JITLink JITLink_EHFrameSupport.cpp

[JITLink] Fix a missing header and bad prototype.

LLVM/llvm 358818llvm/trunk/include/llvm/ExecutionEngine/JITLink JITLink.h, llvm/trunk/lib/ExecutionEngine/JITLink JITLink_MachO_x86_64.cpp JITLink_EHFrameSupport.cpp

Initial implementation of JITLink - A replacement for RuntimeDyld.


JITLink is a jit-linker that performs the same high-level task as RuntimeDyld:
it parses relocatable object files and makes their contents runnable in a target

JITLink aims to improve on RuntimeDyld in several ways:

(1) A clear design intended to maximize code-sharing while minimizing coupling.

RuntimeDyld has been developed in an ad-hoc fashion for a number of years and
this had led to intermingling of code for multiple architectures (e.g. in
RuntimeDyldELF::processRelocationRef) in a way that makes the code more
difficult to read, reason about, extend. JITLink is designed to isolate
format and architecture specific code, while still sharing generic code.

(2) Support for native code models.

RuntimeDyld required the use of large code models (where calls to external
functions are made indirectly via registers) for many of platforms due to its
restrictive model for stub generation (one "stub" per symbol). JITLink allows
arbitrary mutation of the atom graph, allowing both GOT and PLT atoms to be
added naturally.

    [52 lines not shown]

LLVM/llvm 358817llvm/trunk/lib/Target/X86 X86ISelLowering.cpp, llvm/trunk/test/CodeGen/X86 arg-copy-elide-win64.ll

[X86] Disable argument copy elision for arguments passed via pointers

If you pass two 1024 bit vectors in IR with AVX2 on Windows 64. Both vectors will be split 
in four 256 bit pieces. The four pieces of the first argument will be passed indirectly 
using 4 gprs. The second argument will get passed via pointers in memory.

The PartOffsets stored for the second argument are all in terms of its original 1024 bit 
size. So the PartOffsets for each piece are 32 bytes apart. So if we consider it for copy 
elision we'll only load an 8 byte pointer, but we'll move the address 32 bytes. The stack 
object size we create for the first part is probably wrong too.

This issue was encountered by ISPC. I'm working on getting a reduce test case, but wanted 
to go ahead and get feedback on the fix.

Reviewers: rnk

Reviewed By: rnk

Subscribers: dbabokin, llvm-commits, hiraditya

Tags: #llvm

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

LLVM/llvm 358816llvm/trunk/lib/Transforms/Scalar CorrelatedValuePropagation.cpp, llvm/trunk/test/Transforms/CorrelatedValuePropagation sub.ll add.ll

[CorrelatedValuePropagation] Mark subs that we know not to wrap with nuw/nsw.

Teach CorrelatedValuePropagation to also handle sub instructions in addition to add. 
Relatively simple since makeGuaranteedNoWrapRegion already understood sub instructions. 
Only subtle change is which range is passed as "Other" to that function, since sub isn't 

Note that CorrelatedValuePropagation::processAddSub is still hidden behind a default-off 
flag as IndVarSimplify hasn't yet been fixed to strip the added nsw/nuw flags and causes a 
miscompile. (PR31181)

Reviewers: sanjoy, apilipenko, nikic

Reviewed By: nikic

Subscribers: hiraditya, jfb, jdoerfert, llvm-commits

Tags: #llvm

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

LLVM/llvm 358815llvm/trunk/lib/CodeGen ExecutionDomainFix.cpp

[ExecutionDomainFix] Optimize a binary search insertion

LLVM/llvm 358814llvm/trunk/lib/DebugInfo/Symbolize SymbolizableObjectFile.cpp

[llvm-symbolizer] Fix section index at the end of a section

This is very minor issue. The returned section index is only used by
DWARFDebugLine as an llvm::upper_bound input and the use case shouldn't
cause any behavioral change.

LLVM/llvm 358813llvm/trunk/test/Transforms/IndVarSimplify lftr-reuse.ll lftr-promote.ll

[IndVarSimplify] Generate full checks for some LFTR tests; NFC

LLVM/llvm 358812llvm/trunk/test/Transforms/IndVarSimplify pr31181.ll

[IndVarSimplify] Add tests for PR31181; NFC

LLVM/llvm 358811llvm/trunk/unittests/ADT STLExtrasTest.cpp

[ADT] Avoid warning in bsearch testcase

LLVM/llvm 358810lld/trunk/test/ELF/linkerscript addr-zero.test

[LLD][ELF] - Fix mistype. NFC.

Change the tripple name from
aarch64-linux-gnux to -triple=aarch64-linux-gnu

LLVM/llvm 358809llvm/trunk/tools/llvm-objdump llvm-objdump.cpp

[llvm-objdump] Fix End in disassemblyObject after rL358806

LLVM/llvm 358808llvm/trunk/test/Transforms/CorrelatedValuePropagation sub.ll

[CVP] Add tests for sub nowrap inference; NFC

These are baseline tests for D60036.

Patch by Luqman Aden.

LLVM/llvm 358807llvm/trunk/lib/Target/X86 X86WinAllocaExpander.cpp X86FrameLowering.cpp, llvm/trunk/test/CodeGen/X86 probe-stack-x32.ll

[X86] Fix stack probing on x32 (PR41477)

Fix for https://bugs.llvm.org/show_bug.cgi?id=41477. On the x32 ABI
with stack probing a dynamic alloca will result in a WIN_ALLOCA_32
with a 32-bit size. The current implementation tries to copy it into
RAX, resulting in a physreg copy error. Fix this by copying to EAX
instead. Also fix incorrect opcodes or registers used in subs.

LLVM/llvm 358806llvm/trunk/tools/llvm-objdump llvm-objdump.cpp

[llvm-objdump] Don't disassemble symbols before SectionAddr

This was caught by UBSAN


LLVM/llvm 358805llvm/trunk/lib/Target/X86 X86ISelDAGToDAG.cpp, llvm/trunk/test/CodeGen/X86 narrow-shl-cst.ll

[X86] Don't turn (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) if the original 
AND can represented by MOVZX.

The MOVZX doesn't require an immediate to be encoded at all. Though it does use
a 2 byte opcode so its the same size as a 1 byte immediate. But it has a
separate source and dest register so can help avoid copies.

LLVM/llvm 358804llvm/trunk/lib/Target/X86 X86ISelDAGToDAG.cpp, llvm/trunk/test/CodeGen/X86 narrow-shl-cst.ll

[X86] Turn (and (anyextend (shl X, C1), C2)) into (shl (and (anyextend X), (C1 >> C2), C2) 
if the AND could match a movzx.

There's one slight regression in here because we don't check that the immediate
already allowed movzx before the shift. I'll fix that next.

LLVM/llvm 358803llvm/trunk/tools/llvm-objdump llvm-objdump.cpp

[llvm-objdump] Simplify --{start,stop}-address

LLVM/llvm 358802compiler-rt/trunk/lib/tsan/rtl tsan_platform_mac.cc tsan_interceptors_mac.cc, compiler-rt/trunk/test/lsan/TestCases swapcontext.cc

[TSan] Support fiber API on macOS

Committing on behalf of Yuri Per (yuri).

Reviewers: dvyukov, kubamracek, yln

Reviewed By: kubamracek

Authored By: yuri

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

LLVM/llvm 358801llvm/trunk/lib/Object WasmObjectFile.cpp, llvm/trunk/test/Object wasm-invalid-file.yaml

[WebAssembly] Object: Improve error messages on invalid section

Also add a test.

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

LLVM/llvm 358800llvm/trunk/include/llvm/CodeGen/GlobalISel LegalizerInfo.h, llvm/trunk/lib/CodeGen/GlobalISel LegalizerHelper.cpp

Revert "Revert "[GlobalISel] Add legalization support for non-power-2 loads and stores""

We were shifting the wrong component of a split load when trying to combine them
back into a single value.

LLVM/llvm 358799llvm/trunk/lib/Target/AArch64 AArch64LegalizerInfo.cpp, llvm/trunk/test/CodeGen/AArch64 arm64-vfloatintrinsics.ll

[GlobalISel][AArch64] Legalize + select G_FRINT

Exactly the same as G_FCEIL, G_FABS, etc.

Add tests for the fp16/nofp16 behaviour, update arm64-vfloatintrinsics, etc.

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

LLVM/llvm 358798lld/trunk/test/wasm data-segment-merging.ll, lld/trunk/wasm Writer.cpp OutputSections.cpp

[WebAssembly] Emit the DataCount section when bulk memory is enabled

The DataCount section is necessary for the bulk memory operations
memory.init and data.drop to validate, but it is not recognized by
engines that do not support bulk memory, so emit the section only if
bulk-memory is enabled.

Reviewers: aheejin, dschuff, sbc100

Subscribers: jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

LLVM/llvm 358797cfe/trunk/docs/analyzer checkers.rst, cfe/trunk/include/clang/StaticAnalyzer/Checkers Checkers.td

[analyzer] Move UninitializedObjectChecker out of alpha

Moved UninitializedObjectChecker from the 'alpha.cplusplus' to the
'optin.cplusplus' package.

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

LLVM/llvm 358796cfe/trunk/lib/AST DeclTemplate.cpp, cfe/trunk/test/Modules nested-template-default-arg-redecl.cpp

Modules: Adopt template parameters for variable templates to set their decl context 

Exposed by a related bug about visibility of default arguments of nested
templates - without the correct decl context, default template
parameters of variable templates nested in classes would have incorrect
visibility computed.