Alexander Shaposhnikov [Tue, 24 Apr 2018 05:43:32 +0000 (05:43 +0000)]
Recommit "[llvm-objcopy] Switch over to using TableGen for parsing arguments"
Add explicit dependency on ObjcopyTableGen
and rerun the tests on Windows.
I will double-check the build bots
and revert this commit if necessary.
llvm-svn: 330685
Max Kazantsev [Tue, 24 Apr 2018 04:42:37 +0000 (04:42 +0000)]
[NFC] Use FileCheck in test
llvm-svn: 330684
Max Kazantsev [Tue, 24 Apr 2018 04:33:04 +0000 (04:33 +0000)]
[NFC] Use forgetTopmostLoop instead of logic duplication
llvm-svn: 330683
Craig Topper [Tue, 24 Apr 2018 04:28:02 +0000 (04:28 +0000)]
[X86] Add a BSWAP16 instruction using the 32-bit encoding plus a 0x66 prefix.
This encoding is recognized by the CPU, but the behavior is undefined. This makes the disassembler handle it correctly so we don't print bswapl with a 16-bit register.
llvm-svn: 330682
Craig Topper [Tue, 24 Apr 2018 03:36:08 +0000 (03:36 +0000)]
[X86] Remove '#ifdef __x86_64__' around mask_set1_epi64 intrinsics.
The unmasked versions already didn't have this restrction. I don't think gcc or icc limit these to 64-bit mode so we shouldn't either.
llvm-svn: 330681
Chandler Carruth [Tue, 24 Apr 2018 03:27:00 +0000 (03:27 +0000)]
[PM/LoopUnswitch] Remove another over-aggressive assert.
This code path can very clearly be called in a context where we have
baselined all the cloned blocks to a particular loop and are trying to
handle nested subloops. There is no harm in this, so just relax the
assert. I've added a test case that will make sure we actually exercise
this code path.
llvm-svn: 330680
David Blaikie [Tue, 24 Apr 2018 02:23:41 +0000 (02:23 +0000)]
Fixup Polly for an LLVM header file change.
llvm-svn: 330679
Eric Christopher [Tue, 24 Apr 2018 02:10:59 +0000 (02:10 +0000)]
Remove unused function HexagonEarlyIfConversion::replacePhiEdges. NFC.
llvm-svn: 330678
Max Kazantsev [Tue, 24 Apr 2018 02:08:05 +0000 (02:08 +0000)]
[NFC] Add clarification comment
llvm-svn: 330677
Eric Christopher [Tue, 24 Apr 2018 01:57:03 +0000 (01:57 +0000)]
Reflow formatting after previous NFC commit.
llvm-svn: 330676
Eric Christopher [Tue, 24 Apr 2018 01:57:02 +0000 (01:57 +0000)]
Change if-conditionals to else-if as they should all be mutually exclusive.
No functional change intended.
llvm-svn: 330675
Nico Weber [Tue, 24 Apr 2018 01:30:44 +0000 (01:30 +0000)]
Make add_clang_tool() formatting a bit more consistent.
llvm-svn: 330674
Nico Weber [Tue, 24 Apr 2018 01:24:42 +0000 (01:24 +0000)]
Mostly revert r330672.
The test is apparently needed e.g. for check-cfi on Windows where we get
'C:/b/slave/sanitizer-windows/build/./bin/clang.exe': command not found
without it. Try to fix the problem that was fixed by r330672 by also checking
for isabs() instead.
llvm-svn: 330673
Nico Weber [Tue, 24 Apr 2018 01:05:04 +0000 (01:05 +0000)]
Remove code that's almost always dead, and harmful if not.
lit's util.which() would check if the passed-in path existed directly,
and if so return it as-is. This is never the case when running llvm's, clang's,
or lld's tests normally. But when running `./llvm-lit path/to/clang/test`
with a cwd of llvm-build/bin, this if would detect that clang exists at path
'clang' and return 'clang' as the discovered clang binary -- and then lit would
use the " clang " -> "*** Do not use 'clang' in tests, use '%clang'. ***"
substitution to replace that with a broken test. By removing this early
return, lit ends up with the usual absolute path and everything works even
in this uncommon case.
llvm-svn: 330672
David Blaikie [Tue, 24 Apr 2018 00:59:22 +0000 (00:59 +0000)]
Fix build break due to content moving from Scalar.h to InstCombine.h in LLVM
llvm-svn: 330671
David Blaikie [Tue, 24 Apr 2018 00:58:57 +0000 (00:58 +0000)]
Fix build breaks in examples due to moving stuff from Scalar.h to InstCombine.h
llvm-svn: 330670
David Blaikie [Tue, 24 Apr 2018 00:48:59 +0000 (00:48 +0000)]
InstCombine: Fix layering by not including Scalar.h in InstCombine
(notionally Scalar.h is part of libLLVMScalarOpts, so it shouldn't be
included by InstCombine which doesn't/shouldn't need to depend on
ScalarOpts)
llvm-svn: 330669
Craig Topper [Tue, 24 Apr 2018 00:39:29 +0000 (00:39 +0000)]
[AggressiveInstCombine] Add aggressive inst combiner to the LLVM C API.
I just tried to copy what was done for regular InstCombine. Hopefully I didn't miss anything.
llvm-svn: 330668
George Burgess IV [Tue, 24 Apr 2018 00:25:01 +0000 (00:25 +0000)]
Reland r301880(!): "[InstSimplify] Handle selects of GEPs with 0 offset"
I was reminded today that this patch got reverted in r301885. I can no
longer reproduce the failure that caused the revert locally (...almost
one year later), and the patch applied pretty cleanly, so I guess we'll
see if the bots still get angry about it.
The original breakage was InstSimplify complaining (in "assertion
failed" form) about getting passed some crazy IR when running `ninja
check-sanitizer`. I'm unable to find traces of what, exactly, said crazy
IR was. I suppose we'll find out pretty soon if that's still the case.
:)
Original commit:
Author: gbiv
Date: Mon May 1 18:12:08 2017
New Revision: 301880
URL: http://llvm.org/viewvc/llvm-project?rev=301880&view=rev
Log:
[InstSimplify] Handle selects of GEPs with 0 offset
In particular (since it wouldn't fit nicely in the summary):
(select (icmp eq V 0) P (getelementptr P V)) -> (getelementptr P V)
Differential Revision: https://reviews.llvm.org/D31435
llvm-svn: 330667
Alex Shlyapnikov [Tue, 24 Apr 2018 00:17:02 +0000 (00:17 +0000)]
[HWASan] Use dynamic shadow memory on Android only.
There're issues with IFUNC support on other platforms.
Differential Revision: https://reviews.llvm.org/D45847
llvm-svn: 330666
Alex Shlyapnikov [Tue, 24 Apr 2018 00:16:54 +0000 (00:16 +0000)]
[HWASan] Use dynamic shadow memory on Android only (LLVM)
There're issues with IFUNC support on other platforms.
DIfferential Revision: https://reviews.llvm.org/D45840
llvm-svn: 330665
Craig Topper [Tue, 24 Apr 2018 00:11:04 +0000 (00:11 +0000)]
[AggressiveInstCombine] Add createAggressiveInstCombinerPass to LinkAllPasses.h.
llvm-svn: 330664
Craig Topper [Tue, 24 Apr 2018 00:05:21 +0000 (00:05 +0000)]
[AggressiveInstCombine] Add library initializer routine for AggressiveInstCombine library. Use it in bugpoint and llvm-opt-fuzzer to match regular InstCombine.
This should make aggressive instcombine usable with these tools.
llvm-svn: 330663
Simon Pilgrim [Mon, 23 Apr 2018 22:45:04 +0000 (22:45 +0000)]
[X86] Remove unnecessary vector memory folded InstRW overrides.
We have test coverage for these with resources-sse*/avx*
llvm-svn: 330662
Robert Widmann [Mon, 23 Apr 2018 22:31:49 +0000 (22:31 +0000)]
[LLVM-C] DIBuilder Bindings For Variable Expressions
Summary: Add DIBuilder bindings for (global) variable expressions, variable value expressions, and debug value intrinsic insertion.
Reviewers: harlanhaskins, deadalnix, whitequark
Reviewed By: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45979
llvm-svn: 330661
Roman Tereshin [Mon, 23 Apr 2018 22:28:36 +0000 (22:28 +0000)]
[GlobalISel][Legalizer] Look thro copies while combining G_UNMERGE's
As we're becoming stricter w/ respect to not allowing vregs having LLTs
and regclasses assigned both mid-globalisel pipeline, the number of
extra copies grows, some of which separate G_UNMERGE's from their
corresponding G_MERGE's, becoming a performance concern.
It's worth mentioning that we're already looking through copies while
combining legalization artifacts for every kind of artifact but
G_UNMERGE.
Reviewed By: aditya_nandakumar
Reviewers: ab, t.p.northover, volkan, javed.absar
Subscribers: rovka, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D45644
llvm-svn: 330660
Simon Pilgrim [Mon, 23 Apr 2018 22:19:55 +0000 (22:19 +0000)]
[X86] Remove unnecessary BMI2 InstRW overrides.
We have test coverage for these with resources-bmi2.s
llvm-svn: 330659
Craig Topper [Mon, 23 Apr 2018 22:18:36 +0000 (22:18 +0000)]
[X86] Move the 32-bit versions of rdfsbase/rdgsbase/wrfsbase/wrgsbase to BuiltinsX86_64.def.
The 32-bit refers to their input/output type, but the instructions are only available in 64-bit mode.
llvm-svn: 330658
Craig Topper [Mon, 23 Apr 2018 22:18:34 +0000 (22:18 +0000)]
[X86] Move __builtin_ia32_movnti64 andd __builtin_ia32_rdrand64_step to BuiltinsX86_64.def to make them unavailable in 32-bit mode.
llvm-svn: 330657
Benjamin Kramer [Mon, 23 Apr 2018 22:04:34 +0000 (22:04 +0000)]
[AST] strcmp/memcmp always compares unsigned chars.
This makes it return the right result in a couple of edge cases. The
wide versions always do the comparison on the underlying wchar_t type.
llvm-svn: 330656
Tim Shen [Mon, 23 Apr 2018 21:54:06 +0000 (21:54 +0000)]
Re-commit r330627 "[libcxx] implement <experimental/simd> declarations based on P0214R7."
There are 3 changes:
* Renamed genertor.pass.cpp to generator.pass.cpp
* Removed nothing_to_do.pass.cpp
* Mark GCC 4.9 as UNSUPPORTED for the test files that have negative
narrowing conversion SFINAE test (see GCC PR63723).
llvm-svn: 330655
Craig Topper [Mon, 23 Apr 2018 21:41:06 +0000 (21:41 +0000)]
[Docs] Regenerate command line documentation.
llvm-svn: 330654
Florian Hahn [Mon, 23 Apr 2018 21:38:19 +0000 (21:38 +0000)]
[LoopInterchange] Do not change LI for BBs in child loops.
If a loop with child loops becomes our new inner loop after
interchanging, we only need to update LoopInfo for the blocks defined in
the old outer loop. BBs in child loops will stay there.
Reviewers: efriedma, karthikthecool, mcrosier
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D45970
llvm-svn: 330653
Matt Morehouse [Mon, 23 Apr 2018 21:36:21 +0000 (21:36 +0000)]
[libFuzzer] Add feature to not use AFL's deferred forkserver.
A small but substantial minority of libFuzzer-based fuzzers run code that
does not play well with fork in global constructors or LLVMFuzzerInitialize.
This patch allows these fuzzers to use afl_driver by allowing them to
opt-out of using AFL's deferred forkserver which deferres calling fork until
after this code.
Patch By: metzman
Differential Revision: https://reviews.llvm.org/D45744
llvm-svn: 330652
Roman Lebedev [Mon, 23 Apr 2018 21:35:21 +0000 (21:35 +0000)]
[Sema] Add -Wno-self-assign-overloaded
Summary:
It seems there isn't much enthusiasm for `-wtest` D45685.
This is more conservative version, which i had in the very first
revision of D44883, but that 'erroneously' got removed because of the review.
**Based on some [irc] discussions, it must really be documented that
we want all the new diagnostics to have their own flags, to ease
rollouts, transitions, etc.**
Please do note that i'm only adding `-Wno-self-assign-overloaded`,
but not `-Wno-self-assign-field-overloaded`, because i'm honestly
not aware of any false-positives from the `-field` variant,
but i can just as easily add it if wanted.
https://reviews.llvm.org/D44883#1068561
Reviewers: dblaikie, aaron.ballman, thakis, rjmccall, rsmith
Reviewed By: dblaikie
Subscribers: Quuxplusone, chandlerc, cfe-commits
Differential Revision: https://reviews.llvm.org/D45766
llvm-svn: 330651
Martin Liska [Mon, 23 Apr 2018 21:13:40 +0000 (21:13 +0000)]
Change kAllocatorSpace for powerpc64.
Fixes issue: https://github.com/google/sanitizers/issues/933
Differential Revision: https://reviews.llvm.org/D45950
llvm-svn: 330650
Jan Vesely [Mon, 23 Apr 2018 21:10:42 +0000 (21:10 +0000)]
log10: Use sw implementation from amd builtins
Add missing table.
Fixes log10d CTS on carrizo.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Aaron Watry <awatry@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 330649
Simon Pilgrim [Mon, 23 Apr 2018 21:04:23 +0000 (21:04 +0000)]
[X86] Remove unnecessary WriteLEA InstRW overrides.
llvm-svn: 330648
Zachary Turner [Mon, 23 Apr 2018 20:54:08 +0000 (20:54 +0000)]
[COFF] Alias /DEBUG:FULL to /DEBUG
With MSVC linker, /DEBUG is an alias of /DEBUG:FASTLINK, and if
you don't want /DEBUG:FASTLINK you have to explicitly specify
/DEBUG:FULL.
LLD doesn't support /DEBUG:FASTLINK, and so our standard /DEBUG
option is what MSVC calls /DEBUG:FULL. To provide command line
compatibility with MSVC, we should also support /DEBUG:FULL, and
since it's the same as what LLD already does for /DEBUG, just
alias it.
llvm-svn: 330647
Roman Lebedev [Mon, 23 Apr 2018 20:38:49 +0000 (20:38 +0000)]
[DAGCombiner] Unfold scalar masked merge if profitable
Summary:
This is [[ https://bugs.llvm.org/show_bug.cgi?id=37104 | PR37104 ]].
[[ https://bugs.llvm.org/show_bug.cgi?id=6773 | PR6773 ]] will introduce an IR canonicalization that is likely bad for the end assembly.
Previously, `andl`+`andn`/`andps`+`andnps` / `bic`/`bsl` would be generated. (see `@out`)
Now, they would no longer be generated (see `@in`).
So we need to make sure that they are still generated.
If the mask is constant, we do nothing. InstCombine should have unfolded it.
Else, i use `hasAndNot()` TLI hook.
For now, only handle scalars.
https://rise4fun.com/Alive/bO6
----
I *really* don't like the code i wrote in `DAGCombiner::unfoldMaskedMerge()`.
It is super fragile. Is there something like IR Pattern Matchers for this?
Reviewers: spatel, craig.topper, RKSimon, javed.absar
Reviewed By: spatel
Subscribers: andreadb, courbet, kristof.beyls, javed.absar, rengolin, nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D45733
llvm-svn: 330646
Roman Lebedev [Mon, 23 Apr 2018 20:38:42 +0000 (20:38 +0000)]
[X86][AArch64][NFC] Add tests for masked merge unfolding
Summary:
This is [[ https://bugs.llvm.org/show_bug.cgi?id=37104 | PR37104 ]].
[[ https://bugs.llvm.org/show_bug.cgi?id=6773 | PR6773 ]] will introduce an IR canonicalization that is likely bad for the end assembly.
Previously, `andl`+`andn`/`andps`+`andnps` / `bic`/`bsl` would be generated. (see `@out`)
Now, they would no longer be generated (see `@in`).
I'm guessing `llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp` should be able to unfold this.
Reviewers: spatel, craig.topper, RKSimon, javed.absar
Reviewed By: spatel
Subscribers: nemanjai, rengolin, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D45563
llvm-svn: 330645
Rui Ueyama [Mon, 23 Apr 2018 20:34:35 +0000 (20:34 +0000)]
Remove duplicate "error:" from an error message.
This patch also simplifies the code a bit which wasn't committed in
https://reviews.llvm.org/r330600.
llvm-svn: 330644
Alex Shlyapnikov [Mon, 23 Apr 2018 20:30:50 +0000 (20:30 +0000)]
[Sanitizer] Internal Printf string width + left-justify.
Summary:
Example:
Printf("%-5s", "123");
should yield:
'123 '
In case Printf's requested string field width is larger than the string
argument length, the resulting string should be padded up to the requested
width.
For the simplicity sake, implementing left-justified (right padding) only.
Reviewers: eugenis
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D45906
llvm-svn: 330643
Sanjay Patel [Mon, 23 Apr 2018 20:20:32 +0000 (20:20 +0000)]
[AggressiveInstCombine] add tests for PR37098; NFC
I'm not sure if this is where we should try to fold these
patterns inspired by:
https://bugs.llvm.org/show_bug.cgi?id=37098
...if this isn't the right place, we can move the tests.
llvm-svn: 330642
Xin Tong [Mon, 23 Apr 2018 20:09:08 +0000 (20:09 +0000)]
[CallSiteSplit] Make sure we remove nonnull if the parameter turns out to be a constant.
Summary: We do not need nonull attribute if we know an argument is going to be constant.
Reviewers: junbuml, davide, fhahn
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45608
llvm-svn: 330641
Gabor Buella [Mon, 23 Apr 2018 20:05:51 +0000 (20:05 +0000)]
[X86] Revert r330638 - accidental commit
llvm-svn: 330640
George Burgess IV [Mon, 23 Apr 2018 20:03:00 +0000 (20:03 +0000)]
Fix a broken typedef; NFCI
Richard Smith noted that `typedef typename iplist::iplist_impl_type
iplist_impl_type` is incorrect, per
http://eel.is/c++draft/basic.scope#class-2
It seems that neither clang nor gcc get too angry about this, but a
newer version of msvc does.
Thanks to jcmac on IRC for pointing this out!
llvm-svn: 330639
Gabor Buella [Mon, 23 Apr 2018 20:00:59 +0000 (20:00 +0000)]
[X86] movdiri and movdir64b instructions
Reviewers: craig.topper
llvm-svn: 330638
Marc-Andre Laperle [Mon, 23 Apr 2018 20:00:52 +0000 (20:00 +0000)]
[clangd] Implementation of workspace/symbol request
Summary:
This is a basic implementation of the "workspace/symbol" request which is
used to find symbols by a string query. Since this is similar to code completion
in terms of result, this implementation reuses the "fuzzyFind" in order to get
matches. For now, the scoring algorithm is the same as code completion and
improvements could be done in the future.
The index model doesn't contain quite enough symbols for this to cover
common symbols like methods, enum class enumerators, functions in unamed
namespaces, etc. The index model will be augmented separately to achieve this.
Reviewers: sammccall, ilya-biryukov
Reviewed By: sammccall
Subscribers: jkorous, hokein, simark, sammccall, klimek, mgorny, ilya-biryukov, mgrang, jkorous-apple, ioeric, MaskRay, cfe-commits
Differential Revision: https://reviews.llvm.org/D44882
llvm-svn: 330637
Tim Shen [Mon, 23 Apr 2018 19:56:20 +0000 (19:56 +0000)]
Revert "[libcxx] implement <experimental/simd> declarations based on P0214R7."
This reverts commit r330627.
This causes several bots to freak out.
llvm-svn: 330636
Bjorn Pettersson [Mon, 23 Apr 2018 19:55:04 +0000 (19:55 +0000)]
[MemCpyOpt] Skip optimizing basic blocks not reachable from entry
Summary:
Skip basic blocks not reachable from the entry node
in MemCpyOptPass::iterateOnFunction.
Code that is unreachable may have properties that do not exist
for reachable code (an instruction in a basic block can for
example be dominated by a later instruction in the same basic
block, for example if there is a single block loop).
MemCpyOptPass::processStore is only safe to use for reachable
basic blocks, since it may iterate past the basic block
beginning when used for unreachable blocks. By simply skipping
to optimize unreachable basic blocks we can avoid asserts such
as "Assertion `!NodePtr->isKnownSentinel()' failed."
in MemCpyOptPass::processStore.
The problem was detected by fuzz tests.
Reviewers: eli.friedman, dneilson, efriedma
Reviewed By: efriedma
Subscribers: efriedma, llvm-commits
Differential Revision: https://reviews.llvm.org/D45889
llvm-svn: 330635
Alexey Bataev [Mon, 23 Apr 2018 19:53:05 +0000 (19:53 +0000)]
[OPENMP] Formatting and code improvement, NFC.
llvm-svn: 330634
Nico Weber [Mon, 23 Apr 2018 19:22:52 +0000 (19:22 +0000)]
Fix typo in comment.
llvm-svn: 330633
Sam Clegg [Mon, 23 Apr 2018 19:16:19 +0000 (19:16 +0000)]
[WebAssembly] MC: Refactor section creation code
Remove the use of default argument in favor of a separate
startCustomSection method.
Differential Revision: https://reviews.llvm.org/D45794
llvm-svn: 330632
Quentin Colombet [Mon, 23 Apr 2018 19:09:49 +0000 (19:09 +0000)]
[CODE_OWNERS] Update my email address.
NFC
llvm-svn: 330631
Peter Collingbourne [Mon, 23 Apr 2018 19:09:34 +0000 (19:09 +0000)]
Reland r329956, "AArch64: Introduce a DAG combine for folding offsets into addresses.", with a fix for the bot failure.
This reland includes a check to prevent the DAG combiner from folding an
offset that is smaller than the existing one. This can cause oscillations
between two possible DAGs, which was the cause of the hang and later assertion
failure observed on the lnt-ctmark-aarch64-O3-flto bot.
http://green.lab.llvm.org/green/job/lnt-ctmark-aarch64-O3-flto/2024/
Original commit message:
> This is a code size win in code that takes offseted addresses
> frequently, such as C++ constructors that typically need to compute
> an offseted address of a vtable. This reduces the size of Chromium
> for Android's .text section by 108KB.
Differential Revision: https://reviews.llvm.org/D45199
llvm-svn: 330630
Daniel Neilson [Mon, 23 Apr 2018 19:06:49 +0000 (19:06 +0000)]
[DSE] Teach the pass that atomic memory intrinsics are stores.
Summary:
This change teaches DSE that the atomic memory intrinsics are stores
that can be eliminated, and can allow other stores to be eliminated.
This change specifically does not teach DSE that these intrinsics
can be partially eliminated (i.e. length reduced, and dest/src changed);
that will be handled in another change.
Reviewers: mkazantsev, skatkov, apilipenko, efriedma, rsmith
Reviewed By: efriedma
Subscribers: dmgreen, llvm-commits
Differential Revision: https://reviews.llvm.org/D45535
llvm-svn: 330629
Alex Shlyapnikov [Mon, 23 Apr 2018 19:05:12 +0000 (19:05 +0000)]
[HWASan] Add files missing in r330624
llvm-svn: 330628
Tim Shen [Mon, 23 Apr 2018 18:47:07 +0000 (18:47 +0000)]
[libcxx] implement <experimental/simd> declarations based on P0214R7.
Summary:
The patch includes all declarations, and also implements the following features:
* ABI.
* narrowing-conversion related SFIANE, including simd<> ctors and (static_)simd_cast.
Reviewers: mclow.lists, EricWF
Subscribers: lichray, sanjoy, MaskRay, cfe-commits
Differential Revision: https://reviews.llvm.org/D41148
llvm-svn: 330627
Richard Smith [Mon, 23 Apr 2018 18:38:30 +0000 (18:38 +0000)]
DR727: remove wrong assertion for use of class-scope explicit
specialization without -fms-extensions.
llvm-svn: 330626
Matthew Simpson [Mon, 23 Apr 2018 18:21:29 +0000 (18:21 +0000)]
[AArch64] Add cost model test case for transpose
This patch adds a cost model test case for vector shuffles having transpose
masks. The given costs are inaccurate and will be updated in a follow-on patch.
llvm-svn: 330625
Alex Shlyapnikov [Mon, 23 Apr 2018 18:19:23 +0000 (18:19 +0000)]
[HWASan] Introduce non-zero based and dynamic shadow memory (compiler-rt).
Retire the fixed shadow memory mapping to avoid conflicts with default
process memory mapping (currently manifests on Android).
Tests on AArch64 show <1% performance loss and code size increase,
making it possible to use dynamic shadow memory by default.
Keep the fixed shadow memory mapping around to be able to run
performance comparison tests later.
Re-commiting D45847 with fixed shadow for x86-64.
llvm-svn: 330624
Alex Shlyapnikov [Mon, 23 Apr 2018 18:14:39 +0000 (18:14 +0000)]
[HWASan] Switch back to fixed shadow mapping for x86-64
For now switch back to fixed shadow mapping for x86-64 due to the issues
with IFUNC linking on older binutils. More details will be added to
https://bugs.chromium.org/p/chromium/issues/detail?id=835864
Differential Revision: https://reviews.llvm.org/D45840
llvm-svn: 330623
Bjorn Pettersson [Mon, 23 Apr 2018 18:05:35 +0000 (18:05 +0000)]
Improve checks in test/Frontend/ftime-report-template-decl.cpp
Some buildbots seems to have problems with the CHECKs in
test/Frontend/ftime-report-template-decl.cpp.
I this the problem is that the order in which timers are printed
is based on consumed wall time. So there is no guarantee in which
order the timers are printed.
This patch uses CHECK-DAG instead of CHECK to make the test
case less sensitive to the actual time used by the different
passes.
The (sometimes) failing test cases where introduced in trunk@330571.
llvm-svn: 330622
Craig Topper [Mon, 23 Apr 2018 17:47:33 +0000 (17:47 +0000)]
[X86] Add disassembler test cases for bswap.
This demonstrates a bug where the encoding for a 16-bit bswap prints a 16-bit register and a 32-bit mnemonic. Intel docs say 16-bit bswap is undefined. We should either claim it as an invalid encoding or we should print a 16-bit mnemonic.
objdump does print the encoding as bswap with a 16-bit register. But it doesn't seem to ever print a suffix.
llvm-svn: 330621
Alexey Bataev [Mon, 23 Apr 2018 17:33:41 +0000 (17:33 +0000)]
[OPENMP] Do not cast captured by value variables with pointer types in
NVPTX target.
When generating the wrapper function for the offloading region, we need
to call the outlined function and cast the arguments correctly to follow
the ABI. Usually, variables captured by value are casted to `uintptr_t`
type. But this should not performed for the variables with pointer type.
llvm-svn: 330620
Reid Kleckner [Mon, 23 Apr 2018 17:26:33 +0000 (17:26 +0000)]
Revert r330474 - "[HWASan] Introduce non-zero based and dynamic shadow memory (compiler-rt)."
This commit causes internal errors with ld.bfd 2.24. My guess is that
the ifunc usage in this commit is causing problems. This is the default
system linker on Trusty Tahr, which is from 2014. I claim it's still in
our support window. Maybe we will decide to drop support for it, but
let's get the bots green while we do the investigation and have that
discussion.
Discovered here: https://crbug.com/835864
llvm-svn: 330619
Vedant Kumar [Mon, 23 Apr 2018 17:18:24 +0000 (17:18 +0000)]
[SelectionDAG] Dump debug locs in SDNodes
This helps debug issues where selection-dag assigns the wrong location
to an instruction.
Differential Revision: https://reviews.llvm.org/D45913
llvm-svn: 330618
Davide Italiano [Mon, 23 Apr 2018 17:06:55 +0000 (17:06 +0000)]
[CMake] Add the missing `dsymutil` dependency when running tests.
llvm-svn: 330617
Reid Kleckner [Mon, 23 Apr 2018 17:05:47 +0000 (17:05 +0000)]
Fix clang-cl warnings in compiler-rt
The profile library was missing some includes and was erroneously using
ftruncate. WinASan was using `= {0}` to initialize structs, which
creates -Wmissing-field-initializers and -Wmissing-braces warnings with
clang. Use `= {}` instead, since this is C++.
llvm-svn: 330616
Simon Pilgrim [Mon, 23 Apr 2018 16:59:06 +0000 (16:59 +0000)]
[MC] Remove MachineInstr reference in MC layer (PR37160)
Only add support for getSchedInfoStr(const MachineInstr &MI) at the TargetSubtargetInfo level.
Really, the getSchedInfoStr calls need to be removed entirely, we should just return a latency/rthroughput through the subtarget and keep a string creation helper function somewhere else.
llvm-svn: 330615
Reid Kleckner [Mon, 23 Apr 2018 16:47:27 +0000 (16:47 +0000)]
Fix -Wtautological-compare warning with npos on Windows
llvm-svn: 330614
Aleksei Sidorin [Mon, 23 Apr 2018 16:38:29 +0000 (16:38 +0000)]
Quick fix for rC330605: specify a target arch for test
llvm-svn: 330613
Matt Arsenault [Mon, 23 Apr 2018 16:13:30 +0000 (16:13 +0000)]
AMDGPU: Move a flawed assert when spilling SGPRs
It's possible to validly spill the frame offset register
in a call sequence to a VGPR. There are definitely issues
with SGPR spilling to memory, so move the assert later.
llvm-svn: 330612
Simon Pilgrim [Mon, 23 Apr 2018 16:10:50 +0000 (16:10 +0000)]
[X86] Replace x87 instregex with instrs if they only match one instruction
llvm-svn: 330611
Adrian Prantl [Mon, 23 Apr 2018 16:08:01 +0000 (16:08 +0000)]
Fix computeSymbolSizes SEGFAULT on invalid file
We use llvm-symbolizer in some production systems, and we run it
against all possibly related files, including some that are not
ELF. We noticed that for some of those invalid files, llvm-symbolizer
would crash with SEGFAULT. Here is an example of such a file.
It is due to that in computeSymbolSizes, a loop uses condition
for (unsigned I = 0, N = Addresses.size() - 1; I < N; ++I) {
where if Addresses.size() is 0, N would overflow and causing the loop
to access invalid memory.
Instead of patching the loop conditions, the commit makes so that the
function returns early if Addresses is empty.
Validated by checking that llvm-symbolizer no longer crashes.
Patch by Teng Qin!
Differential Revision: https://reviews.llvm.org/D44285
llvm-svn: 330610
Jan Korous [Mon, 23 Apr 2018 15:58:42 +0000 (15:58 +0000)]
[clangd][tests] Fix delimiter handling
Empty line shouldn't be considered a delimiter
Differential Revision: https://reviews.llvm.org/D45764
llvm-svn: 330609
Jan Korous [Mon, 23 Apr 2018 15:55:07 +0000 (15:55 +0000)]
[clangd][tests] Fix handling of EOF in delimited input
Request in delimited input ended by EOF shouldn't be an error state.
Comments at the end of test file shouldn't be logged as an error state.
Input mirroring should work for the last request in delimited test file.
llvm-svn: 330608
Matt Arsenault [Mon, 23 Apr 2018 15:51:26 +0000 (15:51 +0000)]
AMDGPU: Assign enum name to stack ID
Also assert that it is correct for SGPRs. There is currently a bug
where stack slot coloring replaces SGPR spill FIs with one with
the default ID, which results in a more confusing assert later
about a dead object.
llvm-svn: 330607
Matt Arsenault [Mon, 23 Apr 2018 15:51:21 +0000 (15:51 +0000)]
StackSlotColoring: Fix missing skipFunction check
llvm-svn: 330606
Aleksei Sidorin [Mon, 23 Apr 2018 15:41:44 +0000 (15:41 +0000)]
[analyzer] Don't crash on printing ConcreteInt of size >64 bits
Printing of ConcreteInts with size >64 bits resulted in assertion failure
in get[Z|S]ExtValue() because these methods are only allowed to be used
with integers of 64 max bit width. This patch fixes the issue.
llvm-svn: 330605
Nico Weber [Mon, 23 Apr 2018 15:41:08 +0000 (15:41 +0000)]
Fix case of LLVM library names.
llvm-svn: 330604
Daniel Neilson [Mon, 23 Apr 2018 15:40:37 +0000 (15:40 +0000)]
[SelectionDAG] Refactor lowering of atomic memory intrinsics.
Summary:
This just refactors the lowering of the atomic memory intrinsics to more
closely match the code patterns used in the lowering of the non-atomic
memory intrinsics. Specifically, we encapsulate the lowering in
SelectionDAG::getAtomicMem*() functions rather than embedding
the code directly in the SelectionDAGBuilder code.
llvm-svn: 330603
Benjamin Kramer [Mon, 23 Apr 2018 15:27:42 +0000 (15:27 +0000)]
[clangd] Fix Context::derive to actually call the right method.
C++ is weird.
llvm-svn: 330602
Nico Weber [Mon, 23 Apr 2018 15:26:15 +0000 (15:26 +0000)]
Remove unused code (made unused by r161073, and later more so by r248043).
llvm-svn: 330601
Zaara Syeda [Mon, 23 Apr 2018 15:01:24 +0000 (15:01 +0000)]
[PPC64] Fix toc restore nops offset for V2 ABI
The PPC64 V2 ABI restores the toc base by loading from an offset of 24 from r1.
This patch fixes the offset and updates the testcases from V1 to V2. It also
issues an error when a nop is missing after a call to an external function.
Differential Revision: https://reviews.llvm.org/D45892
llvm-svn: 330600
Benjamin Kramer [Mon, 23 Apr 2018 14:58:18 +0000 (14:58 +0000)]
[clangd] Prune some dead declarations. No functionality change.
llvm-svn: 330599
Kostya Kortchinsky [Mon, 23 Apr 2018 14:53:13 +0000 (14:53 +0000)]
[scudo] Read ARM feature bits using Fuchsia APIs.
Summary:
Fuchsia uses zx_system_get_features in lieu of getauxval.
Use this call when checking for CRC32 support.
Reviewers: cryptoad
Reviewed By: cryptoad
Subscribers: delcypher, llvm-commits, #sanitizers, kristof.beyls, chrib
Differential Revision: https://reviews.llvm.org/D45896
llvm-svn: 330598
George Rimar [Mon, 23 Apr 2018 14:41:49 +0000 (14:41 +0000)]
[ELF] - Simplify. NFC.
llvm-svn: 330597
Henry Wong [Mon, 23 Apr 2018 14:41:17 +0000 (14:41 +0000)]
[analyzer] Move `TaintBugVisitor` from `GenericTaintChecker.cpp` to `BugReporterVisitors.h`.
Summary: `TaintBugVisitor` is a universal visitor, and many checkers rely on it, such as `ArrayBoundCheckerV2.cpp`, `DivZeroChecker.cpp` and `VLASizeChecker.cpp`. Moving `TaintBugVisitor` to `BugReporterVisitors.h` enables other checker can also track where `tainted` value came from.
Reviewers: NoQ, george.karpenkov, xazax.hun
Reviewed By: george.karpenkov
Subscribers: szepet, rnkovacs, a.sidorin, cfe-commits, MTC
Differential Revision: https://reviews.llvm.org/D45682
llvm-svn: 330596
Benjamin Kramer [Mon, 23 Apr 2018 14:30:21 +0000 (14:30 +0000)]
[index] Fix methods that take a shared_ptr to just take a reference.
There is no ownership here, passing a shared_ptr just adds confusion. No
functionality change intended.
llvm-svn: 330595
Robert Widmann [Mon, 23 Apr 2018 14:29:33 +0000 (14:29 +0000)]
[LLVM-C] DIBuilderBindings for Subrange and Arrays
Summary: Move Go bindings for subranges and DINode arrays.
Reviewers: harlanhaskins, whitequark, deadalnix
Reviewed By: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45933
llvm-svn: 330594
Nico Weber [Mon, 23 Apr 2018 14:28:49 +0000 (14:28 +0000)]
Sort a target list a bit better.
llvm-svn: 330593
Alexey Bataev [Mon, 23 Apr 2018 14:00:53 +0000 (14:00 +0000)]
[DEBUGINFO, NVPTX] Add the test for the debug info of the local
variables, NFC.
llvm-svn: 330592
Robert Widmann [Mon, 23 Apr 2018 13:51:43 +0000 (13:51 +0000)]
[LLVM-C] Finish Up Scope Bindings
Summary: Adds bindings for Module and NameSpace scopes and LLVMDIBuilderCreateForwardDecl, a counterpart to LLVMDIBuilderCreateReplaceableCompositeType.
Reviewers: harlanhaskins, whitequark, deadalnix
Reviewed By: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45934
llvm-svn: 330591
Marianne Mailhot-Sarrasin [Mon, 23 Apr 2018 13:45:28 +0000 (13:45 +0000)]
[doc] Removed obsolete -count-aa from AliasAnalysis documentation
Summary:
This patch removes references to AliasAnalysisCounter pass from the AliasAnalysis documentation. That pass have been eliminated in 2015, at revision trunk@247167.
Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D45876
llvm-svn: 330590
Henry Wong [Mon, 23 Apr 2018 13:36:51 +0000 (13:36 +0000)]
[analyzer] CStringChecker.cpp - Code refactoring on bug report.
Reviewers: NoQ, george.karpenkov, xazax.hun
Reviewed By: george.karpenkov
Differential Revision: https://reviews.llvm.org/D44557
llvm-svn: 330589
Simon Pilgrim [Mon, 23 Apr 2018 13:24:17 +0000 (13:24 +0000)]
[X86] Remove instregex matching from CLAC/STAC.
Note - noticed this as the STAC case as it was unintentionally matching against *STACK* pseudo instructions.
llvm-svn: 330588
Nico Weber [Mon, 23 Apr 2018 13:11:51 +0000 (13:11 +0000)]
List cpp file only once (was added in 147117 and 147117 as build fix each).
llvm-svn: 330587
Nicolai Haehnle [Mon, 23 Apr 2018 13:06:03 +0000 (13:06 +0000)]
AMDGPU: Fix SDWA peephole for V_AND_B32
Summary:
Found by inspection. We care about the operand that *doesn't*
contain the immediate.
I believe this is currently not hit because we fold 0xff / 0xffff
immediates only later.
Change-Id: Ic3cf8538bc7da5eff3200d96eccf9d339e6345a7
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D45886
llvm-svn: 330586