Sanjay Patel [Sun, 7 Oct 2018 14:46:33 +0000 (14:46 +0000)]
[InstSimplify] add vector test for fneg+fdiv; NFC
This should be fixed with D52934.
llvm-svn: 343936
Simon Pilgrim [Sun, 7 Oct 2018 11:45:46 +0000 (11:45 +0000)]
[SelectionDAG] Respect multiple uses in SimplifyDemandedBits to SimplifyDemandedVectorElts simplification
rL343913 was using SimplifyDemandedBits's original demanded mask instead of the adjusted 'NewMask' that accounts for multiple uses of the op (those variable names really need improving....).
Annoyingly many of the test changes (back to pre-rL343913 state) are actually safe - but only because their multiple uses are all by PMULDQ/PMULUDQ.
Thanks to Jan Vesely (@jvesely) for bisecting the bug.
llvm-svn: 343935
Simon Pilgrim [Sun, 7 Oct 2018 11:24:04 +0000 (11:24 +0000)]
[AARCH64][X86] Remove _nonsplat from test names
As discussed on D50222
llvm-svn: 343934
Craig Topper [Sun, 7 Oct 2018 07:16:44 +0000 (07:16 +0000)]
[LegalizeVectorOps] Make ExpandStrictFPOp return the result corresponding to the result number of the SDValue passed in.
It was always returning the chain which seems to be the result number of the SDValue in the lit tests we have. But I don't know if that's guaranteed.
llvm-svn: 343933
Dorit Nuzman [Sun, 7 Oct 2018 06:57:25 +0000 (06:57 +0000)]
[IAI,LV] Avoid creating interleave-groups for predicated accesse
This patch fixes PR39099.
When strided loads are predicated, each of them will form an interleaved-group
(with gaps). However, subsequent stages of vectorization (planning and
transformation) assume that if a load is part of an Interleave-Group it is not
predicated, resulting in wrong code - unmasked wide loads are created.
The Interleaving Analysis does take care not to have conditional interleave
groups of size > 1, but until we extend the planning and transformation stages
to support masked-interleave-groups we should also avoid having them for
size == 1.
Reviewers: Ayal, hsaito, dcaballe, fhahn
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D52682
llvm-svn: 343931
Alex Bradbury [Sun, 7 Oct 2018 06:53:46 +0000 (06:53 +0000)]
[RISCV] Introduce alu8.ll and alu16.ll tests
These track the quality of generated code for simple arithmetic operations
that were legalised from non-native types.
llvm-svn: 343930
Lang Hames [Sun, 7 Oct 2018 01:08:02 +0000 (01:08 +0000)]
[ORC] Consume unhandled errors in unit test.
This should fix the failures on the debug buildbots.
llvm-svn: 343929
Lang Hames [Sat, 6 Oct 2018 23:03:59 +0000 (23:03 +0000)]
[ORC] Add a 'remove' method to JITDylib to remove symbols.
Symbols can be removed provided that all are present in the JITDylib and none
are currently in the materializing state. On success all requested symbols are
removed. On failure an error is returned and no symbols are removed.
llvm-svn: 343928
Lang Hames [Sat, 6 Oct 2018 23:02:06 +0000 (23:02 +0000)]
[ORC] Pass symbol name to discard by const reference.
This saves some unnecessary atomic ref-counting operations.
llvm-svn: 343927
Simon Pilgrim [Sat, 6 Oct 2018 22:13:44 +0000 (22:13 +0000)]
[X86] getFauxShuffleMask - Handle undef + sentinel values in subvector insertion
llvm-svn: 343926
Simon Pilgrim [Sat, 6 Oct 2018 20:24:27 +0000 (20:24 +0000)]
[X86][SSE] Add SSE41 vector int2fp tests
llvm-svn: 343925
Simon Pilgrim [Sat, 6 Oct 2018 17:18:41 +0000 (17:18 +0000)]
[X86][AVX] Ensure resolveTargetShuffleInputs shuffle masks are the correct width
Don't handle ZERO_EXTEND style shuffles until we support bitcasts. Found by inspection.
llvm-svn: 343924
Marshall Clow [Sat, 6 Oct 2018 15:07:03 +0000 (15:07 +0000)]
Papers and Issues for San Diego
llvm-svn: 343923
Simon Pilgrim [Sat, 6 Oct 2018 14:51:14 +0000 (14:51 +0000)]
[X86] combinePMULDQ - add op back to worklist if SimplifyDemandedBits succeeds on either operand
Prevents missing other simplifications that may occur deep in the operand chain where CommitTargetLoweringOpt won't add the PMULDQ back to the worklist itself
llvm-svn: 343922
Simon Pilgrim [Sat, 6 Oct 2018 14:26:38 +0000 (14:26 +0000)]
[X86] Regenerate LSR loop iteration test
llvm-svn: 343921
Sanjay Patel [Sat, 6 Oct 2018 14:11:05 +0000 (14:11 +0000)]
[x86] add test for masked store with extra shift op; NFC
llvm-svn: 343920
Simon Pilgrim [Sat, 6 Oct 2018 13:49:31 +0000 (13:49 +0000)]
[X86][SSE] SimplifyDemandedVectorEltsForTargetNode - simplify PSHUFB masks
Attempt to simplify PSHUFB masks (even non-constant ones) - we should probably be able to simplify other variable shuffles as well as the need arises.
llvm-svn: 343919
Simon Pilgrim [Sat, 6 Oct 2018 13:29:08 +0000 (13:29 +0000)]
[X86] Use the SimplifyDemandedBits wrappers where possible. NFCI.
Leave the wrapper to handle TargetLowering::TargetLoweringOpt and CommitTargetLoweringOpt.
llvm-svn: 343918
Simon Pilgrim [Sat, 6 Oct 2018 11:59:31 +0000 (11:59 +0000)]
Revert rL343916: Fix -Wmissing-braces warning. NFCI.
llvm-svn: 343917
Simon Pilgrim [Sat, 6 Oct 2018 11:46:27 +0000 (11:46 +0000)]
Fix -Wmissing-braces warning. NFCI.
llvm-svn: 343916
Simon Pilgrim [Sat, 6 Oct 2018 11:12:59 +0000 (11:12 +0000)]
Wdocumentation fix
llvm-svn: 343915
Simon Pilgrim [Sat, 6 Oct 2018 11:09:15 +0000 (11:09 +0000)]
Wdocumentation fix
llvm-svn: 343914
Simon Pilgrim [Sat, 6 Oct 2018 10:20:04 +0000 (10:20 +0000)]
[SelectionDAG] Add SimplifyDemandedBits to SimplifyDemandedVectorElts simplification
This patch enables SimplifyDemandedBits to call SimplifyDemandedVectorElts in cases where the demanded bits mask covers entire elements of a bitcasted source vector.
There are a couple of cases here where simplification at a deeper level (such as through bitcasts) prevents further simplification - CommitTargetLoweringOpt only adds immediate uses/users back to the worklist when we might want to combine the original caller again to see what else it can simplify.
As well as that I had to disable handling of bool vector until SimplifyDemandedVectorElts better supports some of their opcodes (SETCC, shifts etc.).
Fixes PR39178
Differential Revision: https://reviews.llvm.org/D52935
llvm-svn: 343913
Fangrui Song [Sat, 6 Oct 2018 07:00:50 +0000 (07:00 +0000)]
[clangd] Remove unused headers from CodeComplete.cpp
queue is not used after index-provided completions' merge with those from Sema
USRGeneration.h is not used after introduction of getSymbolID
llvm-svn: 343912
Alex Bradbury [Sat, 6 Oct 2018 06:09:46 +0000 (06:09 +0000)]
[RISCV] Compress addiw rd, x0, simm6 to c.li rd, simm6
A pattern was present for addi rd, x0, simm6 but not addiw which is
semantically identical when the source register is x0. This patch addresses
that, and the benefit can be seen in rv64c-aliases-valid.s.
llvm-svn: 343911
Tom Stellard [Sat, 6 Oct 2018 03:32:43 +0000 (03:32 +0000)]
AMDGPU: Consolidate SMRD TableGen patterns
Summary:
Merge the SMRD patterns for CI into the same multiclass as the
patterns for other sub-targets.
This removes some duplicate code and will make it easier for some
future GlobalISel changes I would like to do.
Reviewers: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D52557
llvm-svn: 343909
Aaron Puchert [Sat, 6 Oct 2018 01:09:28 +0000 (01:09 +0000)]
Thread safety analysis: Handle conditional expression in getTrylockCallExpr
Summary:
We unwrap conditional expressions containing try-lock functions.
Additionally we don't acquire on conditional expression branches, since
that is usually not helpful. When joining the branches we would almost
certainly get a warning then.
Hopefully fixes an issue that was raised in D52398.
Reviewers: aaron.ballman, delesley, hokein
Reviewed By: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D52888
llvm-svn: 343902
Jordan Rupprecht [Fri, 5 Oct 2018 23:25:39 +0000 (23:25 +0000)]
[llvm-ar] Use POSIX-specified timestamps for 'tv'.
Summary:
The POSIX spec says:
```
If the −t option is used with the −v option, the standard output format shall be:
"%s %u/%u %u %s %d %d:%d %d %s\n", <member mode>, <user ID>,
<group ID>, <number of bytes in member>,
<abbreviated month>, <day-of-month>, <hour>,
<minute>, <year>, <file>
where:
...
<abbreviated month>
Equivalent to the format of the %b conversion specification format in date.
<day-of-month>
Equivalent to the format of the %e conversion specification format in date.
<hour> Equivalent to the format of the %H conversion specification format in date.
<minute> Equivalent to the format of the %M conversion specification format in date.
<year> Equivalent to the format of the %Y conversion specification format in date.
```
This actually used to be the format printed by llvm-ar. It was apparently accidentally changed (see r207385 followed by comments in r207387). This makes it conform to GNU ar for easier replacement.
Reviewers: MaskRay
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52940
llvm-svn: 343901
Vedant Kumar [Fri, 5 Oct 2018 23:23:15 +0000 (23:23 +0000)]
Add support for artificial tail call frames
This patch teaches lldb to detect when there are missing frames in a
backtrace due to a sequence of tail calls, and to fill in the backtrace
with artificial tail call frames when this happens. This is only done
when the execution history can be determined from the call graph and
from the return PC addresses of calls on the stack. Ambiguous sequences
of tail calls (e.g anything involving tail calls and recursion) are
detected and ignored.
Depends on D49887.
Differential Revision: https://reviews.llvm.org/D50478
llvm-svn: 343900
Vedant Kumar [Fri, 5 Oct 2018 23:14:13 +0000 (23:14 +0000)]
Relax a data formatter test
Before inspecting the contents of a list, make sure that we've stepped
past the push_back() that inserts the element we're interested in.
llvm-svn: 343899
Fedor Sergeev [Fri, 5 Oct 2018 22:32:01 +0000 (22:32 +0000)]
[New PM][PassTiming] implement -time-passes for the new pass manager
Enable time-passes functionality through PassInstrumentation callbacks
for passes and analyses.
TimePassesHandler class keeps all the callbacks, the timing data as it
is being collected as well as the stack of currently active timers.
Parts of the fix that might be somewhat unobvious:
- mapping of passes into Timer (TimingData) can not be done per-instance.
PassID name provided into the callback is common for all the pass invocations.
Thus the only way to get a timing with reasonable granularity is to collect
timing data per pass invocation, getting a new timer for each BeforePass.
Hence the key for TimingData uses a pair of <StringRef/unsigned count> to
uniquely identify a pass invocation.
- consequently, this new-pass-manager implementation performs no aggregation
of timing data, reporting timings for each pass invocation separately.
In that it differs from legacy-pass-manager time-passes implementation that
reports timing data aggregated per pass instance.
- pass managers and adaptors are not tracked, similar to how pass managers are
not tracked in legacy time-passes.
- TimerStack tracks timers that are active, each BeforePass pushes the new timer
on stack, each AfterPass pops active timer from stack and stops it.
Reviewers: chandlerc, philip.pfaffe
Differential Revision: https://reviews.llvm.org/D51276
llvm-svn: 343898
Joel Jones [Fri, 5 Oct 2018 22:23:21 +0000 (22:23 +0000)]
[AArch64] -mcpu=native CPU detection for Cavium processors
This small patch updates the CPU detection for Cavium processors when
-mcpu=native is passed on compile-line.
Patch by Stefan Teleman
Differential Revision: https://reviews.llvm.org/D51939
llvm-svn: 343897
Petr Hosek [Fri, 5 Oct 2018 22:16:37 +0000 (22:16 +0000)]
[llvm-nm] Update all tests to redirect stderr to stdout
This addresses the breakage introduced in r343887.
llvm-svn: 343896
Matthias Braun [Fri, 5 Oct 2018 22:00:13 +0000 (22:00 +0000)]
X86, AArch64, ARM: Do not attach debug location to spill/reload instructions
This rebases and recommits r343520. hwasan should be fixed now and this
shouldn't break the tests anymore.
Spill/reload instructions are artificially generated by the compiler and
have no relation to the original source code. So the best thing to do is
not attach any debug location to them (instead of just taking the next
debug location we find on following instructions).
Differential Revision: https://reviews.llvm.org/D52125
llvm-svn: 343895
Mandeep Singh Grang [Fri, 5 Oct 2018 21:57:41 +0000 (21:57 +0000)]
[COFF, ARM64] Add _InterlockedAdd intrinsic
Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar, efriedma
Reviewed By: efriedma
Subscribers: efriedma, kristof.beyls, chrib, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D52811
llvm-svn: 343894
Vedant Kumar [Fri, 5 Oct 2018 21:54:58 +0000 (21:54 +0000)]
Specify -mtriple=x86_64 in an X86-specific dwarf test
On the PPC bot, the %llc_dwarf substitution does not contain an -mtriple
argument. This can cause the wrong backend to be exercised.
This causes issues because the backends differ in when they decide to
emit tail calls:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/12440
This is mostly a speculative fix as I don't have a PPC machine to test
with.
llvm-svn: 343893
James Y Knight [Fri, 5 Oct 2018 21:53:51 +0000 (21:53 +0000)]
Emit CK_NoOp casts in C mode, not just C++.
Previously, it had been using CK_BitCast even for casts that only
change const/restrict/volatile. Now it will use CK_Noop where
appropriate.
This is an alternate solution to r336746.
Differential Revision: https://reviews.llvm.org/D52918
llvm-svn: 343892
Simon Pilgrim [Fri, 5 Oct 2018 21:44:19 +0000 (21:44 +0000)]
[X86][AVX] Limit getFauxShuffleMask INSERT_SUBVECTOR support to 2 inputs
rL343853 didn't limit the number of subinputs, but we don't currently support faux shuffles with more than 2 total inputs, so put a limiter in place until this is fixed.
Found by Artem Dergachev.
llvm-svn: 343891
Vedant Kumar [Fri, 5 Oct 2018 21:44:15 +0000 (21:44 +0000)]
[LiveDebugValues] Extend var ranges through artificial blocks
ASan often introduces basic blocks consisting exclusively of
instructions without debug locations, or with line 0 debug locations.
LiveDebugValues needs to extend variable ranges through these artificial
blocks. Otherwise, a lot of variables disappear -- even at -O0.
Typically, LiveDebugValues does not extend a variable's range into a
block unless the block is essentially "part of" the variable's scope
(for a precise definition, see LexicalScopes::dominates). This patch
relaxes the lexical dominance check for artificial blocks.
This makes the following Swift program debuggable at -O0:
```
1| var x = 100
2| print("x = \(x)")
```
rdar://
39127144
Differential Revision: https://reviews.llvm.org/D52921
llvm-svn: 343890
Vedant Kumar [Fri, 5 Oct 2018 21:44:00 +0000 (21:44 +0000)]
Clarify debug output in LiveDebugValues
MachineBasicBlocks often do not have names, so it helps to refer to them
by block number when printing debug messages.
llvm-svn: 343889
Vedant Kumar [Fri, 5 Oct 2018 21:28:14 +0000 (21:28 +0000)]
Disable the dwarf callsite attrs test on Windows
The Windows formats don't understand relocations inside of AT_return_pc.
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/270
llvm-svn: 343888
Petr Hosek [Fri, 5 Oct 2018 21:10:03 +0000 (21:10 +0000)]
[llvm-nm] Write "no symbol" output to stderr
This matches the output of binutils' nm and ensures that any scripts
or tools that use nm and expect empty output in case there no symbols
don't break.
Differential Revision: https://reviews.llvm.org/D52943
llvm-svn: 343887
Vedant Kumar [Fri, 5 Oct 2018 21:05:31 +0000 (21:05 +0000)]
Avoid hardcoding PC addresses in a dwarf test
The PCs appear to vary from builder-to-builder:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/20053
llvm-svn: 343886
Jessica Paquette [Fri, 5 Oct 2018 21:02:46 +0000 (21:02 +0000)]
[GlobalIsel] Add llvm.invariant.start and llvm.invariant.end
Port over the implementation in SelectionDAGBuilder.cpp into the IRTranslator
and update the arm64-irtranslator test.
These were causing fallbacks in CTMark/Bullet (-Rpass-missed=gisel-select),
and this patch fixes that.
https://reviews.llvm.org/D52945
llvm-svn: 343885
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