LLVM/llvm 361219llvm/trunk/test/CodeGen/PowerPC unaligned-addressing-mode.ll

[PowerPC] test cases for selecting x-form instruction for unaligned offset - NFC 

LLVM/llvm 361218llvm/trunk/lib/Target/PowerPC PPCISelLowering.cpp

[PowerPC] use more meaningful name - NFC

LLVM/llvm 361217zorg/trunk/zorg/buildbot/builders ClangLTOBuilder.py

Removed explicit build of lib/LLVMgold.so targer.

LLVM/llvm 361216lldb/trunk/source/Expression CMakeLists.txt, lldb/trunk/source/Symbol CMakeLists.txt

[CMake] Correct some dependencies

Symbol doesn't depend on CPlusPlusLanguage, but Expressiond does.

LLVM/llvm 361215llvm/trunk/include/llvm/ExecutionEngine/Orc Core.h, llvm/trunk/lib/ExecutionEngine/Orc Core.cpp

[ORC] Assert that JITDylibs have unique names.

Patch by Praveen Velliengiri. Thanks Praveen!

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

LLVM/llvm 361214llvm/trunk/cmake/modules HandleLLVMOptions.cmake

Tweaks for setting CMAKE_LINKER to lld-link

- Just look for "lld-link", not "lld-link.exe".
  llvm/cmake/platforms/WinMsvc.cmake for example sets CMAKE_LINKER to
  lld-link without .exe

- Stop passing -gwarf to the compiler in sanitizer options when lld is
  enabled -- there's no reason to use different debug information keyed
  off the linker. (If this was for MinGW, we should check for that

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

LLVM/llvm 361213lld/trunk/ELF Relocations.cpp, lld/trunk/test/ELF local-undefined-symbol.s

[ELF] Error on relocations to local undefined symbols

For a reference to a local symbol, ld.bfd and gold error if the symbol
is defined in a discarded section but accept it if the symbol is
undefined. This inconsistent behavior seems unnecessary for us (it
probably makes sense for them as they differentiate local/global
symbols, the error would mean more code).

Catch such errors. Symbol index 0 may be used by marker relocations,
e.g. R_*_NONE R_ARM_V4BX. Don't error on them.

The difference from D61563 (which caused msan failure) is we don't call
Sym.computeBinding() on local symbols - VersionId is uninitialized.

LLVM/llvm 361212lld/trunk/COFF Chunks.h Chunks.cpp

Revert r361206 "[COFF] Store alignment in log2 form, NFC"

Makes the linker crash when linking nasm.exe.

LLVM/llvm 361211zorg/trunk/zorg/buildbot/builders/sanitizers buildbot_cmake.sh

Fix cfi-and-supported

LLVM/llvm 361210lldb/trunk/tools/lldb-server SystemInitializerLLGS.cpp

lldb-server: LLGS: support 32-bit on 64-bit hosts

Enable the ARM emulation support on AArch64 which can execute ARM32
code. Similarly, handle MIPS 32 on 64.

LLVM/llvm 361209cfe/trunk/unittests/Tooling RangeSelectorTest.cpp, llvm/trunk/utils/gn/secondary/clang/unittests/Tooling BUILD.gn

Try to fix build with older gccs after r361152

Also merge the cmake change there to the gn build.

LLVM/llvm 361208cfe/trunk/test/FixIt fixit-cxx0x.cpp fixit-c++11.cpp

Give 'fixit-cxx0x.cpp' a more modern name.

LLVM/llvm 361207compiler-rt/trunk/lib/builtins/arm comparesf2.S

[builtins] Deduplicate __eqsf2 and __gtsf2 via macro

The only difference between __eqsf2 and __gtsf2 is whether they return
1 or -1 on NaN. Rather than duplicating all the code, use a macro to
define the function twice and use an argument to decide whether to
negate the return value.

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

LLVM/llvm 361206lld/trunk/COFF Chunks.h Chunks.cpp

[COFF] Store alignment in log2 form, NFC

Valid section or chunk alignments are powers of 2 in the range [1,
8192]. These can be stored more canonically in log2 form to free up some
bits in Chunk. Combined with D61696, SectionChunk gets 8 bytes smaller.

Reviewers: ruiu, aganea

Subscribers: llvm-commits

Tags: #llvm

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

LLVM/llvm 361205cfe/trunk/lib/AST Type.cpp, cfe/trunk/test/SemaObjC nullability_macro.m

[Sema] Fix for build on some iOS programs.

Nullability attributes weren't being stripped for AttributedTypes that
were wrapped in a MacroQualifiedType. This fix adds a check for this
type and a test.

LLVM/llvm 361204polly/trunk/lib/CodeGen BlockGenerators.cpp, polly/trunk/test/Isl/CodeGen region_multiexit_partialwrite___%bb3---%bb19.jscop region_multiexit_partialwrite___%bb3---%bb19.jscop.transformed

[CodeGen] Fix order of PHINode and MA Write generation.

At the end of a region statement, the PHINode must be generated
while the current IRBuilder's block is the region's exit node. For
obvious reasons: The PHINode references the region's exiting block.
A partial write would insert new control flow, i.e. insert new basic
blocks between the exiting blocks and the current block.

We fix this by generating the PHI nodes (region exit values) before
generating any MemoryAccess's stores.

This should fix the AOSP buildbot.

Reported-by: Eli Friedman <efriedma at quicinc.com>

LLVM/llvm 361203llvm/trunk/lib/ExecutionEngine/Orc Layer.cpp

[ORC] fix use-after-move. NFC

scan-build flagged a potential use-after-move in debug builds.  It's not
safe that a moved from value contains anything but garbage.  Manually
DRY up these repeated expressions.

Reviewers: lhames

Reviewed By: lhames

Subscribers: hiraditya, llvm-commits, srhines

Tags: #llvm

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

LLVM/llvm 361202llvm/trunk/lib/Target/AMDGPU SIInstrInfo.cpp, llvm/trunk/test/CodeGen/AMDGPU call-skip.ll

AMDGPU: Force skip branches over calls

Unfortunately the way SIInsertSkips works is backwards, and is
required for correctness. r338235 added handling of some special cases
where skipping is mandatory to avoid side effects if no lanes are
active. It conservatively handled asm correctly, but the same logic
needs to apply to calls.

Usually the call sequence code is larger than the skip threshold,
although the way the count is computed is really broken, so I'm not
sure if anything was likely to really hit this.

LLVM/llvm 361201libcxx/trunk/include string, libcxx/trunk/test/std/strings/basic.string.hash char_type_hash.fail.cpp

Ensure that hash<basic_string> uses char_traits. Fixes PR#41876. Reviewed as 

LLVM/llvm 361200llvm/trunk/docs ORCv2DesignAndImplementation.rst

[docs] Fix an RST typo: "code-blocks" should be "code-block".

LLVM/llvm 361199llvm/trunk/lib/ExecutionEngine/Orc ExecutionUtils.cpp

[ORC] Remove some unreachable code.

Fixes http://llvm.org/PR41662.

LLVM/llvm 361198llvm/trunk/docs ORCv2DesignAndImplementation.rst

[docs] Add more details/examples for LLJIT/LLLazyJIT, tweak lookup discussion.

LLVM/llvm 361197llvm/trunk/lib/Transforms/InstCombine InstCombineAddSub.cpp

[NFC][InstCombine] Add FIXME for one-use check on constant negation transforms.

LLVM/llvm 361196polly/trunk/lib/Analysis DependenceInfo.cpp

[DependenceInfo] Remove dead initialization. NFC.

Fix scan-analyzer issue:
Value stored to 'WARMemAccesses' during its initialization is never read

Patch by Dominik Adamski <adamski.dominik at gmail.com>

Signed-off-by: Dominik Adamski <adamski.dominik at gmail.com>

LLVM/llvm 361195llvm/trunk/include/llvm/Support Memory.h, llvm/trunk/lib/ExecutionEngine SectionMemoryManager.cpp

[Support] Renamed member 'Size' to 'AllocatedSize' in MemoryBlock and OwningMemoryBlock.

Rename member 'Size' to 'AllocatedSize' in order to provide a hint that the
allocated size may be different than the requested size. Comments are added to
clarify this point.  Updated the InMemoryBuffer in FileOutputBuffer.cpp to track
the requested buffer size.

Patch by Machiel van Hooren. Thanks Machiel!


LLVM/llvm 361194compiler-rt/trunk/lib/profile InstrProfiling.h InstrProfiling.c

This change adds an API to allow setting the flag to indicate that the profile data has 
been dumped to the file.

The main use is for users to disable dumping profile data to the file
for certain processes in case the processes don't have permission to
write to the disks, and trying to do so would result in side effects
such as crashes.

Patch by Yuke Liao (@liaoyuke).

Additional context (Chromium use case):
- https://bugs.chromium.org/p/chromium/issues/detail?id=842424
- https://bugs.chromium.org/p/chromium/issues/detail?id=957655
- https://chromium-review.googlesource.com/c/chromium/src/+/1610093

Reviewers: Dor1s, vsk, davidxl

Reviewed By: Dor1s, davidxl

Subscribers: delcypher, davidxl, sajjadm, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

LLVM/llvm 361193cfe/trunk/lib/AST JSONNodeDumper.cpp, cfe/trunk/test/AST ast-dump-expr-json.c

Add more tests for AST JSON output; NFC.

This adds tests for dumping expressions in C. It also updates a comment to note an issue 
to be fixed with printing character literals discovered as part of this testing.

LLVM/llvm 361192llvm/trunk/lib/Target/AArch64 AArch64InstrInfo.td, llvm/trunk/test/CodeGen/AArch64 lround-conv-win.ll

[AArch64] Handle lowering lround on windows, where long is 32 bit

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

LLVM/llvm 361191llvm/trunk/utils/gn/secondary/clang/lib/Tooling Syntax, llvm/trunk/utils/gn/secondary/clang/lib/Tooling/Syntax BUILD.gn

gn build: Merge r361148

LLVM/llvm 361190lld/trunk/ELF Driver.cpp, lld/trunk/test/ELF symbol-ordering-file-cgprofile-conflicts.s

[ELF][Driver] Fix precedence of symbol ordering file and CGProfile

This patch is a fix for https://bugs.llvm.org/show_bug.cgi?id=41804.
We try to solve the precedence of user-specified symbol ordering file and C3 ordering 
provided as call graph. It deals with two case:
(1) When both --symbol-ordering-file=<file> and --call-graph-order-file=<file> are 
present, whichever flag comes later will take precedence.
(2) When only --symbol-ordering-file=<file> is present, it takes precedence over implicit 
call graph (CGProfile) generated by CGProfilePass enabled in new pass manager.

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

[LFTR] Add additional PR31181 test cases

One case where overflow happens in the first loop iteration, and
two cases where we switch to a dynamically dead IV with post/pre
increment, respectively.

LLVM/llvm 361188llvm/trunk/include/llvm/IR InstrTypes.h, llvm/trunk/lib/Transforms/InstCombine InstCombineAddSub.cpp

[InstCombine] Add visitFNeg(...) visitor for unary Fneg

Also, break out a helper function, namely foldFNegIntoConstant(...), which performs 
transforms common between visitFNeg(...) and visitFSub(...).

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

LLVM/llvm 361187cfe/trunk/test/CodeGen avx512f-builtins.c

[X86] Check the alignment argument for the masked.load/store for the _mm_mask_store_ss/sd 
and _mm_mask(z)_load_ss/sd intrinsics.

LLVM/llvm 361186lld/trunk/ELF Driver.cpp

Test commit, add an empty line.

LLVM/llvm 361185compiler-rt/trunk/test/fuzzer fork-sigusr.test

[libFuzzer] Disable fork-sigusr.test on AArch64.

Test fails on the clang-cmake-aarch64-lld build and I'm not sure why.

LLVM/llvm 361184cfe/trunk/cmake/caches DistributionExample.cmake DistributionExample-stage2.cmake

[CMake] Update DistributionExample for mono repo

This just updates the DistributionExamples from my 2016 Dev Meeting talk to work more 
seamlessly with the monorepo.

LLVM/llvm 361183llvm/trunk/utils/TableGen CodeGenDAGPatterns.cpp

[TableGen] - Type comparison LE should be LT or equal.

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

LLVM/llvm 361182cfe/trunk/include/clang/Parse Parser.h, cfe/trunk/lib/Parse ParseExprCXX.cpp ParseTentative.cpp

Rearrange and clean up how we disambiguate lambda-introducers from ObjC
message sends, designators, and attributes.

Instead of having the tentative parsing phase sometimes return an
indicator to say what diagnostic to produce if parsing fails and
sometimes ask the caller to run it again, consistently ask the caller to
try parsing again if tentative parsing would fail or is otherwise unable
to completely parse the lambda-introducer without producing an
irreversible semantic effect.

Mostly NFC, but we should recover marginally better in some error cases
(avoiding duplicate diagnostics).

LLVM/llvm 361181llvm/trunk/test/Transforms/InstCombine/AMDGPU amdgcn-intrinsics.ll

[InstCombine] auto-generate test checks; NFC

LLVM/llvm 361180llvm/trunk/lib/Analysis InstructionSimplify.cpp

[InstSimplify] update stale comment; NFC

Missed this diff with rL361118.

LLVM/llvm 361179llvm/trunk/test/CodeGen/X86 callbr-asm-bb-exports.ll

[X86] Add test case for r361177.

That commit makes sure we flush PendingExports in SelectDAGBuilder
before we create INLINEASM_BR. Unfortunatley, I haven't yet found
a CodeGen failure without that change.

This commit uses the debug output from SelectionDAG to at least
ensure we build the DAG correctly.

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

[clangd] Make it possible to use VFS from parsing for getting tidy options

To give an option for clangd embedders with snapshotted filesystem to
read config files from exact snapshots, possibly loosing some
performance from caching capabilities of the current implementations.

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

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

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

[SelectionDAGBuilder] Flush PendingExports before creating INLINEASM_BR node for asm goto.

Since INLINEASM_BR is a terminator we need to flush the pending exports before
emitting it. If we don't do this, a TokenFactor can be inserted between it and
the BR instruction emitted to finish the callbr lowering.

It looks like nodes are glued to the INLINEASM_BR so I had to make sure we emit
the TokenFactor before that.

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

LLVM/llvm 361176llvm/trunk/lib/DebugInfo/DWARF DWARFFormValue.cpp

[DWARF] hoist nullptr checks. NFC

This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
15" (see under #13). It looks like PVS studio flags nullptr checks where
the ptr is used inbetween creation and checking against nullptr.

Reviewers: JDevlieghere, probinson

Reviewed By: JDevlieghere

Subscribers: RKSimon, hiraditya, llvm-commits, srhines

Tags: #llvm

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

LLVM/llvm 361175compiler-rt/trunk/lib/builtins cpu_model.c

[X86] Add icelake-client and tremont model numbers to compiler-rt's implementation of 

LLVM/llvm 361174llvm/trunk/lib/Support Host.cpp

[X86] Add icelake-client and tremont model numbers to getHostCPUName.

LLVM/llvm 361173llvm/trunk/include/llvm/Analysis LazyCallGraph.h, llvm/trunk/lib/Analysis InlineCost.cpp

[INLINER] allow inlining of blockaddresses if sole uses are callbrs

It was supposed that Ref LazyCallGraph::Edge's were being inserted by
inlining, but that doesn't seem to be the case.  Instead, it seems that
there was no test for a blockaddress Constant in an instruction that
referenced the function that contained the instruction. Ex:

define void @f() {
  %1 = alloca i8*, align 8
  store i8* blockaddress(@f, %2), i8** %1, align 8
  ret void

When iterating blockaddresses, do not add the function they refer to
back to the worklist if the blockaddress is referring to the contained
function (as opposed to an external function).

Because blockaddress has sligtly different semantics than GNU C's
address of labels, there are 3 cases that can occur with blockaddress,
where only 1 can happen in GNU C due to C's scoping rules:
* blockaddress is within the function it refers to (possible in GNU C).

    [37 lines not shown]

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

Dump macro expansion information as needed when outputting the AST to JSON.

LLVM/llvm 361171llvm/trunk/lib/Target/AMDGPU AMDGPURegisterBankInfo.cpp

[AMDGPU] Fix std::array initializers to avoid warnings with older tool chains. NFC

A std::array is implemented as a template with an array
inside a struct. Older versions of clang, like 3.6,
require an extra set of curly braces around std::array
initializations to avoid warnings.

The C++ language was changed regarding this by CWG 1270.
So more modern tool chains does not complaing even if
leaving out one level of braces.

LLVM/llvm 361170cfe/trunk/unittests/Tooling RangeSelectorTest.cpp

Renamed `apply` to `select` to avoid ADL conflict with `std::apply`

`std::apply` in C++14 and above is defined with two unrestricted arguments, and
it wins overload resolution in this case.

Reviewers: ilya-biryukov

Subscribers: cfe-commits, ymandel

Tags: #clang

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