Vedant Kumar [Thu, 12 Jul 2018 19:53:15 +0000 (19:53 +0000)]
[Driver] Conform warn_drv_object_size_disabled_O0 to DefaultWarnNoError
This diagnostic triggers when -fsanitize=object-size is explicitly
specified but will be a no-op (i.e, at -O0).
This diagnostic should not fail a -Werror build because it's just an
explanatory note to the user. It's not always actionable.
For example, a user may not be able to simply disable object-size,
because they want it enabled in optimized builds.
rdar://
42128447
llvm-svn: 336937
Krzysztof Parzyszek [Thu, 12 Jul 2018 19:44:39 +0000 (19:44 +0000)]
[Hexagon] Fix testcases failing after r336933
llvm-svn: 336936
Matt Arsenault [Thu, 12 Jul 2018 19:40:16 +0000 (19:40 +0000)]
AMDGPU: Fix assert in truncate combine with vectors
The piece above probably has the same problem, but I need
to try to come up with a test for it.
llvm-svn: 336935
Matthias Braun [Thu, 12 Jul 2018 19:27:01 +0000 (19:27 +0000)]
Revert "(HEAD -> master, origin/master, arcpatch-D37582) CodeGen: Remove pipeline dependencies on StackProtector; NFC"
This was triggering pass scheduling failures.
This reverts commit r336929.
llvm-svn: 336934
Krzysztof Parzyszek [Thu, 12 Jul 2018 18:54:04 +0000 (18:54 +0000)]
[Hexagon] Diagnose intrinsics not supported by selected CPU/HVX
llvm-svn: 336933
Matt Morehouse [Thu, 12 Jul 2018 18:52:10 +0000 (18:52 +0000)]
[libFuzzer] If LLD available, require it to build first.
Since we now have a test that requires LLD, make sure it is built before
that test runs.
llvm-svn: 336932
Richard Smith [Thu, 12 Jul 2018 18:49:13 +0000 (18:49 +0000)]
Add tests for function conversions in conversion function template
deduction.
llvm-svn: 336931
Nicolas Lesser [Thu, 12 Jul 2018 18:45:41 +0000 (18:45 +0000)]
[C++17] Disallow lambdas in template parameters (PR33696).
Summary: This revision disallows lambdas in template parameters, as reported in PR33696.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D37442
llvm-svn: 336930
Matthias Braun [Thu, 12 Jul 2018 18:33:32 +0000 (18:33 +0000)]
CodeGen: Remove pipeline dependencies on StackProtector; NFC
PrologEpilogInserter and StackColoring depend on the StackProtector analysis
being alive from the point it is run until PEI, which requires that they are all
scheduled in the same FunctionPassManager. Inserting a (machine) ModulePass
between StackProtector and PEI results in these passes being in separate
FunctionPassManagers and the StackProtector is not available for PEI.
PEI and StackColoring don't use much information from the StackProtector pass,
so transfering the required information to MachineFrameInfo is cleaner than
keeping the StackProtector pass around. This commit moves the SSP layout
information to MFI instead of keeping it in the pass.
This patch set (D37580, D37581, D37582, D37583, D37584, D37585, D37586, D37587)
is a first draft of the pagerando implementation described in
http://lists.llvm.org/pipermail/llvm-dev/2017-June/113794.html.
Patch by Stephen Crane <sjc@immunant.com>
Differential Revision: https://reviews.llvm.org/D49256
llvm-svn: 336929
Eric Liu [Thu, 12 Jul 2018 18:32:11 +0000 (18:32 +0000)]
[Tooling] Make standalone executor support user-provided vfs.
llvm-svn: 336928
Wolfgang Pieb [Thu, 12 Jul 2018 18:18:21 +0000 (18:18 +0000)]
[DWARF v5] Generate range list tables into the .debug_rnglists section. No support for split DWARF
and no use of DW_FORM_rnglistx with the DW_AT_ranges attribute.
Reviewer: aprantl
Differential Revision: https://reviews.llvm.org/D49214
llvm-svn: 336927
Matt Morehouse [Thu, 12 Jul 2018 18:09:03 +0000 (18:09 +0000)]
[libFuzzer] Use lld-available for gc-sections.test.
The lld feature is never available for libFuzzer tests, so
gc-sections.test never actually runs.
llvm-svn: 336926
Craig Topper [Thu, 12 Jul 2018 18:04:05 +0000 (18:04 +0000)]
[X86] Connect the flags user from PCMPISTR instructions to the correct node from the instruction.
We were accidentally connecting it to result 0 instead of result 1. This was caught by the machine verifier that noticed the flags were dead, but we were using them somehow. I'm still not clear what actually happened downstream.
llvm-svn: 336925
Craig Topper [Thu, 12 Jul 2018 18:03:56 +0000 (18:03 +0000)]
[X86][FastISel] Choose EVEX instructions when possible when lowering x86_sse_cvttss2si and similar intrinsics.
This should fix a machine verifier error.
llvm-svn: 336924
Galina Kistanova [Thu, 12 Jul 2018 17:58:10 +0000 (17:58 +0000)]
Reverted r336805 as it broke llvm-clang-x86_64-expensive-checks-win build bot
llvm-svn: 336923
Nicolas Lesser [Thu, 12 Jul 2018 17:43:49 +0000 (17:43 +0000)]
[C++11] Fix warning when dropping cv-qualifiers when assigning to a reference with a braced initializer list
llvm-svn: 336922
Stephen Hines [Thu, 12 Jul 2018 17:42:17 +0000 (17:42 +0000)]
Add --strip-all option back to llvm-strip.
Summary:
This option appears to have been dropped as part of the refactoring in
r331663. Unfortunately, if we want to use llvm-strip as a drop-in
replacement for strip, this option should still be available.
Reviewers: alexshap
Reviewed By: alexshap
Subscribers: meikeb, kongyi, chh, jakehehrlich, llvm-commits, pirama
Differential Revision: https://reviews.llvm.org/D49226
llvm-svn: 336921
Bruno Cardoso Lopes [Thu, 12 Jul 2018 17:38:48 +0000 (17:38 +0000)]
Revert "[modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOpts"
This reverts commit
f40124d4f05ecf4f880cf4e8f26922d861f705f3 / r336660.
This change shouldn't be affecting `@import` behavior, but turns out it is:
https://ci.swift.org/view/swift-master-next/job/oss-swift-incremental-RA-osx-master-next/2800/consoleFull#-
12570166563122a513-f36a-4c87-8ed7-
cbc36a1ec144
Working on a reduced testcase for this, reverting in the meantime.
rdar://problem/
42102222
llvm-svn: 336920
Ben Hamilton [Thu, 12 Jul 2018 17:32:55 +0000 (17:32 +0000)]
[clang-tidy/ObjC] Add SQL to list of acronyms
Summary: SQL is a common acronym.
Reviewers: Wizard, hokein
Reviewed By: Wizard, hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49190
llvm-svn: 336919
Leonard Mosescu [Thu, 12 Jul 2018 17:27:18 +0000 (17:27 +0000)]
Restructure the minidump loading path and add early & explicit consistency checks
Corrupted minidumps was leading to unpredictable behavior.
This change adds explicit consistency checks for the minidump early on. The
checks are not comprehensive but they should catch obvious structural violations:
streams with type == 0
duplicate streams (same type)
overlapping streams
truncated minidumps
Another early check is to make sure we actually support the minidump architecture
instead of crashing at a random place deep inside LLDB.
Differential Revision: https://reviews.llvm.org/D49202
llvm-svn: 336918
Roman Lebedev [Thu, 12 Jul 2018 17:00:11 +0000 (17:00 +0000)]
[NFC][X86][AArch64] Add tests for the 'check for [no] signed truncation' pattern
Summary:
[[ https://bugs.llvm.org/show_bug.cgi?id=38149 | PR38149 ]]
As discussed in https://reviews.llvm.org/D49179#1158957 and later,
the IR can be improved:
https://rise4fun.com/Alive/gBf
^ that pattern will be produced by Implicit Integer Truncation sanitizer,
https://reviews.llvm.org/D48958
https://bugs.llvm.org/show_bug.cgi?id=21530
in signed case, therefore it is probably a good idea to improve it.
But as it looks from these tests,
i think we want to revert at least some cases in DAGCombine.
Reviewers: spatel, craig.topper, RKSimon, javed.absar
Reviewed By: spatel
Subscribers: kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D49247
llvm-svn: 336917
Matt Davis [Thu, 12 Jul 2018 16:56:17 +0000 (16:56 +0000)]
[llvm-mca] Simplify eventing by adding an onEvent templated method.
Summary:
This patch eliminates some redundancy in iterating across Listeners for the
Instruction and Stall HWEvents, by introducing a template onEvent routine.
This change was suggested by @courbet in https://reviews.llvm.org/D48576. I
hope that this patch addresses that suggestion appropriately. I do like this
change better than what we had previously.
Reviewers: andreadb, courbet, RKSimon
Reviewed By: andreadb, courbet
Subscribers: javed.absar, tschuett, gbedwell, llvm-commits, courbet
Differential Revision: https://reviews.llvm.org/D48672
llvm-svn: 336916
Alexey Bataev [Thu, 12 Jul 2018 15:18:28 +0000 (15:18 +0000)]
[OPENMP, NVPTX] Fix loop boundaries calculation for dynamic loops.
Summary:
Patch fixes the next problems.
1. Removes unused functions from omptarget_nvptx_ThreadPrivateContext
class + simplified data members.
2. Fixed calculation of loop boundaries for dynamic loops with static
scheduling.
3. Introduced saving/restoring of the dynamic loop boundaries to support
several nested parallel dynamic loops.
Reviewers: grokos
Subscribers: guansong, kkwli0, openmp-commits
Differential Revision: https://reviews.llvm.org/D49241
llvm-svn: 336915
Sjoerd Meijer [Thu, 12 Jul 2018 14:59:02 +0000 (14:59 +0000)]
Follow up of r336913: forgot to add the new test files.
llvm-svn: 336914
Sjoerd Meijer [Thu, 12 Jul 2018 14:57:59 +0000 (14:57 +0000)]
[AArch64] Armv8.4-A: LDAPR & STLR with immediate offset instructions
These instructions are added to AArch64 only.
llvm-svn: 336913
Roman Lebedev [Thu, 12 Jul 2018 14:56:17 +0000 (14:56 +0000)]
[InstCombine] icmp-logical.ll: restore the original intention of the test.
While that fold is clearly not happening [anymore],
we do now have separate test cases for these cases,
so we should be ok to slightly adjust these tests
to not potentially loose test coverage.
As suggested by Hiroshi Yamauchi in
https://reviews.llvm.org/D49179#1159345
llvm-svn: 336912
Roman Lebedev [Thu, 12 Jul 2018 14:56:12 +0000 (14:56 +0000)]
[InstCombine] Fold x & (-1 >> y) != x to x u> (-1 >> y)
Summary:
A complementary fold to D49179.
https://bugs.llvm.org/show_bug.cgi?id=38123
https://rise4fun.com/Alive/Rny
Caveat: one more thing in `test/Transforms/InstCombine/icmp-logical.ll` breaks.
Reviewers: spatel, craig.topper
Reviewed By: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49205
llvm-svn: 336911
Eric Liu [Thu, 12 Jul 2018 14:54:25 +0000 (14:54 +0000)]
[Tooling] Get working directory properly without assuming real file system.
llvm-svn: 336910
Sam McCall [Thu, 12 Jul 2018 14:49:52 +0000 (14:49 +0000)]
[clangd] Extract FileSystemProvider into a separate header. NFC
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: mgorny, ioeric, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D49142
llvm-svn: 336909
Andrew Ng [Thu, 12 Jul 2018 14:40:21 +0000 (14:40 +0000)]
[ThinLTO] Escape module paths when printing
We have located a bug in AssemblyWriter::printModuleSummaryIndex(). This
function outputs path strings incorrectly. Backslashes in the strings
are not correctly escaped.
Consequently, if a path name contains a backslash followed by two
hexadecimal characters, the sequence is incorrectly interpreted when the
output is read by another component. This mangles the path and results
in error.
This patch fixes this issue by calling printEscapedString() to output
the module paths.
Patch by Chris Jackson.
Differential Revision: https://reviews.llvm.org/D49090
llvm-svn: 336908
Francis Visoiu Mistrih [Thu, 12 Jul 2018 14:36:48 +0000 (14:36 +0000)]
[DebugInfo][X86] Add start-after flags to MIR tests
These tests would fail with -verify-machineinstrs because the MI
generated from the IR would be merged with the one already in the MIR
files, and we get the following error:
```
*** Bad machine code: Function has NoVRegs property but there are VReg operands ***
- function: f
```
Differential Revision: https://reviews.llvm.org/D49191
llvm-svn: 336907
Francis Visoiu Mistrih [Thu, 12 Jul 2018 14:36:43 +0000 (14:36 +0000)]
[XRay] Fix machine verifier issues in X86
I'm not sure if this fix is the right thing to do, but it seemed to me
that PATCHABLE_RET and PATCHABLE_TAIL_CALL don't have any defs.
Running the following:
```
LLVM_ENABLE_MACHINE_VERIFIER=1 ./build/bin/llvm-lit -v -a test/CodeGen/X86/xray-*
```
results in the following tests to fail (along others):
```
LLVM :: CodeGen/X86/xray-attribute-instrumentation.ll
LLVM :: CodeGen/X86/xray-custom-log.ll
LLVM :: CodeGen/X86/xray-log-args.ll
LLVM :: CodeGen/X86/xray-loop-detection.ll
LLVM :: CodeGen/X86/xray-multiplerets-in-blocks.mir
LLVM :: CodeGen/X86/xray-section-group.ll
LLVM :: CodeGen/X86/xray-selective-instrumentation.ll
LLVM :: CodeGen/X86/xray-tail-call-sled.ll
LLVM :: CodeGen/X86/xray-typed-event-log.ll
```
The errors are:
```
*** Bad machine code: Explicit definition must be a register ***
- function: fn
- basic block: %bb.0 (0x7fa31a84d908)
- instruction: PATCHABLE_RET 2560, $eax
- operand 0: 2560
```
and
```
*** Bad machine code: Explicit definition must be a register ***
- function: caller
- basic block: %bb.0 (0x7fbff3044108)
- instruction: PATCHABLE_TAIL_CALL 3009, @callee, <regmask $bh $bl $bp $bph $bpl $bx $ebp $ebx $hbp $hbx $rbp $rbx $r12 $r13 $r14 $r15 $r12b $r13b $r14b $r15b $r12bh $r13bh $r14bh $r15bh $r12d $r13d $r14d $r15d $r12w $r13w $r14w $r15w $r12wh and 3 more...>, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp, implicit $edi
- operand 0: 3009
```
Differential Revision: https://reviews.llvm.org/D49187
llvm-svn: 336906
Dan Liew [Thu, 12 Jul 2018 13:48:18 +0000 (13:48 +0000)]
[CMake] Remove unnecesary list of source files for Xray unit tests.
The list duplicates information already available in the parent
directory so use that instead. It is unclear to me why we need
to spell out the dependencies explicitly but fixing that should
be done in a separate patch.
Differential Revision: https://reviews.llvm.org/D49177
llvm-svn: 336905
Dan Liew [Thu, 12 Jul 2018 13:36:44 +0000 (13:36 +0000)]
[CMake] Rename `SANITIZER_HEADERS` to `SANITIZER_IMPL_HEADERS` under `lib/sanitizer_common`.
The variable name `SANITIZER_HEADERS` is already used for the list of
public headers in `include/CMakeLists.txt`. Although the previous
implementation worked it's probably best to avoid shadowing global
variables to avoid confusion.
Differential Revision: https://reviews.llvm.org/D49176
llvm-svn: 336904
Simon Pilgrim [Thu, 12 Jul 2018 13:29:41 +0000 (13:29 +0000)]
[X86][SSE] Utilize ZeroableElements for canWidenShuffleElements
canWidenShuffleElements can do a better job if given a mask with ZeroableElements info. Apparently, ZeroableElements was being only used to identify AllZero candidates, but possibly we could plug it into more shuffle matchers.
Original Patch by Zvi Rackover @zvi
Differential Revision: https://reviews.llvm.org/D42044
llvm-svn: 336903
Chen Zheng [Thu, 12 Jul 2018 13:28:20 +0000 (13:28 +0000)]
[InstCombine]add testcases for folding more SPFofSPF pattern
Differential Revision: https://reviews.llvm.org/D49222
llvm-svn: 336902
Kristof Umann [Thu, 12 Jul 2018 13:13:46 +0000 (13:13 +0000)]
[analyzer][UninitializedObjectChecker] Moved non-member functions out of the anonymous namespace
As the code for the checker grew, it became increasinly difficult to see
whether a function was global or statically defined. In this patch,
anything that isn't a type declaration or definition was moved out of the
anonymous namespace and is marked as static.
llvm-svn: 336901
Simon Pilgrim [Thu, 12 Jul 2018 13:03:58 +0000 (13:03 +0000)]
[X86][AVX] Use Zeroable mask to improve shuffle mask widening
Noticed while updating D42044, lowerV2X128VectorShuffle can improve the shuffle mask with the zeroable data to create a target shuffle mask to recognise more 'zero upper 128' patterns.
NOTE: lowerV4X128VectorShuffle could benefit as well but the code needs refactoring first to discriminate between SM_SentinelUndef and SM_SentinelZero for negative shuffle indices.
Differential Revision: https://reviews.llvm.org/D49092
llvm-svn: 336900
Sam McCall [Thu, 12 Jul 2018 11:52:18 +0000 (11:52 +0000)]
[clangd] log request/response messages with method/ID/error at INFO level
Summary: Bodies are logged at VERBOSE level (since r336785), tweak the formatting.
Reviewers: hokein
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D49224
llvm-svn: 336899
Gabor Marton [Thu, 12 Jul 2018 11:50:21 +0000 (11:50 +0000)]
[ASTImporter] Fix infinite recursion on function import with struct definition in parameters
Summary:
Importing a function having a struct definition in the parameter list
causes a crash in the importer via infinite recursion. This patch avoids
the crash and reports such functions as not supported. Unit tests make
sure that normal struct definitions inside function bodies work normally
on the other hand and LLDB-like type imports also do.
Reviewers: a.sidorin, martong
Differential Revision: https://reviews.llvm.org/D47946
Patch by Zoltan Gera!
llvm-svn: 336898
David Green [Thu, 12 Jul 2018 10:44:47 +0000 (10:44 +0000)]
[UnJ] Use SmallPtrSets for block collections. NFC
We no longer care about the order of blocks in these collections,
so can change to SmallPtrSets, making contains checks quicker.
Differential revision: https://reviews.llvm.org/D49060
llvm-svn: 336897
Gabor Marton [Thu, 12 Jul 2018 09:42:05 +0000 (09:42 +0000)]
[ASTImporter] Refactor Decl creation
Summary:
Generalize the creation of Decl nodes during Import. With this patch we do the
same things after and before a new AST node is created (::Create) The import
logic should be really simple, we create the node, then we mark that as
imported, then we recursively import the parts for that node and then set them
on that node. However, the AST is actually a graph, so we have to handle
circles. If we mark something as imported (`MapImported()`) then we return with
the corresponding `To` decl whenever we want to import that node again, this way
circles are handled. In order to make this algorithm work we must ensure
things, which are handled in the generic CreateDecl<> template:
* There are no `Import()` calls in between any node creation (::Create)
and the `MapImported()` call.
* Before actually creating an AST node (::Create), we must check if
the Node had been imported already, if yes then return with that one.
One very important case for this is connected to templates: we may
start an import both from the templated decl of a template and from
the template itself.
Now, the virtual `Imported` function is called in `ASTImporter::Impor(Decl *)`,
but only once, when the `Decl` is imported. One point of this refactor is to
separate responsibilities. The original `Imported()` had 3 responsibilities:
- notify subclasses when an import happened
- register the decl into `ImportedDecls`
- initialise the Decl (set attributes, etc)
Now all of these are in separate functions:
- `Imported`
- `MapImported`
- `InitializeImportedDecl`
I tried to check all the clients, I executed tests for `ExternalASTMerger.cpp`
and some unittests for lldb.
Reviewers: a.sidorin, balazske, xazax.hun, r.stahl
Subscribers: rnkovacs, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D47632
llvm-svn: 336896
Simon Pilgrim [Thu, 12 Jul 2018 09:10:55 +0000 (09:10 +0000)]
Fix -Wdocumentation warnings. NFCI.
llvm-svn: 336895
Simon Pilgrim [Thu, 12 Jul 2018 09:04:28 +0000 (09:04 +0000)]
[X86] Add UDIV by uniform/non-uniform constant tests
llvm-svn: 336894
Simon Atanasyan [Thu, 12 Jul 2018 08:50:11 +0000 (08:50 +0000)]
[mips] Mark standard encoded instructions as not being in MIPS16e
Mark standard encoded instructions and pseudo "standard encoded"
as not being in MIPS16e by default.
Patch by Simon Dardis.
Differential revision: https://reviews.llvm.org/D48379
llvm-svn: 336893
George Rimar [Thu, 12 Jul 2018 08:33:02 +0000 (08:33 +0000)]
[ELF] - Simplify code. NFC.
Just use getDataAs for taking sections contents.
llvm-svn: 336892
George Rimar [Thu, 12 Jul 2018 08:12:08 +0000 (08:12 +0000)]
[ELF] - Eliminate dead code. NFC.
Code is dead because caller of the isDuplicateArmExidxSex
(https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L1446)
explicitly does not pass sentinel. So no reason to check it.
llvm-svn: 336891
Sam McCall [Thu, 12 Jul 2018 08:00:21 +0000 (08:00 +0000)]
[clangd] Simplify logging wrapper after r336888
llvm-svn: 336890
Craig Topper [Thu, 12 Jul 2018 07:30:01 +0000 (07:30 +0000)]
[X86] Remove i128 type from FR128 regclass.
i128 isn't a legal type in our x86 implementation today. So remove this and the few patterns that used it until it becomes necessary.
llvm-svn: 336889
Sam McCall [Thu, 12 Jul 2018 07:11:28 +0000 (07:11 +0000)]
[Support] Require llvm::Error passed to formatv() to be wrapped in fmt_consume()
Summary:
Someone must be responsible for handling an Error. When formatv takes
ownership of an Error, the formatv_object destructor must take care of this.
Passing an error by value to formatv() is not considered explicit enough to mark
the error as handled (see D49013), so we require callers to use a format adapter
to confirm this intent.
Reviewers: zturner
Subscribers: llvm-commits, lhames
Differential Revision: https://reviews.llvm.org/D49170
llvm-svn: 336888
Stefan Granitz [Thu, 12 Jul 2018 06:41:41 +0000 (06:41 +0000)]
Fix few typos in comments (write access test commit)
llvm-svn: 336887
Chijun Sima [Thu, 12 Jul 2018 04:08:14 +0000 (04:08 +0000)]
[Dominators] Add isUpdateLazy() method to the DomTreeUpdater
Summary:
Previously, when people need to deal with DTU with different UpdateStrategy using different actions, they need to
```
if (DTU.getUpdateStrategy() == DomTreeUpdater::UpdateStrategy::Lazy) {
...
}
if (DTU.getUpdateStrategy() == DomTreeUpdater::UpdateStrategy::Eager) {
...
}
```
After the patch, they can avoid code patterns above
```
if (DTU.isUpdateLazy()){
...
}
if (!DTU.isUpdateLazy()){
...
}
```
Reviewers: kuhar, brzycki, dmgreen
Reviewed By: kuhar
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49056
llvm-svn: 336886
Eric Christopher [Thu, 12 Jul 2018 03:52:46 +0000 (03:52 +0000)]
Remove the unused m_signal member variable, but leave the code that gets it out of the json.
llvm-svn: 336885
Eric Christopher [Thu, 12 Jul 2018 03:52:45 +0000 (03:52 +0000)]
Remove unused variable m_header as it hasn't been used since it was
added in 2016.
llvm-svn: 336884
Craig Topper [Thu, 12 Jul 2018 03:42:41 +0000 (03:42 +0000)]
[X86] Remove patterns and ISD nodes for the old scalar FMA intrinsic lowering.
We now use llvm.fma.f32/f64 or llvm.x86.fmadd.f32/f64 intrinsics that use scalar types rather than vector types. So we don't these special ISD nodes that operate on the lowest element of a vector.
llvm-svn: 336883
Zachary Turner [Thu, 12 Jul 2018 03:22:39 +0000 (03:22 +0000)]
[coff] remove_dots from /PDBPATH but not /PDBALTPATH.
This more closely matches the behavior of link.exe, and also
simplifies the code slightly.
llvm-svn: 336882
Chen Zheng [Thu, 12 Jul 2018 03:06:04 +0000 (03:06 +0000)]
[InstSimplify] simplify add instruction if two operands are negative
Differential Revision: https://reviews.llvm.org/D49216
llvm-svn: 336881
Marshall Clow [Thu, 12 Jul 2018 02:55:01 +0000 (02:55 +0000)]
Turns out that wide literals U"xxx" and u"xxx" are c++11 and later.
llvm-svn: 336880
Fangrui Song [Thu, 12 Jul 2018 02:03:53 +0000 (02:03 +0000)]
[AsmParser] Fix inconsistent declaration parameter name
llvm-svn: 336879
Dean Michael Berris [Thu, 12 Jul 2018 01:54:29 +0000 (01:54 +0000)]
[XRay][compiler-rt] Fixup: require x86_64 for profiling mode tests
This constrains the build environments we are testing/supporting for the runtime
tests until we can be sure xray works in more platforms.
llvm-svn: 336878
Eric Christopher [Thu, 12 Jul 2018 01:53:21 +0000 (01:53 +0000)]
Temporarily revert "Recommit r328307: [IPSCCP] Use constant range information for comparisons of parameters." as it's causing miscompiles.
A testcase was provided in the original review thread.
This reverts commit r336098.
llvm-svn: 336877
Chandler Carruth [Thu, 12 Jul 2018 01:43:21 +0000 (01:43 +0000)]
[x86] Fix another trivial bug in x86 flags copy lowering that has been
there for a long time.
The boolean tracking whether we saw a kill of the flags was supposed to
be per-block we are scanning and instead was outside that loop and never
cleared. It requires a quite contrived test case to hit this as you have
to have multiple levels of successors and interleave them with kills.
I've included such a test case here.
This is another bug found testing SLH and extracted to its own focused
patch.
llvm-svn: 336876
Craig Topper [Thu, 12 Jul 2018 00:54:40 +0000 (00:54 +0000)]
[X86] Add patterns to use VMOVSS/SD zero masking for scalar f32/f64 select with zero.
These showed up in some of the upgraded FMA code. We really need to improve these test cases more, but this helps for now.
llvm-svn: 336875
Chandler Carruth [Thu, 12 Jul 2018 00:52:50 +0000 (00:52 +0000)]
[x86] Fix EFLAGS copy lowering to correctly handle walking past uses in
multiple successors where some of the uses end up killing the EFLAGS
register.
There was a bug where rather than skipping to the next basic block
queued up with uses once we saw a kill, we stopped processing the blocks
entirely. =/
Test case produces completely nonsensical code w/o this tiny fix.
This was found testing Speculative Load Hardening and split out of that
work.
Differential Revision: https://reviews.llvm.org/D49211
llvm-svn: 336874
Zachary Turner [Thu, 12 Jul 2018 00:44:15 +0000 (00:44 +0000)]
[coff] Remove dots in path pointing to PDB file.
Some Microsoft tools (e.g. new versions of WPA) fail when the
COFF Debug Directory contains a path to the PDB that contains
dots, such as D:\foo\./bar.pdb. Remove dots before writing this
path.
This fixes pr38126.
llvm-svn: 336873
Davide Italiano [Thu, 12 Jul 2018 00:31:04 +0000 (00:31 +0000)]
[IRInterpreter] Fix misevaluation of interpretation expressions with `urem`.
Scalar::MakeUnsigned was implemented incorrectly so it didn't
really change the sign of the type (leaving signed types signed).
This showed up as a misevaluation when IR-interpreting urem but
it's likely to arise in other contexts.
This commit fixes the definition, and adds a test to make
sure this won't regress in future (hopefully).
Fixes rdar://problem/
42038760 and LLVM PR38076
Differential Revision: https://reviews.llvm.org/D49155
llvm-svn: 336872
Craig Topper [Thu, 12 Jul 2018 00:29:56 +0000 (00:29 +0000)]
[X86] Remove and autoupgrade the scalar fma intrinsics with masking.
This converts them to what clang is now using for codegen. Unfortunately, there seem to be a few kinks to work out still. I'll try to address with follow up patches.
llvm-svn: 336871
Eric Christopher [Thu, 12 Jul 2018 00:01:51 +0000 (00:01 +0000)]
Add -allow-deprecated-dag-overlap to one of the experimental webassembly target tests.
llvm-svn: 336870
Duncan P. N. Exon Smith [Wed, 11 Jul 2018 23:30:25 +0000 (23:30 +0000)]
IR: Skip -print-*-all after -print-*
This changes `-print-*` from transformation passes to analysis passes so
that `-print-after-all` and `-print-before-all` don't trigger. This
avoids some redundant output.
Patch by Son Tuan Vu!
llvm-svn: 336869
Eli Friedman [Wed, 11 Jul 2018 23:26:35 +0000 (23:26 +0000)]
[CodeGen] Emit more precise AssertZext/AssertSext nodes.
This is marginally helpful for removing redundant extensions, and the
code is easier to read, so it seems like an all-around win. In the new
test i8-phi-ext.ll, we used to emit an AssertSext i8; now we emit an
AssertZext i2, which allows the extension of the return value to be
eliminated.
Differential Revision: https://reviews.llvm.org/D49004
llvm-svn: 336868
Richard Smith [Wed, 11 Jul 2018 23:19:41 +0000 (23:19 +0000)]
Fix deduction for conversion function templates converting to reference
types.
We previously tried to use the "parameter is a reference" logic here,
but that doesn't work because it gets P and A backwards. Instead, add
a separate implementation of the "deduced A can be less qualified than
A" rule.
This also exposes that we incorrectly stripped cv-qualifiers from the
referent of A if it was a reference. However, if we don't do that, we
get the wrong results when P is a reference. In an attempt to match
what sanity dictates and what other implementations are doing, we now
remove cv-qualifiers from A and P unless both are reference types. I've
brought this up on the core reflector too, to try to get the standard
fixed.
llvm-svn: 336867
Louis Dionne [Wed, 11 Jul 2018 23:14:33 +0000 (23:14 +0000)]
[libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY
Summary:
We never actually mean to always inline a function -- all the uses of
the macro I could find are actually attempts to control the visibility
of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which
is actually always defined the same.
This change is orthogonal to the decision of what we're actually going
to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by
having one canonical way of doing things.
Note that this commit had originally been applied in r336369 and then
reverted in r336382 because of unforeseen problems. Both of these problems
have now been fixed.
Reviewers: EricWF, mclow.lists
Subscribers: christof, dexonsmith, erikvanderpoel
Differential Revision: https://reviews.llvm.org/D48892
llvm-svn: 336866
Stella Stamenova [Wed, 11 Jul 2018 22:47:35 +0000 (22:47 +0000)]
[windows] Fix out-of-memory failure in some of the tests
Summary: When ReadProcessMemory fails, bytes_read is sometimes set to a large garbage value. In that case, we need to set it back to zero before returning or the garbage value will be used to allocate memory later causing LLDB to crash with an out of memory error.
Reviewers: asmith, zturner
Reviewed By: zturner
Subscribers: zturner, asmith, stella.stamenova, llvm-commits
Differential Revision: https://reviews.llvm.org/D49159
llvm-svn: 336865
Craig Topper [Wed, 11 Jul 2018 22:35:28 +0000 (22:35 +0000)]
[LoopIdiomRecognize] Don't convert a do while loop to ctlz.
This commit suppresses turning loops like this into "(bitwidth - ctlz(input))".
unsigned foo(unsigned input) {
unsigned num = 0;
do {
++num;
input >>= 1;
} while (input != 0);
return num;
}
The loop version returns a value of 1 for both an input of 0 and an input of 1. Converting to a naive ctlz does not preserve that.
Theoretically we could do better if we checked isKnownNonZero or we could insert a select to handle the divergence. But until we have motivating cases for that, this is the easiest solution.
llvm-svn: 336864
Akira Hatanaka [Wed, 11 Jul 2018 22:19:14 +0000 (22:19 +0000)]
os_log: When there are multiple privacy annotations in the format
string, choose the strictest one instead of the last.
Also fix an undefined behavior. Move the pointer update to a later point to
avoid adding StringRef::npos to the pointer.
rdar://problem/
40706280
llvm-svn: 336863
Craig Topper [Wed, 11 Jul 2018 22:17:26 +0000 (22:17 +0000)]
[LoopIdiomRecognize] Add a test case showing a loop we turn into ctlz that we shouldn't.
This loop executes one iteration without checking the input value. This produces a count of 1 for an input of 0 and 1. We are turning this into 32 - ctlz(n), but that returns 0 if n is 0.
llvm-svn: 336862
Tom Stellard [Wed, 11 Jul 2018 22:15:15 +0000 (22:15 +0000)]
AMDGPU/SI: Initialize InstrInfo before TargetLoweringInfo in GCNSubtarget
SITargetLowering queries SIInstrInfo in its constructor, so SIInstrInfo
must be initialized first. This fixes msan buildbot failures and was
introduced by r336851.
llvm-svn: 336861
Alina Sbirlea [Wed, 11 Jul 2018 22:11:46 +0000 (22:11 +0000)]
[MemorySSA] Add APIs to move memory accesses between blocks, following CFG changes.
Summary:
The move APIs added in this patch will be used to update MemorySSA when CFG changes merge or split blocks, by moving memory accesses accordingly in MemorySSA's internal data structures.
[Split from D45299 for easier review]
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D48897
llvm-svn: 336860
Joel E. Denny [Wed, 11 Jul 2018 22:07:31 +0000 (22:07 +0000)]
[FileCheck] Add -allow-deprecated-dag-overlap to another compiler-rt test
See https://reviews.llvm.org/D47106 for details.
llvm-svn: 336859
Bill Wendling [Wed, 11 Jul 2018 21:47:55 +0000 (21:47 +0000)]
Temporarily reverting.
llvm-svn: 336858
Roman Lebedev [Wed, 11 Jul 2018 21:28:42 +0000 (21:28 +0000)]
[NFC][InstCombine] Tests for x & (-1 >> y) != x -> x u> (-1 >> y) fold
https://bugs.llvm.org/show_bug.cgi?id=38123
https://rise4fun.com/Alive/Rny
llvm-svn: 336857
Marshall Clow [Wed, 11 Jul 2018 21:22:13 +0000 (21:22 +0000)]
Same reversed ifdef happened twice. Test fix only, NFC to the library.
llvm-svn: 336856
Marshall Clow [Wed, 11 Jul 2018 21:20:42 +0000 (21:20 +0000)]
Fix a test #ifdef that was reversed. NFC to the library.
llvm-svn: 336855
Tom Stellard [Wed, 11 Jul 2018 21:12:03 +0000 (21:12 +0000)]
AMDGPU: Remove duplicate call to initializeSubtargetDependencies()
This was added in r336851.
llvm-svn: 336853
Richard Smith [Wed, 11 Jul 2018 21:07:04 +0000 (21:07 +0000)]
Fix determination of whether one set of cvr-qualifiers is compatible
with another in template argument deduction.
We happened to typically get away with getting this wrong, because the
cases where we'd produce a bogus deduction were caught by the final
"deduced A is compatible with A" check.
llvm-svn: 336852
Tom Stellard [Wed, 11 Jul 2018 20:59:01 +0000 (20:59 +0000)]
AMDGPU: Refactor Subtarget classes
Summary:
This is a follow-up to r335942.
- Merge SISubtarget into AMDGPUSubtarget and rename to GCNSubtarget
- Rename AMDGPUCommonSubtarget to AMDGPUSubtarget
- Merge R600Subtarget::Generation and GCNSubtarget::Generation into
AMDGPUSubtarget::Generation.
Reviewers: arsenm, jvesely
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D49037
llvm-svn: 336851
Eugene Zelenko [Wed, 11 Jul 2018 20:56:26 +0000 (20:56 +0000)]
[Documentation] Fix incorrect documentation references, new checks order in Release Notes
llvm-svn: 336850
Eugene Zelenko [Wed, 11 Jul 2018 20:41:16 +0000 (20:41 +0000)]
[Documentation] Link format and order of Clang-tidy changes in Release Notes
llvm-svn: 336849
Joel E. Denny [Wed, 11 Jul 2018 20:31:51 +0000 (20:31 +0000)]
finish: [FileCheck] Add -allow-deprecated-dag-overlap to failing llvm tests
Differential Revision: https://reviews.llvm.org/D47171
This contains the portions of that patch that could not be committed
using the git monorepo because of dos line ending problems.
llvm-svn: 336848
Joel E. Denny [Wed, 11 Jul 2018 20:27:27 +0000 (20:27 +0000)]
[FileCheck] Don't permit overlapping CHECK-DAG
That is, make CHECK-DAG skip matches that overlap the matches of any
preceding consecutive CHECK-DAG directives. This change makes
CHECK-DAG more consistent with other directives, and there is evidence
it makes CHECK-DAG more intuitive and less error-prone. See the RFC
discussion starting at:
http://lists.llvm.org/pipermail/llvm-dev/2018-May/123010.html
Moreover, this behavior enables CHECK-DAG groups for unordered,
non-unique strings or patterns. For example, it is useful for
verifying output or logs from a parallel program, such as the OpenMP
runtime.
This patch also implements the command-line option
-allow-deprecated-dag-overlap, which reverts CHECK-DAG to the old
overlapping behavior. This option should not be used in new tests.
It is meant only for the existing tests that are broken by this change
and that need time to update.
See the following bugzilla issue for tracking of such tests:
https://bugs.llvm.org/show_bug.cgi?id=37532
Patches to add -allow-deprecated-dag-overlap to those tests will
follow immediately.
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D47106
llvm-svn: 336847
Joel E. Denny [Wed, 11 Jul 2018 20:27:05 +0000 (20:27 +0000)]
[FileCheck] Add -allow-deprecated-dag-overlap to failing lldb tests
See https://reviews.llvm.org/D47106 for details.
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D49192
llvm-svn: 336846
Joel E. Denny [Wed, 11 Jul 2018 20:26:44 +0000 (20:26 +0000)]
[FileCheck] Add -allow-deprecated-dag-overlap to failing compiler-rt tests
See https://reviews.llvm.org/D47106 for details.
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D47326
llvm-svn: 336845
Joel E. Denny [Wed, 11 Jul 2018 20:26:20 +0000 (20:26 +0000)]
[FileCheck] Add -allow-deprecated-dag-overlap to failing clang tests
See https://reviews.llvm.org/D47106 for details.
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D47172
llvm-svn: 336844
Joel E. Denny [Wed, 11 Jul 2018 20:25:49 +0000 (20:25 +0000)]
[FileCheck] Add -allow-deprecated-dag-overlap to failing llvm tests
See https://reviews.llvm.org/D47106 for details.
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D47171
This commit drops that patch's changes to:
llvm/test/CodeGen/NVPTX/f16x2-instructions.ll
llvm/test/CodeGen/NVPTX/param-load-store.ll
For some reason, the dos line endings there prevent me from commiting
via the monorepo. A follow-up commit (not via the monorepo) will
finish the patch.
llvm-svn: 336843
Petr Pavlu [Wed, 11 Jul 2018 20:17:54 +0000 (20:17 +0000)]
Fix setting of empty implicit-section-name attribute
Code in `CodeGenModule::SetFunctionAttributes()` could set an empty
attribute `implicit-section-name` on a function that is affected by
`#pragma clang text="section"`. This is incorrect because the attribute
should contain a valid section name. If the function additionally also
used `__attribute__((section("section")))` then this could result in
emitting the function in a section with an empty name.
The patch fixes the issue by removing the problematic code that sets
empty `implicit-section-name` from
`CodeGenModule::SetFunctionAttributes()` because it is sufficient to set
this attribute only from a similar code in `setNonAliasAttributes()`
when the function is emitted.
Differential Revision: https://reviews.llvm.org/D48916
llvm-svn: 336842
Teresa Johnson [Wed, 11 Jul 2018 20:08:32 +0000 (20:08 +0000)]
Revert "[docs] As of binutils 2.21.51.0.2, ld.bfd supports plugins too, represent this in docs"
This reverts commit r306102.
This change was made without any review, and has a couple of issues.
First, AFAIK we do not test the combination of the LLVM gold plugin with
ld.bfd. Second, the change removed documentation for how to build gold
and replaced it with instructions for building ld.bfd.
llvm-svn: 336841
JF Bastien [Wed, 11 Jul 2018 19:51:40 +0000 (19:51 +0000)]
[NFC] typo
llvm-svn: 336840
Zaara Syeda [Wed, 11 Jul 2018 19:17:43 +0000 (19:17 +0000)]
Remove ppc64 BE XFAILs now that gcov profiling works, after starting a clean
build this time.
llvm-svn: 336839
Bill Wendling [Wed, 11 Jul 2018 19:13:26 +0000 (19:13 +0000)]
gold: Add ability to toggle function/data sections
Some programs (e.g. Linux) aren't able to handle function/data sections when
LTO is used. Thus they need a way to disable it. That can be done with these
plugin options:
-plugin-opt=-function-sections=0
-plugin-opt=-data-sections=0
llvm-svn: 336838
Fangrui Song [Wed, 11 Jul 2018 19:09:37 +0000 (19:09 +0000)]
[DebugInfo] Fix getPreviousSibling after r336823
llvm-svn: 336837