Tom Roeder [Tue, 26 Feb 2019 19:26:41 +0000 (19:26 +0000)]
[ASTImporter] Add support for importing ChooseExpr AST nodes.
Summary:
This allows ASTs to be merged when they contain ChooseExpr (the GNU
__builtin_choose_expr construction). This is needed, for example, for
cross-CTU analysis of C code that makes use of __builtin_choose_expr.
The node is already supported in the AST, but it didn't have a matcher
in ASTMatchers. So, this change adds the matcher and adds support to
ASTImporter.
This was originally reviewed and approved in
https://reviews.llvm.org/D58292 and submitted as r354832. It was
reverted in r354839 due to failures on the Windows CI builds.
This version fixes the test failures on Windows, which were caused by
differences in template expansion between versions of clang on different
OSes. The version of clang built with MSVC and running on Windows never
expands the template in the C++ test in ImportExpr.ImportChooseExpr in
clang/unittests/AST/ASTImporter.cpp, but the version on Linux does for
the empty arguments and -fms-compatibility.
So, this version of the patch drops the C++ test for
__builtin_choose_expr, since that version was written to catch
regressions of the logic for isConditionTrue() in the AST import code
for ChooseExpr, and those regressions are also caught by
ASTImporterOptionSpecificTestBase.ImportChooseExpr, which does work on
Windows.
Reviewers: shafik, a_sidorin, martong, aaron.ballman, rnk, a.sidorin
Subscribers: cfe-commits, jdoerfert, rnkovacs, aaron.ballman
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58663
llvm-svn: 354916
Craig Topper [Tue, 26 Feb 2019 19:20:04 +0000 (19:20 +0000)]
[X86] Add 'znver2' and 'cascadelake' to the __builtin_cpu_is test.
These are supported by at least libgcc trunk so we can include them now.
llvm-svn: 354915
Jim Ingham [Tue, 26 Feb 2019 19:18:09 +0000 (19:18 +0000)]
Mention predicting exception catch at throw site
llvm-svn: 354914
Craig Topper [Tue, 26 Feb 2019 19:17:12 +0000 (19:17 +0000)]
[X86] Use X86_CPU_SUBTYPE_COMPAT for 'cascadelake' cpu.
This CPU is supported by at least libgcc trunk now so we should make it available to __builtin_cpu_is.
llvm-svn: 354913
Julian Lettner [Tue, 26 Feb 2019 19:03:26 +0000 (19:03 +0000)]
[lit] Allow setting parallelism groups to None
Check that we do not crash if a parallelism group is explicitly set to
None. Permits usage of the following pattern.
[lit.common.cfg]
lit_config.parallelism_groups['my_group'] = None
if <condition>:
lit_config.parallelism_groups['my_group'] = 3
[project/lit.cfg]
config.parallelism_group = 'my_group'
Reviewers: rnk
Differential Revision: https://reviews.llvm.org/D58305
llvm-svn: 354912
Kristina Brooks [Tue, 26 Feb 2019 18:53:13 +0000 (18:53 +0000)]
Update docs of memcpy/move/set wrt. align and len
Fix https://bugs.llvm.org/show_bug.cgi?id=38583: Describe
how memcpy/memmove/memset behave when len=0. Also fix
some fallout from when the alignment parameter was
replaced by an attribute.
This closes PR38583.
Patch by RalfJung (Ralf)
Differential Revision: https://reviews.llvm.org/D57600
llvm-svn: 354911
Andrew Ng [Tue, 26 Feb 2019 18:50:49 +0000 (18:50 +0000)]
[TableGen] Make OpcodeMappings sort comparator deterministic NFCI
The previous sort comparator was not deterministic, i.e. in some
situations it would be possible for lhs < rhs && rhs < lhs. This was
discovered by an STL assertion in a Windows debug build of llvm-tblgen.
Differential Revision: https://reviews.llvm.org/D58687
llvm-svn: 354910
Michael Liao [Tue, 26 Feb 2019 18:49:36 +0000 (18:49 +0000)]
[AMDGPU] Allow using integral non-type template parameters
Summary:
- Allow using integral non-type template parameters in the following
attributes
__attribute__((amdgpu_flat_work_group_size(<min>, <max>)))
__attribute__((amdgpu_waves_per_eu(<min>[, <max>])))
Reviewers: kzhuravl, yaxunl
Subscribers: jvesely, wdng, nhaehnle, dstuttard, tpr, t-tye, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58623
llvm-svn: 354909
Mitch Phillips [Tue, 26 Feb 2019 18:41:55 +0000 (18:41 +0000)]
Fixed a minor merge error with this patch.
llvm-svn: 354908
Mitch Phillips [Tue, 26 Feb 2019 18:41:54 +0000 (18:41 +0000)]
[compiler-rt] Provide better llvm-lit failure when llvm-config fails.
Summary:
The current error message can cause confusion if llvm-config can't be
executed for reasons other than "not found". In my example, cross
compiling generated an llvm-config binary for aarch64 which couldn't be
executed natively. Instead of telling me that the error was with the
file architecture, it reports the file as not being present.
Reviewers: pcc
Subscribers: dberris, javed.absar, kristof.beyls, jdoerfert, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58647
llvm-svn: 354907
Vlad Tsyrklevich [Tue, 26 Feb 2019 18:28:15 +0000 (18:28 +0000)]
Revert "[compiler-rt] Intercept the bcmp() function."
This reverts commits r354851, 354852, 354853 and r354888. They were
causing build failures on the android sanitizer bot.
llvm-svn: 354906
Sanjay Patel [Tue, 26 Feb 2019 18:26:56 +0000 (18:26 +0000)]
[InstSimplify] remove zero-shift-guard fold for general funnel shift
As discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2019-February/130491.html
We can't remove the compare+select in the general case because
we are treating funnel shift like a standard instruction (as
opposed to a special instruction like select/phi).
That means that if one of the operands of the funnel shift is
poison, the result is poison regardless of whether we know that
the operand is actually unused based on the instruction's
particular semantics.
The motivating case for this transform is the more specific
rotate op (rather than funnel shift), and we are preserving the
fold for that case because there is no chance of introducing
extra poison when there is no anonymous extra operand to the
funnel shift.
llvm-svn: 354905
Marshall Clow [Tue, 26 Feb 2019 18:17:30 +0000 (18:17 +0000)]
Remove P1272R1, it was not moved in Kona
llvm-svn: 354904
Jonas Toth [Tue, 26 Feb 2019 18:15:17 +0000 (18:15 +0000)]
[clang-tidy] undo bitfields in ExceptionAnalyzer
Scoped enums do induce some problems with some MSVC and GCC versions
if used as bitfields. Therefor this is deactivated for now.
llvm-svn: 354903
Jonathan Metzman [Tue, 26 Feb 2019 17:46:13 +0000 (17:46 +0000)]
[libFuzzer] Remove extra semicolons
Summary:
Remove extra semicolons so that libFuzzer can compile with
-Werror -Wextra-semi
Reviewers: Dor1s, morehouse, thakis
Reviewed By: Dor1s, morehouse
Subscribers: jdoerfert, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58674
llvm-svn: 354902
Marshall Clow [Tue, 26 Feb 2019 17:22:47 +0000 (17:22 +0000)]
Put a 'first implemented' version into the entry for P1357
llvm-svn: 354901
Petar Avramovic [Tue, 26 Feb 2019 17:22:42 +0000 (17:22 +0000)]
[MIPS GlobalISel] Select G_UADDO
Lower G_UADDO.
Legalize G_UADDO for MIPS32
Differential Revision: https://reviews.llvm.org/D58671
llvm-svn: 354900
Ganesh Gopalasubramanian [Tue, 26 Feb 2019 17:15:36 +0000 (17:15 +0000)]
[X86] AMD znver2 enablement
This patch enables the following
1) AMD family 17h "znver2" tune flag (-march, -mcpu).
2) ISAs that are enabled for "znver2" architecture.
3) For the time being, it uses the znver1 scheduler model.
4) Tests are updated.
5) This patch is the clang counterpart to D58343
Reviewers: craig.topper
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58344
llvm-svn: 354899
Marshall Clow [Tue, 26 Feb 2019 17:01:00 +0000 (17:01 +0000)]
Mark several issues (and one paper) as complete. Reviewed as D58099; but I added LWG3101 and LWG3144 and P1357R1 as well.
llvm-svn: 354898
Ganesh Gopalasubramanian [Tue, 26 Feb 2019 16:55:10 +0000 (16:55 +0000)]
[X86] AMD znver2 enablement
This patch enables the following
1) AMD family 17h "znver2" tune flag (-march, -mcpu).
2) ISAs that are enabled for "znver2" architecture.
3) For the time being, it uses the znver1 scheduler model.
4) Tests are updated.
5) Scheduler descriptions are yet to be put in place.
Reviewers: craig.topper
Differential Revision: https://reviews.llvm.org/D58343
llvm-svn: 354897
Jonas Paulsson [Tue, 26 Feb 2019 16:47:59 +0000 (16:47 +0000)]
[SystemZ] Wait with selection of legal vector/FP constants until Select().
This patch aims to make sure that any such constant that can be generated
with a vector instruction (for example VGBM) is recognized as such during
legalization and kept as a target independent node through post-legalize
DAGCombining.
Two new functions named isVectorConstantLegal() and loadVectorConstant()
replace old ways of handling vector/FP constants.
A new struct named SystemZVectorConstantInfo is used to cache the results of
isVectorConstantLegal() and pass them onto loadVectorConstant().
Support for fp128 constants in the presence of FeatureVectorEnhancements1
(z14) has been added.
Review: Ulrich Weigand
https://reviews.llvm.org/D58270
llvm-svn: 354896
Kostya Kortchinsky [Tue, 26 Feb 2019 16:47:25 +0000 (16:47 +0000)]
[scudo][standalone] Introduce platform specific code & mutexes
Summary:
This CL adds the platform specific code for Fuchsia, Linux & Android,
as well as some tests related to those (more tests to come later).
While some of it is pretty much a straight port of the existing scudo &
sanitizer_common code, the memory mapping functions have been reworked
a bit to fit the limited usage scenario that Scudo has for them.
For Fuchsia, I can now track the Vmar/Vmo pair for memory mappings if
there is an intent to grow or decommit some mapping (that will be
useful for the Primary).
Reviewers: eugenis, vitalybuka, mcgrathr, phosek, flowerhack, morehouse, dmmoore415
Reviewed By: vitalybuka, morehouse
Subscribers: kcc, dvyukov, srhines, mgorny, delcypher, jfb, jdoerfert, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D58184
llvm-svn: 354895
Sanjay Patel [Tue, 26 Feb 2019 16:44:08 +0000 (16:44 +0000)]
[InstSimplify] add tests for rotate; NFC
Rotate is a special-case of funnel shift that has different
poison constraints than the general case. That's not visible
yet in the existing tests, but it needs to be corrected.
llvm-svn: 354894
Yaxun Liu [Tue, 26 Feb 2019 16:20:41 +0000 (16:20 +0000)]
[OpenCL] Fix assertion due to blocks
A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called.
There is code
Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee());
getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle
BlockExpr and returns nullptr, which causes isa to assert.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D58658
llvm-svn: 354893
Marshall Clow [Tue, 26 Feb 2019 16:07:03 +0000 (16:07 +0000)]
Implement P1357: Traits for [Un]bounded Arrays; adopted in Kona
llvm-svn: 354891
Tatyana Krasnukha [Tue, 26 Feb 2019 15:38:30 +0000 (15:38 +0000)]
Fix short options syntax in Minidump test
llvm-svn: 354890
Sanjay Patel [Tue, 26 Feb 2019 15:25:42 +0000 (15:25 +0000)]
[InstCombine] remove duplicate (but not updated) tests; NFC
Not sure how it happened, but rL354886 was a duplicate of rL354881,
but not updated with rL354887.
llvm-svn: 354889
Clement Courbet [Tue, 26 Feb 2019 15:25:04 +0000 (15:25 +0000)]
[compiler-rt] Disable failing test on darwin during investigation.
/Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/llvm/projects/compiler-rt/test/asan/TestCases/Posix/bcmp_test.cc:14:12: error: CHECK: expected string not found in input
// CHECK: {{#1.*bcmp}}
^
<stdin>:2:57: note: scanning from here
==34677==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffee93777c4 at pc 0x0001068a7285 bp 0x7ffee9377770 sp 0x7ffee9376ef8
^
<stdin>:6:20: note: possible intended match here
#2 0x106888e77 in main bcmp_test.cc:12
^
llvm-svn: 354888
Sanjay Patel [Tue, 26 Feb 2019 15:18:49 +0000 (15:18 +0000)]
[InstCombine] canonicalize more unsigned saturated add with 'not'
Yet another pattern variation suggested by:
https://bugs.llvm.org/show_bug.cgi?id=14613
There are 8 more potential commuted patterns here on top of the
8 that were already handled (rL354221, rL354276, rL354393).
We have the obvious commute of the 'add' + commute of the cmp
predicate/operands (ugt/ult) + commute of the select operands:
Name: base
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ult i32 %x, %y
%r = select i1 %c, i32 -1, i32 %a
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a
Name: ugt
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ugt i32 %y, %x
%r = select i1 %c, i32 -1, i32 %a
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a
Name: commute select
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ult i32 %y, %x
%r = select i1 %c, i32 %a, i32 -1
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a
Name: ugt + commute select
%notx = xor i32 %x, -1
%a = add i32 %notx, %y
%c = icmp ugt i32 %x, %y
%r = select i1 %c, i32 %a, i32 -1
=>
%c2 = icmp ult i32 %a, %y
%r = select i1 %c2, i32 -1, i32 %a
https://rise4fun.com/Alive/den
llvm-svn: 354887
Sanjay Patel [Tue, 26 Feb 2019 15:18:44 +0000 (15:18 +0000)]
[InstCombine] add more tests for saturated add; NFC
llvm-svn: 354886
Emilio Cobos Alvarez [Tue, 26 Feb 2019 15:04:18 +0000 (15:04 +0000)]
[libclang] Avoid crashing when getting layout info of an undeduced type.
When the type is not deducible, return an error instead of crashing.
This fixes https://bugs.llvm.org/show_bug.cgi?id=40813.
Differential Revision: https://reviews.llvm.org/D58569
llvm-svn: 354885
Nirav Dave [Tue, 26 Feb 2019 15:02:32 +0000 (15:02 +0000)]
[DAG] Fix constant store folding to handle non-byte sizes.
Avoid crashes from zero-byte values due to sub-byte store sizes.
Reviewers: uabelho, courbet, rnk
Reviewed By: courbet
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58626
llvm-svn: 354884
Tatyana Krasnukha [Tue, 26 Feb 2019 14:50:40 +0000 (14:50 +0000)]
Fix error handling in Options::Parse
Moved `if (error.Fail())` to correct place to catch all faulty cases such as
"unknown or ambiguous option" which was ignored before.
llvm-svn: 354883
Simon Atanasyan [Tue, 26 Feb 2019 14:45:17 +0000 (14:45 +0000)]
[mips] Emit `.module softfloat` directive
This change fixes crash on an assertion in case of using
`soft float` ABI for mips32r6 target.
llvm-svn: 354882
Sanjay Patel [Tue, 26 Feb 2019 14:40:23 +0000 (14:40 +0000)]
[InstCombine] add more tests for saturated add; NFC
llvm-svn: 354881
Andrew Ng [Tue, 26 Feb 2019 14:34:49 +0000 (14:34 +0000)]
[clang-format] SpaceBeforeParens for lambda expressions
Add support for lambda expressions to the SpaceBeforeParens formatting
option.
Differential Revision: https://reviews.llvm.org/D58241
llvm-svn: 354880
Kadir Cetinkaya [Tue, 26 Feb 2019 14:23:47 +0000 (14:23 +0000)]
[clangd] Index UsingDecls
Summary:
D58340 enables indexing of USRs, this makes sure test in clangd are
aligned with the change
Reviewers: hokein
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58341
llvm-svn: 354879
Kadir Cetinkaya [Tue, 26 Feb 2019 14:23:12 +0000 (14:23 +0000)]
[clang][Index] Visit UsingDecls and generate USRs for them
Summary:
Add indexing of UsingDecl itself.
Also enable generation of USRs for UsingDecls, using the qualified name of the
decl.
Reviewers: ilya-biryukov, akyrtzi
Subscribers: arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58340
llvm-svn: 354878
Andrea Di Biagio [Tue, 26 Feb 2019 14:19:00 +0000 (14:19 +0000)]
[MCA] Always check if scheduler resources are unavailable when reporting dispatch stalls.
Dispatch stall cycles may be associated to multiple dispatch stall events.
Before this patch, each stall cycle was associated with a single stall event.
This patch also improves a couple of code comments, and adds a helper method to
query the Scheduler for dispatch stalls.
llvm-svn: 354877
George Rimar [Tue, 26 Feb 2019 14:14:49 +0000 (14:14 +0000)]
[yaml2obj][obj2yaml] - Add support for the architecture specific dynamic tags.
This allows tools to parse/dump the architecture specific tags
like DT_MIPS_*, DT_PPC64_* and DT_HEXAGON_*
Also fixes a bug in DynamicTags.def which was revealed in this patch.
Differential revision: https://reviews.llvm.org/D58667
llvm-svn: 354876
Pierre Gousseau [Tue, 26 Feb 2019 13:50:29 +0000 (13:50 +0000)]
revert r354873 as this breaks lldb builds.
llvm-svn: 354875
Pavel Labath [Tue, 26 Feb 2019 13:38:23 +0000 (13:38 +0000)]
[Sanitizer] Add interceptor for pthread_sigmask
Summary:
pthread_sigmask is just like sigprocmask, except that its behavior in
multithreaded programs is explicitly specified. Sanitizers were lacking
a common interceptor for pthread_sigmask (although some specific
sanitizers defined custom version), which lead to false positives
(at least in msan) when using this function.
The interceptor implementation, and its test are based on the equivalent
code for sigprocmask.
Reviewers: eugenis, vitalybuka
Subscribers: kubamracek, delcypher, jfb, jdoerfert, llvm-commits, #sanitizers
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D58382
llvm-svn: 354874
Pierre Gousseau [Tue, 26 Feb 2019 13:30:14 +0000 (13:30 +0000)]
[Driver] Allow enum SanitizerOrdinal to represent more than 64 different sanitizer checks, NFC.
enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks.
This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare".
Fixes: https://llvm.org/PR39425
Differential Revision: https://reviews.llvm.org/D57914
llvm-svn: 354873
Simon Pilgrim [Tue, 26 Feb 2019 13:22:35 +0000 (13:22 +0000)]
[AArch64] Add arithmetic zext bswap tests.
As requested on D58017.
llvm-svn: 354872
Xing GUO [Tue, 26 Feb 2019 13:06:16 +0000 (13:06 +0000)]
[llvm-objdump] Add `Version Definitions` dumper
Summary: `llvm-objdump` needs a `Version Definitions` dumper.
Reviewers: grimar, jhenderson
Reviewed By: grimar, jhenderson
Subscribers: rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58615
llvm-svn: 354871
Igor Kudrin [Tue, 26 Feb 2019 12:15:14 +0000 (12:15 +0000)]
[llvm-objdump] Implement -Mreg-names-raw/-std options.
The --disassembler-options, or -M, are used to customize
the disassembler and affect its output.
The two implemented options allow selecting register names on ARM:
* With -Mreg-names-raw, the disassembler uses rNN for all registers.
* With -Mreg-names-std it prints sp, lr and pc for r13, r14 and r15,
which is the default behavior of llvm-objdump.
Differential Revision: https://reviews.llvm.org/D57680
llvm-svn: 354870
Simon Pilgrim [Tue, 26 Feb 2019 12:04:37 +0000 (12:04 +0000)]
[AArch64] Add 'free' zext bswap tests.
As requested on D58017.
llvm-svn: 354869
Luke Cheeseman [Tue, 26 Feb 2019 12:02:12 +0000 (12:02 +0000)]
[ARM] Add Cortex-M35P
- Add LLVM backend support for Cortex-M35P
- Documentation can be found at
https://developer.arm.com/products/processors/cortex-m/cortex-m35p
Differentail Revision: https://reviews.llvm.org/D57763
llvm-svn: 354868
Simon Pilgrim [Tue, 26 Feb 2019 11:44:23 +0000 (11:44 +0000)]
[LegalizeDAG] Use APInt::getSplat helper to create bitreverse masks. NFCI.
llvm-svn: 354867
Simon Pilgrim [Tue, 26 Feb 2019 11:27:53 +0000 (11:27 +0000)]
[LegalizeDAG] Expand SADDO/SSUBO using SADDSAT/SSUBSAT (PR37763)
If SADDSAT/SSUBSAT are legal, then we can expand SADDO/SSUBO by performing a ADD/SUB and a SADDO/SSUBO and then compare the results.
I looked at doing this for UADDO/USUBO as well but as we don't have to do as many range comparisons I didn't see any/much benefit.
Differential Revision: https://reviews.llvm.org/D58637
llvm-svn: 354866
Kadir Cetinkaya [Tue, 26 Feb 2019 11:08:04 +0000 (11:08 +0000)]
[clangd] Update docs to mention YCM integration and new LSP features
Reviewers: gribozavr
Reviewed By: gribozavr
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D56718
llvm-svn: 354865
Ilya Biryukov [Tue, 26 Feb 2019 11:01:50 +0000 (11:01 +0000)]
[CodeComplete] Propagate preferred type for function arguments in more cases
Summary:
See the added test for some new cases.
This change also removes special code completion calls inside the
ParseExpressionList function now that we properly propagate expected
type to the function responsible for parsing elements of the expression list
(ParseAssignmentExpression).
Reviewers: kadircet
Reviewed By: kadircet
Subscribers: xbolva00, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58541
llvm-svn: 354864
Simon Pilgrim [Tue, 26 Feb 2019 11:01:08 +0000 (11:01 +0000)]
[AMDGPU] Regenerate bswap/bitreverse tests.
Make codegen changes more obvious in D58017
llvm-svn: 354863
Clement Courbet [Tue, 26 Feb 2019 10:54:45 +0000 (10:54 +0000)]
[llvm-exegesis] Teach llvm-exegesis to handle instructions with multiple tied variables.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58285
llvm-svn: 354862
Alexander Potapenko [Tue, 26 Feb 2019 10:46:21 +0000 (10:46 +0000)]
CodeGen: Explicitly initialize structure padding in the -ftrivial-auto-var-init mode
When generating initializers for local structures in the
-ftrivial-auto-var-init mode, explicitly wipe the padding bytes with
either 0x00 or 0xAA.
This will allow us to automatically handle the padding when splitting
the initialization stores (see https://reviews.llvm.org/D57898).
Reviewed at https://reviews.llvm.org/D58188
llvm-svn: 354861
Eugene Leviant [Tue, 26 Feb 2019 09:24:22 +0000 (09:24 +0000)]
[llvm-objcopy] Add --set-start, --change-start and --adjust-start
Differential revision: https://reviews.llvm.org/D58173
llvm-svn: 354854
Clement Courbet [Tue, 26 Feb 2019 09:16:51 +0000 (09:16 +0000)]
[compiler-rt] disable asan bcmp tests on android.
Android does not have bcmp.
sanitizer-x86_64-linux-android: run instrumented asan tests [arm/aosp_marlin-userdebug/PI] - stdio
llvm-svn: 354853
Clement Courbet [Tue, 26 Feb 2019 08:17:49 +0000 (08:17 +0000)]
[compiler-rt] Fix test broken by r354851.
error: CHECK: expected string not found in input
// CHECK: Uninitialized bytes in __interceptor_memcmp at offset 3
llvm-svn: 354852
Clement Courbet [Tue, 26 Feb 2019 07:43:01 +0000 (07:43 +0000)]
[compiler-rt] Intercept the bcmp() function.
Summary:
I have not introduced a separate hook for `bcmp()` as I don't think there
should be any reason for a sanitizer to treat it differently from `memcmp()`.
This is only enabled when building on POSIX with GNU extensions.
Context: this is to avoid losing coverage when emitting `bcmp() == 0` instead
of `memcmp() == 0` in llvm, see https://reviews.llvm.org/D56593.
Reviewers: mgorny, krytarowski, vitalybuka, dvyukov
Subscribers: kubamracek, dberris, delcypher, jdoerfert, #sanitizers, llvm-commits, jyknight
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D58379
llvm-svn: 354851
Eugene Leviant [Tue, 26 Feb 2019 07:38:21 +0000 (07:38 +0000)]
[ThinLTO] Use defined node and edge order when dumping DOT file
Differential revision: https://reviews.llvm.org/D58631
llvm-svn: 354850
Vlad Tsyrklevich [Tue, 26 Feb 2019 07:04:56 +0000 (07:04 +0000)]
Revert "Improve "llvm-nm -f sysv" output for Elf files"
This reverts commit r354833, it was causing ASan test failures on
sanitizer-x86_64-linux-fast.
llvm-svn: 354849
Louis Dionne [Tue, 26 Feb 2019 06:34:42 +0000 (06:34 +0000)]
[libc++] Rename _NOALIAS macro to _LIBCPP_NOALIAS
Summary:
For consistency, libc++ macros always start with _LIBCPP. This should
have no functionality change.
Reviewers: EricWF, mclow.lists
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D58558
llvm-svn: 354848
Chen Zheng [Tue, 26 Feb 2019 05:46:45 +0000 (05:46 +0000)]
[NFC] Add to contributor list.
llvm-svn: 354847
Dan Gohman [Tue, 26 Feb 2019 05:20:19 +0000 (05:20 +0000)]
[WebAssembly] Properly align fp128 arguments in outgoing varargs arguments
For outgoing varargs arguments, it's necessary to check the OrigAlign field
of the corresponding OutputArg entry to determine argument alignment, rather
than just computing an alignment from the argument value type. This is
because types like fp128 are split into multiple argument values, with
narrower types that don't reflect the ABI alignment of the full fp128.
This fixes the printf("printfL: %4.*Lf\n", 2, lval); testcase.
Differential Revision: https://reviews.llvm.org/D58656
llvm-svn: 354846
Philip Reames [Tue, 26 Feb 2019 04:30:33 +0000 (04:30 +0000)]
[ARM] Be super conservative about atomics
As requested during review of D57601 <https://reviews.llvm.org/D57601> https://reviews.llvm.org/D57601, be equally conservative for atomic MMOs as for volatile MMOs in all in tree backends. At the moment, all atomic MMOs are also volatile, but I'm about to change that.
Differential Revision: https://reviews.llvm.org/D58490
Note: D58498 landed in several pieces as individual backends were approved. This is the last chunk.
llvm-svn: 354845
Heejin Ahn [Tue, 26 Feb 2019 04:08:49 +0000 (04:08 +0000)]
[WebAssembly] Fix a bug deleting instruction in a ranged for loop
Summary: We shouldn't delete elements while iterating a ranged for loop.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58519
llvm-svn: 354844
Aaron Smith [Tue, 26 Feb 2019 03:49:05 +0000 (03:49 +0000)]
[CGDebugInfo] Set NonTrivial DIFlag to a c++ record if it's not trivial
This goes with https://reviews.llvm.org/D44406
llvm-svn: 354843
Heejin Ahn [Tue, 26 Feb 2019 03:29:59 +0000 (03:29 +0000)]
[WebAssembly] Improve readability of EH tests
Summary:
- Indent check lines to easily figure out try-catch-end structure
- Add the original C++ code the tests were genereated from
- Add a few more lines to make the structure more readable
- Rename a couple function / structures
- Add label and branch annotations to cfg-stackify-eh.ll
- Temporarily delete check lines for `test1` in `cfg-stackify-eh.ll`
because it will be updated in a later CL soon and there's no point of
making it look better here
Reviewers: dschuff
Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58562
llvm-svn: 354842
Aaron Smith [Tue, 26 Feb 2019 03:23:56 +0000 (03:23 +0000)]
[CodeView] Emit HasConstructorOrDestructor class option for non-trivial constructors
Reviewers: zturner, rnk, llvm-commits, aleksandr.urakov
Reviewed By: zturner, rnk
Subscribers: jdoerfert, majnemer, asmith
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D44406
llvm-svn: 354841
Reid Kleckner [Tue, 26 Feb 2019 02:30:00 +0000 (02:30 +0000)]
[llvm-cov] Fix llvm-cov on Windows and un-XFAIL test
Summary:
The llvm-cov tool needs to be able to find coverage names in the
executable, so the .lprfn and .lcovmap sections cannot be merged into
.rdata.
Also, the linker merges .lprfn$M into .lprfn, so llvm-cov needs to
handle that when looking up sections. It has to support running on both
relocatable object files and linked PE files.
Lastly, when loading .lprfn from a PE file, llvm-cov needs to skip the
leading zero byte added by the profile runtime.
Reviewers: vsk
Subscribers: hiraditya, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58661
llvm-svn: 354840
Reid Kleckner [Tue, 26 Feb 2019 02:22:22 +0000 (02:22 +0000)]
Revert r354832 "[ASTImporter] Add support for importing ChooseExpr AST nodes."
Test does not pass on Windows
llvm-svn: 354839
Reid Kleckner [Tue, 26 Feb 2019 02:22:17 +0000 (02:22 +0000)]
[MS] Fix for Bug 8446, template instantiation without a 'typename' keyword
Patch by Zahira Ammarguellat!
Differential Revision: https://reviews.llvm.org/D41950
llvm-svn: 354838
Reid Kleckner [Tue, 26 Feb 2019 02:11:25 +0000 (02:11 +0000)]
[X86] Fix bug in x86_intrcc with arg copy elision
Summary:
Use a custom calling convention handler for interrupts instead of fixing
up the locations in LowerMemArgument. This way, the offsets are correct
when constructed and we don't need to account for them in as many
places.
Depends on D56883
Replaces D56275
Reviewers: craig.topper, phil-opp
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D56944
llvm-svn: 354837
David Major [Tue, 26 Feb 2019 01:35:48 +0000 (01:35 +0000)]
[winasan] Unpoison stack memory when threads exit (redux)
This is a second attempt at r342652 using a TLS callback instead of an
interceptor.
In long-running builds we've seen some ASan complaints during thread creation
that we suspect are due to leftover poisoning from previous threads whose
stacks occupied that memory. This patch adds a callback that unpoisons the
stack memory when a thread exits.
Differential Revision: https://reviews.llvm.org/D58641
llvm-svn: 354836
Evgeniy Stepanov [Tue, 26 Feb 2019 00:22:22 +0000 (00:22 +0000)]
[sanitizer] Re-disable a few tests on android.
Tests were accidentally enabled r354829.
llvm-svn: 354834
Sunil Srivastava [Tue, 26 Feb 2019 00:19:39 +0000 (00:19 +0000)]
Improve "llvm-nm -f sysv" output for Elf files
Specifically, compute and Print Type and Section columns.
Differential Revision: https://reviews.llvm.org/D58263
llvm-svn: 354833
Tom Roeder [Mon, 25 Feb 2019 23:24:58 +0000 (23:24 +0000)]
[ASTImporter] Add support for importing ChooseExpr AST nodes.
Summary:
This allows ASTs to be merged when they contain ChooseExpr (the GNU
__builtin_choose_expr construction). This is needed, for example, for
cross-CTU analysis of C code that makes use of __builtin_choose_expr.
The node is already supported in the AST, but it didn't have a matcher
in ASTMatchers. So, this change adds the matcher and adds support to
ASTImporter.
Reviewers: shafik, a_sidorin, martong, aaron.ballman
Subscribers: aaron.ballman, rnkovacs, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58292
llvm-svn: 354832
JF Bastien [Mon, 25 Feb 2019 23:09:34 +0000 (23:09 +0000)]
[NFC] Reorder some mis-ordered tests
I somehow had misaligned some of the tests when I originally wrote this. Re-order them properly.
llvm-svn: 354831
Stanislav Mekhanoshin [Mon, 25 Feb 2019 22:59:55 +0000 (22:59 +0000)]
[AMDGPU] Added target to mir test. NFC.
Test was used without -mcpu, although tested instructions
not available on all ASICs.
llvm-svn: 354830
Evgeniy Stepanov [Mon, 25 Feb 2019 22:32:30 +0000 (22:32 +0000)]
[sanitizer] Remove "-android" from test_arch.
Summary:
ASan and Scudo tests are adding "-android" to test arch.
There are no tests that depend on it as far as I can see.
If necessary, do this instead:
REQUIRES: aarch64-target-arch && android
Reviewers: pcc, vitalybuka
Subscribers: srhines, kubamracek, mgorny, javed.absar, kristof.beyls, cryptoad, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58532
llvm-svn: 354829
Matt Arsenault [Mon, 25 Feb 2019 22:24:13 +0000 (22:24 +0000)]
RegBankSelect: Handle slightly more complex value mappings
Try to use concat_vectors. Also remove unnecessary assert on
pointers. Fixes asserting for <4 x s16> operations and 64-bit pointers
for AMDGPU.
llvm-svn: 354828
Alexander Kornienko [Mon, 25 Feb 2019 22:22:09 +0000 (22:22 +0000)]
Reapply "Make static counters in ASTContext non-static." with fixes.
This reverts commit
e50038e4dc53caee1acc811362ac0b15e00ef5eb.
llvm-svn: 354827
Erik Pilkington [Mon, 25 Feb 2019 21:35:14 +0000 (21:35 +0000)]
[CodeGenObjC] Fix a nullptr dyn_cast
ObjCMessageExpr::getInstanceReceiver returns nullptr if the receiver
is 'super'. Make this check more strict, since we don't care about
messages to super here.
rdar://
48247290
llvm-svn: 354826
Matt Arsenault [Mon, 25 Feb 2019 21:32:48 +0000 (21:32 +0000)]
AMDGPU/GlobalISel: Fix bit ops for non-power-of-2 sizes
llvm-svn: 354825
Emilio Cobos Alvarez [Mon, 25 Feb 2019 21:24:52 +0000 (21:24 +0000)]
[libclang] Expose warn_unused and warn_unused_result attributes.
This is helpful to properly detect them, and fixing issues like
https://github.com/rust-lang/rust-bindgen/issues/1518.
Differential Revision: https://reviews.llvm.org/D58570
llvm-svn: 354824
Emilio Cobos Alvarez [Mon, 25 Feb 2019 21:15:34 +0000 (21:15 +0000)]
[libclang] Fix a trivial error introduced in D57946.
The value for CXCursor_ConvergentAttr is not 420. I'm not really sure how easy
it is to test this, and I'm not familiar with the python bindings, just noticed
the error while looking at D57946 to write D58570.
Differential Revision: https://reviews.llvm.org/D58571
llvm-svn: 354823
Roman Lebedev [Mon, 25 Feb 2019 21:11:19 +0000 (21:11 +0000)]
Revert "[Support] Make raw_string_ostream unbuffered"
Shame on me, did not run all the tests, bots are angry.
This reverts commit r354819.
llvm-svn: 354822
Simon Pilgrim [Mon, 25 Feb 2019 21:05:09 +0000 (21:05 +0000)]
[LangRef] *.overflow intrinsics now support vectors
We have all the necessary legalization, expansion and unrolling support required for the *.overflow intrinsics with vector types, so update the docs to make that clear.
Note: vectorization is not in place yet (the non-homogenous return types aren't well supported) so we still must explicitly use the vectors intrinsics and not reply on slp/loop.
Differential Revision: https://reviews.llvm.org/D58618
llvm-svn: 354821
Roman Lebedev [Mon, 25 Feb 2019 20:51:49 +0000 (20:51 +0000)]
[Support] Make raw_string_ostream unbuffered
Summary:
In D58580 i have noted that `llvm::to_string()` is a memory hog.
It uses `raw_string_ostream`, and since it was buffered,
every `raw_string_ostream` had a cost of `BUFSIZ` bytes
(which is `8192` at least here). So every `llvm::to_string()`
call, even to just print an `int`, costed `8192` bytes.
In D58580, getting rid of that buffering //had// significant
performance and memory consumption improvements for `llvm-xray convert`.
Similarly, in D58580 @rnk pointed out that the `raw_svector_ostream`
is already unbuffered, and `write_unsigned_impl` and friends
do internal buffering. So it should be ok performance-wise to just
make the `raw_string_ostream` itself unbuffered.
Here, i don't have any perf measurements.
Another letdown is that i'm leaving a loose-end - not deleting the
`flush()` method. I don't expect that cleanup to be anything more
than just fixing every new compiler error, but i'm presently unable
to do that. Will look into that later.
Reviewers: rnk, zturner
Reviewed By: rnk
Subscribers: kristina, jdoerfert, llvm-commits, rnk
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58643
llvm-svn: 354819
Matt Arsenault [Mon, 25 Feb 2019 20:46:06 +0000 (20:46 +0000)]
AMDGPU/GlobalISel: Clamp max implicit_def elements
llvm-svn: 354818
Michael Kruse [Mon, 25 Feb 2019 20:34:15 +0000 (20:34 +0000)]
[OpenMP 5.0] Parsing/sema support for from clause with mapper modifier.
This patch implements the parsing and sema support for the OpenMP
'from'-clause with potential user-defined mappers attached.
User-defined mappers are a new feature in OpenMP 5.0. A 'from'-clause
can have an explicit or implicit associated mapper, which instructs the
compiler to generate and use customized mapping functions. An example is
shown below:
struct S { int len; int *d; };
#pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len])
struct S ss;
#pragma omp target update from(mapper(id): ss) // use the mapper with name 'id' to map ss from device
Contributed-by: Lingda Li <lildmh@gmail.com>
Differential Revision: https://reviews.llvm.org/D58638
llvm-svn: 354817
Matt Arsenault [Mon, 25 Feb 2019 20:29:04 +0000 (20:29 +0000)]
RegisterScavenger: Allow fail without spill
AMDGPU wants to use this in some contexts where
the spilling is either impossible, or a worse alternative
to doing something else.
llvm-svn: 354816
Matt Arsenault [Mon, 25 Feb 2019 20:16:11 +0000 (20:16 +0000)]
AMDGPU: Remove IntrReadMem from memtime/memrealtime intrinsics
EarlyCSE with MemorySSA was able to use this to merge multiple calls
with no intervening store.
llvm-svn: 354814
Matt Arsenault [Mon, 25 Feb 2019 20:00:25 +0000 (20:00 +0000)]
GlobalISel: Make legalizer/regbankselect clear NoPHIs property
If no phi existed in the original MIR and these introduced one, the
verifier would fail.
llvm-svn: 354813
Vlad Tsyrklevich [Mon, 25 Feb 2019 19:53:13 +0000 (19:53 +0000)]
Revert "Make static counters in ASTContext non-static."
This reverts commit r354795, I suspect it is causing test failures
on MSan sanitizer bots.
llvm-svn: 354812
Craig Topper [Mon, 25 Feb 2019 19:42:47 +0000 (19:42 +0000)]
[X86] Improve detection of unneeded shift amount masking to also handle the case that the LHS has known zeroes in it
If the LHS has known zeros, the RHS immediate will have had bits removed. So call computeKnownBits to get the known zeroes so we can handle this case.
Differential Revision: https://reviews.llvm.org/D58475
llvm-svn: 354811
Andrea Di Biagio [Mon, 25 Feb 2019 19:33:58 +0000 (19:33 +0000)]
Fix a sign compare warning breaking the -Werror build.
The warning was introduced at r354793.
llvm-svn: 354810
Matt Arsenault [Mon, 25 Feb 2019 19:24:46 +0000 (19:24 +0000)]
AMDGPU: Correct definitions for bitset instructions
These really read and write the result register, so these need a tied
input.
llvm-svn: 354809
Nikita Popov [Mon, 25 Feb 2019 18:54:17 +0000 (18:54 +0000)]
[Mips] Fix missing masking in fast-isel of br (PR40325)
Fixes https://bugs.llvm.org/show_bug.cgi?id=40325 by zero extending
(and x, 1) the condition before branching on it.
To avoid regressing trivial cases, I'm combining emission of cmp+br
sequences for the single-use + same block case (similar to what we
do in x86). icmpbr1.ll still regresses due to the cross-bb usage
of the condition.
Differential Revision: https://reviews.llvm.org/D58576
llvm-svn: 354808
Amara Emerson [Mon, 25 Feb 2019 18:52:54 +0000 (18:52 +0000)]
[AArch64][GlobalISel] Refactor selectBuildVector to use MachineIRBuilder. NFC.
This is a preparatory change as I want to use emitScalarToVector() elsewhere,
and in general we want to transition to MIRBuilder instead of using BuildMI
directly.
Differential Revision: https://reviews.llvm.org/D58528
llvm-svn: 354807