Pavel Labath [Tue, 28 Nov 2017 10:56:54 +0000 (10:56 +0000)]
Fix floating point register write on new x86 linux kernels
Summary:
New linux kernels (on systems that support the XSAVES instruction) will
not update the inferior registers unless the corresponding flag in the
XSAVE header is set. Normally this flag will be set in our image of the
XSAVE area (since we obtained it from the kernel), but if the inferior
has never used the corresponding register set, the respective flag can
be clear.
This fixes the issue by making sure we explicitly set the flags
corresponding to the registers we modify. I don't try to precisely match
the flags to set on each write, as the rules could get quite complicated
-- I use a simpler over-approximation instead.
This was already caught by test_fp_register_write, but that was only
because the code that ran before main() did not use some of the register
sets. Since nothing in this test relies on being stopped in main(), I
modify the test to stop at the entry point instead, so we can be sure
the inferior did not have a chance to access these registers.
Reviewers: clayborg, valentinagiusti
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D40434
llvm-svn: 319161
Kamil Rytarowski [Tue, 28 Nov 2017 10:54:58 +0000 (10:54 +0000)]
Handle symbol renaming of sigaction for NetBSD
Summary:
NetBSD uses the __sigaction14 symbol name for historical and compat
reasons for the sigaction(2) function name.
Rename the interceptors and users of sigaction to sigaction_symname
and reuse it in the code base.
This change fixes 4 failing tests in TSan/NetBSD:
- ThreadSanitizer-x86_64 :: signal_errno.cc
- ThreadSanitizer-x86_64 :: signal_malloc.cc
- ThreadSanitizer-x86_64 :: signal_sync2.cc
- ThreadSanitizer-x86_64 :: signal_thread.cc
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka, eugenis, dvyukov, kcc
Reviewed By: dvyukov
Subscribers: kubamracek, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D40341
llvm-svn: 319160
Sam McCall [Tue, 28 Nov 2017 09:37:43 +0000 (09:37 +0000)]
[clangd] Switch from YAMLParser to JSONExpr
Summary:
- Converted Protocol.h parse() functions to take JSON::Expr.
These no longer detect and log unknown fields, as this is not that
useful and no longer free.
I haven't changed the error handling too much: fields that were
treated as optional before are still optional, even when it's wrong.
Exception: object properties with the wrong type are now ignored.
- Made JSONRPCDispatcher parse using json::parse
- The bug where 'method' must come before 'params' in the stream is
fixed as a side-effect. (And the same bug in executeCommand).
- Some parser crashers fixed as a side effect.
e.g. https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3890
- The debug stream now prettyprints the input messages with --pretty.
- Request params are attached to traces when tracing is enabled.
- Fixed some bugs in tests (errors tolerated by YAMLParser, and
off-by-ones in Content-Length that our null-termination was masking)
- Fixed a random double-escape bug in ClangdLSPServer (it was our last
use of YAMLParser!)
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D40406
llvm-svn: 319159
Florian Hahn [Tue, 28 Nov 2017 09:32:25 +0000 (09:32 +0000)]
[TailRecursionElimination] Skip debug intrinsics.
Summary:
I think we do not need to analyze debug intrinsics here, as they should
not impact codegen. This has 2 benefits: 1) slightly less work to do and
2) avoiding generating optimization remarks for converting calls to
debug intrinsics to tail calls, which are not really helpful for users.
Based on work by Sander de Smalen.
Reviewers: davide, trentxintong, aprantl
Reviewed By: aprantl
Subscribers: llvm-commits, JDevlieghere
Tags: #debug-info
Differential Revision: https://reviews.llvm.org/D40440
llvm-svn: 319158
Sam McCall [Tue, 28 Nov 2017 09:25:09 +0000 (09:25 +0000)]
[clangd] Add missing (but documented!) JSONExpr typed accessors
Summary:
Noticed this when I tried to port the Protocol.h parsers.
And tests for the inspect API, which caught a small bug.
Reviewers: ioeric
Subscribers: ilya-biryukov
Differential Revision: https://reviews.llvm.org/D40399
llvm-svn: 319157
Nicolai Haehnle [Tue, 28 Nov 2017 08:42:46 +0000 (08:42 +0000)]
AMDGPU: Re-organize the outer loop of SILoadStoreOptimizer
Summary:
The entire algorithm operates per basic-block, so for cache locality
it should be better to re-optimize a basic-block immediately rather than
in a separate loop.
I don't have performance measurements.
Change-Id: I85106570bd623c4ff277faaa50ee43258e1ddcc5
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D40344
llvm-svn: 319156
Nicolai Haehnle [Tue, 28 Nov 2017 08:41:50 +0000 (08:41 +0000)]
AMDGPU: Consistently check for immediates in SIInstrInfo::FoldImmediate
Summary:
The PeepholeOptimizer pass calls this function solely based on checking
DefMI->isMoveImmediate(), which only checks the MoveImm bit of the
instruction description. So it's up to FoldImmediate itself to properly
check that DefMI *actually* moves from an immediate.
I don't have a separate test case for this, but the next patch introduces
a test case which happens to crash without this change.
This error is caught by the assertion in MachineOperand::getImm().
Change-Id: I88e7cdbcf54d75e1a296822e6fe5f9a5f095bbf8
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D40342
llvm-svn: 319155
Igor Kudrin [Tue, 28 Nov 2017 08:39:40 +0000 (08:39 +0000)]
Revert r319008, "[ELF] Do not keep symbols if they referenced only from discarded sections."
and r319051, "Add a missing test."
r319008 broke the LTO bots;
r319051 depends on changes in r319008.
llvm-svn: 319154
Max Kazantsev [Tue, 28 Nov 2017 08:26:43 +0000 (08:26 +0000)]
[SCEV][NFC] More efficient caching in CompareValueComplexity
Currently, we use a set of pairs to cache responces like `CompareValueComplexity(X, Y) == 0`. If we had
proved that `CompareValueComplexity(S1, S2) == 0` and `CompareValueComplexity(S2, S3) == 0`,
this cache does not allow us to prove that `CompareValueComplexity(S1, S3)` is also `0`.
This patch replaces this set with `EquivalenceClasses` that merges Values into equivalence sets so that
any two values from the same set are equal from point of `CompareValueComplexity`. This, in particular,
allows us to prove the fact from example above.
Differential Revision: https://reviews.llvm.org/D40429
llvm-svn: 319153
Martin Storsjo [Tue, 28 Nov 2017 08:12:03 +0000 (08:12 +0000)]
Fix shared library builds of lld, broken in SVN r319138
llvm-svn: 319152
Martin Storsjo [Tue, 28 Nov 2017 08:08:37 +0000 (08:08 +0000)]
[COFF] Interpret a period as a separator for section suffix just like '$'
This allows grouping all sections like ".ctors.12345" into ".ctors".
For MinGW, the numerical values for such ctors are all zero-padded,
so a lexical sort is good enough.
Differential Revision: https://reviews.llvm.org/D40408
llvm-svn: 319151
Martin Storsjo [Tue, 28 Nov 2017 08:07:18 +0000 (08:07 +0000)]
[COFF] Implement constructor priorities
The priorities in the section name suffixes are zero padded,
allowing the linker to just do a lexical sort.
Add zero padding for .ctors sections in ELF as well.
Differential Revision: https://reviews.llvm.org/D40407
llvm-svn: 319150
Max Kazantsev [Tue, 28 Nov 2017 07:48:12 +0000 (07:48 +0000)]
[SCEV][NFC] More efficient caching in CompareSCEVComplexity
Currently, we use a set of pairs to cache responces like `CompareSCEVComplexity(X, Y) == 0`. If we had
proved that `CompareSCEVComplexity(S1, S2) == 0` and `CompareSCEVComplexity(S2, S3) == 0`,
this cache does not allow us to prove that `CompareSCEVComplexity(S1, S3)` is also `0`.
This patch replaces this set with `EquivalenceClasses` any two values from the same set are equal from
point of `CompareSCEVComplexity`. This, in particular, allows us to prove the fact from example above.
Differential Revision: https://reviews.llvm.org/D40428
llvm-svn: 319149
Kevin Funk [Tue, 28 Nov 2017 07:17:01 +0000 (07:17 +0000)]
run-clang-tidy: Use check_call instead of check_output
Summary:
Streamlines the output under Python 3.x.
Before:
```
b'Enabled checks:\n clang-analyzer-apiModeling.google.GTest\n ...
```
After:
```
Enabled checks:
clang-analyzer-apiModeling.google.GTest
...
```
Reviewers: cfe-commits, alexfh
Reviewed By: alexfh
Subscribers: JDevlieghere
Differential Revision: https://reviews.llvm.org/D37482
Change-Id: I6287104bc73926ae6d0f66c15c250c3cb44bee33
llvm-svn: 319148
Max Kazantsev [Tue, 28 Nov 2017 07:07:55 +0000 (07:07 +0000)]
[GVN] Prevent ScalarPRE from hoisting across instructions that don't pass control flow to successors
This is to address a problem similar to those in D37460 for Scalar PRE. We should not
PRE across an instruction that may not pass execution to its successor unless it is safe
to speculatively execute it.
Differential Revision: https://reviews.llvm.org/D38619
llvm-svn: 319147
Adam Nemet [Tue, 28 Nov 2017 06:22:29 +0000 (06:22 +0000)]
Revert "Add opt-viewer testing"
This reverts commit r319073.
Bot fails with a mismatch that looks like pygments-generated HTML.
llvm-svn: 319146
Martin Storsjo [Tue, 28 Nov 2017 05:47:24 +0000 (05:47 +0000)]
[test] Fix a typo in a test comment. NFC.
llvm-svn: 319145
Dan Gohman [Tue, 28 Nov 2017 05:36:42 +0000 (05:36 +0000)]
[WebAssembly] Handle errors better in fast-isel.
Fast-isel routines need to bail out in the case that fast-isel
fails on the operands.
This fixes https://bugs.llvm.org/show_bug.cgi?id=35064
llvm-svn: 319144
Craig Topper [Tue, 28 Nov 2017 05:23:57 +0000 (05:23 +0000)]
[X86] Remove some unused pattern fragments from td file. NFC
llvm-svn: 319143
Simon Dardis [Tue, 28 Nov 2017 04:07:59 +0000 (04:07 +0000)]
[DAGCombine] Disable finding better chains for stores at O0
Unoptimized IR can have linear sequences of stores to an array, where the
initial GEP for the first store is formed from the pointer to the array, and the
GEP for each store after the first is formed from the previous GEP with some
offset in an inductive fashion.
The (large) resulting DAG when analyzed by DAGCombine undergoes an excessive
number of combines as each store node is examined every time its' offset node
is combined with any child of the offset. One of the transformations is
findBetterNeighborChains which assists MergeConsecutiveStores. The former
relies on repeated chain walking to do its' work, however MergeConsecutiveStores
is disabled at O0 which makes the transformation redundant.
Any optimization level other than O0 would invoke InstCombine which would
resolve the chain of GEPs into flat base + offset GEP for each store which
does not exhibit the repeated examination of each store to the array.
Disabling this optimization fixes an excessive compile time issue (30~ minutes
for the test case provided) at O0.
Reviewers: niravd, craig.topper, t.p.northover
Differential Revision: https://reviews.llvm.org/D40193
llvm-svn: 319142
Matthias Braun [Tue, 28 Nov 2017 03:54:20 +0000 (03:54 +0000)]
MachineVerifier: Improve register operand checks
This fixes cases where we wouldn't perform various register operand
checks just because we didn't happen to have a definition in the
MCInstrDesc. This changes the code to only skip the tests that actually
depend on the MCInstrDesc definition.
This makes the machine verifier spot the problem from
https://llvm.org/PR33071 after the pass that actually caused it.
llvm-svn: 319141
Matthias Braun [Tue, 28 Nov 2017 03:54:19 +0000 (03:54 +0000)]
MachineVerifier: Improve PHI operand checking
Additional checks for phi operands:
- first operand should be a virtual register def. It should not be
tied, implicit, internalread, earlyclobber or a read.
- The other operands should be register/mbb operands next to each other
- The register operands should not be implicit, internalread,
earlyclobber, debug or tied.
- We can perform most of the PHI checks even for unreachable blocks.
llvm-svn: 319140
Matthias Braun [Tue, 28 Nov 2017 03:23:07 +0000 (03:23 +0000)]
lit: Bring back -Dtool=xxx feature lost in r313928
llvm-svn: 319139
Rui Ueyama [Tue, 28 Nov 2017 02:15:26 +0000 (02:15 +0000)]
Factor out common code to Common/Strings.cpp.
Differential Revision: https://reviews.llvm.org/D40530
llvm-svn: 319138
Rafael Espindola [Tue, 28 Nov 2017 01:41:22 +0000 (01:41 +0000)]
Use FILE_FLAG_DELETE_ON_CLOSE for TempFile on windows.
We won't see the temp file no more.
llvm-svn: 319137
Craig Topper [Tue, 28 Nov 2017 01:36:33 +0000 (01:36 +0000)]
[X86] Make zero extend from v16i1/v8i1 to v16i8/v8i16/v16i16 not scalarize under AVX512.
llvm-svn: 319136
Craig Topper [Tue, 28 Nov 2017 01:36:31 +0000 (01:36 +0000)]
[X86] Add command line without AVX512BW/AVX512VL to bitcast-int-to-vector-bool-zext.ll.
llvm-svn: 319135
Rafael Espindola [Tue, 28 Nov 2017 01:34:20 +0000 (01:34 +0000)]
Move code. NFC.
This moves the TempFile implementation so that it can use system
specific code.
llvm-svn: 319134
Peter Collingbourne [Tue, 28 Nov 2017 01:30:07 +0000 (01:30 +0000)]
Reland r319090, "COFF: Do not create SectionChunks for discarded comdat sections." with a fix for debug sections.
If /debug was not specified, readSection will return a null
pointer for debug sections. If the debug section is associative with
another section, we need to make sure that the section returned from
readSection is not a null pointer before adding it as an associative
section.
Differential Revision: https://reviews.llvm.org/D40533
llvm-svn: 319133
Stephane Sezer [Tue, 28 Nov 2017 01:26:07 +0000 (01:26 +0000)]
Remove some duplicated code in UUID.cpp
Summary: Formatting needs to be done only once. Ran check-lldb and nothing changes.
Reviewers: clayborg, davide
Reviewed By: clayborg, davide
Subscribers: zturner, davide, lldb-commits
Differential Revision: https://reviews.llvm.org/D40519
llvm-svn: 319132
Rafael Espindola [Tue, 28 Nov 2017 01:25:38 +0000 (01:25 +0000)]
This reverts commit r319096 and r319097.
Revert "[SROA] Propagate !range metadata when moving loads."
Revert "[Mem2Reg] Clang-format unformatted parts of this file. NFCI."
Davide says they broke a bot.
llvm-svn: 319131
Matthias Braun [Tue, 28 Nov 2017 01:17:52 +0000 (01:17 +0000)]
ARM: Fix PR32578
https://llvm.org/PR32578
I simplified and converted the reproducer into a lit test.
Patch by Vedant Kumar!
llvm-svn: 319130
Dan Gohman [Tue, 28 Nov 2017 01:13:45 +0000 (01:13 +0000)]
[WebAssembly] Add options for using the nontrapping-fptoint feature.
This adds ways to control use of WebAssembly's new nontrapping-fptoint
feature.
llvm-svn: 319129
Dan Gohman [Tue, 28 Nov 2017 01:13:40 +0000 (01:13 +0000)]
[WebAssembly] Fix trapping behavior in fptosi/fptoui.
This adds code to protect WebAssembly's `trunc_s` family of opcodes
from values outside their domain. Even though such conversions have
full undefined behavior in C/C++, LLVM IR's `fptosi` and `fptoui` do
not, and only return undef.
This also implements the proposed non-trapping float-to-int conversion
feature and uses that instead when available.
llvm-svn: 319128
Rafael Espindola [Tue, 28 Nov 2017 01:04:51 +0000 (01:04 +0000)]
Store the real binding of shared symbols.
Currently we mark every shared symbol as STB_WEAK.
That is a hack to make it easy to decide when a .so is needed or not
because of a reference to a given symbol.
That hack leaks when we create copy relocations as shown by the update
to relocation-copy-alias.s.
This patch stores the original binding when we first read a shared
symbol. We still have to update the binding to weak if we see a weak
undef, but I find the logic easier to read where it is now.
llvm-svn: 319127
Adrian Prantl [Tue, 28 Nov 2017 00:57:53 +0000 (00:57 +0000)]
SROA: Avoid creating a fragment expression that covers the entire variable.
Fixes PR35416.
https://bugs.llvm.org/show_bug.cgi?id=35416
llvm-svn: 319126
Adrian Prantl [Tue, 28 Nov 2017 00:57:51 +0000 (00:57 +0000)]
Move getVariableSize from Verifier.cpp into DIVariable::getSize() (NFC)
llvm-svn: 319125
Craig Topper [Tue, 28 Nov 2017 00:41:12 +0000 (00:41 +0000)]
[X86] Remove unnecessary fp<->int setOperationAction lines from a hasVLX block. NFCI
These lines all exist identically either under SSE2, AVX2 or AVX512. Given that VLX implies all of those, these aren't providing anything new.
llvm-svn: 319124
Akira Hatanaka [Tue, 28 Nov 2017 00:36:29 +0000 (00:36 +0000)]
Insert padding before the __cxa_exception header to ensure the thrown
object is sufficiently aligned.
r303175 annotated field unwindHeader of __cxa_exception with attribute
'aligned' to ensure the thrown object following the __cxa_exception
header was sufficiently aligned. This caused changes in the field
offsets of __cxa_exception relative to the start of the thrown object,
which was an ABI breaking change for some clients.
Instead of annotating field unwindHeader, this commit inserts extra
space before the header. This ensures the thrown object following the
header is sufficiently aligned without changing the field offsets, thus
avoiding any ABI breakages.
rdar://problem/
25364625
rdar://problem/
35556163
llvm-svn: 319123
Craig Topper [Tue, 28 Nov 2017 00:16:42 +0000 (00:16 +0000)]
[X86] Remove duplicate calls to setOperationAction. NFCI
These same calls exist a few lines down.
llvm-svn: 319122
Rafael Espindola [Tue, 28 Nov 2017 00:12:44 +0000 (00:12 +0000)]
Add an F_Delete flag.
For now this only changes the handle Access.
llvm-svn: 319121
Craig Topper [Mon, 27 Nov 2017 23:51:40 +0000 (23:51 +0000)]
[DAGCombiner] Don't combine aext(setcc) if the setcc is already using the target's preferred result type.
With AVX512 vXi1 types are legal so we shouldn't be extending them.
This change is similar to existing code in the zext(setcc) combine.
llvm-svn: 319120
Craig Topper [Mon, 27 Nov 2017 23:51:31 +0000 (23:51 +0000)]
[DAGCombiner] Use EVT::changeVectorElementTypeToInteger() instead of implementing manually.
llvm-svn: 319119
Rafael Espindola [Mon, 27 Nov 2017 23:44:11 +0000 (23:44 +0000)]
Add OpenFlags to the create(Unique|Temporary)File interfaces.
This will allow a future F_Delete flag to be specified when we want
the file to be automatically deleted on close.
llvm-svn: 319117
Reid Kleckner [Mon, 27 Nov 2017 23:42:20 +0000 (23:42 +0000)]
[clang-cl] Alias /Wall to -Weverything
cl interprets this option to mean enable every supported warning, which
is what Clang's -Weverything flag does.
llvm-svn: 319116
Evgeniy Stepanov [Mon, 27 Nov 2017 23:25:38 +0000 (23:25 +0000)]
[msan] Avoid shadowing a variable in common interceptors.
"offset" declared in a macro may shadow a variable with the same name
in the caller which is used in a macro argument. We are quite lucky
that it does not actually happen, but rename the variable anyway to
be on the safe side.
llvm-svn: 319115
Matt Morehouse [Mon, 27 Nov 2017 23:20:47 +0000 (23:20 +0000)]
[TSan] Do not run cond_cancel.c test on ppc64.
After r319004, the expected failure on ppc64 manifests as an infinite
loop.
llvm-svn: 319114
Sam Clegg [Mon, 27 Nov 2017 23:16:06 +0000 (23:16 +0000)]
Rename `Symtab` private memory to avoid confusion with global `Symtab`
This is also consistent with SymVector that exists in COFF port
and soon to be added to the wasm port.
Split off as part of https://reviews.llvm.org/D40371
Differential Revision: https://reviews.llvm.org/D40525
llvm-svn: 319113
Sam Clegg [Mon, 27 Nov 2017 23:09:19 +0000 (23:09 +0000)]
Fix typo in test name
llvm-svn: 319112
Aaron Ballman [Mon, 27 Nov 2017 22:59:33 +0000 (22:59 +0000)]
Add an option to misc-move-const-arg to not diagnose on trivially copyable types.
Patch by Oleg Smolsky
llvm-svn: 319111
Craig Topper [Mon, 27 Nov 2017 22:56:10 +0000 (22:56 +0000)]
[X86] Teach getSetCCResultType to handle more than just SimpleVTs when looking at larger than 512-bit vectors.
Which VTs are considered simple is determined by the superset of the legal types of all targets in LLVM. If we're looking at VTs that are going to be split down to 512-bits we should allow any VT not just simple ones since the simple list changes over time as new targets are added.
llvm-svn: 319110
Petr Hosek [Mon, 27 Nov 2017 22:50:48 +0000 (22:50 +0000)]
[CMake] Pass LLVM_HOST_TRIPLE to external projects
LLVM runtimes rely on LLVM_HOST_TRIPLE being set in their builds
and tests so make sure it's being passed down.
Differential Revision: https://reviews.llvm.org/D40515
llvm-svn: 319109
Sam Clegg [Mon, 27 Nov 2017 22:49:16 +0000 (22:49 +0000)]
Consistent use of <internal> when displaying internal symbol names
Differential Revision: https://reviews.llvm.org/D40510
llvm-svn: 319108
Petr Hosek [Mon, 27 Nov 2017 22:31:11 +0000 (22:31 +0000)]
[CMake][runtimes] Support monorepo layout with runtimes build
We introduce a new variable LLVM_ENABLE_RUNTIMES which works
similarly to LLVM_ENABLE_PROJECTS and allows specifying runtimes
that will be enabled in the runtimes build.
Differential Revision: https://reviews.llvm.org/D40233
llvm-svn: 319107
Marshall Clow [Mon, 27 Nov 2017 22:27:22 +0000 (22:27 +0000)]
Fix problems with r'890 when building on machines where sizeof(size_t) != sizeof(unsigned long long) and C++03
llvm-svn: 319106
Michal Gorny [Mon, 27 Nov 2017 22:23:09 +0000 (22:23 +0000)]
[cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
Prevent unloading shared libraries on Linux when dlclose() is called.
This is necessary since command-line option parsing API relies on
registering the global option instances in the option parser instance
which can be loaded in a different shared library.
Given that we can't reliably remove those options when a library is
unloaded, the parser ends up containing dangling references. Since glibc
has relatively complex library unloading rules, some of the LLVM
libraries can be unloaded while others (including the Support library)
stay loaded causing quite a mayhem. To reliably prevent that, just
forbid unloading all libraries -- it's a very bad idea anyway.
While the issue arguably happens only with BUILD_SHARED_LIBS, it may
affect any library reusing llvm::cl interface.
Based on patch provided Ross Hayward on https://bugs.gentoo.org/617154.
Previously hit by Fedora back in Feb 2016:
https://lists.freedesktop.org/archives/mesa-dev/2016-February/107242.html
Differential Revision: https://reviews.llvm.org/D40459
llvm-svn: 319105
Greg Clayton [Mon, 27 Nov 2017 22:12:44 +0000 (22:12 +0000)]
Fixed the ability to recursively get an attribute value from a DWARFDie.
The previous implementation would only look 1 DW_AT_specification or DW_AT_abstract_origin deep. This means DWARFDie::getName() would fail in certain cases. I ran into such a case while creating a tool that used the LLVM DWARF parser to generate a symbolication format so I have seen this in the wild.
Differential Revision: https://reviews.llvm.org/D40156
llvm-svn: 319104
Craig Topper [Mon, 27 Nov 2017 22:01:17 +0000 (22:01 +0000)]
[X86] Remove lines that set v8f32 FP_ROUND/FP_EXTEND to Legal under AVX512. NFCI
We don't do this for narrow vectors under AVX or SSE features. We also don't set them to Expand like we do for many vectors op. Nor does TargetLoweringBase.cpp. This leads me to believe these default to Legal.
llvm-svn: 319103
Dan Gohman [Mon, 27 Nov 2017 21:39:16 +0000 (21:39 +0000)]
[WebAssemby] Enable "-mthread-model single" by default, for now.
The WebAssembly standard does not yet have threads, and while it's in the
process of being standardized, it'll take some time for it to make it
through and be available in all popular implementations. With increasing
numbers of people using the LLVM wasm backend through LLVM directly rather
than through Emscripten, it's increasingly important to have friendly
defaults.
See also https://bugs.llvm.org/show_bug.cgi?id=35411
llvm-svn: 319101
Peter Collingbourne [Mon, 27 Nov 2017 21:37:51 +0000 (21:37 +0000)]
Revert r319090, "COFF: Do not create SectionChunks for discarded comdat sections."
Caused test failures in check-cfi on Windows.
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/20284
llvm-svn: 319100
Kostya Kortchinsky [Mon, 27 Nov 2017 21:34:43 +0000 (21:34 +0000)]
[scudo] Workaround for uninitialized Bionic globals
Summary:
Bionic doesn't initialize its globals early enough. This causes issues when
trying to access them from a preinit_array (b/
25751302) or from another
constructor called before the libc one (b/
68046352). __progname is initialized
after the other globals, so we can check its value to know if calling
`getauxval` is safe.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, llvm-commits
Differential Revision: https://reviews.llvm.org/D40504
llvm-svn: 319099
Yan Zhang [Mon, 27 Nov 2017 21:30:10 +0000 (21:30 +0000)]
add new check to find OSSpinlock usage
Summary:
This check finds the use of methods related to OSSpinlock in Objective-C code, which should be deprecated due to livelock issues.
The following method call will be detected:
- OSSpinlockLock()
- OSSpinlockTry()
- OSSpinlockUnlcok()
Reviewers: hokein, benhamilton
Reviewed By: benhamilton
Subscribers: klimek, cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D40325
llvm-svn: 319098
Davide Italiano [Mon, 27 Nov 2017 21:25:52 +0000 (21:25 +0000)]
[Mem2Reg] Clang-format unformatted parts of this file. NFCI.
llvm-svn: 319097
Davide Italiano [Mon, 27 Nov 2017 21:25:13 +0000 (21:25 +0000)]
[SROA] Propagate !range metadata when moving loads.
This tries to propagate !range metadata to a pre-existing load
when a load is optimized out. This is done instead of adding an
assume because converting loads to and from assumes creates a
lot of IR.
Patch by Ariel Ben-Yehuda.
Differential Revision: https://reviews.llvm.org/D37216
llvm-svn: 319096
Stephane Sezer [Mon, 27 Nov 2017 21:16:37 +0000 (21:16 +0000)]
Mark UUID::GetByteSize() const
Summary:
This method doesn't modify anything in the object it's called on so we
can mark it const to make it usable in a const context.
Reviewers: clayborg
Reviewed By: clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D40517
llvm-svn: 319095
Sanjay Patel [Mon, 27 Nov 2017 21:15:43 +0000 (21:15 +0000)]
[PartiallyInlineLibCalls][x86] add TTI hook to allow sqrt inlining to depend on arg rather than result
This should fix PR31455:
https://bugs.llvm.org/show_bug.cgi?id=31455
Differential Revision: https://reviews.llvm.org/D28314
llvm-svn: 319094
Daniel Sanders [Mon, 27 Nov 2017 21:12:55 +0000 (21:12 +0000)]
Add release note about TargetRegistry change from r318352
llvm-svn: 319093
Yaxun Liu [Mon, 27 Nov 2017 20:48:21 +0000 (20:48 +0000)]
[AMDGPU] Update test nullptr.ll to use amdgiz environment
This test needs to be manually updated since it is difficult to do it with script.
Addr space 6 to 23 are only used by r600, therefore only check them for r600.
Differential Revision: https://reviews.llvm.org/D40117
llvm-svn: 319092
Marshall Clow [Mon, 27 Nov 2017 20:47:54 +0000 (20:47 +0000)]
Revert commit removing allocator support from packaged_task. Will investigate further
llvm-svn: 319091
Peter Collingbourne [Mon, 27 Nov 2017 20:42:34 +0000 (20:42 +0000)]
COFF: Do not create SectionChunks for discarded comdat sections.
With this change, instead of creating a SectionChunk for each section
in the object file, we only create them when we encounter a prevailing
comdat section.
Also change how symbol resolution occurs between comdat symbols. Now
only the comdat leader participates in comdat resolution, and not any
other external associated symbols. This is more in line with how COFF
semantics are defined, and should allow for a more straightforward
implementation of non-ANY comdat types.
On my machine, this change reduces our runtime linking a release
build of chrome_child.dll with /nopdb from 5.65s to 4.54s (median of
50 runs).
Differential Revision: https://reviews.llvm.org/D40238
llvm-svn: 319090
Petr Hosek [Mon, 27 Nov 2017 20:41:53 +0000 (20:41 +0000)]
Use LIST_SEPARATOR rather than escaping in ExternalProject_Add
Escaping ; in list arguments passed to ExternalProject_Add doesn't seem
to be working in newer versions of CMake (see
https://public.kitware.com/Bug/view.php?id=16137 for more details). Use
a custom LIST_SEPARATOR instead which is the officially supported way.
Differential Revision: https://reviews.llvm.org/D40232
llvm-svn: 319089
Petr Hosek [Mon, 27 Nov 2017 20:29:13 +0000 (20:29 +0000)]
[CMake][Fuchsia] Disable terminfo database in Fuchsia toolchain
It's used to determine whether terminal supports colors, but within LLVM
it's only used in handful of places and in Clang it's only used in AST
dumper, otherwise Clang relies on the -fcolor-diagnostics flag which we
pass explicitly from our build system anyway. This eliminates one of the
shared libraries dependencies making the toolchain less reliant on the
host environment.
Differential Revision: https://reviews.llvm.org/D40329
llvm-svn: 319088
Zaara Syeda [Mon, 27 Nov 2017 20:26:36 +0000 (20:26 +0000)]
[PowerPC] Remove redundant TOC saves
This patch adds a peep hole optimization to remove any redundant toc save
instructions added as part of the call sequence for indirect calls. It removes
any toc saves within a function that are dominated by another toc save.
Differential Revision: https://reviews.llvm.org/D39736
llvm-svn: 319087
David Blaikie [Mon, 27 Nov 2017 19:55:16 +0000 (19:55 +0000)]
Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header as much as it is for stamping out some global/static variables
llvm-svn: 319086
Craig Topper [Mon, 27 Nov 2017 19:54:57 +0000 (19:54 +0000)]
[SelectionDAG] Add a debug message when vector_shuffle nodes are created.
We print a debug message when most nodes are created, but getVectorShuffle was missing.
llvm-svn: 319085
David Blaikie [Mon, 27 Nov 2017 19:54:06 +0000 (19:54 +0000)]
Fix for file renaming in LLVM (CommandFlags.h -> CommandFlags.def)
llvm-svn: 319084
Kostya Kortchinsky [Mon, 27 Nov 2017 19:53:53 +0000 (19:53 +0000)]
[fuchsia] Update Fuchsia with a new mmap implementation.
Summary:
Now that the sanitizer_common interface for MmapNoAccess / MmapFixed
have been refactored to allow a more OO-esque access pattern, update the
Fuchsia mmap implementation to take advantage of this.
Previously MmapNoAccess / MmapFixed relied on a global allocator_vmar,
since the sanitizer_allocator only called MmapNoAccess once. Now, we
create a new VMAR per ReservedAddressRange object.
This allows the sanitizer allocator to work in tandem with the Scudo
secondary allocator.
This is part 4 of a 4 part changeset:
* part 1 https://reviews.llvm.org/D38593
* part 2 https://reviews.llvm.org/D38592
* part 3 https://reviews.llvm.org/D38593
Reviewers: mcgrathr, cryptoad
Reviewed By: cryptoad
Subscribers: alekseyshl, mcgrathr, kubamracek, mehdi_amini
Differential Revision: https://reviews.llvm.org/D38595
llvm-svn: 319083
David Blaikie [Mon, 27 Nov 2017 19:43:58 +0000 (19:43 +0000)]
Rename CommandFlags.h -> CommandFlags.def
Since this isn't a real header - it includes static functions and had
external linkage variables (though this change makes them static, since
that's what they should be) so can't be included more than once in a
program.
llvm-svn: 319082
David Blaikie [Mon, 27 Nov 2017 19:43:57 +0000 (19:43 +0000)]
Fix -Werror build for signed/unsigned comparison with use of explicit unsigned literals
llvm-svn: 319081
Marshall Clow [Mon, 27 Nov 2017 19:43:28 +0000 (19:43 +0000)]
Implement LWG#2921 and LWG#2976 - removing allocator support from packaged_task.
llvm-svn: 319080
Alexey Bataev [Mon, 27 Nov 2017 19:38:58 +0000 (19:38 +0000)]
[OPENMP] Codegen for `distribute parallel for simd` directive.
Initial codegen for `#pragma omp distribute parallel for simd` directive
and its clauses.
llvm-svn: 319079
Alexey Bataev [Mon, 27 Nov 2017 19:38:52 +0000 (19:38 +0000)]
[OPENMP] Codegen for `distribute parallel for simd` directive.
Added proper codegen for `distribute parallel for simd` directive.
llvm-svn: 319078
Pirama Arumuga Nainar [Mon, 27 Nov 2017 19:18:39 +0000 (19:18 +0000)]
Switch CPU names not recognized by GNU assembler
Summary:
Switch CPU names not recognized by GNU assembler to a close CPU that it
does recognize. In this patch, kryo, falkor and saphira all get
replaced by cortex-a57 when invoking the assembler. In addition, krait
was already being replaced by cortex-a15.
Reviewers: weimingz
Subscribers: srhines, cfe-commits
Differential Revision: https://reviews.llvm.org/D40476
llvm-svn: 319077
Michal Gorny [Mon, 27 Nov 2017 19:18:36 +0000 (19:18 +0000)]
Revert r319069 - [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
This breaks one of the unit tests. Need to find a good solution.
llvm-svn: 319076
Arnold Schwaighofer [Mon, 27 Nov 2017 19:03:40 +0000 (19:03 +0000)]
Inliner: Don't mark notail calls with the 'tail' attribute
enum TailCallKind { TCK_None = 0, TCK_Tail = 1, TCK_MustTail = 2,
TCK_NoTail = 3 };
TCK_NoTail is greater than TCK_Tail so taking the min does not do the
correct thing.
rdar://
35639547
llvm-svn: 319075
Marshall Clow [Mon, 27 Nov 2017 19:03:30 +0000 (19:03 +0000)]
Fix PR#35438 - bitset constructor does not zero unused bits
llvm-svn: 319074
Adam Nemet [Mon, 27 Nov 2017 19:00:29 +0000 (19:00 +0000)]
Add opt-viewer testing
Detects whether we have the Python modules (pygments, yaml) required by
opt-viewer and hooks this up to REQUIRES.
This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer
testing).
It's also related to https://github.com/apple/swift/pull/12938 and the idea is
to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake.
Differential Revision: https://reviews.llvm.org/D40202
llvm-svn: 319073
Adam Nemet [Mon, 27 Nov 2017 19:00:22 +0000 (19:00 +0000)]
[opt-viewer] Fix option name
llvm-svn: 319072
Jake Ehrlich [Mon, 27 Nov 2017 18:56:01 +0000 (18:56 +0000)]
[llvm-objcopy] Add --strip-all-gnu and change --strip-all
GNU's --strip-all doesn't strip as aggressively as it could in general.
Currently llvm-objcopy copies the exact behavoir of GNU's --strip-all.
eu-strip is used as a drop in replacement for GNU strip/objcopy in many many
places without issue. eu-strip removes non-allocated sections and keeps
.gnu.warning* sections. Because --strip-all will likely be the most widely
used stripping option we should make --strip-all as aggressive as it can safely
be. Since we have evidence from eu-strip that this is a safe option we should
allow it. For those that might still have an issue afterwards I've added
--strip-all-gnu as an exact drop in replacement for GNU's --strip-all as well.
llvm-svn: 319071
Zachary Turner [Mon, 27 Nov 2017 18:48:37 +0000 (18:48 +0000)]
[BinaryStream] Support growable streams.
The existing library assumed that a stream's length would never
change. This makes some things simpler, but it's not flexible
enough for what we need, especially for writable streams where
what you really want is for each call to write to actually append.
llvm-svn: 319070
Michal Gorny [Mon, 27 Nov 2017 18:34:52 +0000 (18:34 +0000)]
[cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
Prevent unloading shared libraries on Linux when dlclose() is called.
This is necessary since command-line option parsing API relies on
registering the global option instances in the option parser instance
which can be loaded in a different shared library.
Given that we can't reliably remove those options when a library is
unloaded, the parser ends up containing dangling references. Since glibc
has relatively complex library unloading rules, some of the LLVM
libraries can be unloaded while others (including the Support library)
stay loaded causing quite a mayhem. To reliably prevent that, just
forbid unloading all libraries -- it's a very bad idea anyway.
While the issue arguably happens only with BUILD_SHARED_LIBS, it may
affect any library reusing llvm::cl interface.
Based on patch provided Ross Hayward on https://bugs.gentoo.org/617154.
Previously hit by Fedora back in Feb 2016:
https://lists.freedesktop.org/archives/mesa-dev/2016-February/107242.html
Differential Revision: https://reviews.llvm.org/D40459
llvm-svn: 319069
Craig Topper [Mon, 27 Nov 2017 18:25:54 +0000 (18:25 +0000)]
[X86] Remove an unused isel pattern that looked for pshufd with v4f32 type.
I don't believe our current lowering/combining would ever produce such a node. We only produce integer typed pshufds.
llvm-svn: 319068
Sanjay Patel [Mon, 27 Nov 2017 18:19:32 +0000 (18:19 +0000)]
[InstCombine] use 'auto' with 'dyn_cast'; NFC
llvm-svn: 319067
Craig Topper [Mon, 27 Nov 2017 18:15:14 +0000 (18:15 +0000)]
[X86] Teach combineX86ShuffleChain that AllowIntDomain requires at least SSE2.
I don't have a good test case for this at the moment. I was playing around with a change in legalizing and triggered this code to produce a PSHUFD with sse1 only.
llvm-svn: 319066
Simon Pilgrim [Mon, 27 Nov 2017 18:14:18 +0000 (18:14 +0000)]
[X86][AVX512] Tag AVX512 PACKSS/PACKUS/PMADDWD/PMADDUBSW instructions with SSE_PACK/SSE_PMADD schedule classes
llvm-svn: 319065
Krzysztof Parzyszek [Mon, 27 Nov 2017 18:12:16 +0000 (18:12 +0000)]
[Hexagon] Implement HexagonSubtarget::isHVXVectorType
llvm-svn: 319064
Craig Topper [Mon, 27 Nov 2017 18:00:49 +0000 (18:00 +0000)]
[X86] Add avx512bw command lines to vselect-packss.ll
This shows several places where we fail to use masked move or blendm.
llvm-svn: 319063
Alexander Kornienko [Mon, 27 Nov 2017 17:59:26 +0000 (17:59 +0000)]
[clang-tidy] Rename qualified references to check class + support inconsistent names
llvm-svn: 319062
Jonas Hahnfeld [Mon, 27 Nov 2017 17:55:47 +0000 (17:55 +0000)]
Delete obsolete function mergeUseListsImpl
mergeUseLists is implemented iteratively since r243590.
Differential Revision: https://reviews.llvm.org/D40491
llvm-svn: 319061
Kamil Rytarowski [Mon, 27 Nov 2017 17:54:26 +0000 (17:54 +0000)]
Build more sanitizers for NetBSD
Summary:
Enable for NetBSD:
- MSan,
- TSan,
- LSan.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, eugenis, dvyukov, vitalybuka
Reviewed By: eugenis
Subscribers: srhines, mgorny, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D40464
llvm-svn: 319060