Richard Smith [Fri, 24 May 2019 01:35:07 +0000 (01:35 +0000)]
Factor out repeated code to build 'this' expressions and mark them
referenced.
llvm-svn: 361588
Artem Dergachev [Fri, 24 May 2019 01:34:26 +0000 (01:34 +0000)]
[CFG] NFC: Modernize a test file for constructor initializer CFGs.
Move FileCheck directives around so that it was easy to understand
what tests what and what effect do changes have.
Differential Revision: https://reviews.llvm.org/D61815
llvm-svn: 361587
Artem Dergachev [Fri, 24 May 2019 01:34:22 +0000 (01:34 +0000)]
[CFG] NFC: Remove implicit conversion from CFGTerminator to Stmt *.
Turn it into a variant class instead. This conversion does indeed save some code
but there's a plan to add support for more kinds of terminators that aren't
necessarily based on statements, and with those in mind it becomes more and more
confusing to have CFGTerminators implicitly convertible to a Stmt *.
Differential Revision: https://reviews.llvm.org/D61814
llvm-svn: 361586
Reid Kleckner [Fri, 24 May 2019 01:27:20 +0000 (01:27 +0000)]
[AArch64] Preserve X8 for thunks ending in variadic musttail calls
Summary:
On Windows, X8 may be used to pass in the address of an aggregate that
is returned indirectly. Therefore, it should be forwarded to variadic
musttail calls and preserved in thunks.
Fixes PR41997
Reviewers: mgrang, efriedma
Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62344
llvm-svn: 361585
Serge Pavlov [Fri, 24 May 2019 01:20:34 +0000 (01:20 +0000)]
[AArch64] Add nvcast patterns for v2f32 -> v1f64
Summary: Constant stores of f32 values can create such NvCast nodes.
Reviewers: t.p.northover
Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62285
llvm-svn: 361584
Jonas Devlieghere [Fri, 24 May 2019 01:08:54 +0000 (01:08 +0000)]
Revert "[lldb] followup fix for https://reviews.llvm.org/D62305"
This fails on the Windows bot:
cannot convert from 'initializer list' to 'lldb::thread_result_t'
llvm-svn: 361583
David Blaikie [Fri, 24 May 2019 01:05:52 +0000 (01:05 +0000)]
dwarfdump: Add a bit more DWARF64 support
This test case was incorrect because it mixed DWARF32 and DWARF64 for a
single unit (DWARF32 unit referencing a DWARF64 str_offsets section). So
fix enough of the unit parsing for DWARF64 and make the test valid.
(not sure if anyone needs DWARF64 support though - support in
libDebugInfoDWARF has been added piecemeal and LLVM doesn't produce it
at all)
llvm-svn: 361582
Eli Friedman [Fri, 24 May 2019 01:03:51 +0000 (01:03 +0000)]
Revert r361460
It regresses https://bugs.llvm.org/show_bug.cgi?id=38309 (represented
by the testcase test/Transforms/GlobalOpt/globalsra-multigep.ll).
llvm-svn: 361581
Jonas Devlieghere [Fri, 24 May 2019 00:44:33 +0000 (00:44 +0000)]
Fix integer literals which are cast to bool
This change replaces built-in types that are implicitly converted to
booleans.
Differential revision: https://reviews.llvm.org/D62284
llvm-svn: 361580
Kostya Serebryany [Fri, 24 May 2019 00:43:52 +0000 (00:43 +0000)]
[libFuzzer] when using data-flow-trace (DFT) only load the DFT for the files present in the corpus
llvm-svn: 361579
Peter Collingbourne [Fri, 24 May 2019 00:21:46 +0000 (00:21 +0000)]
llvm-objcopy: Change sectionWithinSegment() to use virtual addresses instead of file offsets for SHT_NOBITS sections.
Without this, sectionWithinSegment() will return the wrong answer for bss
sections. This doesn't seem to matter now (for non-broken ELF files), but
it will matter with a change that I'm working on.
Differential Revision: https://reviews.llvm.org/D58426
llvm-svn: 361578
Thomas Lively [Fri, 24 May 2019 00:15:04 +0000 (00:15 +0000)]
[WebAssembly] Expand more SIMD float ops
Summary: These were previously causing ISel failures.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62354
llvm-svn: 361577
Sanjay Patel [Fri, 24 May 2019 00:13:58 +0000 (00:13 +0000)]
[InstSimplify] fold insertelement-of-extractelement
This was partly handled in InstCombine (only the constant
index case), so delete that and zap it more generally in
InstSimplify.
llvm-svn: 361576
Sanjay Patel [Fri, 24 May 2019 00:11:23 +0000 (00:11 +0000)]
[InstSimplify] add tests for insert-of-extract; NFC
llvm-svn: 361575
Eric Fiselier [Fri, 24 May 2019 00:10:33 +0000 (00:10 +0000)]
Update C++2a status for destroying delete
llvm-svn: 361574
Reid Kleckner [Fri, 24 May 2019 00:02:00 +0000 (00:02 +0000)]
[COFF] Remove finalizeContents virtual method from Chunk, NFC
This only needs to be done for MergeChunks, so just do that in a
separate pass in the Writer.
This is one small step towards eliminating the vtable in Chunk.
llvm-svn: 361573
Eric Fiselier [Thu, 23 May 2019 23:46:44 +0000 (23:46 +0000)]
P0722R3: Implement library support for destroying delete
Summary:
This provides the `std::destroying_delete_t` declaration in C++2a and after. (Even when the compiler doesn't support the language feature).
However, the feature test macro `__cpp_lib_destroying_delete` is only defined when we have both language support and C++2a.
Reviewers: ldionne, ckennelly, serge-sans-paille, EricWF
Reviewed By: EricWF
Subscribers: dexonsmith, riccibruno, christof, jwakely, jdoerfert, mclow.lists, ldionne, libcxx-commits
Differential Revision: https://reviews.llvm.org/D55840
llvm-svn: 361572
Eric Fiselier [Thu, 23 May 2019 23:34:43 +0000 (23:34 +0000)]
Fix hang during constant evaluation of union assignment.
HandleUnionActiveMemberChange forgot to walk over a nop implicit
conversion node and got stuck in the process.
As a cleanup I changed the declaration of `E` so it can't
be accidentally accessed after the loop.
llvm-svn: 361571
Sanjay Patel [Thu, 23 May 2019 23:33:38 +0000 (23:33 +0000)]
[InstCombine] remove redundant fold for extractelement; NFC
The out-of-bounds index pattern is handled by InstSimplify,
so the extractelement should be eliminated next time it is
visited.
llvm-svn: 361570
Sanjay Patel [Thu, 23 May 2019 23:33:34 +0000 (23:33 +0000)]
[InstCombine] remove redundant fold for insertelement; NFC
The out-of-bounds index pattern is handled by InstSimplify.
llvm-svn: 361569
Daniel Sanders [Thu, 23 May 2019 23:02:56 +0000 (23:02 +0000)]
Break false dependencies on target libraries
Summary:
For the most part this consists of replacing ${LLVM_TARGETS_TO_BUILD} with
some combination of AllTargets* so that they depend on specific components
of a target backend rather than all of it. The overall effect of this is
that, for example, tools like opt no longer falsely depend on the
disassembler, while tools like llvm-ar no longer depend on the code
generator.
There's a couple quirks to point out here:
* AllTargetsCodeGens is a bit more prevalent than expected. Tools like dsymutil
seem to need it which I was surprised by.
* llvm-xray linked to all the backends but doesn't seem to need any of them.
It builds and passes the tests so that seems to be correct.
* I left gold out as it's not built when binutils is not available so I'm
unable to test it
Reviewers: bogner, JDevlieghere
Reviewed By: bogner
Subscribers: mehdi_amini, mgorny, steven_wu, dexonsmith, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62331
llvm-svn: 361567
Kristof Umann [Thu, 23 May 2019 22:52:09 +0000 (22:52 +0000)]
[analyzer] List checker/plugin options in 3 categories: released, alpha, developer
Same patch as D62093, but for checker/plugin options, the only
difference being that options for alpha checkers are implicitly marked
as alpha.
Differential Revision: https://reviews.llvm.org/D62093
llvm-svn: 361566
Konrad Kleine [Thu, 23 May 2019 22:39:13 +0000 (22:39 +0000)]
[lldb] followup fix for https://reviews.llvm.org/D62305
Summary:
Fixing this error on windows build bot:
```
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(21): error C2440: 'initializing': cannot convert from 'nullptr' to 'lldb::thread_result_t'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(21): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(21): error C2439: 'lldb_private::HostNativeThreadBase::m_result': member could not be initialized
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\include\lldb/Host/HostNativeThreadBase.h(48): note: see declaration of 'lldb_private::HostNativeThreadBase::m_result'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(24): error C2440: 'initializing': cannot convert from 'nullptr' to 'lldb::thread_result_t'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(24): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(24): error C2439: 'lldb_private::HostNativeThreadBase::m_result': member could not be initialized
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\include\lldb/Host/HostNativeThreadBase.h(48): note: see declaration of 'lldb_private::HostNativeThreadBase::m_result'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(40): error C2440: '=': cannot convert from 'nullptr' to 'lldb::thread_result_t'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(40): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(50): error C2440: '=': cannot convert from 'nullptr' to 'lldb::thread_result_t'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(50): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
```
see http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/5050/steps/build/logs/stdio
Reviewers: stella.stamenova, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D62337
llvm-svn: 361565
Alexey Bataev [Thu, 23 May 2019 22:30:43 +0000 (22:30 +0000)]
[OPENMP]Do not crash for const firstprivates.
If the variable is a firstprivate variable and it was not emitted beause
this a constant variable with the constant initializer, we can use the
initial value instead of the variable itself. It also fixes the problem
with the compiler crash in this case.
llvm-svn: 361564
Bob Haarman [Thu, 23 May 2019 22:28:18 +0000 (22:28 +0000)]
fix accidental implicit matches in elf-disassemble-symbol-labels-rel.test
llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-labels-rel.test
uses --implicit-check-not to verify that certain patterns do not occur
in llvm-objdump's output, except in places where they are explicitly
checked. Unfortunately, the patterns are generic enough that they may
be part of the file name which is also output by llvm-objdump. This
change matches the line with the filename explicitly so that the
implicit patterns are not applied to it.
llvm-svn: 361563
Alina Sbirlea [Thu, 23 May 2019 22:07:37 +0000 (22:07 +0000)]
Use clang_cc1 instead of clang in CodeGen test.
llvm-svn: 361562
Kristof Umann [Thu, 23 May 2019 22:07:16 +0000 (22:07 +0000)]
[analyzer] Hide developer-only checker/package options by default
These options are now only visible under
-analyzer-checker-option-help-developer.
Differential Revision: https://reviews.llvm.org/D61839
llvm-svn: 361561
Alina Sbirlea [Thu, 23 May 2019 21:52:59 +0000 (21:52 +0000)]
[NewPassManager] Add tuning option: ForgetAllSCEVInLoopUnroll [NFC].
Summary: Mirror tuning option from old pass manager in new pass manager.
Reviewers: chandlerc
Subscribers: mehdi_amini, jlebar, zzheng, dmgreen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61612
llvm-svn: 361560
Sanjay Patel [Thu, 23 May 2019 21:49:47 +0000 (21:49 +0000)]
[InstSimplify] insertelement V, undef, ? --> V
This was part of InstCombine, but it's better placed in
InstSimplify. InstCombine also had an unreachable but weaker
fold for insertelement with undef index, so that is deleted.
llvm-svn: 361559
Kristof Umann [Thu, 23 May 2019 21:46:51 +0000 (21:46 +0000)]
[analyzer] List checkers in 3 categories: released, alpha, developer
Previously, the only way to display the list of available checkers was
to invoke the analyzer with -analyzer-checker-help frontend flag. This
however wasn't really great from a maintainer standpoint: users came
across checkers meant strictly for development purposes that weren't to
be tinkered with, or those that were still in development. This patch
creates a clearer division in between these categories.
From now on, we'll have 3 flags to display the list checkers. These
lists are mutually exclusive and can be used in any combination (for
example to display both stable and alpha checkers).
-analyzer-checker-help: Displays the list for stable, production ready
checkers.
-analyzer-checker-help-alpha: Displays the list for in development
checkers. Enabling is discouraged
for non-development purposes.
-analyzer-checker-help-developer: Modeling and debug checkers. Modeling
checkers shouldn't be enabled/disabled
by hand, and debug checkers shouldn't
be touched by users.
Differential Revision: https://reviews.llvm.org/D62093
llvm-svn: 361558
Craig Topper [Thu, 23 May 2019 21:34:36 +0000 (21:34 +0000)]
[X86] Split multi-line chained assignments into single lines to avoid making clang-format create triangle shaped indentation. Simplify one if statement to remove a bunch of string matches. NFCI
We had an if statement that checked over every avx512* feature to see if it should enabled avx512f. Since they are all prefixed with avx512 just check for that instead.
llvm-svn: 361557
Peter Collingbourne [Thu, 23 May 2019 21:30:30 +0000 (21:30 +0000)]
ELF: Remove a comparison against In.EhFrame. NFCI.
This won't work once we have multiple .eh_frame sections.
Differential Revision: https://reviews.llvm.org/D62280
llvm-svn: 361556
J. Ryan Stinnett [Thu, 23 May 2019 21:13:50 +0000 (21:13 +0000)]
[NFC] Add blank line (test commit)
llvm-svn: 361555
Craig Topper [Thu, 23 May 2019 21:04:01 +0000 (21:04 +0000)]
[TTI] Fix some typos in comments. NFC
'implementaion' -> 'implementation'
'non-unform' -> 'non-uniform'
'mimimum' -> 'minimum'
Patch by Pavel Samolysov
Differential Revision: https://reviews.llvm.org/D62136
llvm-svn: 361554
Kit Barton [Thu, 23 May 2019 20:53:05 +0000 (20:53 +0000)]
Revert [LOOPINFO] Extend Loop object to add utilities to get the loop bounds, step, induction variable, and guard branch.
This reverts r361517 (git commit
2049e4dd8f61100f88f14db33bd95d197bcbfbbc)
llvm-svn: 361553
Kristof Umann [Thu, 23 May 2019 20:47:28 +0000 (20:47 +0000)]
[analyzer] Add a new frontend flag to display all checker options
Add the new frontend flag -analyzer-checker-option-help to display all
checker/package options.
Differential Revision: https://reviews.llvm.org/D57858
llvm-svn: 361552
Tamas Zolnai [Thu, 23 May 2019 20:29:04 +0000 (20:29 +0000)]
[clang-tidy]: Add cert-oop54-cpp alias for bugprone-unhandled-self-assignment
Summary:
Added WarnOnlyIfThisHasSuspiciousField option to allow
to catch any copy assignment operator independently from
the container class's fields.
Added the cert alias using this option.
Reviewers: aaron.ballman
Reviewed By: aaron.ballman
Subscribers: mgorny, Eugene.Zelenko, xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62192
llvm-svn: 361550
Reid Kleckner [Thu, 23 May 2019 20:26:41 +0000 (20:26 +0000)]
[COFF] Move KeepUnique bit from Chunk to SectionChunk, NFC
The KeepUnique bit is used during ICF, which only operates on
SectionChunks, so only SectionChunks need it. This frees up a byte in
Chunk, which I plan to use in a follow-up change.
llvm-svn: 361549
Jonas Devlieghere [Thu, 23 May 2019 20:25:49 +0000 (20:25 +0000)]
[Process] Fix another thread_result_t & nullptr incompatibility.
llvm-svn: 361548
Sanjay Patel [Thu, 23 May 2019 20:17:25 +0000 (20:17 +0000)]
[DAGCombiner] make folds of binops safe for opcodes that produce >1 value
This is no-functional-change-intended currently because the definition
of isBinOp() only includes opcodes that produce 1 value. But if we
share that implementation with isCommutativeBinOp() as proposed in
D62191, then we need to make sure that the callers bail out for
opcodes that they are not prepared to handle correctly.
llvm-svn: 361547
Jorge Gorbe Moya [Thu, 23 May 2019 20:11:17 +0000 (20:11 +0000)]
[lldb] Make sure RegularExpression constructors always initialize member variables
The copy constructor of RegularExpression doesn't initialize m_comp_err. This causes an use-of-initialized-value error when a RegularExpression is copied: the copy constructor calls Compile, which calls Free to free the existing regex if needed, which in turn reads m_comp_err to check if there's any regex to be freed.
This change calls the default constructor from the other constructors to make sure members are always initialized with sensible values. This also avoids duplicating init logic, like the RegularExpression(llvm:StringRef) constructor does, which is error prone.
Differential Revision: https://reviews.llvm.org/D62334
llvm-svn: 361546
Simon Pilgrim [Thu, 23 May 2019 20:07:27 +0000 (20:07 +0000)]
Fix sphinx unknown document error
llvm-svn: 361545
Jonas Devlieghere [Thu, 23 May 2019 20:05:21 +0000 (20:05 +0000)]
[Utility] Avoid a few unnecessary copies (NFC)
Avoid unnecessary copies by either passing by const-reference or moving
the argument.
llvm-svn: 361544
Roman Lebedev [Thu, 23 May 2019 19:54:41 +0000 (19:54 +0000)]
UpdateTestChecks: ppc32 triple support
Summary:
Appears identical to powerpc64{,le}.
Regenerate test that is being affected by upcoming patch.
Reviewers: RKSimon
Reviewed By: RKSimon
Subscribers: nemanjai, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62339
llvm-svn: 361543
Alina Sbirlea [Thu, 23 May 2019 19:51:16 +0000 (19:51 +0000)]
Update breaking test.
llvm-svn: 361542
Matt Arsenault [Thu, 23 May 2019 19:38:14 +0000 (19:38 +0000)]
AMDGPU: Correct maximum possible private allocation size
We were assuming a much larger possible per-wave visible stack
allocation than is possible:
https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/
faa3ae51388517353afcdaf9c16621f879ef0a59/src/core/runtime/amd_gpu_agent.cpp#L70
Based on this, we can assume the high 15 bits of a frame index or sret
are 0. The frame index value is the per-lane offset, so the maximum
frame index value is MAX_WAVE_SCRATCH / wavesize.
Remove the corresponding subtarget feature and option that made
this configurable.
llvm-svn: 361541
Alina Sbirlea [Thu, 23 May 2019 19:35:40 +0000 (19:35 +0000)]
[NewPassManager] Add tuning option: LoopUnrolling [NFC].
Summary: Mirror tuning option from old pass manager in new pass manager.
Reviewers: chandlerc
Subscribers: jlebar, dmgreen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61618
llvm-svn: 361540
Jonas Devlieghere [Thu, 23 May 2019 19:32:46 +0000 (19:32 +0000)]
[gdb-remote] Fix more issues with thread_result_t
More fixes needed to un-break the Windows bot.
llvm-svn: 361539
Roman Lebedev [Thu, 23 May 2019 19:15:05 +0000 (19:15 +0000)]
[NFC] UpdateTestChecks: asm.py: fix whitespace issue
llvm-svn: 361538
Alina Sbirlea [Thu, 23 May 2019 19:07:41 +0000 (19:07 +0000)]
[SLPVectorizer] Set flag to previous default.
Summary:
The refactoring in r360276 moved the `RunSLPVectorization` flag and added the default explicitly. The default should have been `false`, as before.
The new pass manager used to have SLPVectorization on by default, now it's off in opt, and needs D61617 checked in to enable it in clang.
Reviewers: chandlerc
Subscribers: mehdi_amini, jlebar, eraman, steven_wu, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61955
llvm-svn: 361537
Thomas Lively [Thu, 23 May 2019 18:55:00 +0000 (18:55 +0000)]
Fix unresolved symbols when linking tools/clang/unittests/Tooling/ToolingTests
Summary: Add correct cmake dependencies so that `ToolingTests` link
successfully.
Patch by Guanzhong Chen
Reviewers: tlively, aheejin
Reviewed By: tlively
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62333
llvm-svn: 361536
Chris Bieneman [Thu, 23 May 2019 18:51:52 +0000 (18:51 +0000)]
[CMake] Fixing errors in r361513
Summary:
I somehow messed this up. libcxx appends the subdirectories itself, so we don't need to add them here.
Also, r361513 broke the "projects" build of libcxx because it always included the extra targets.
Reviewers: lebedev.ri, mclow.lists
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62336
llvm-svn: 361535
Alina Sbirlea [Thu, 23 May 2019 18:51:02 +0000 (18:51 +0000)]
[NewPassManager] Add tuning option: SLPVectorization [clang-change]
Summary:
NewPassManager is not using CodeGenOpts values before this patch.
[to be coupled with D61616]
Reviewers: chandlerc
Subscribers: jlebar, cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61617
llvm-svn: 361534
Sanjay Patel [Thu, 23 May 2019 18:46:03 +0000 (18:46 +0000)]
[InstCombine] be more careful when transforming a shuffle mask
This is reduced from a fuzzer test:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14890
Usually, demanded elements should be able to simplify shuffle
mask elements that are pointing to undef elements of its source
operands, but that doesn't happen in the test case.
llvm-svn: 361533
Jordan Rupprecht [Thu, 23 May 2019 18:43:19 +0000 (18:43 +0000)]
[git] Be more specific when looking for llvm-svn
Summary:
A commit may, for some reason, have `llvm-svn:` in it multiple times. It may even take up the whole line and look identical to what gets added automatically when svn commits land in github.
To workaround this, make changes to both lookups:
1) When doing the git -> svn lookup, make sure to go through the whole message, and:
a) Only look for llvm-svn starting at the beginning of the line (excluding the whitespace that `git log` adds).
b) Take the last one (at the end of the commit message), if there are multiple matches.
2) When doing the svn -> git lookup, look through a sizeable but still reasonably small number of git commits (10k, about 4-5 months right now), and:
a) Only consider commits with the '^llvm-svn: NNNNNN' we expect, and
b) Only consider those that also follow the same git -> svn matching above. (Error if it's not exactly one commit).
Reviewers: jyknight
Reviewed By: jyknight
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60017
llvm-svn: 361532
Antonio Afonso [Thu, 23 May 2019 18:35:54 +0000 (18:35 +0000)]
Test commit access by removing a empty line
llvm-svn: 361531
Reid Kleckner [Thu, 23 May 2019 18:35:43 +0000 (18:35 +0000)]
[Driver] Move the "-o OUT -x TYPE SRC.c" flags to the end of -cc1
New -cc1 arguments, such as -faddrsig, have started appearing after the
input name. I personally find it convenient for the input to be the last
argument to the compile command line, since I often need to edit it when
running crash reproduction scripts.
Differential Revision: https://reviews.llvm.org/D62270
llvm-svn: 361530
Alexey Bataev [Thu, 23 May 2019 18:19:54 +0000 (18:19 +0000)]
[OPENMP]Simplify codegen for the outlined regions.
Simplified codegen for the outlined regions, excluding duplication code
for handling variables with the reference types.
llvm-svn: 361529
Jonas Devlieghere [Thu, 23 May 2019 18:15:43 +0000 (18:15 +0000)]
[HostNativeThreadBase] Undo nullptr changes
The thread result type is an unsigned instead of a pointer on windows,
so we shouldn't replace 0 with nullptr here.
llvm-svn: 361528
Robert Lougher [Thu, 23 May 2019 18:15:12 +0000 (18:15 +0000)]
Resubmit r360436 "[X86] Avoid SFB - Fix inconsistent codegen with/without debug info"
Fixes https://bugs.llvm.org/show_bug.cgi?id=40969
The functions findPotentiallyBlockedCopies and buildCopy are currently not
accounting for the presence of debug instructions. In the former this results
in the optimization not being trigerred, and in the latter results in
inconsistent codegen.
This patch enables the optimization to be performed in a debug build and
ensures the codegen is consistent with non-debug builds.
Patch by Chris Dawson.
Differential Revision: https://reviews.llvm.org/D61680
llvm-svn: 361527
Thomas Lively [Thu, 23 May 2019 18:09:26 +0000 (18:09 +0000)]
[WebAssembly] Implement ReplaceNodeResults to fix a SIMD crash
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61037
llvm-svn: 361526
Roman Lebedev [Thu, 23 May 2019 18:08:26 +0000 (18:08 +0000)]
[NFC][PPC] Autogenerate vec_add_sub_quadword.ll test
Being affected by (sub %x, C) -> add %X, (sub 0, C) 'for vectors' patch.
llvm-svn: 361525
Roman Lebedev [Thu, 23 May 2019 18:08:21 +0000 (18:08 +0000)]
[NFC][PPC] Autogenerate vec_add_sub_doubleword.ll test
Being affected by (sub %x, C) -> add %X, (sub 0, C) 'for vectors' patch.
llvm-svn: 361524
Roman Lebedev [Thu, 23 May 2019 18:08:17 +0000 (18:08 +0000)]
[NFC][Mips] Autogenerate msa/i5-s.ll test
Being affected by (sub %x, C) -> add %X, (sub 0, C) 'for vectors' patch.
llvm-svn: 361523
Roman Lebedev [Thu, 23 May 2019 18:08:13 +0000 (18:08 +0000)]
[NFC][Mips] Autogenerate msa/arithmetic.ll test
Being affected by (sub %x, C) -> add %X, (sub 0, C) 'for vectors' patch.
llvm-svn: 361522
Roman Lebedev [Thu, 23 May 2019 18:08:00 +0000 (18:08 +0000)]
UpdateTestChecks: -march=mips/-march=mipsel is mips triple.
Again, a mixture of march and triple, with majority being march:
llvm/test/CodeGen/Mips$ grep -ri triple | wc -l
818
llvm/test/CodeGen/Mips$ grep -ri march | wc -l
1457
llvm-svn: 361521
Nico Weber [Thu, 23 May 2019 18:01:16 +0000 (18:01 +0000)]
gn build: Merge r361418 more
llvm-svn: 361520
Matt Arsenault [Thu, 23 May 2019 17:58:48 +0000 (17:58 +0000)]
AMDGPU/GlobalISel: Legality for integer min/max
llvm-svn: 361519
Nico Weber [Thu, 23 May 2019 17:58:33 +0000 (17:58 +0000)]
lld-link, clang: Treat non-existent input files as possible spellos for option flags
OptTable treats arguments starting with / that aren't a known option
as filenames. This means lld-link's and clang-cl's typo correction for
unknown flags didn't do spell checking for misspelled options that start
with /.
I first tried changing OptTable, but that got pretty messy, see PR41787
comments 2 and 3.
Instead, let lld-link's and clang's (including clang-cl's) "file not
found" diagnostic check if a non-existent file looks like it could be a
mis-spelled option, and if so add a "did you mean" suggestion to the
"file not found" diagnostic.
While here, make formatting of a few diagnostics a bit more
self-consistent.
Fixes PR41787.
Differential Revision: https://reviews.llvm.org/D62276
llvm-svn: 361518
Kit Barton [Thu, 23 May 2019 17:56:35 +0000 (17:56 +0000)]
[LOOPINFO] Extend Loop object to add utilities to get the loop bounds, step, induction variable, and guard branch.
Summary:
This PR extends the loop object with more utilities to get loop bounds, step, induction variable, and guard branch. There already exists passes which try to obtain the loop induction variable in their own pass, e.g. loop interchange. It would be useful to have a common area to get these information. Moreover, loop fusion (https://reviews.llvm.org/D55851) is planning to use getGuard() to extend the kind of loops it is able to fuse, e.g. rotated loop with non-constant upper bound, which would have a loop guard.
/// Example:
/// for (int i = lb; i < ub; i+=step)
/// <loop body>
/// --- pseudo LLVMIR ---
/// beforeloop:
/// guardcmp = (lb < ub)
/// if (guardcmp) goto preheader; else goto afterloop
/// preheader:
/// loop:
/// i1 = phi[{lb, preheader}, {i2, latch}]
/// <loop body>
/// i2 = i1 + step
/// latch:
/// cmp = (i2 < ub)
/// if (cmp) goto loop
/// exit:
/// afterloop:
///
/// getBounds
/// getInitialIVValue --> lb
/// getStepInst --> i2 = i1 + step
/// getStepValue --> step
/// getFinalIVValue --> ub
/// getCanonicalPredicate --> '<'
/// getDirection --> Increasing
/// getGuard --> if (guardcmp) goto loop; else goto afterloop
/// getInductionVariable --> i1
/// getAuxiliaryInductionVariable --> {i1}
/// isCanonical --> false
Committed on behalf of @Whitney (Whitney Tsang).
Reviewers: kbarton, hfinkel, dmgreen, Meinersbur, jdoerfert, syzaara, fhahn
Reviewed By: kbarton
Subscribers: tvvikram, bmahjour, etiotto, fhahn, jsji, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60565
llvm-svn: 361517
Thomas Lively [Thu, 23 May 2019 17:26:47 +0000 (17:26 +0000)]
[WebAssembly] Add multivalue and tail-call target features
Summary:
These features will both be implemented soon, so I thought I would
save time by adding the boilerplate for both of them at the same time.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D62047
llvm-svn: 361516
Thomas Preud'homme [Thu, 23 May 2019 17:19:36 +0000 (17:19 +0000)]
[FileCheck] Remove llvm:: prefix
Summary:
Remove all llvm:: prefixes in FileCheck library header and
implementation except for calls to make_unique and make_shared since
both files already use the llvm namespace.
Reviewers: jhenderson, jdenny, probinson, arichardson
Subscribers: hiraditya, arichardson, probinson, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62323
llvm-svn: 361515
Yitzhak Mandelbaum [Thu, 23 May 2019 17:11:33 +0000 (17:11 +0000)]
[LibTooling] Fix dangling references in RangeSelector.
Summary:
RangeSelector had a number of cases of capturing a StringRef in a lambda, which
lead to dangling references. This change converts all uses in the API of
`StringRef` to `std::string` to avoid this problem. `std::string` in the API is
a reasonable choice, because the combinators are always storing the string
beyond the life of the combinator construction.
Reviewers: ilya-biryukov, gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62328
llvm-svn: 361514
Chris Bieneman [Thu, 23 May 2019 17:06:46 +0000 (17:06 +0000)]
[CMake] Copy C++ headers before configuring runtimes build
Summary: On some platforms C++ headers are packaged with the compiler not the sysroot. If you don't copy C++ headers into the build include directory during configuraiton of the outer build the C++ check during the runtime configuration may get inaccurate results.
Reviewers: phosek, compnerd, smeenai, EricWF
Reviewed By: compnerd
Subscribers: EricWF, christof, libcxx-commits, mgorny, llvm-commits
Tags: #llvm, #libc
Differential Revision: https://reviews.llvm.org/D62155
llvm-svn: 361513
Saleem Abdulrasool [Thu, 23 May 2019 17:03:43 +0000 (17:03 +0000)]
Transforms: lower fadd and fsub atomicrmw instructions
`fadd` and `fsub` have recently (r351850) been added as `atomicrmw`
operations. This diff adds lowering cases for them to the LowerAtomic
transform.
Patch by Josh Berdine!
llvm-svn: 361512
Ilya Biryukov [Thu, 23 May 2019 16:48:47 +0000 (16:48 +0000)]
[Index] Fix reported references in presence of template type aliases
Summary: See the added test for an example.
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62303
llvm-svn: 361511
Ilya Biryukov [Thu, 23 May 2019 16:39:26 +0000 (16:39 +0000)]
[CodeComplete] Only show lambda completions if patterns are requested
This is a trivial follow-up to r361461, so sending without review.
llvm-svn: 361510
Andrea Di Biagio [Thu, 23 May 2019 16:32:19 +0000 (16:32 +0000)]
[MCA] Add the ability to compute critical register dependency of an instruction.
This patch adds the methods `getCriticalRegDep()` and `computeCriticalRegDep()` to
class InstructionBase.
The goal is to allow users to obtain information about the critical register
dependency that most affects the latency of an instruction.
These methods are currently unused. However, the long term plan is to use them
in order to allow the computation of a critical-path as part of the bottleneck
analysis. So, this is yet another step towards fixing PR37494.
llvm-svn: 361509
Shoaib Meenai [Thu, 23 May 2019 16:29:09 +0000 (16:29 +0000)]
[AsmPrinter] Treat a narrowing PtrToInt like Trunc
When printing assembly for PtrToInt, AsmPrinter::lowerConstant
incorrectly assumed that if PtrToInt was not converting to an
int with exactly the same number of bits, it must be widening
to a larger int. But this isn't necessarily true; PtrToInt can
also shrink the size, which is useful when you want to produce
a known 32-bit pointer on a 64-bit platform (on x86_64 ELF
this yields a R_X86_64_32 relocation).
The old behavior of falling through to the widening case for a
narrowing PtrToInt yields bogus assembly code like this, which
fails to assemble because the no-op bit and it accidentally
creates is not a valid relocation:
```
.long a&-1
```
The fix is to treat a narrowing PtrToInt exactly the same as
it already treats Trunc: just emit the expression and let
the assembler deal with truncating it in the appropriate way.
Patch by Mat Hostetter <mjh@fb.com>.
Differential Revision: https://reviews.llvm.org/D61325
llvm-svn: 361508
Erich Keane [Thu, 23 May 2019 16:05:21 +0000 (16:05 +0000)]
Ensure builtins use the target default Calling Convention
r355317 changed builtins/allocation functions to use the default calling
convention in order to support platforms that use non-cdecl calling
conventions by default.
However the default calling convention is overridable on Windows 32 bit
implementations with some of the /G options. The intent is to permit the
user to set the calling convention of normal functions, however it
should NOT apply to builtins and C++ allocation functions.
This patch ensures that the builtin/allocation functions always use the
Target specific Calling Convention, ignoring the user overridden version
of said default.
llvm-svn: 361507
Fangrui Song [Thu, 23 May 2019 16:01:59 +0000 (16:01 +0000)]
[Object] object::ELFObjectFile::symbol_begin(): skip symbol index 0
For clients iterating the symbol table, none expects to handle index 0
(STN_UNDEF). Skip it to improve consistency with other binary formats.
Clients that need STN_UNDEF (e.g. lld) can use
getSectionContentsAsArray(). A test will be added in D62148.
Reviewed By: mtrent
Differential Revision: https://reviews.llvm.org/D62296
llvm-svn: 361506
Kristof Umann [Thu, 23 May 2019 15:49:04 +0000 (15:49 +0000)]
[analyzer][NFC] Prettify some RUN: lines in test files.
This is a test commit in disguise.
llvm-svn: 361505
Petr Hosek [Thu, 23 May 2019 15:23:16 +0000 (15:23 +0000)]
[Driver] Try normalized triple when looking for C++ libraries
This addresses the issue introduced in r361432 where we would only
try effective triple but not the normalized one as we do for other
runtimes.
Differential Revision: https://reviews.llvm.org/D62286
llvm-svn: 361504
Konrad Kleine [Thu, 23 May 2019 15:17:39 +0000 (15:17 +0000)]
[lldb] fix cannot convert from 'nullptr' to 'lldb::thread_result_t'
Summary:
On Windows `lldb::thread_result_t` resolves to `typedef unsigned thread_result_t;` and on other platforms it resolves to `typedef void *thread_result_t;`.
Therefore one cannot use `nullptr` when returning from a function that returns `thread_result_t`.
I've made this change because a windows build bot fails with these errors:
```
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Communication.cpp(362): error C2440: 'return': cannot convert from 'nullptr' to 'lldb::thread_result_t'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Communication.cpp(362): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
```
and
```
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1619): error C2440: 'return': cannot convert from 'nullptr' to 'lldb::thread_result_t'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1619): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1664): error C2440: 'return': cannot convert from 'nullptr' to 'lldb::thread_result_t'
E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Core\Debugger.cpp(1664): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
```
This is the failing build: http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/5035/steps/build/logs/stdio
Reviewers: JDevlieghere, teemperor, jankratochvil, labath, clayborg, RKSimon, courbet, jhenderson
Reviewed By: labath, clayborg
Subscribers: labath, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D62305
llvm-svn: 361503
Paul Robinson [Thu, 23 May 2019 15:07:46 +0000 (15:07 +0000)]
Work around a Visual C++ bug.
Using a static function as a template parameter gets a bogus compile-time
error with Visual Studio 2017, prior to version 15.8. Our current
minimum-version requirement is a particular update to VS2015, and we
assume all Visual Studio 2017 versions are usable. This patch makes the
code buildable with older versions of VS2017, and can be reverted after
we upgrade the minimum version sometime in the future.
Description of the Microsoft bug:
https://developercommunity.visualstudio.com/content/problem/25334/error-code-c2971-when-specifying-a-function-as-the.html
Differential Revision: https://reviews.llvm.org/D62202
llvm-svn: 361502
Don Hinton [Thu, 23 May 2019 15:03:22 +0000 (15:03 +0000)]
[cmake] When getting Ninja version, don't include CMakeNinjaFindMake
which doesn't play well with passing CMAKE_MAKE_PROGRAM from the
commandline without a path.
Fixes a bug introduced in r361280.
Thanks to Mikael Holmén for reporting this!
llvm-svn: 361501
Cameron McInally [Thu, 23 May 2019 14:53:42 +0000 (14:53 +0000)]
[NFC][InstCombine] Add unary FNeg tests to maximum.ll/minimum.ll
llvm-svn: 361500
Lewis Revill [Thu, 23 May 2019 14:46:27 +0000 (14:46 +0000)]
[RISCV] Support assembling TLS LA pseudo instructions
This patch adds the pseudo instructions la.tls.ie and la.tls.gd, used in
the initial-exec and global-dynamic TLS models respectively when
addressing a global. The pseudo instructions are expanded in the
assembly parser.
llvm-svn: 361499
Nico Weber [Thu, 23 May 2019 13:59:44 +0000 (13:59 +0000)]
gn build: Merge r361487
llvm-svn: 361498
Petar Jovanovic [Thu, 23 May 2019 13:49:06 +0000 (13:49 +0000)]
[LiveDebugValues] Rename 'DMI' into 'DebugInstr' (NFC)
This will improve code readability.
Patch by Djordje Todorovic.
Differential Revision: https://reviews.llvm.org/D62295
llvm-svn: 361497
Andrea Di Biagio [Thu, 23 May 2019 13:42:47 +0000 (13:42 +0000)]
[MCA] Introduce class LSUnitBase and let LSUnit derive from it.
Class LSUnitBase provides a abstract interface for all the concrete LS units in
llvm-mca.
Methods exposed by the public abstract LSUnitBase interface are:
- Status isAvailable(const InstRef&);
- void dispatch(const InstRef &);
- const InstRef &isReady(const InstRef &);
LSUnitBase standardises the API, but not the data structures internally used by
LS units. This allows for more flexibility.
Previously, only method `isReady()` was declared virtual by class LSUnit.
Also, derived classes had to inherit all the internal data members of LSUnit.
No functional change intended.
llvm-svn: 361496
Simon Pilgrim [Thu, 23 May 2019 13:30:10 +0000 (13:30 +0000)]
[X86] Regenerate LZCNT tests on x86/x32/x64 targets
llvm-svn: 361495
Louis Dionne [Thu, 23 May 2019 13:11:00 +0000 (13:11 +0000)]
[libcxx][tests] Fix order checking in unordered_multiset tests.
Some tests assume that iteration through an unordered multiset elements
will return them in the same order as at the container creation. This
assumption is not true since the container is unordered, so that no
specific order of elements is ever guaranteed for such container. This
patch introduces checks verifying that any iteration will return
elements exactly from a set of valid values and without repetition,
but in no particular order.
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D56500
llvm-svn: 361494
Alex Bradbury [Thu, 23 May 2019 12:43:13 +0000 (12:43 +0000)]
[RISCV][NFC] Add nounwind attribute to functions missing it in test/CodeGen/RISCV
r360897 was incomplete, must have applied an old/wip patch. This is in preparation for emitting CFI directives.
llvm-svn: 361493
Fangrui Song [Thu, 23 May 2019 12:43:08 +0000 (12:43 +0000)]
[llvm-objdump][test] Make MachO test names consistent
We have macho-disassembl{e,y}-*. Rename macho-disassembly-* to
macho-disassemble-* for consistency.
llvm-svn: 361492
James Henderson [Thu, 23 May 2019 12:38:06 +0000 (12:38 +0000)]
[llvm-objdump][test] Make test names consistent
This change renames a number of the disassembly tests to standardise
disasm/diassemble/disassembly to disassemble. Requested in
https://reviews.llvm.org/D62255.
llvm-svn: 361491
Clement Courbet [Thu, 23 May 2019 12:35:26 +0000 (12:35 +0000)]
[MergeICmps] Make the pass compatible with the new pass manager.
Reviewers: gchatelet, spatel
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62287
llvm-svn: 361490
James Henderson [Thu, 23 May 2019 12:30:39 +0000 (12:30 +0000)]
[llvm-objdump][test] Improve testing of some switches #3
This is the third commit in a series of patches to improve test coverage
of llvm-objdump. In this patch I have added a number of tests testing
various aspects of disassembly.
Reviewed by: MaskRay, grimar, rupprecht
Differential Revision: https://reviews.llvm.org/D62255
llvm-svn: 361489
Kadir Cetinkaya [Thu, 23 May 2019 12:02:14 +0000 (12:02 +0000)]
[clangd] Also update package-lock.json
llvm-svn: 361488
Dmitri Gribenko [Thu, 23 May 2019 12:01:26 +0000 (12:01 +0000)]
[clang-tidy] New check calling out uses of +new in Objective-C code
Summary:
Google's Objective-C style guide forbids calling or overriding +new to instantiate objects. This check warns on violations.
Style guide reference: https://google.github.io/styleguide/objcguide.html#do-not-use-new
Patch by Michael Wyman.
Reviewers: benhamilton, aaron.ballman, JonasToth, gribozavr, ilya-biryukov, stephanemoore, mwyman
Reviewed By: aaron.ballman, gribozavr, stephanemoore, mwyman
Subscribers: stephanemoore, xazax.hun, Eugene.Zelenko, mgorny, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D61350
llvm-svn: 361487