Yitzhak Mandelbaum [Tue, 13 Aug 2019 12:31:29 +0000 (12:31 +0000)]
[libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.
Summary:
This patch removes an (artificial) limitation of `applyFirst`, which requires
that all of the rules' matchers can be grouped together in a single `anyOf()`.
This change generalizes the code to group the matchers into separate `anyOf`s
based on compatibility. Correspondingly, `buildMatcher` is changed to
`buildMatchers`, to allow for returning a set of matchers rather than just one.
Reviewers: gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65877
llvm-svn: 368681
Raphael Isemann [Tue, 13 Aug 2019 12:12:19 +0000 (12:12 +0000)]
[lldb][NFC] Add basic IOHandler completion test
We have no test coverage for the IOHandler code that is doing the
completion in the command line. This is adding a pexpect-based test
as a preparation for the switch to using CompletionRequest in the
whole completion machinery.
llvm-svn: 368679
George Rimar [Tue, 13 Aug 2019 12:07:41 +0000 (12:07 +0000)]
[llvm-readobj] - Remove 'error(Error EC)' helper.
We do not need it. I replaced it with
reportError(StringRef Input, Error Err).
Differential revision: https://reviews.llvm.org/D66011
llvm-svn: 368677
Brian Gesiak [Tue, 13 Aug 2019 12:02:25 +0000 (12:02 +0000)]
[CodeGen] Disable UBSan for coroutine functions
Summary:
As explained in http://lists.llvm.org/pipermail/llvm-dev/2018-March/121924.html,
the LLVM coroutines transforms are not yet able to move the
instructions for UBSan null checking past coroutine suspend boundaries.
For now, disable all UBSan checks when generating code for coroutines
functions.
I also considered an approach where only '-fsanitize=null' would be disabled,
However in practice this led to other LLVM errors when writing object files:
"Cannot represent a difference across sections". For now, disable all
UBSan checks until coroutine transforms are updated to handle them.
Test Plan:
1. check-clang
2. Compile the program in https://gist.github.com/modocache/
54a036c3bf9c06882fe85122e105d153
using the '-fsanitize=null' option and confirm it does not crash
during LLVM IR generation.
Reviewers: GorNishanov, vsk, eric_niebler, lewissbaker
Reviewed By: vsk
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D44672
llvm-svn: 368675
Louis Dionne [Tue, 13 Aug 2019 11:50:26 +0000 (11:50 +0000)]
[pstl] Rename PARALLELSTL_BACKEND to PSTL_PARALLEL_BACKEND
It makes more sense to name configuration options as PSTL_XXX.
Also, I'm naming it PSTL_PARALLEL_BACKEND because we might introduce
the ability to customize the vectorization backend, in which case
PSTL_BACKEND would become ambiguous.
llvm-svn: 368672
Nico Weber [Tue, 13 Aug 2019 11:48:15 +0000 (11:48 +0000)]
gn build: Extract git() and git_out() functions in sync script
llvm-svn: 368671
Nico Weber [Tue, 13 Aug 2019 11:32:54 +0000 (11:32 +0000)]
gn build: Merge r368630
llvm-svn: 368668
Nico Weber [Tue, 13 Aug 2019 11:32:45 +0000 (11:32 +0000)]
gn build: Give cmake sync script an opt-in --write flag
Differential Revision: https://reviews.llvm.org/D66101
llvm-svn: 368667
Louis Dionne [Tue, 13 Aug 2019 11:25:16 +0000 (11:25 +0000)]
[libc++] Fix incorrect UNSUPPORTED annotation
The test was marked as UNSUPPORTED for clang-6 and clang-6, instead of
clang-6 and clang-7.
llvm-svn: 368666
Nico Weber [Tue, 13 Aug 2019 11:24:20 +0000 (11:24 +0000)]
gn build: Make sync script group output by revision
Differential Revision: https://reviews.llvm.org/D66090
llvm-svn: 368665
Louis Dionne [Tue, 13 Aug 2019 11:12:28 +0000 (11:12 +0000)]
[libc++] Use [[nodiscard]] for lock_guard, as an extension
Summary:
D64914 added support for applying [[nodiscard]] to constructors. This
commit uses that capability to flag incorrect uses of std::lock_guard
where one forgets to actually create a variable for the lock_guard.
rdar://
45790820
Reviewers: mclow.lists, EricWF
Subscribers: christof, jkorous, dexonsmith, libcxx-commits, Quuxplusone, lebedev.ri
Tags: #libc
Differential Revision: https://reviews.llvm.org/D65900
llvm-svn: 368664
Simon Pilgrim [Tue, 13 Aug 2019 11:11:42 +0000 (11:11 +0000)]
[X86] XFormVExtractWithShuffleIntoLoad - handle shuffle mask scaling
If the target shuffle mask is from a wider type, attempt to scale the mask so that the extraction can attempt to peek through.
Fixes the regression mentioned in rL368662
Reapplying this as rL368308 had to be reverted as part of rL368660 to revert rL368276
llvm-svn: 368663
Simon Pilgrim [Tue, 13 Aug 2019 10:51:39 +0000 (10:51 +0000)]
[X86] SimplifyDemandedVectorElts - attempt to recombine target shuffle using DemandedElts mask (reapplied)
If we don't demand all elements, then attempt to combine to a simpler shuffle.
At the moment we can only do this if Depth == 0 as combineX86ShufflesRecursively uses Depth to track whether the shuffle has really changed or not - we'll need to change this before we can properly start merging combineX86ShufflesRecursively into SimplifyDemandedVectorElts.
The insertps-combine.ll regression is because XFormVExtractWithShuffleIntoLoad can't see through shuffles of different widths - this will be fixed in a follow-up commit.
Reapplying this as rL368307 had to be reverted as part of rL368660 to revert rL368276
llvm-svn: 368662
Fangrui Song [Tue, 13 Aug 2019 09:43:40 +0000 (09:43 +0000)]
[ELF] Don't special case symbolic relocations with 0 addend to ifunc in writable locations
Currently the following 3 relocation types do not trigger the creation
of a canonical PLT (which changes STT_GNU_IFUNC to STT_FUNC and
redirects all references):
1) GOT-generating (`needsGot`)
2) PLT-generating (`needsPlt`)
3) R_ABS with 0 addend in a writable location. This is used for
for ifunc function pointers in writable sections such as .data and .toc.
This patch deletes case 3) to simplify the R_*_IRELATIVE generating
logic added in D57371. Other advantages:
* It is guaranteed no more than 1 R_*_IRELATIVE is created for an ifunc.
* PPC64: no need to special case ifunc in toc-indirect to toc-relative relaxation. See D65755
The deleted elf::addIRelativeRelocs demonstrates that one-pass scan
through relocations makes several optimizations difficult. This is
something we can think about in the future.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D65995
llvm-svn: 368661
Hans Wennborg [Tue, 13 Aug 2019 09:33:25 +0000 (09:33 +0000)]
Revert r368276 "[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for ISD::EXTRACT_VECTOR_ELT"
This introduced a false positive MemorySanitizer warning about use of
uninitialized memory in a vectorized crc function in Chromium. That suggests
maybe something is not right with this transformation. See
https://crbug.com/992853#c7 for a reproducer.
This also reverts the follow-up commits r368307 and r368308 which
depended on this.
> This patch attempts to peek through vectors based on the demanded bits/elt of a particular ISD::EXTRACT_VECTOR_ELT node, allowing us to avoid dependencies on ops that have no impact on the extract.
>
> In particular this helps remove some unnecessary scalar->vector->scalar patterns.
>
> The wasm shift patterns are annoying - @tlively has indicated that the wasm vector shift codegen are to be refactored in the near-term and isn't considered a major issue.
>
> Differential Revision: https://reviews.llvm.org/D65887
llvm-svn: 368660
Fangrui Song [Tue, 13 Aug 2019 09:12:52 +0000 (09:12 +0000)]
[ELF] Simplify handling of exportDynamic and isPreemptible
In Writer::includeInDynSym(), exportDynamic is used by a Defined with
protected or default visibility, to record whether it is required to be
exported into .dynsym. It is set when any of the following conditions
hold:
1) There is an interposable symbol from a DSO (Undefined or SharedSymbol with default visibility)
2) If -shared or --export-dynamic is specified, any symbol in an object file/bitcode sets this property, unless suppressed by canBeOmittedFromSymbolTable().
3) --dynamic-list when producing an executable
4) protected symbol from a DSO preempted by copy relocation/canonical PLT when
--ignore-{data,function}-address-equality is specified
5) ifunc is exported when -z ifunc-noplt is specified
Bullet points 4) and 5) are irrelevant in this patch.
Bullet 3) does not play well with 1) and 2). When -shared is specified,
exportDynamic of most symbols is true. This makes it incapable to record
--dynamic-list marked symbols. We thus have obscure:
if (!config->shared)
b->exportDynamic = true;
else if (b->includeInDynsym())
b->isPreemptible = true;
This patch adds another bit `Symbol::inDynamicList` to record
3). We can thus simplify handleDynamicList() by unifying the DSO and
executable cases. It also allows us to simplify isPreemptible - now
the field is only used in finalizeSections() and later stages.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D66091
llvm-svn: 368659
David Bolvansky [Tue, 13 Aug 2019 09:12:07 +0000 (09:12 +0000)]
[NFC] Updated tests after r368657
llvm-svn: 368658
David Bolvansky [Tue, 13 Aug 2019 09:11:49 +0000 (09:11 +0000)]
[SimplifyLibCalls] Add dereferenceable bytes from known callsites
Summary:
int mm(char *a, char *b) {
return memcmp(a,b,16);
}
Currently:
define dso_local i32 @mm(i8* nocapture readonly %a, i8* nocapture readonly %b) local_unnamed_addr #1 {
entry:
%call = tail call i32 @memcmp(i8* %a, i8* %b, i64 16)
ret i32 %call
}
After patch:
define dso_local i32 @mm(i8* nocapture readonly %a, i8* nocapture readonly %b) local_unnamed_addr #1 {
entry:
%call = tail call i32 @memcmp(i8* dereferenceable(16) %a, i8* dereferenceable(16) %b, i64 16)
ret i32 %call
}
Reviewers: jdoerfert, efriedma
Reviewed By: jdoerfert
Subscribers: javed.absar, spatel, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66079
llvm-svn: 368657
Roman Lebedev [Tue, 13 Aug 2019 08:14:13 +0000 (08:14 +0000)]
[NFC][InstCombine] Non-canonical clamp pattern: non-canonical predicate tests
We can't handle 'uge' case because we can't ever get it,
there needs to be extra use on that compare or else it will be
canonicalized, but because of extra use we can't handle it.
'sge' case we can have.
llvm-svn: 368656
Balazs Keri [Tue, 13 Aug 2019 08:04:06 +0000 (08:04 +0000)]
[ASTImporter] Import additional flags for functions.
Summary:
At AST import of function delcarations import the flags for defaulted
and deleted.
Reviewers: martong, a.sidorin, shafik, a_sidorin
Reviewed By: a_sidorin
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65999
llvm-svn: 368655
Qiu Chaofan [Tue, 13 Aug 2019 07:53:29 +0000 (07:53 +0000)]
[PowerPC] Fix ICE when truncating some vectors
The legalizer would hit an assertion on PowerPC platform when truncating
a vector whose size is not power of 2. This patch is to add a check to
prevent vectors with such odd-size elements from being custom lowered.
Reviewed By: Hal Finkel
Differential Revision: https://reviews.llvm.org/D65261
llvm-svn: 368654
Amara Emerson [Tue, 13 Aug 2019 06:55:32 +0000 (06:55 +0000)]
[AArch64][GlobalISel] Replace explicit vreg creation with implicit using SrcOp. NFC.
llvm-svn: 368653
Amara Emerson [Tue, 13 Aug 2019 06:26:59 +0000 (06:26 +0000)]
[GlobalISel] Make the InstructionSelector instance non-const, allowing state to be maintained.
Currently we can't keep any state in the selector object that we get from
subtarget. As a result we have to plumb through all our variables through
multiple functions. This change makes it non-const and adds a virtual init()
method to allow further state to be captured for each target.
AArch64 makes use of this in this patch to cache a call to hasFnAttribute()
which is expensive to call, and is used on each selection of G_BRCOND.
Differential Revision: https://reviews.llvm.org/D65984
llvm-svn: 368652
Fangrui Song [Tue, 13 Aug 2019 06:19:39 +0000 (06:19 +0000)]
[ELF] Rename odd variable names "New" after r365730. NFC
New -> newSym or newFlags
Reviewed By: atanasyan
Differential Revision: https://reviews.llvm.org/D66127
llvm-svn: 368651
Serge Pavlov [Tue, 13 Aug 2019 05:21:18 +0000 (05:21 +0000)]
Added unit tests to check supported rounding modes
Also added fixed misspelled metadata name.
Differential Revision: https://reviews.llvm.org/D66073
llvm-svn: 368650
Fangrui Song [Tue, 13 Aug 2019 05:08:46 +0000 (05:08 +0000)]
[ELF][test] Add dynamic-list-preempt2.s
When producing a DSO, the isPreemptible property of a Defined with
default or protected visibility is affected by the --dynamic-list file,
but not by interposable symbols in other DSOs.
llvm-svn: 368649
Aditya Nandakumar [Tue, 13 Aug 2019 04:32:33 +0000 (04:32 +0000)]
[GlobalISel]: Add KnownBits for G_XOR
https://reviews.llvm.org/D66119
llvm-svn: 368648
Yevgeny Rouban [Tue, 13 Aug 2019 04:03:38 +0000 (04:03 +0000)]
Verifier: check prof branch_weights
This patch is to check some of constraints on
!pro branch_weights metadata:
https://llvm.org/docs/BranchWeightMetadata.html
Reviewers: asbirlea, reames, chandlerc
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D61179
llvm-svn: 368647
Akira Hatanaka [Tue, 13 Aug 2019 01:23:06 +0000 (01:23 +0000)]
Do not call replaceAllUsesWith to upgrade calls to ARC runtime functions
to intrinsic calls
This fixes a bug in r368311.
It turns out that the ARC runtime functions in the IR can have pointer
parameter types that are not i8* or i8**. Instead of RAUWing normal
functions with intrinsics, manually bitcast the arguments before passing
them to the intrinsic functions and bitcast the return value back to the
type of the original call instruction.
This recommits r368634, which was reverted in r368637. The loop in the
patch was iterating over uses of a function and deleting function calls
inside it, which caused bots to crash.
rdar://problem/
54125406
Differential Revision: https://reviews.llvm.org/D66047
llvm-svn: 368646
Stanislav Mekhanoshin [Tue, 13 Aug 2019 01:07:27 +0000 (01:07 +0000)]
[AMDGPU] Fix msan failure in printf lowering
llvm-svn: 368645
Bob Haarman [Tue, 13 Aug 2019 01:02:30 +0000 (01:02 +0000)]
[lld] Remove unnecessary "class Lazy"
llvm-svn: 368644
Daniel Sanders [Tue, 13 Aug 2019 00:55:24 +0000 (00:55 +0000)]
Eliminate implicit Register->unsigned conversions in VirtRegMap. NFC
Summary:
This was mostly an experiment to assess the feasibility of completely
eliminating a problematic implicit conversion case in D61321 in advance of
landing that* but it also happens to align with the goal of propagating the
use of Register/MCRegister instead of unsigned so I believe it makes sense
to commit it.
The overall process for eliminating the implicit conversions from
Register/MCRegister -> unsigned was to:
1. Add an explicit conversion to support genuinely required conversions to
unsigned. For example, using them as an index for IndexedMap. Sadly it's
not possible to have an explicit and implicit conversion to the same
type and only deprecate the implicit one so I called the explicit
conversion get().
2. Temporarily annotate the implicit conversion to unsigned with
LLVM_ATTRIBUTE_DEPRECATED to make them visible
3. Eliminate implicit conversions by propagating Register/MCRegister/
explicit-conversions appropriately
4. Remove the deprecation added in 2.
* My conclusion is that it isn't feasible as there's too much code to
update in one go.
Depends on D65678
Reviewers: arsenm
Subscribers: MatzeB, wdng, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65685
llvm-svn: 368643
Julian Lettner [Tue, 13 Aug 2019 00:37:48 +0000 (00:37 +0000)]
[TSan] Fix test failing on Linux
llvm-svn: 368641
Alex Lorenz [Tue, 13 Aug 2019 00:36:35 +0000 (00:36 +0000)]
clang-scan-deps: do not spawn threads when LLVM_ENABLE_THREADS is disabled
llvm-svn: 368640
Alex Langford [Tue, 13 Aug 2019 00:25:49 +0000 (00:25 +0000)]
[Symbol] Remove redundant include
llvm-svn: 368638
Akira Hatanaka [Tue, 13 Aug 2019 00:20:36 +0000 (00:20 +0000)]
Revert "Do not call replaceAllUsesWith to upgrade calls to ARC runtime functions"
This reverts commit r368634 because it broke a bot.
llvm-svn: 368637
Eric Christopher [Tue, 13 Aug 2019 00:05:01 +0000 (00:05 +0000)]
Move findBBwithCalls to the file it's used in to avoid unused function
warnings.
llvm-svn: 368636
Craig Topper [Tue, 13 Aug 2019 00:00:27 +0000 (00:00 +0000)]
[X86] Remove 'Server' from Tigerlake description comments.
Tigerlake is a client CPU not a server CPU.
llvm-svn: 368635
Akira Hatanaka [Mon, 12 Aug 2019 23:53:23 +0000 (23:53 +0000)]
Do not call replaceAllUsesWith to upgrade calls to ARC runtime functions
to intrinsic calls
This fixes a bug in r368311.
It turns out that the ARC runtime functions in the IR can have pointer
parameter types that are not i8* or i8**. Instead of RAUWing normal
functions with intrinsics, manually bitcast the arguments before passing
them to the intrinsic functions and bitcast the return value back to the
type of the original call instruction.
rdar://problem/
54125406
llvm-svn: 368634
Stanislav Mekhanoshin [Mon, 12 Aug 2019 23:32:35 +0000 (23:32 +0000)]
[AMDGPU] removed unused functions from printf lowering
Differential Revision: https://reviews.llvm.org/D66117
llvm-svn: 368633
Stephane Moore [Mon, 12 Aug 2019 23:23:35 +0000 (23:23 +0000)]
[clang] Update isDerivedFrom to support Objective-C classes 🔍
Summary:
This change updates `isDerivedFrom` to support Objective-C classes by
converting it to a polymorphic matcher.
Notes:
The matching behavior for Objective-C classes is modeled to match the
behavior of `isDerivedFrom` with C++ classes. To that effect,
`isDerivedFrom` matches aliased types of derived Objective-C classes,
including compatibility aliases. To achieve this, the AST visitor has
been updated to map compatibility aliases to their underlying
Objective-C class.
`isSameOrDerivedFrom` also provides similar behaviors for C++ and
Objective-C classes. The behavior that
`cxxRecordDecl(isSameOrDerivedFrom("X"))` does not match
`class Y {}; typedef Y X;` is mirrored for Objective-C in that
`objcInterfaceDecl(isSameOrDerivedFrom("X"))` does not match either
`@interface Y @end typedef Y X;` or
`@interface Y @end @compatibility_alias X Y;`.
Test Notes:
Ran clang unit tests.
Reviewers: aaron.ballman, jordan_rose, rjmccall, klimek, alexfh, gribozavr
Reviewed By: aaron.ballman, gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60543
llvm-svn: 368632
Reid Kleckner [Mon, 12 Aug 2019 23:02:00 +0000 (23:02 +0000)]
[WinEH] Fix catch block parent frame pointer offset
r367088 made it so that funclets store XMM registers into their local
frame instead of storing them to the parent frame. However, that change
forgot to update the parent frame pointer offset for catch blocks. This
change does that.
Fixes crashes when an exception is rethrown in a catch block that saves
XMMs, as described in https://crbug.com/992860.
llvm-svn: 368631
Juergen Ributzka [Mon, 12 Aug 2019 23:01:07 +0000 (23:01 +0000)]
[TextAPI] Fix & Add tests for tbd files version 3.
- There was a simple typo in TextStub code that prevented version 3 files to be read.
- Included a version 3 unit test to handle the differences in the format.
- Also a typo in Error.h inside the comments.
https://reviews.llvm.org/D66041
This patch is from Cyndy Ishida <cyndy_ishida@apple.com>.
llvm-svn: 368630
Daniel Sanders [Mon, 12 Aug 2019 22:41:02 +0000 (22:41 +0000)]
[risc-v] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).
Depends on D65919
Reviewers: lenary
Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits
Tags: #llvm
Differential Revision for full review was: https://reviews.llvm.org/D65962
llvm-svn: 368629
Daniel Sanders [Mon, 12 Aug 2019 22:40:53 +0000 (22:40 +0000)]
[aarch64] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).
Manual fixups in:
AArch64InstrInfo.cpp - genFusedMultiply() now takes a Register* instead of unsigned*
AArch64LoadStoreOptimizer.cpp - Ternary operator was ambiguous between Register/MCRegister. Settled on Register
Depends on D65919
Reviewers: aemerson
Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits
Tags: #llvm
Differential Revision for full review was: https://reviews.llvm.org/D65962
llvm-svn: 368628
Daniel Sanders [Mon, 12 Aug 2019 22:40:45 +0000 (22:40 +0000)]
[webassembly] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).
Reviewers: aheejin
Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits
Tags: #llvm
Differential Revision for whole review: https://reviews.llvm.org/D65962
llvm-svn: 368627
Stanislav Mekhanoshin [Mon, 12 Aug 2019 22:32:21 +0000 (22:32 +0000)]
[AMDGPU] Use PredicateControl in MIMGBaseOpcode. NFC.
This is infrastructural, will be needed for future work.
For some reason it was only used in MIMG_NoSampler, while
needed everywere we use MIMGBaseOpcode if we want to use
predicates.
Differential Revision: https://reviews.llvm.org/D66115
llvm-svn: 368626
Johannes Doerfert [Mon, 12 Aug 2019 22:21:09 +0000 (22:21 +0000)]
[Attributor] Use the cached data layout directly
This removes the warning by using the new DL member.
It also simplifies the code.
llvm-svn: 368625
Whitney Tsang [Mon, 12 Aug 2019 22:20:54 +0000 (22:20 +0000)]
Title: Fix build warning for operator<< when using GCC 7.
Authored By: etiotto
Differential Revision: https://reviews.llvm.org/D63459
llvm-svn: 368624
Craig Topper [Mon, 12 Aug 2019 22:18:23 +0000 (22:18 +0000)]
[X86] Allow combineTruncateWithSat to use pack instructions for i16->i8 without AVX512BW.
We need AVX512BW to be able to truncate an i16 vector. If we don't
have that we have to extend i16->i32, then trunc, i32->i8. But we
won't be able to remove the min/max if we do that. At least not
without more special handling.
llvm-svn: 368623
Johannes Doerfert [Mon, 12 Aug 2019 22:07:34 +0000 (22:07 +0000)]
[Attributor][NFC] Add IntegerState raw_ostream << operator
llvm-svn: 368622
Johannes Doerfert [Mon, 12 Aug 2019 22:05:53 +0000 (22:05 +0000)]
[Attributor] Make the InformationCache an Attributor member
The functionality is not changed but the interfaces are simplified and
repetition is removed.
llvm-svn: 368621
Davide Italiano [Mon, 12 Aug 2019 21:49:54 +0000 (21:49 +0000)]
[CompilerType] Pass an ExecutionContextScope to GetTypeBitAlign.
llvm-svn: 368620
Mitch Phillips [Mon, 12 Aug 2019 21:36:44 +0000 (21:36 +0000)]
[GWP-ASan] Update backtrace function signature.
Summary:
Updates the function signature and comments for backtracing (and printing
backtraces). This update brings GWP-ASan in line with future requirements for
stack frame compression, wherein the length of the trace is provided
explicitly, rather than relying on nullptr-termination.
Reviewers: vlad.tsyrklevich
Reviewed By: vlad.tsyrklevich
Subscribers: #sanitizers, llvm-commits, morehouse
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D66099
llvm-svn: 368619
Aditya Nandakumar [Mon, 12 Aug 2019 21:28:12 +0000 (21:28 +0000)]
[GISel]: Fix a bug in KnownBits where we should have been using SizeInBits
https://reviews.llvm.org/D66039
We were using getIndexSize instead of getIndexSizeInBits().
Added test case for G_PTRTOINT and G_INTTOPTR.
llvm-svn: 368618
Max Moroz [Mon, 12 Aug 2019 20:21:27 +0000 (20:21 +0000)]
[libFuzzer] Merge: print feature coverage number as well.
Summary:
feature coverage is a useful signal that is available during the merge
process, but was not printed previously.
Output example:
```
$ ./fuzzer -use_value_profile=1 -merge=1 new_corpus/ seed_corpus/
INFO: Seed:
1676551929
INFO: Loaded 1 modules (2380 inline 8-bit counters): 2380 [0x90d180, 0x90dacc),
INFO: Loaded 1 PC tables (2380 PCs): 2380 [0x684018,0x68d4d8),
MERGE-OUTER: 180 files, 78 in the initial corpus
MERGE-OUTER: attempt 1
INFO: Seed:
1676574577
INFO: Loaded 1 modules (2380 inline 8-bit counters): 2380 [0x90d180, 0x90dacc),
INFO: Loaded 1 PC tables (2380 PCs): 2380 [0x684018,0x68d4d8),
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes
MERGE-INNER: using the control file '/tmp/libFuzzerTemp.111754.txt'
MERGE-INNER: 180 total files; 0 processed earlier; will process 180 files now
#1 pulse cov: 134 ft: 330 exec/s: 0 rss: 37Mb
#2 pulse cov: 142 ft: 462 exec/s: 0 rss: 38Mb
#4 pulse cov: 152 ft: 651 exec/s: 0 rss: 38Mb
#8 pulse cov: 152 ft: 943 exec/s: 0 rss: 38Mb
#16 pulse cov: 520 ft: 2783 exec/s: 0 rss: 39Mb
#32 pulse cov: 552 ft: 3280 exec/s: 0 rss: 41Mb
#64 pulse cov: 576 ft: 3641 exec/s: 0 rss: 50Mb
#78 LOADED cov: 602 ft: 3936 exec/s: 0 rss: 88Mb
#128 pulse cov: 611 ft: 3996 exec/s: 0 rss: 93Mb
#180 DONE cov: 611 ft: 4016 exec/s: 0 rss: 155Mb
MERGE-OUTER: succesfull in 1 attempt(s)
MERGE-OUTER: the control file has 39741 bytes
MERGE-OUTER: consumed 0Mb (37Mb rss) to parse the control file
MERGE-OUTER: 9 new files with 80 new features added; 9 new coverage edges
```
Reviewers: hctim, morehouse
Reviewed By: morehouse
Subscribers: delcypher, #sanitizers, llvm-commits, kcc
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D66030
llvm-svn: 368617
Stella Stamenova [Mon, 12 Aug 2019 20:08:07 +0000 (20:08 +0000)]
Revert "[lldb] Refactor guard variable checks in IRForTarget"
This reverts commit
94fbbf712e906464f5f3abbeabcfcbc05d5352ec.
llvm-svn: 368616
Stella Stamenova [Mon, 12 Aug 2019 20:08:05 +0000 (20:08 +0000)]
Revert "[lldb] Fix dynamic_cast by no longer failing on variable without metadata"
This reverts commit
b448d1bf212219febbb182d00c210bad1bd25e7f.
llvm-svn: 368615
Davide Italiano [Mon, 12 Aug 2019 20:03:19 +0000 (20:03 +0000)]
[Symbol] GetTypeBitAlign() should return None in case of failure.
Summary:
And not `zero`. This is the last API needed to be converted to
an Optional<T>.
Reviewers: xiaobai, compnerd
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D66093
llvm-svn: 368614
Nico Weber [Mon, 12 Aug 2019 19:57:17 +0000 (19:57 +0000)]
Fix Wnewline-eof after r368598
llvm-svn: 368613
Juergen Ributzka [Mon, 12 Aug 2019 19:51:34 +0000 (19:51 +0000)]
Revert "Disable MachO TBD write tests for Windows."
The underlying issue was fixed in r357759.
llvm-svn: 368611
Erik Pilkington [Mon, 12 Aug 2019 19:29:43 +0000 (19:29 +0000)]
[Sema] Check __builtin_bit_cast operand for completeness before materializing it.
This shouldn't be observable, but it doesn't make sense to materialize an
incomplete type.
llvm-svn: 368610
Craig Topper [Mon, 12 Aug 2019 19:26:45 +0000 (19:26 +0000)]
[X86] Remove unreachable code from LowerTRUNCATE. NFC
All three 256->128 bit cases were already handled above.
Noticed while looking at the coverage report.
llvm-svn: 368609
Craig Topper [Mon, 12 Aug 2019 19:26:37 +0000 (19:26 +0000)]
[X86] Add a paranoia type check to the code that detects AVG patterns from truncating stores.
If we're after type legalize, we should make sure we won't create
a store with an illegal type when we separate the AVG pattern
from the truncating store.
I don't know of a way to fail for this today. Just noticed while
I was in the vicinity.
llvm-svn: 368608
Craig Topper [Mon, 12 Aug 2019 19:26:30 +0000 (19:26 +0000)]
[X86] Simplify creation of saturating truncating stores.
We just need to check if the truncating store is legal
instead of going through isSATValidOnAVX512Subtarget.
llvm-svn: 368607
Craig Topper [Mon, 12 Aug 2019 19:26:22 +0000 (19:26 +0000)]
[X86] Replace call to isTruncStoreLegalOrCustom with isTruncStoreLegal. NFC
We have no custom trunc stores on X86.
llvm-svn: 368606
Nico Weber [Mon, 12 Aug 2019 19:19:29 +0000 (19:19 +0000)]
small follow-up to r368604
llvm-svn: 368605
Nico Weber [Mon, 12 Aug 2019 19:11:23 +0000 (19:11 +0000)]
libcxxabi: Rename .hpp files to .h
LLVM uses .h as its extension for header files.
Differential Revision: https://reviews.llvm.org/D65981
llvm-svn: 368604
Dan Liew [Mon, 12 Aug 2019 18:51:25 +0000 (18:51 +0000)]
[asan_symbolize] Fix bug where the frame counter was not incremented.
Summary:
This bug occurred when a plug-in requested that a binary not be
symbolized while the script is trying to symbolize a stack frame. In
this case `self.frame_no` would not be incremented. This would cause
subsequent stack frames that are symbolized to be incorrectly numbered.
To fix this `get_symbolized_lines()` has been modified to take an
argument that indicates whether the stack frame counter should
incremented. In `process_line_posix()` `get_symbolized_lines(None, ...)`
is now used in in the case where we don't want to symbolize a line so
that we can keep the frame counter increment in a single function.
A test case is included. The test uses a dummy plugin that always asks
`asan_symbolize.py` script to not symbolize the first binary that the
script asks about. Prior to the patch this would cause the output to
script to look something like
```
#0 0x0
#0 0x0 in do_access
#1 0x0 in main
```
This is the second attempt at landing this patch. The first (r368373)
failed due to failing some android bots and so was reverted in r368472.
The new test is now disabled for Android. It turns out that the patch
also fails for iOS too so it is also disabled for that family of
platforms too.
rdar://problem/
49476995
Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka
Subscribers: #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D65495
llvm-svn: 368603
Diego Astiazaran [Mon, 12 Aug 2019 18:42:46 +0000 (18:42 +0000)]
[clang-doc] Generate HTML links for children namespaces/records
Path is now stored in the references to the child while serializing,
then this path is used to generate the relative path in the HTML
generator.
Now some references have paths and some don't so in the reducing phase,
references are now properly merged checking for empty attributes.
Tests added for HTML and YAML generators, merging and serializing.
computeRelativePath function had a bug when the filepath is part of the
given directory; it returned a path that starts with a separator. This
has been fixed.
Differential Revision: https://reviews.llvm.org/D65987
llvm-svn: 368602
Nico Weber [Mon, 12 Aug 2019 18:33:10 +0000 (18:33 +0000)]
gn build: Merge r368592
llvm-svn: 368601
Erik Pilkington [Mon, 12 Aug 2019 18:31:27 +0000 (18:31 +0000)]
[Sema] Require a complete type for __builtin_bit_cast operands
Fixes llvm.org/PR42936
llvm-svn: 368600
Louis Dionne [Mon, 12 Aug 2019 18:30:31 +0000 (18:30 +0000)]
[libc++] Implement CTAD for std::tuple
Summary:
We were using implicit deduction guides instead of explicit ones,
however the implicit ones don't do work anymore when changing the
constructors.
This commit adds the actual guides specified in the Standard to make
libc++ (1) closer to the Standard and (2) more resistent to changes
in std::tuple's constructors.
Reviewers: Quuxplusone
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D65225
llvm-svn: 368599
Matthew G McGovern [Mon, 12 Aug 2019 18:08:44 +0000 (18:08 +0000)]
[builtins] MSVC warning disable for clean build
- https://reviews.llvm.org/D66023
- amended for ifdef/if gcc errors in previous verison
llvm-svn: 368598
Kang Zhang [Mon, 12 Aug 2019 17:50:01 +0000 (17:50 +0000)]
[NFC][PowerPC] Add the test case shrink-wrap.mir and shrink-wrap.ll for PPC
llvm-svn: 368597
Wenlei He [Mon, 12 Aug 2019 17:45:14 +0000 (17:45 +0000)]
[ThinLTO][AutoFDO] Fix memory corruption due to race condition from thin backends
Summary:
This commit fixed a race condition from multi-threaded thinLTO backends that causes non-deterministic memory corruption for a data structure used only by AutoFDO with compact binary profile.
GUIDToFuncNameMap, a static data member of type DenseMap in FunctionSamples is used as a per-module mapping from function name MD5 to name string when input AutoFDO profile is in compact binary format. However with ThinLTO, we can have parallel backends modifying and accessing the class static map concurrently. The fix is to make GUIDToFuncNameMap a member of SampleProfileLoader instead of a file static data.
Reviewers: wmi, davidxl, danielcdh
Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65848
llvm-svn: 368596
Roman Lebedev [Mon, 12 Aug 2019 17:45:12 +0000 (17:45 +0000)]
[CostModel][X86][AArch64] Check all 3 cost kinds in aggregates.ll
llvm-svn: 368595
Craig Topper [Mon, 12 Aug 2019 17:43:26 +0000 (17:43 +0000)]
[X86] Disable use of zmm registers for varargs musttail calls under prefer-vector-width=256 and min-legal-vector-width=256.
Under this config, the v16f32 type we try to use isn't to a register
class so the getRegClassFor call will fail.
llvm-svn: 368594
David Green [Mon, 12 Aug 2019 17:39:56 +0000 (17:39 +0000)]
[ARM] sext of a load is free
This teaches the cost model that the sext or zext of a load is going to be
free.
Differential Revision: https://reviews.llvm.org/D66006
llvm-svn: 368593
Stanislav Mekhanoshin [Mon, 12 Aug 2019 17:12:29 +0000 (17:12 +0000)]
[AMDGPU] Printf runtime binding pass
This pass is a port of the according pass from the HSAIL compiler.
It parses printf calls and setup runtime printf buffer.
After that it copies printf arguments to the buffer and fills in
module metadata for runtime.
Differential Revision: https://reviews.llvm.org/D24035
llvm-svn: 368592
Shafik Yaghmour [Mon, 12 Aug 2019 17:07:49 +0000 (17:07 +0000)]
[ASTDump] Add is_anonymous to VisitCXXRecordDecl
Summary:
Adding is_anonymous the ASTDump for CXXRecordDecl. This turned out to be useful when debugging some problems with how LLDB creates ASTs from DWARF.
Differential Revision: https://reviews.llvm.org/D66028
llvm-svn: 368591
Sam McCall [Mon, 12 Aug 2019 17:05:35 +0000 (17:05 +0000)]
[clangd] Refactor computation of extracted expr in ExtractVariable tweak. NFC
Summary:
This takes this logic out of the Tweak class, and simplifies the signature of
the function where the main logic is.
The goal is to make it easier to turn into a loop like:
for (current = N; current and current->parent are both expr; current = current->parent)
if (suitable(current))
return current;
return null;
Reviewers: SureYeaah
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65333
llvm-svn: 368590
David Green [Mon, 12 Aug 2019 16:54:07 +0000 (16:54 +0000)]
[ARM] MVE shuffle broadcast costs
A VDUP will perform a vector broadcast in a single instruction. Update the cost
model for MVE accordingly.
Code originally by David Sherwood.
Differential Revision: https://reviews.llvm.org/D63448
llvm-svn: 368589
Gabor Horvath [Mon, 12 Aug 2019 16:19:39 +0000 (16:19 +0000)]
Fix multiple lifetime warning messages for range based for loop
llvm-svn: 368588
David Green [Mon, 12 Aug 2019 15:59:52 +0000 (15:59 +0000)]
[ARM] Put some of the TTI costmodel behind hasNeon calls.
This puts some of the calls in ARMTargetTransformInfo.cpp behind hasNeon()
checks, now that we have MVE, and updates all the tests accordingly.
Differential Revision: https://reviews.llvm.org/D63447
llvm-svn: 368587
David Green [Mon, 12 Aug 2019 15:40:27 +0000 (15:40 +0000)]
[ARM] Add or update a number of costmodel tests. NFC
This adds a number of cost model tests for ARM, useful for MVE. It also re-jigs
some of the existing tests to make them easier to update and read.
llvm-svn: 368586
Kostya Kortchinsky [Mon, 12 Aug 2019 15:35:09 +0000 (15:35 +0000)]
[scudo][standalone] Minor corrections
Summary:
Few corrections with no functional change:
- replacing `%zd` with `%zu` all around: the values are unsigned
- prefer `MAP_ANONYMOUS` to `MAP_ANON` (it's deprecated)
- remove the unused `enum LinkerInitialized`
- mark a parameter as `UNUSED` in Fuchsia's `getRandom`
- correct the casing of a variable and use `nullptr` instead of 0 for
pointers in `list.h`
- reorder some `typedef` to be consistent between `signed` and
`unsigned`
Reviewers: eugenis, vitalybuka, morehouse, hctim
Reviewed By: vitalybuka, morehouse
Subscribers: delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D65660
llvm-svn: 368585
Sean Fertile [Mon, 12 Aug 2019 15:27:40 +0000 (15:27 +0000)]
[XCOFF] Use a single symbolic constant for the size of an embeded name. [NFC]
Convert SymbolNameSize and SectionNameSize into just `NameSize`. The length of
a name embeded in a symbol table entry or section header table entry is length 8
for Sections, Symbols and Files. No need to have a distinct constant for each
one. Also removes the Size argument to 'generateStringRef' as the size is
always 'XCOFF::NameSize'.
llvm-svn: 368584
Sanjay Patel [Mon, 12 Aug 2019 15:21:11 +0000 (15:21 +0000)]
[InstCombine] add tests for scalar-select-of-vectors; NFC
llvm-svn: 368583
Raphael Isemann [Mon, 12 Aug 2019 14:37:12 +0000 (14:37 +0000)]
[lldb][NFC] Minor fixes for lldb_private::DiagnosticManager
llvm-svn: 368582
Ilya Biryukov [Mon, 12 Aug 2019 14:35:30 +0000 (14:35 +0000)]
[clangd] Separate chunks with a space when rendering markdown
Summary:
This results in better rendering of resulting markdown.
Especially noticeable in coc.nvim that does not have a visible horizontal
spaces around inline code blocks. More details and a screenshot from
coc.nvim can be found in https://github.com/clangd/clangd/issues/95.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66086
llvm-svn: 368581
Benjamin Kramer [Mon, 12 Aug 2019 14:33:46 +0000 (14:33 +0000)]
Remove outdated comment about clang not populating src2dst_offset
Clang has been setting this since r174293 (of 2013 vintage).
llvm-svn: 368580
Hans Wennborg [Mon, 12 Aug 2019 14:23:13 +0000 (14:23 +0000)]
Revert r368339 "[MBP] Disable aggressive loop rotate in plain mode"
It caused assertions to fire when building Chromium:
lib/CodeGen/LiveDebugValues.cpp:331: bool
{anonymous}::LiveDebugValues::OpenRangesSet::empty() const: Assertion
`Vars.empty() == VarLocs.empty() && "open ranges are inconsistent"' failed.
See https://crbug.com/992871#c3 for how to reproduce.
> Patch https://reviews.llvm.org/D43256 introduced more aggressive loop layout optimization which depends on profile information. If profile information is not available, the statically estimated profile information(generated by BranchProbabilityInfo.cpp) is used. If user program doesn't behave as BranchProbabilityInfo.cpp expected, the layout may be worse.
>
> To be conservative this patch restores the original layout algorithm in plain mode. But user can still try the aggressive layout optimization with -force-precise-rotation-cost=true.
>
> Differential Revision: https://reviews.llvm.org/D65673
llvm-svn: 368579
Jordan Rupprecht [Mon, 12 Aug 2019 14:21:51 +0000 (14:21 +0000)]
[llvm-ar][NFC] Fix buildbot
llvm-svn: 368578
Raphael Isemann [Mon, 12 Aug 2019 14:11:37 +0000 (14:11 +0000)]
[lldb] Remove undocumented return value from DiagnosticManager::PutString
The returned value is currently unused. It also seems to imply that
it somehow represents 'printf-style' the number of characters/bytes
written to some output stream (which is incorrect, as we only know
the actual size of the written message when we have rendered it,
e.g. via GetString and DiagnosticManagers have no associated
output stream).
llvm-svn: 368577
Jordan Rupprecht [Mon, 12 Aug 2019 14:05:37 +0000 (14:05 +0000)]
[llvm-readobj] Downgrade 'PT_DYNAMIC segment offset + size exceeds the size of the file' from an error to a warning
Summary: This allows llvm-readobj to print other useful information for truncated files instead of giving up.
Reviewers: jhenderson, grimar, MaskRay
Reviewed By: jhenderson, grimar, MaskRay
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66036
llvm-svn: 368576
Simon Pilgrim [Mon, 12 Aug 2019 14:01:16 +0000 (14:01 +0000)]
[X86][SSE] Add test showing missing demanded elts PSADBW handling
llvm-svn: 368575
Kang Zhang [Mon, 12 Aug 2019 14:00:31 +0000 (14:00 +0000)]
Revert r368565: [CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks
llvm-svn: 368574
Owen Reynolds [Mon, 12 Aug 2019 14:00:28 +0000 (14:00 +0000)]
[llvm-ar] Accept file paths with windows format slashes
The internal representation of llvm-ar archives uses linux style slashes
for paths, no matter the OS. In the case of windows this meant file
paths input intending to match existing members would only match if
linux style slashes where used. This change allows either slash
direction to be input by the user.
This change includes removing an unnecessary call to normalisePath and
moving the call of another.
Differential Revision: https://reviews.llvm.org/D65743
llvm-svn: 368573
Sam Elliott [Mon, 12 Aug 2019 13:51:00 +0000 (13:51 +0000)]
[RISCV] Fix ICE in isDesirableToCommuteWithShift
Summary:
Ana Pazos reported a bug where we were not checking that an APInt would
fit into 64-bits before calling `getSExtValue()`. This caused asserts when
compiling large constants, such as i128s, as happens when compiling compiler-rt.
This patch adds a testcase and makes the callback less error-prone.
Reviewers: apazos, asb, luismarques
Reviewed By: luismarques
Subscribers: hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66081
llvm-svn: 368572