David Blaikie [Fri, 5 Oct 2018 20:55:20 +0000 (20:55 +0000)]
dwarfdump: Avoid parsing units unnecessarily
NFC-ish (the parsing of the units is not a functional change - no
errors/warnings are emitted during the shallow parsing - though without
parsing them here, the "max version" would be wrong (still zero) later
on, so in those cases the units do need to be parsed)
llvm-svn: 343884
Vedant Kumar [Fri, 5 Oct 2018 20:37:17 +0000 (20:37 +0000)]
[DebugInfo] Add support for DWARF5 call site-related attributes
DWARF v5 introduces DW_AT_call_all_calls, a subprogram attribute which
indicates that all calls (both regular and tail) within the subprogram
have call site entries. The information within these call site entries
can be used by a debugger to populate backtraces with synthetic tail
call frames.
Tail calling frames go missing in backtraces because the frame of the
caller is reused by the callee. Call site entries allow a debugger to
reconstruct a sequence of (tail) calls which led from one function to
another. This improves backtrace quality. There are limitations: tail
recursion isn't handled, variables within synthetic frames may not
survive to be inspected, etc. This approach is not novel, see:
https://gcc.gnu.org/wiki/summit2010?action=AttachFile&do=get&target=jelinek.pdf
This patch adds an IR-level flag (DIFlagAllCallsDescribed) which lowers
to DW_AT_call_all_calls. It adds the minimal amount of DWARF generation
support needed to emit standards-compliant call site entries. For easier
deployment, when the debugger tuning is LLDB, the DWARF requirement is
adjusted to v4.
Testing: Apart from check-{llvm, clang}, I built a stage2 RelWithDebInfo
clang binary. Its dSYM passed verification and grew by 1.4% compared to
the baseline. 151,879 call site entries were added.
rdar://
42001377
Differential Revision: https://reviews.llvm.org/D49887
llvm-svn: 343883
Sanjay Patel [Fri, 5 Oct 2018 20:26:54 +0000 (20:26 +0000)]
[x86] make blend tests resistant to demanded elements improvements; NFC
Similar to rL343858 - we don't want these tests to lose value with D52912.
llvm-svn: 343882
Mandeep Singh Grang [Fri, 5 Oct 2018 19:49:36 +0000 (19:49 +0000)]
[COFF, ARM64] Add _InterlockedCompareExchangePointer_nf intrinsic
Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, efriedma
Reviewed By: efriedma
Subscribers: efriedma, kristof.beyls, chrib, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D52807
llvm-svn: 343881
Reid Kleckner [Fri, 5 Oct 2018 19:46:51 +0000 (19:46 +0000)]
Fix dwarf-no-source-loc.ll path separator on Windows
llvm-svn: 343880
Martin Storsjo [Fri, 5 Oct 2018 19:43:24 +0000 (19:43 +0000)]
[COFF] Do MinGW specific entry/subsystem inference
ld.bfd doesn't do any inference of subsystem; unless the windows
subsystem is specified, the console subsystem is used.
For the console subsystem, the entry point is called mainCRTStartup,
regardless of whether the the user code entry point is main or wmain.
The same goes for the windows subsystem, where the entry point always
is WinMainCRTStartup, for both WinMain and wWinMain in user code.
One detail that we don't emulate, is that if the inferred entry point
is undefined, ld.bfd silently just sets the entry point to the start
of the image. And if an explicit entry point is set, but it is
undefined, the link still succeeds but the linker warns about the
entry point not being found.
Differential Revision: https://reviews.llvm.org/D52931
llvm-svn: 343879
Martin Storsjo [Fri, 5 Oct 2018 19:43:20 +0000 (19:43 +0000)]
[docs] Mention some notable feature in the release notes
Differential Revision: https://reviews.llvm.org/D52908
llvm-svn: 343878
Martin Storsjo [Fri, 5 Oct 2018 19:43:16 +0000 (19:43 +0000)]
[COFF] Cope with GCC produced weak aliases referring to comdat functions
For certain cases of inline functions written to comdat sections,
GCC 5.x produces a weak symbol in addition, which would end up
undefined in some cases.
This no longer seems to happen with GCC 6.x or newer though.
Differential Revision: https://reviews.llvm.org/D52602
llvm-svn: 343877
Reid Kleckner [Fri, 5 Oct 2018 18:48:53 +0000 (18:48 +0000)]
Revert r343606/r342652 "[winasan] Unpoison the stack in NtTerminateThread""
This still seems to be causing pnacl + asan to crash.
llvm-svn: 343876
Artem Belevich [Fri, 5 Oct 2018 18:39:58 +0000 (18:39 +0000)]
[CUDA] Use all 64 bits of GUID in __nv_module_id
getGUID() returns an uint64_t and "%x" only prints 32 bits of it.
Use PRIx64 format string to print all 64 bits.
Differential Revision: https://reviews.llvm.org/D52938
llvm-svn: 343875
Matthias Braun [Fri, 5 Oct 2018 18:29:24 +0000 (18:29 +0000)]
DwarfDebug: Pick next location in case of missing location at block begin
Context: Compiler generated instructions do not have a debug location
assigned to them. However emitting 0-line records for all of them bloats
the line tables for very little benefit so we usually avoid doing that.
Not emitting anything will lead to the previous debug location getting
applied to the locationless instructions. This is not desirable for
block begin and after labels. Previously we would emit simply emit
line-0 records in this case, this patch changes the behavior to do a
forward search for a debug location in these cases before emitting a
line-0 record to further reduce line table bloat.
Inspired by the discussion in https://reviews.llvm.org/D52862
llvm-svn: 343874
Alex Bradbury [Fri, 5 Oct 2018 18:25:55 +0000 (18:25 +0000)]
[RISCV] Regenerate several tests now enableMultipleCopyHints is enabled by default
r343851 caused codegen changes in several tests. This patch regenerates them.
llvm-svn: 343873
Nico Weber [Fri, 5 Oct 2018 18:22:21 +0000 (18:22 +0000)]
clang-format: Don't insert spaces in front of :: for Java 8 Method References.
The existing code kept the space if it was there for identifiers, and it didn't
handle `this`. After this patch, for Java `this` is handled in addition to
identifiers, and existing space is always stripped between identifier and `::`.
Also accept `::` in addition to `.` in front of `<` in `foo::<T>bar` generic
calls.
Differential Revision: https://reviews.llvm.org/D52842
llvm-svn: 343872
Craig Topper [Fri, 5 Oct 2018 18:13:36 +0000 (18:13 +0000)]
[X86] Don't promote i16 compares to i32 if the immediate will fit in 8 bits.
The comments in this code say we were trying to avoid 16-bit immediates, but if the immediate fits in 8-bits this isn't an issue. This avoids creating a zero extend that probably won't go away.
The movmskb related changes are interesting. The movmskb instruction writes a 32-bit result, but fills the upper bits with 0. So the zero_extend we were previously emitting was free, but we turned a -1 immediate that would fit in 8-bits into a 32-bit immediate so it was still bad.
llvm-svn: 343871
Kamil Rytarowski [Fri, 5 Oct 2018 18:07:34 +0000 (18:07 +0000)]
Unwind local macro DEFINE_INTERNAL()
No functional change intended.
This is a follow up of a suggestion from D52793.
llvm-svn: 343870
Jonathan Peyton [Fri, 5 Oct 2018 17:59:39 +0000 (17:59 +0000)]
[OpenMP] Convert KMP_DYNAMIC_LIB to a 0 or 1 guard everywhere
llvm-svn: 343869
Simon Pilgrim [Fri, 5 Oct 2018 17:57:29 +0000 (17:57 +0000)]
[X86] Move ReadAfterLd functionality into X86FoldableSchedWrite (PR36957)
Currently we hardcode instructions with ReadAfterLd if the register operands don't need to be available until the folded load has completed. This doesn't take into account the different load latencies of different memory operands (PR36957).
This patch adds a ReadAfterFold def into X86FoldableSchedWrite to replace ReadAfterLd, allowing us to specify the load latency at a scheduler class level.
I've added ReadAfterVec*Ld classes that match the XMM/Scl, XMM and YMM/ZMM WriteVecLoad classes that we currently use, we can tweak these values in future patches once this infrastructure is in place.
Differential Revision: https://reviews.llvm.org/D52886
llvm-svn: 343868
James Y Knight [Fri, 5 Oct 2018 17:49:48 +0000 (17:49 +0000)]
Emit diagnostic note when calling an invalid function declaration.
The comment said it was intentionally not emitting any diagnostic
because the declaration itself was already diagnosed. However,
everywhere else that wants to not emit a diagnostic without an extra
note emits note_invalid_subexpr_in_const_expr instead, which gets
suppressed later.
This was the only place which did not emit a diagnostic note.
Differential Revision: https://reviews.llvm.org/D52919
llvm-svn: 343867
Jonathan Peyton [Fri, 5 Oct 2018 17:47:58 +0000 (17:47 +0000)]
[OpenMP] Fix KMP_DYNAMIC_LIB to be dependent on LIBOMP_ENABLE_SHARED
The KMP_DYNAMIC_LIB guard was hard set to 1. This patch has the guard depend
on CMake variable LIBOMP_ENABLE_SHARED.
llvm-svn: 343866
Sanjay Patel [Fri, 5 Oct 2018 17:42:19 +0000 (17:42 +0000)]
[SelectionDAG] allow undefs when matching splat constants
And use that to transform fsub with zero constant operands.
The integer part isn't used yet, but it is proposed for use in
D44548, so adding both enhancements here makes that
patch simpler.
llvm-svn: 343865
Adrian Prantl [Fri, 5 Oct 2018 17:41:30 +0000 (17:41 +0000)]
Format the dwarfdump --statistics version as an integer instead of a string.
llvm-svn: 343864
Sanjay Patel [Fri, 5 Oct 2018 17:36:51 +0000 (17:36 +0000)]
[x86] add test for (X - 0.0) vector with undef elts; NFC
llvm-svn: 343863
Krasimir Georgiev [Fri, 5 Oct 2018 17:19:26 +0000 (17:19 +0000)]
[clang-format] Java import sorting in clang-format
Contributed by SamMaier!
llvm-svn: 343862
Stefan Granitz [Fri, 5 Oct 2018 16:49:53 +0000 (16:49 +0000)]
TestMultilineExpr: validate evaluation for expressions that span multiple lines
Summary:
When LLDB successfully parses a command (like "expression" in this case) and determines incomplete input, the user can continue typing on multiple lines (in this case "2+3"). This should provide the correct result.
Note that LLDB reverts input from the additional lines, so they are not present in the output.
Reviewers: vsk, davide, aprantl
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D52270
llvm-svn: 343860
Stefan Granitz [Fri, 5 Oct 2018 16:49:47 +0000 (16:49 +0000)]
Add EchoCommentCommands to CommandInterpreterRunOptions in addition to the existing EchoCommands and expose both as interpreter settings.
Summary:
Add settings to control command echoing:
```
(lldb) settings set interpreter.echo-commands true
(lldb) settings set interpreter.echo-comment-commands true
```
Both settings default to true, which keeps LLDB's existing behavior in non-interactive mode (echo all command inputs to the output).
So far the only way to change this behavior was the `--source-quietly` flag, which disables all output including evaluation results.
Now `echo-commands` allows to turn off echoing for commands, while evaluation results are still printed. No effect if `--source-quietly` was present.
`echo-comment-commands` allows to turn off echoing for commands in case they are pure comment lines. No effect if `echo-commands` is false.
Note that the behavior does not change immediately! The new settings take effect only with the next command source.
LLDB lit test are the main motivation for this feature. So far incoming `#CHECK` line have always been echoed to the output and so they could never fail. Now we can disable it in lit-lldb-init.
Todos: Finish test for this feature. Add to lit-lldb-init. Check for failing lit tests.
Reviewers: aprantl, jasonmolenda, JDevlieghere
Subscribers: friss, lldb-commits
Differential Revision: https://reviews.llvm.org/D52788
llvm-svn: 343859
Simon Pilgrim [Fri, 5 Oct 2018 15:50:18 +0000 (15:50 +0000)]
[X86][SSE] Try to make MOVLPS/MOVHPS(+PD) instructions SimplifyDemandedElts proof
Fix for D52912 which was simplifying MOVLPS/MOVHPS(+PD) instructions as the tests were only touching one of the vector halfs
llvm-svn: 343858
Alexey Bataev [Fri, 5 Oct 2018 15:27:47 +0000 (15:27 +0000)]
[OPENMP][NVPTX] Fix emission of __kmpc_global_thread_num() for non-SPMD
mode.
__kmpc_global_thread_num() should be called before initialization of the
runtime.
llvm-svn: 343857
Alexey Bataev [Fri, 5 Oct 2018 15:08:53 +0000 (15:08 +0000)]
[OPENMP] Fix emission of the __kmpc_global_thread_num.
Fixed emission of the __kmpc_global_thread_num() so that it is not
messed up with alloca instructions anymore. Plus, fixes emission of the
__kmpc_global_thread_num() functions in the target outlined regions so
that they are not called before runtime is initialized.
llvm-svn: 343856
Sanjay Patel [Fri, 5 Oct 2018 14:56:14 +0000 (14:56 +0000)]
[x86] regenerate full checks; NFC
llvm-svn: 343855
Sanjay Patel [Fri, 5 Oct 2018 14:49:20 +0000 (14:49 +0000)]
[x86] add test for fneg matching failure; NFC
llvm-svn: 343854
Simon Pilgrim [Fri, 5 Oct 2018 14:41:00 +0000 (14:41 +0000)]
[X86][AVX] getFauxShuffleMask - add support for INSERT_SUBVECTOR subvector shuffles
Decode subvector shuffles from INSERT_SUBVECTOR(SRC0, SHUFFLE(EXTRACT_SUBVECTOR(SRC1))
This was found necessary while investigating PR39161
llvm-svn: 343853
Jonas Paulsson [Fri, 5 Oct 2018 14:34:04 +0000 (14:34 +0000)]
[LoopVectorizer] Use TTI.getOperandInfo()
Call getOperandInfo() instead of using (near) duplicated code in
LoopVectorizationCostModel::getInstructionCost().
This gets the OperandValueKind and OperandValueProperties values for a Value
passed as operand to an arithmetic instruction.
getOperandInfo() used to be a static method in TargetTransformInfo.cpp, but
is now instead a public member.
Review: Florian Hahn
https://reviews.llvm.org/D52883
llvm-svn: 343852
Jonas Paulsson [Fri, 5 Oct 2018 14:23:11 +0000 (14:23 +0000)]
[TargetRegisterInfo] Remove temporary hook enableMultipleCopyHints()
Finally all targets are enabling multiple regalloc hints, so the hook to
disable this can now be removed.
NFC.
Review: Simon Pilgrim
https://reviews.llvm.org/D52316
llvm-svn: 343851
Jonas Toth [Fri, 5 Oct 2018 14:15:19 +0000 (14:15 +0000)]
[clang-tidy] NFC refactor lexer-utils to be usable without ASTContext
Summary:
This patch is a small refactoring necessary for
'readability-isolate-declaration' and does not introduce functional changes.
It allows to use the utility functions without a full `ASTContext` and requires only the `SourceManager` and the `LangOpts`.
Reviewers: alexfh, aaron.ballman, hokein
Reviewed By: alexfh
Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D52684
llvm-svn: 343850
Sam McCall [Fri, 5 Oct 2018 14:03:04 +0000 (14:03 +0000)]
[clangd] Remove last usage of ast matchers from SymbolCollector. NFC
llvm-svn: 343849
Jonas Toth [Fri, 5 Oct 2018 13:36:00 +0000 (13:36 +0000)]
[clang-tidy] Replace deprecated std::ios_base aliases
This check warns the uses of the deprecated member types of std::ios_base
and replaces those that have a non-deprecated equivalent.
Patch by andobence!
Reviewd by: alexfh
Revision ID: https://reviews.llvm.org/D51332
llvm-svn: 343848
Alexandre Ganea [Fri, 5 Oct 2018 12:56:46 +0000 (12:56 +0000)]
[LLD][COFF] Fix ordering of CRT global initializers in COMDAT sections
(patch by Benoit Rousseau)
This patch fixes a bug where the global variable initializers were sometimes not invoked in the correct order when it involved a C++ template instantiation.
Differential Revision: https://reviews.llvm.org/D52749
llvm-svn: 343847
Simon Pilgrim [Fri, 5 Oct 2018 12:33:57 +0000 (12:33 +0000)]
Fix llvm-clang-x86_64-expensive-checks-win build by setting bigobj flag.
llvm-svn: 343846
Sam McCall [Fri, 5 Oct 2018 12:22:40 +0000 (12:22 +0000)]
[clangd] Remove debugging output in test
llvm-svn: 343845
Sam McCall [Fri, 5 Oct 2018 12:08:06 +0000 (12:08 +0000)]
[clangd] Fix a subtle case for GetBeginningOfIdentifier.
Calling getMacroArgExpansionLocation too early was causing
Lexer::getRawToken to do the wrong thing - lexing the macro name instead
of the arg contents.
Differential Revision: https://reviews.llvm.org/D52928
llvm-svn: 343844
David Green [Fri, 5 Oct 2018 10:21:25 +0000 (10:21 +0000)]
[AArch64] Use filecheck captures for metadata node numbers in test. NFC
Just a quick fix for cases where extra metadata members are present.
llvm-svn: 343843
Neil Henning [Fri, 5 Oct 2018 09:39:07 +0000 (09:39 +0000)]
Add missing period to comment to match style of file.
This is a test commit to show that my commit access is working.
llvm-svn: 343842
Sam McCall [Fri, 5 Oct 2018 09:05:28 +0000 (09:05 +0000)]
[clangd] Make binary index format the default, remove dead flag.
Reviewers: hokein
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D52872
llvm-svn: 343841
Kamil Rytarowski [Fri, 5 Oct 2018 06:58:02 +0000 (06:58 +0000)]
Introduce internal_sysctlbyname in place of sysctlbyname
Summary:
This change will allow to install sysctlbyname() interceptors
more easily in sanitizers.
Reviewers: vitalybuka, joerg
Reviewed By: vitalybuka
Subscribers: kubamracek, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D52793
llvm-svn: 343840
Tom Stellard [Fri, 5 Oct 2018 04:34:09 +0000 (04:34 +0000)]
AMDGPU/GlobalISel: Add support for G_INTTOPTR
Summary: This is a no-op.
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D52916
llvm-svn: 343839
Thomas Lively [Fri, 5 Oct 2018 01:02:54 +0000 (01:02 +0000)]
[WebAssembly] abs and sqrt builtins
Summary: Depends on D52910.
Reviewers: aheejin, dschuff, craig.topper
Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits
Differential Revision: https://reviews.llvm.org/D52913
llvm-svn: 343838
Thomas Lively [Fri, 5 Oct 2018 00:59:37 +0000 (00:59 +0000)]
[WebAssembly] any_true and all_true builtins
Summary: Depends on D52858.
Reviewers: aheejin, dschuff, craig.topper
Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits
Differential Revision: https://reviews.llvm.org/D52910
llvm-svn: 343837
Thomas Lively [Fri, 5 Oct 2018 00:58:56 +0000 (00:58 +0000)]
[WebAssembly] saturating arithmetic builtins
Summary: Depends on D52856.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits
Differential Revision: https://reviews.llvm.org/D52858
llvm-svn: 343836
Thomas Lively [Fri, 5 Oct 2018 00:58:07 +0000 (00:58 +0000)]
[WebAssembly] __builtin_wasm_replace_lane_* builtins
Summary: Depends on D52852.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits
Differential Revision: https://reviews.llvm.org/D52856
llvm-svn: 343835
Thomas Lively [Fri, 5 Oct 2018 00:54:44 +0000 (00:54 +0000)]
[WebAssembly] __builtin_wasm_extract_lane_* builtins
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits
Differential Revision: https://reviews.llvm.org/D52852
llvm-svn: 343834
Thomas Lively [Fri, 5 Oct 2018 00:45:20 +0000 (00:45 +0000)]
[WebAssembly] Saturating arithmetic intrinsics
Summary: Depends on D52805.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D52813
llvm-svn: 343833
Shoaib Meenai [Fri, 5 Oct 2018 00:08:27 +0000 (00:08 +0000)]
[cmake] Also create lowercase extension WinSDK symlinks
Some projects rely on using libraries from the Windows SDK with their
original casing, just with a lowercase extension. E.g. the WinSock2 lib
is named WS2_32.Lib in the Windows SDK, and we would previously only
create a ws2_32.lib symlink for it (i.e. all lowercase). Also create a
WS2_32.lib symlink (i.e. original casing with lowercase extension) to
cover users of this casing. As a drive-by fix, only create these
symlinks when they differ from the original name to reduce the amount of
noise in the library symlinks directory.
llvm-svn: 343832
Aaron Puchert [Thu, 4 Oct 2018 23:51:14 +0000 (23:51 +0000)]
Thread safety analysis: Examine constructor arguments
Summary:
Instead of only examining call arguments, we also examine constructor
arguments applying the same rules.
That was an opportunity for refactoring the examination procedure to
work with iterators instead of integer indices. For the case of
CallExprs no functional change is intended.
Reviewers: aaron.ballman, delesley
Reviewed By: delesley
Subscribers: JonasToth, cfe-commits
Differential Revision: https://reviews.llvm.org/D52443
llvm-svn: 343831
Wouter van Oortmerssen [Thu, 4 Oct 2018 23:48:53 +0000 (23:48 +0000)]
[WebAssembly] Fixed missing "global" symbol type in AsmParser.
Summary:
These are emitted by the wasm backend for e.g.
__stack_pointer@GLOBAL which previously wasn't accepted by the
assembler.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, llvm-commits, sunfish
Differential Revision: https://reviews.llvm.org/D52911
llvm-svn: 343830
Daniel Sanders [Thu, 4 Oct 2018 23:47:37 +0000 (23:47 +0000)]
[globalisel][combine] When placing truncates, handle the case when the BB is empty
GlobalISel uses MIR with implicit fallthrough on each basic block. As a result,
getFirstNonPhi() can return end().
llvm-svn: 343829
Craig Topper [Thu, 4 Oct 2018 23:40:31 +0000 (23:40 +0000)]
[SimplifyCFG] Pass AggressiveInsts to DominatesMergePoint by reference. Remove null check.
Summary:
At some point in the past the recursion in DominatesMergePoint used to pass null for AggressiveInsts as part of the recursion. It no longer does this. So there is no way for AggressiveInsts to be null.
This passes it by reference and removes the null check to make this explicit.
Reviewers: efriedma, reames
Reviewed By: efriedma
Subscribers: xbolva00, llvm-commits
Differential Revision: https://reviews.llvm.org/D52575
llvm-svn: 343828
Yury Delendik [Thu, 4 Oct 2018 23:31:00 +0000 (23:31 +0000)]
[WebAssembly] Ignore DBG_VALUE in WebAssemblyCFGStackify pass when looking for block start
Summary:
Fixes https://bugs.llvm.org/show_bug.cgi?id=39158 and regression caused by
D49034. Though it is possible the problem was existed before and was exposed by
additional DBG_VALUEs.
Reviewers: sunfish, dschuff, aheejin
Reviewed By: aheejin
Subscribers: sbc100, aheejin, llvm-commits, alexcrichton, jgravelle-google
Differential Revision: https://reviews.llvm.org/D52837
llvm-svn: 343827
Bruce Mitchener [Thu, 4 Oct 2018 22:33:39 +0000 (22:33 +0000)]
Fix typos.
Reviewers: lldb-commits
Subscribers: srhines, ki.stfu
Differential Revision: https://reviews.llvm.org/D52884
llvm-svn: 343825
Mandeep Singh Grang [Thu, 4 Oct 2018 22:32:42 +0000 (22:32 +0000)]
[COFF, ARM64] Add __getReg intrinsic
Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar, efriedma
Reviewed By: efriedma
Subscribers: peter.smith, efriedma, kristof.beyls, chrib, cfe-commits
Differential Revision: https://reviews.llvm.org/D52838
llvm-svn: 343824
Matt Davis [Thu, 4 Oct 2018 22:16:39 +0000 (22:16 +0000)]
[llvm-mca] Remove unused/stale forward decl. NFC.
llvm-svn: 343823
Ana Pazos [Thu, 4 Oct 2018 21:50:54 +0000 (21:50 +0000)]
[RISCV] Support named operands for CSR instructions.
Reviewers: asb, mgrang
Reviewed By: asb
Subscribers: jocewei, mgorny, jfb, PkmX, MartinMosbeck, brucehoult, the_o, rkruppe, rogfer01, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones
Differential Revision: https://reviews.llvm.org/D46759
llvm-svn: 343822
Daniel Sanders [Thu, 4 Oct 2018 21:44:32 +0000 (21:44 +0000)]
[globalisel][combine] Fix a rare crash when encountering an instruction whose op0 isn't a reg
The simplest instance of this is an intrinsic with no results which will have the
intrinsic ID as operand 0.
Also fix some benign incorrectness when op0 is a reg but isn't a def that was
guarded against by checking for the extension opcodes.
llvm-svn: 343821
Ed Maste [Thu, 4 Oct 2018 21:37:32 +0000 (21:37 +0000)]
ReleaseNotes: remove superfluous 's' in 'can promotes'
llvm-svn: 343820
Sanjay Patel [Thu, 4 Oct 2018 21:36:50 +0000 (21:36 +0000)]
[InstCombine] drop poison flags in SimplifyVectorDemandedElts
We established the (unfortunately complicated) rules for UB/poison
propagation with vector ops in:
D48893
D48987
D49047
It's clear from the affected tests that we are potentially creating
poison where none existed before the transforms. For add/sub/mul,
the answer is simple: just drop the flags because the extra undef
vector lanes are generally more valuable for analysis and codegen.
llvm-svn: 343819
Julie Hockett [Thu, 4 Oct 2018 21:34:13 +0000 (21:34 +0000)]
[clang-doc] Clean up Markdown output
Make the output for the MDGenerator cleaner and more readable.
Differential Revision: https://reviews.llvm.org/D52754
llvm-svn: 343818
Craig Topper [Thu, 4 Oct 2018 21:24:24 +0000 (21:24 +0000)]
[X86][LegalizeVectorOps] Use MERGE_VALUES to return two results from LowerLoad. Remove special case code in LegalizeVectorOps that allowed us to only return one result.
Previously we replaced the chain use ourself and return the data result. LegalizeVectorOps then detected that we'd done this and assumed the chain had already been handled.
This commit instead returns a MERGE_VALUES node with two results joined from nodes. This allows LegalizeVectorOps to do all the replacements for us without any special casing. The MERGE_VALUES will be removed by DAG combine.
llvm-svn: 343817
Craig Topper [Thu, 4 Oct 2018 21:11:52 +0000 (21:11 +0000)]
[SimplifyCFG] Change recursive calls to llvm::SimplifyCFG to instead use an outer while loop to revisit.
Summary:
The llvm::SimplifyCFG function creates a SimplifyCFGOpt object and calls run on it. There were numerous places reached from this run function that called back out llvm::SimplifyCFG which would create another SimplifyCFGOpt object. This is an inefficient use of stack space at minimum. We are also not passing along the LoopHeaders pointer passed into the outer llvm::SimplifyCFG call. So if its not null we lose it on the first recursion and get nullptr from there on.
This patch adds an outer loop around the main BasicBlock simplifying code and adds a flag to the SimplifyCFGOpt class that can be set by to request another iteration. I don't think we can iterate based just on the change flag alone since some of the simplifications delete a basic block entirely leaving nothing to iterate on.
Reviewers: bogner, eli.friedman, reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52760
llvm-svn: 343816
David Carlier [Thu, 4 Oct 2018 21:07:21 +0000 (21:07 +0000)]
Esan for FreeBSD, forgotten file.
llvm-svn: 343815
Heejin Ahn [Thu, 4 Oct 2018 21:03:35 +0000 (21:03 +0000)]
[WebAssembly] Don't modify preds/succs iterators while erasing from them
Summary:
This caused out-of-bound bugs. Found by
`-DLLVM_ENABLE_EXPENSIVE_CHECKS=ON`.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D52902
llvm-svn: 343814
Konstantin Zhuravlyov [Thu, 4 Oct 2018 21:02:16 +0000 (21:02 +0000)]
AMDGPU: Rename isAmdCodeObjectV2 -> isAmdHsaOrMesa
The isAmdCodeObjectV2 is a misleading name which actually checks whether the os
is amdhsa or mesa.
Also add a test to make sure we do not generate old kernel header for code
object v3.
Differential Revision: https://reviews.llvm.org/D52897
llvm-svn: 343813
David Carlier [Thu, 4 Oct 2018 20:58:18 +0000 (20:58 +0000)]
[Esan] Port cache frag to FreeBSD
Data involving struct accesses accounting work (plan to support only efficiency-cache-frag flag in the frontend side).
Reviewers: krytarowski, vitalybuka, jfb
Reviewed By : vitalybuka
Differential Revision: https://reviews.llvm.org/D52608
llvm-svn: 343812
Martin Storsjo [Thu, 4 Oct 2018 20:43:38 +0000 (20:43 +0000)]
[COFF] [X86] Don't use llvm_unreachable for unsupported relocation types
This can happen if assembling a reference to _GLOBAL_OFFSET_TABLE_.
While it doesn't make sense to try to assemble that for COFF,
the fact that we previously used llvm_unreachable meant that the code
had undefined behaviour if something tried to assemble that.
The configure script of libgmp would try to assemble such a snippet
(which should signal a failure). If llvm is built without assertions,
the undefined behaviour meant a (near) infinite loop.
Differential Revision: https://reviews.llvm.org/D52903
llvm-svn: 343811
Brad Smith [Thu, 4 Oct 2018 20:34:58 +0000 (20:34 +0000)]
The Python 3 part of the script was missed when adding OpenBSD support.
llvm-svn: 343810
Reid Kleckner [Thu, 4 Oct 2018 20:34:52 +0000 (20:34 +0000)]
Update Clang Windows getting started docs
Summary:
- Update the example VS project generation to use VS2017.
- Add docs for generating ninja build files, since they are popular.
- Remove reference to "make update" which no longer exists. Mention the
monorepo instead.
- Try to explain gnuwin32/coreutils requirements better.
- Use https:// links where possible
Reviewers: zturner, STL_MSFT
Subscribers: jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D52843
llvm-svn: 343809
Shoaib Meenai [Thu, 4 Oct 2018 19:50:14 +0000 (19:50 +0000)]
[AST] Revert mangling changes from r339428
As discussed in https://reviews.llvm.org/D50144, we want Obj-C classes
to have the same mangling as C++ structs, to support headers like the
following:
```
@class I;
struct I;
void f(I *);
```
since the header can be used from both C++ and Obj-C++ TUs, and we want
a consistent mangling across the two to prevent link errors. Itanium
mangles both the same way, and so should the MS ABI.
The main concern with having the same mangling for C++ structs and Obj-C
classes was that we want to treat them differently for the purposes of
exception handling, e.g. we don't want a C++ catch statement for a
struct to be able to catch an Obj-C class with the same name as the
struct. We can accomplish this by mangling Obj-C class names differently
in their RTTI, which I'll do in a follow-up patch.
Differential Revision: https://reviews.llvm.org/D52581
llvm-svn: 343808
Stephen Kelly [Thu, 4 Oct 2018 19:22:00 +0000 (19:22 +0000)]
[NestedNameSpecifier] Add missing stream-specific dump methods
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D52870
llvm-svn: 343807
Sanjay Patel [Thu, 4 Oct 2018 19:12:07 +0000 (19:12 +0000)]
[InstCombine] reduce code duplication in SimplifyDemandedVectorElts; NFCI
llvm-svn: 343806
James Y Knight [Thu, 4 Oct 2018 18:49:21 +0000 (18:49 +0000)]
Give same-named members unique timestamps on Darwin in llvm-ar.
This change ensures that the (membername,timestamp) tuple uniquely
identifies an entry in an archive for format=darwin, in deterministic
mode (which is the default).
That, then, enables lldb and dsymutil to locate the appropriate object
within the archive.
Differential Revision: https://reviews.llvm.org/D47659
llvm-svn: 343805
Daniel Sanders [Thu, 4 Oct 2018 18:44:58 +0000 (18:44 +0000)]
[globalisel][combine] Improve the truncate placement for the extending-loads combine
This brings the extending loads patch back to the original intent but minus the
PHI bug and with another small improvement to de-dupe truncates that are
inserted into the same block.
The truncates are sunk to their uses unless this would require inserting before a
phi in which case it sinks to the _beginning_ of the predecessor block for that
path (but no earlier than the def).
The reason for choosing the beginning of the predecessor is that it makes de-duping
multiple truncates in the same block simple, and optimized code is going to run a
scheduler at some point which will likely change the position anyway.
llvm-svn: 343804
Sanjay Patel [Thu, 4 Oct 2018 17:59:30 +0000 (17:59 +0000)]
[x86] add test for SSE sqrtss register dep (PR22206)
llvm-svn: 343803
Sam McCall [Thu, 4 Oct 2018 17:18:55 +0000 (17:18 +0000)]
[clangd] Simplify Dex query tree logic and fix missing-posting-list bug
Summary:
The bug being fixed: when a posting list doesn't exist in the index, it
was previously just dropped from the query rather than being treated as
empty. Now that we have the FALSE iterator, we can use it instead.
The query tree logic previously had a bunch of special cases to detect whether
subtrees are empty. Now we just naively build the whole tree, and rely
on the query optimizations to drop the trivial parts.
Finally, there was a bug in trigram generation: the empty query would
generate a single trigram "$$$" instead of no trigrams.
This had no effect (there was no posting list, so the other bug
cancelled it out). But we now have to fix this bug too.
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D52796
llvm-svn: 343802
Sam McCall [Thu, 4 Oct 2018 17:18:49 +0000 (17:18 +0000)]
[clangd] Dex: FALSE iterator, peephole optimizations, fix AND bug
Summary:
The FALSE iterator will be used in a followup patch to fix a logic bug in Dex
(currently, tokens that don't have posting lists in the index are simply dropped
from the query, changing semantics).
It can usually be optimized away, so added the following opmitizations:
- simplify booleans inside AND/OR
- replace effectively-empty AND/OR with booleans
- flatten nested AND/ORs
While working on this, found a bug in the AND iterator: its constructor sync()
assumes that ReachedEnd is set if applicable, but the constructor never sets it.
This crashes if a non-first iterator is nonempty.
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D52789
llvm-svn: 343801
Sam McCall [Thu, 4 Oct 2018 17:15:41 +0000 (17:15 +0000)]
[clangd] Add std::move for converting-return to satisfy older compilers
llvm-svn: 343800
Matthias Braun [Thu, 4 Oct 2018 17:02:53 +0000 (17:02 +0000)]
AArch64: Fix XSeqPairs/WSeqPairs problems
- Fix spill/reloads of XSeqPairs failing with vregs (only physregs
worked correctly)
- Add missing spill/reload code for WSeqPairs class
Differential Revision: https://reviews.llvm.org/D52761
llvm-svn: 343799
Farhana Aleen [Thu, 4 Oct 2018 16:57:37 +0000 (16:57 +0000)]
[AMDGPU] Match signed dot4/8 pattern.
Summary: This patch matches signed dot4 and dot8 pattern.
Author: FarhanaAleen
Reviewed By: msearles
Differential Revision: https://reviews.llvm.org/D52520
llvm-svn: 343798
Jonas Toth [Thu, 4 Oct 2018 16:39:41 +0000 (16:39 +0000)]
[clang-tidy] fix failing unit tests
The removal from the FIX-IT notes through the check-clang-tidy
script was done incorrect. I did not detect beforehand but adjusted
the script and tests accordingly
llvm-svn: 343797
Jonas Toth [Thu, 4 Oct 2018 16:29:58 +0000 (16:29 +0000)]
[clangd] fix another ambigous constructor in DexTest
llvm-svn: 343796
Simon Pilgrim [Thu, 4 Oct 2018 16:26:56 +0000 (16:26 +0000)]
[llvm-mca][x86] Add PR36951 ReadAfterLd test case
llvm-svn: 343795
Sanjay Patel [Thu, 4 Oct 2018 16:25:05 +0000 (16:25 +0000)]
[InstCombine] allow bitcast to/from FP for vector insert/extract transform
This is a follow-up to rL343482 / D52439.
This was a pattern that initially caused the commit to be reverted because
the transform requires a bitcast as shown here.
llvm-svn: 343794
Sam McCall [Thu, 4 Oct 2018 16:05:22 +0000 (16:05 +0000)]
[clangd] Fix ambiguous constructor in DexTest
llvm-svn: 343793
Jonas Toth [Thu, 4 Oct 2018 15:59:30 +0000 (15:59 +0000)]
[clang-tidy] NFC use CHECK-NOTES in tests for fuchsia-default-arguments
Reviewers: alexfh, aaron.ballman, hokein
Reviewed By: alexfh
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D52688
llvm-svn: 343792
Jonas Toth [Thu, 4 Oct 2018 15:55:37 +0000 (15:55 +0000)]
[clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init
Reviewers: alexfh, aaron.ballman, hokein
Reviewed By: alexfh
Subscribers: lebedev.ri, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D52691
llvm-svn: 343791
Louis Dionne [Thu, 4 Oct 2018 15:49:42 +0000 (15:49 +0000)]
[clang] Add the exclude_from_explicit_instantiation attribute
Summary:
This attribute allows excluding a member of a class template from being part
of an explicit template instantiation of that class template. This also makes
sure that code using such a member will not take for granted that an external
instantiation exists in another translation unit. The attribute was discussed
on cfe-dev at [1] and is primarily motivated by the removal of always_inline
in libc++ to control what's part of the ABI (see links in [1]).
[1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html
rdar://problem/
43428125
Reviewers: rsmith
Subscribers: dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D51789
llvm-svn: 343790
Jonas Toth [Thu, 4 Oct 2018 15:49:25 +0000 (15:49 +0000)]
[clang-tidy] fix PR39167, bugprone-exception-escape hangs-up
Summary:
The check bugprone-exception-escape should not register
if -fno-exceptions is set for the compile options. Bailing out on non-cplusplus
and non-exceptions language options resolves the issue.
Reviewers: alexfh, aaron.ballman, baloghadamsoftware
Reviewed By: alexfh
Subscribers: lebedev.ri, xazax.hun, rnkovacs, cfe-commits
Differential Revision: https://reviews.llvm.org/D52880
llvm-svn: 343789
Jonas Toth [Thu, 4 Oct 2018 15:47:57 +0000 (15:47 +0000)]
[clang-tidy] Added pointer types to clang-tidy readability-identifier-naming check.
Summary:
Option to check for different naming conventions on the following types:
- GlobalConstantPointer
- GlobalPointer
- LocalConstantPointer
- LocalPointer
- PointerParameter
- ConstantPointerParameter
When not specified, the conventions for the non pointer types will be applied (GlobalConstant, GlobalVariable, LocalConstant, ...).
Patch by ffigueras!
Reviewers: alexfh, kbobyrev
Reviewed By: alexfh
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D52882
llvm-svn: 343788
Andrea Di Biagio [Thu, 4 Oct 2018 15:20:56 +0000 (15:20 +0000)]
[llvm-mca] Move field 'AllowZeroMoveEliminationOnly' to class RegisterFile. NFC.
Flag 'AllowZeroMoveEliminationOnly' should have been a property of the PRF, and
not set at register granularity.
This change also restricts move elimination to writes that update a full
physical register. We assume that there is a strong correlation between
logical registers that allow move elimination, and how those same registers are
allocated to physical registers by the register renamer.
This is still a no functional change, because this experimental code path is
disabled for now. This is done in preparation for another patch that will add
the ability to describe how move elimination works in scheduling models.
llvm-svn: 343787
Simon Pilgrim [Thu, 4 Oct 2018 15:06:09 +0000 (15:06 +0000)]
[X86][AVX] Add PR39161 test case for v4f64 zzww shuffle
llvm-svn: 343786
Jonathan Peyton [Thu, 4 Oct 2018 14:57:04 +0000 (14:57 +0000)]
[OpenMP][OMPT] Fix unsafe initialization of ompt_data_t objects
Initializing an ompt_data_t object using the pointer union member is potentially
unsafe in 32-bit programs. This change fixes the issue
by using the constant, ompt_data_none.
Patch by Hansang Bae
Differential Revision: https://reviews.llvm.org/D52046
llvm-svn: 343785
Sid Manning [Thu, 4 Oct 2018 14:54:17 +0000 (14:54 +0000)]
[ELF][HEXAGON] Add support for GOT relocations.
The GOT is referenced through the symbol _GLOBAL_OFFSET_TABLE_ .
The relocation added calculates the offset into the global offset table for
the entry of a symbol. In order to get the correct TargetVA I needed to
create an new relocation expression, HEXAGON_GOT. It does
Sym.getGotVA() - In.GotPlt->getVA().
Differential Revision: https://reviews.llvm.org/D52744
llvm-svn: 343784
Greg Bedwell [Thu, 4 Oct 2018 14:42:19 +0000 (14:42 +0000)]
[utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order
llvm-svn: 343783