Jan Korous [Thu, 4 Jun 2020 03:04:48 +0000 (20:04 -0700)]
[docs] Fix self-contradictory description of llvm_unreachable
Just two paragraphs above it says:
"If the compiler does not support this [skipping code generation for a particular branch], it will fall back
to the "abort" implementation."
And that actually correctly describes llvm_unreachable implementation.
Differential Revision: https://reviews.llvm.org/D81130
Eduardo Caldas [Thu, 4 Jun 2020 17:27:35 +0000 (19:27 +0200)]
Propose naming principle for NodeRole and apply it
Reviewers: gribozavr2
Reviewed By: gribozavr2
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81157
Louis Dionne [Thu, 4 Jun 2020 18:04:01 +0000 (14:04 -0400)]
[libc++] Avoid warning for large types with std::atomic in the test suite
It is legitimate for the test suite to use types that are slow to use
with std::atomic, since we need coverage for those too. If we don't
disable the warning, it is promoted to an error, which prevents us
from testing such types.
LLVM GN Syncbot [Thu, 4 Jun 2020 17:56:21 +0000 (17:56 +0000)]
[gn build] Port
e53f5580578
LLVM GN Syncbot [Thu, 4 Jun 2020 17:56:21 +0000 (17:56 +0000)]
[gn build] Port
c973ad1878f
LLVM GN Syncbot [Thu, 4 Jun 2020 17:56:20 +0000 (17:56 +0000)]
[gn build] Port
ba2a01645b5
LLVM GN Syncbot [Thu, 4 Jun 2020 17:56:20 +0000 (17:56 +0000)]
[gn build] Port
69fa84a6e95
LLVM GN Syncbot [Thu, 4 Jun 2020 17:56:19 +0000 (17:56 +0000)]
[gn build] Port
6756a2c9533
LLVM GN Syncbot [Thu, 4 Jun 2020 17:56:19 +0000 (17:56 +0000)]
[gn build] Port
49a4f3f7d88
Huihui Zhang [Thu, 4 Jun 2020 17:46:32 +0000 (10:46 -0700)]
[NFC] Temporarily disable check for 'uglygep' while investigating some buildbot failure.
The purpose of vscale-factor-out-constant.ll is to check we are crashing
with blind cast 'Factor' in a MulExpr to SCEVConstant.
Thomas Raoux [Thu, 4 Jun 2020 17:45:53 +0000 (10:45 -0700)]
[mlir][gpu] Add subgroup Id/Size/Num to GPU dialect
Add SubgroupId, SubgroupSize and NumSubgroups to GPU dialect ops and add the
lowering of those ops to SPIRV.
Differential Revision: https://reviews.llvm.org/D81042
Amara Emerson [Wed, 3 Jun 2020 18:42:09 +0000 (11:42 -0700)]
[AArch64][GlobalISel] Move GlobalISel source files to a dedicated subdir.
Differential Revision: https://reviews.llvm.org/D81116
Jim Ingham [Thu, 4 Jun 2020 17:49:26 +0000 (10:49 -0700)]
Disable this test for Windows.
The printf expression crashes with the message:
Attempted to dereference an invalid pointer
Someone who knows more about Windows should suggest how to fix this.
Hans Wennborg [Thu, 4 Jun 2020 17:44:36 +0000 (19:44 +0200)]
Make regcoal_remat_empty_subrange.ll test require asserts build.
The -stress-sched flag is only available when asserts are enabled.
Jan Kratochvil [Thu, 4 Jun 2020 17:41:24 +0000 (19:41 +0200)]
[lldb] Fix SLEB128 decoding
Bug 46181 shows SLEB128 0xED9A924C00011151 decoded as 0xffffffff80011151.
LLDB show a wrong value for function argument
https://bugs.llvm.org/show_bug.cgi?id=46181
Differential Revision: https://reviews.llvm.org/D81119
Layton Kifer [Thu, 4 Jun 2020 17:33:03 +0000 (10:33 -0700)]
[TRE] Allow accumulator elimination when base case returns non-constant
Remove the requirement, that when performing accumulator elimination,
all other cases must return the same dynamic constant. We can do this by
initializing the accumulator with the identity value of the accumulation
operation, and inserting an additional operation before any return.
Differential Revision: https://reviews.llvm.org/D80844
Huihui Zhang [Thu, 4 Jun 2020 17:32:36 +0000 (10:32 -0700)]
[LSR][SCEVExpander] Avoid blind cast 'Factor' to SCEVConstant in FactorOutConstant.
Summary:
In SCEVExpander FactorOutConstant(), when GEP indexing into/over scalable vector,
it is legal for the 'Factor' in a MulExpr to be the size of a scalable vector
instead of a compile-time constant.
Current upstream crash with the test attached.
Reviewers: efriedma, sdesmalen, sanjoy.google, mkazantsev
Reviewed By: efriedma
Subscribers: hiraditya, javed.absar, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80973
Christopher Tetreault [Thu, 4 Jun 2020 16:57:36 +0000 (09:57 -0700)]
[SVE] Eliminate calls to default-false VectorType::get() from SystemZ
Reviewers: efriedma, jnspaulsson, kmclaughlin, sdesmalen, samparker, uweigand
Reviewed By: uweigand
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80329
Nathan James [Thu, 4 Jun 2020 16:58:23 +0000 (17:58 +0100)]
[clang-tidy] ignore builtin varargs from pro-type-vararg-check
Disables the check from warning on some built in vararg functions, Address [[ https://bugs.llvm.org/show_bug.cgi?id=45860 | Clang-tidy should not consider __builtin_constant_p a variadic function. ]]
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D80887
Zinovy Nis [Tue, 26 May 2020 06:06:59 +0000 (09:06 +0300)]
[clang-tidy][modernize-loop-convert] Make loop var type human readable
Differential Revision: https://reviews.llvm.org/D80536
ZequanWu [Thu, 4 Jun 2020 16:45:04 +0000 (09:45 -0700)]
[Doc] update ReleaseNotes with new warning note.
Alexey Bataev [Mon, 1 Jun 2020 16:39:25 +0000 (12:39 -0400)]
[OPENMP]Fix PR46146: Do not consider globalized variables as NRVO candidates.
Summary:
If the variables must be globalized in OpenMP mode (local automatic
variable, GPU compilation mode, the variable may escape its declaration
context by the reference or by the pointer), it should not be considered
as the NRVO candidate. Otherwise, incorrect the return value of the
function might not be updated.
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, sstefan1, cfe-commits, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80936
Fangrui Song [Thu, 4 Jun 2020 16:22:44 +0000 (09:22 -0700)]
Louis Dionne [Thu, 4 Jun 2020 16:03:04 +0000 (12:03 -0400)]
[libc++] Disable LLVM benchmarks in the Apple build
Fangrui Song [Thu, 4 Jun 2020 15:56:17 +0000 (08:56 -0700)]
[llvm-dwarfdump] Add a table header for -debug-line -verbose output
Like non-verbose output, so that it is easy to recognize the `Line,Column,File,ISA,Discriminator` column values.
Reviewed By: JDevlieghere, jhenderson
Differential Revision: https://reviews.llvm.org/D80874
Dmitri Gribenko [Thu, 4 Jun 2020 15:40:38 +0000 (17:40 +0200)]
Use libClangTesting in the unittest for AST matchers
Summary:
The unittest for AST matchers has its own way to specify language
standards. I unified it with the shared infrastructure from
libClangTesting.
Reviewers: jdoerfert, hlopko
Reviewed By: hlopko
Subscribers: mgorny, sstefan1, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81150
Louis Dionne [Thu, 4 Jun 2020 14:32:16 +0000 (10:32 -0400)]
[libc++] Merge the Apple install-libcxx and libcxxabi scripts
Also, refactor the now-merged script to remove code duplication in the
creation of universal dylibs.
Matt Arsenault [Thu, 4 Jun 2020 14:27:45 +0000 (10:27 -0400)]
DAG: Change computeKnownBitsForFrameIndex to be usable by GISel
This wasn't getting much value from the DAG or depth arguments, since
it's only called on the frame index root nodes. FrameIndexes can also
only return a scalar value, so it also didn't need DemandedElts.
Jonathan Coe [Thu, 4 Jun 2020 14:32:48 +0000 (15:32 +0100)]
[clang-format] Update GoogleStyle for C# code to match Google's internal C# style guide
Summary: Google's C# style guide is at https://google.github.io/styleguide/csharp-style.html
Reviewers: krasimir, MyDeveloperDay, sammccall
Reviewed By: MyDeveloperDay
Subscribers: cfe-commits, klimek
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D79715
Louis Dionne [Thu, 4 Jun 2020 14:18:50 +0000 (10:18 -0400)]
[libc++] Move away from the standalone build for Apple libc++ and libc++abi
Eduardo Caldas [Thu, 4 Jun 2020 14:12:15 +0000 (16:12 +0200)]
Rename arrow -> arrowToken for unified naming
Reviewers: gribozavr2
Reviewed By: gribozavr2
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81155
Balázs Kéri [Thu, 4 Jun 2020 13:24:08 +0000 (15:24 +0200)]
[Analyzer][StreamChecker] Updated initialization of BugType's.
Summary:
BugType objects are initialized in-class instead of by lazy initialization.
FuchsiaHandleChecker does this already.
Reviewers: Szelethus, baloghadamsoftware, martong
Reviewed By: Szelethus
Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80725
Russell Gallop [Thu, 4 Jun 2020 13:56:09 +0000 (14:56 +0100)]
Revert "Relands "[YAMLVFSWriter][Test][NFC] Add couple tests" vol. 2"
This reverts commit
30949926f98576fbff8d5ad0390be5124ffacd7e.
This was failing on bot here:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/32749
Matt Arsenault [Wed, 3 Jun 2020 21:14:54 +0000 (17:14 -0400)]
RegAllocFast: Remove dead code
Alexey Bataev [Wed, 22 Apr 2020 14:18:04 +0000 (10:18 -0400)]
[OPENMP]Fix PR45383: type dependent array subscripts are diagnosed erroneously.
Summary:
If the array subscript expression is type depent, its analysis must be
delayed before its instantiation.
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, caomhin, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D78637
Sanjay Patel [Thu, 4 Jun 2020 12:50:42 +0000 (08:50 -0400)]
[x86] add test/code comment for chain value use (PR46195); NFC
Denis Antrushin [Wed, 3 Jun 2020 14:08:48 +0000 (17:08 +0300)]
[TableGen] Handle (outs variable_ops)
When `variable_ops` is specified in `InOperandList` of instruction,
it behaves as expected, i.e., does not count as operand.
So for `(ins variable_ops)` instruction description will have 0
operands. However when used in OutOperandList it is counted as
operand. So `(outs variable_ops)` results in instruction with
one def.
This patch makes behavior of `variable_ops` in `out` list to match
that of `in` list.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D81095
LLVM GN Syncbot [Thu, 4 Jun 2020 12:56:45 +0000 (12:56 +0000)]
[gn build] Port
48cd9d9dd86
Pavel Labath [Wed, 3 Jun 2020 10:08:45 +0000 (12:08 +0200)]
[Support] Use outs() in ToolOutputFile
Summary:
If the output filename was specified as "-", the ToolOutputFile class
would create a brand new raw_ostream object referring to the stdout.
This patch changes it to reuse the llvm::outs() singleton.
At the moment, this change should be "NFC", but it does enable other
enhancements, like the automatic stdout/stderr synchronization as
discussed on D80803.
I've checked the history, and I did not find any indication that this
class *has* to use a brand new stream object instead of outs() --
indeed, it is special-casing "-" in a number of places already, so this
change fits the pattern pretty well. I suspect the main reason for the
current state of affairs is that the class was originally introduced
(r111595, in 2010) as a raw_fd_ostream subclass, which made any other
solution impossible.
Another potential benefit of this patch is that it makes it possible to
move the raw_ostream class out of the business of special-casing "-" for
stdout handling. That state of affairs does not seem appropriate because
"-" is a valid filename (albeit hard to access with a lot of command
line tools) on most systems. Handling "-" in ToolOutputFile seems more
appropriate.
To make this possible, this patch changes the return type of
llvm::outs() and errs() to raw_fd_ostream&. Previously the functions
were constructing objects of that type, but returning a generic
raw_ostream reference. This makes it possible for new ToolOutputFile and
other code to use raw_fd_ostream methods like error() on the outs()
object. This does not seem like a bad thing (since stdout is a file
descriptor which can be redirected to anywhere, it makes sense to ask it
whether the writing was successful or if it supports seeking), and
indeed a lot of code was already depending on this fact via the
ToolOutputFile "back door".
Reviewers: dblaikie, JDevlieghere, MaskRay, jhenderson
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81078
AndreyChurbanov [Thu, 4 Jun 2020 12:39:45 +0000 (15:39 +0300)]
[openmp] Fixed nonmonotonic schedule implementation.
Differential Revision: https://reviews.llvm.org/D80942
Sanjay Patel [Thu, 4 Jun 2020 12:33:24 +0000 (08:33 -0400)]
[x86] add FileCheck / assertions to test; NFC
Anastasia Stulova [Thu, 4 Jun 2020 11:29:02 +0000 (12:29 +0100)]
[OpenCL] Add cl_khr_extended_subgroup extensions.
Added extensions and their function declarations into
the standard header.
Patch by Piotr Fusik!
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79781
Vince Bridgers [Mon, 1 Jun 2020 00:03:16 +0000 (19:03 -0500)]
[analyzer] Ignore calculated indices of <= 0 in VLASizeChecker
Summary:
See https://bugs.llvm.org/show_bug.cgi?id=46128. The checker does not
yet comprehend constraints involving multiple symbols, so it's possible
to calculate a VLA size that's negative or 0. A LIT is added to catch
regressions, and this change simply bails if a VLA size of 0 or less is
calculated.
Reviewers: balazske, NoQ, martong, baloghadamsoftware, Szelethus, gamesh411
Reviewed By: balazske, NoQ, Szelethus
Subscribers: xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, Charusso, ASDenysPetrov, cfe-commits, dkrupp
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80903
Sanjay Patel [Thu, 4 Jun 2020 12:17:53 +0000 (08:17 -0400)]
[PhaseOrdering] add more tests for vector reductions; NFC
More coverage for D80867.
Simon Moll [Thu, 4 Jun 2020 09:09:48 +0000 (11:09 +0200)]
[VP][Fix] canIgnoreVectorLength for scalable types
This patch fixes VPIntrinsic::canIgnoreVectorLength when used on a
VPIntrinsic with scalable vector types. Also includes new unittest cases
for the '<vscale x 1 x whatever>' and '%evl == vscale' corner cases.
David Green [Thu, 4 Jun 2020 11:31:42 +0000 (12:31 +0100)]
[ARM] FP16 conversion tests. NFC
Nico Weber [Thu, 4 Jun 2020 12:10:16 +0000 (08:10 -0400)]
[gn build] port some -Wno flags for gcc from the cmake build.
Eduardo Caldas [Thu, 4 Jun 2020 12:03:04 +0000 (14:03 +0200)]
Add support for IntegerLiteral in SyntaxTree
Reviewers: gribozavr2
Reviewed By: gribozavr2
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81135
Max Kazantsev [Thu, 4 Jun 2020 11:54:23 +0000 (18:54 +0700)]
[InstCombine][NFC] Factor out constant check
We plan to add more transforms here. Besides, this check should be
done in the beginning just from function's name.
Max Kazantsev [Thu, 4 Jun 2020 11:14:30 +0000 (18:14 +0700)]
[Test] Add test showing missing opportunity of folding ICmp(Phi(Consts...))
Georgii Rymar [Thu, 4 Jun 2020 11:22:06 +0000 (14:22 +0300)]
[ObjectYAML] - Remove unused function. NFC.
Was introduced in D81005 by mistake.
Catched by BB:
http://lab.llvm.org:8011/builders/clang-ppc64le-rhel/builds/4070/steps/build%20stage%201/logs/stdio
Paul Walker [Mon, 1 Jun 2020 10:09:58 +0000 (10:09 +0000)]
[FileCheck] Implement equality operators for ExpressionValue.
Subscribers: hiraditya, thopre, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81094
Yvan Roux [Thu, 4 Jun 2020 11:12:26 +0000 (13:12 +0200)]
[ARM][MachineOutliner] Remove unneeded dynamic allocation.
Simon Pilgrim [Thu, 4 Jun 2020 10:49:28 +0000 (11:49 +0100)]
[DAG] scalarizeBinOpOfSplats - extract from the source of splat vector (PR46189)
D79003/rG9fa58d1bf2f8 exposed an issue with scalarizeBinOpOfSplats that we were extracting from the splatted vector result instead of the source, the splat index is only valid for the source vector not the result, which may contain undefs, including at the splat index.
Tim Northover [Thu, 4 Jun 2020 10:15:03 +0000 (11:15 +0100)]
Revert "[DAGCombiner] avoid unnecessary indirection from SDNode/SDValue; NFCI"
This reverts commit
21dadd774f56778ef68c1ce307205dfbdacc793a.
In at least PromoteIntBinOps, they wanted to know about users of *all* values
produced by the node not just the integer being promoted. For example not
replacing chain users if the operation was a load breaks the ordering of the
DAG.
Georgii Rymar [Mon, 1 Jun 2020 09:13:02 +0000 (12:13 +0300)]
[yaml2obj] - Add a way to exclude specified sections from the section header.
This implements a new "Excluded" key that can be used
to exclude entries from section header:
```
SectionHeaderTable:
Sections:
...
Excluded:
- Name: .foo
```
Differential revision: https://reviews.llvm.org/D81005
Djordje Todorovic [Thu, 4 Jun 2020 09:59:04 +0000 (11:59 +0200)]
[CSInfo][MIPS] Describe parameter value loaded by ADDiu
Describe parameter's value loaded by MIPS ADDiu instruction.
When parameter's value is loaded into a register by mips ADDiu/DADDiu
instruction, it could be described correctly and emitted as
DW_AT_GNU_call_site_value.
Patch by Nikola Tesic
Differential revision: https://reviews.llvm.org/D78108
Florian Hahn [Thu, 4 Jun 2020 10:15:01 +0000 (11:15 +0100)]
[Sema] Remove unused matrix_begin/end helpers (NFC).
The matrix_types() helper returning an iterator range is used instead.
Simon Pilgrim [Thu, 4 Jun 2020 09:43:19 +0000 (10:43 +0100)]
[X86] Add test case for PR46189
Georgii Rymar [Thu, 4 Jun 2020 10:10:43 +0000 (13:10 +0300)]
Revert "[yaml2obj] - Allocate the file space for SHT_NOBITS sections in some cases."
This reverts commit
aa3a85cdaa4432ca389bdbf48049eaa64dc6e266.
There are problems with it. See here: https://reviews.llvm.org/D80629
Esme-Yi [Thu, 4 Jun 2020 10:09:06 +0000 (10:09 +0000)]
[PowerPC][NFC] Testing ROTL of v1i128.
Summary: A bug is reported in bugzilla-45628, where the swap_with_shift case can’t be matched to a single HW instruction xxswapd as expected. In fact the case matches the idiom of rotate, but PPC doesn’t support ROTL v1i128.
This is a NFC patch for testing ROTL with v1i128 at master.
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D81073
Kadir Cetinkaya [Thu, 4 Jun 2020 10:02:49 +0000 (12:02 +0200)]
[clangd] Fix build for gcc 7.4
Vitaly Buka [Thu, 4 Jun 2020 09:38:58 +0000 (02:38 -0700)]
[StackSafety] Rename testing opts
Vitaly Buka [Tue, 2 Jun 2020 04:40:47 +0000 (21:40 -0700)]
[StackSafety,NFC] Remove SCEVRewriteVisitor
Summary: Depends on D80956.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80976
Jay Foad [Wed, 11 Mar 2020 11:33:30 +0000 (11:33 +0000)]
[AMDGPU] More accurate gfx10 latencies
Differential Revision: https://reviews.llvm.org/D81012
Jay Foad [Tue, 10 Mar 2020 13:08:58 +0000 (13:08 +0000)]
[AMDGPU] Introduce new sched classes for transcendental instructions
This is in preparation for scheduling them slightly differently on
gfx10. NFC.
Differential Revision: https://reviews.llvm.org/D81011
Kazushi (Jam) Marukawa [Thu, 4 Jun 2020 09:27:57 +0000 (11:27 +0200)]
[VE] Clean SDNodeXForm stuff
Summary:
Gather definitions of SDNodeXForm and change them to call C functions
instead of copying C expressions in td files. Doing this solved some
bugs in mimm detections.
Differential Revision: https://reviews.llvm.org/D81132
Georgii Rymar [Wed, 3 Jun 2020 15:19:05 +0000 (18:19 +0300)]
[llvm-readelf] - Do not try to read past the end of the file when dumping the the SHT_GNU_HASH.
We have unobvious issue in the condition that is used to check
that we do not read past the EOF.
The problem is that the result of "GnuHashTable->nbuckets * 4" expression is uint32.
Because of that it was still possible to overflow it and pass the check.
There was no such problem with the "GnuHashTable->maskwords * sizeof(typename ELFT::Off)"
condition, because of `sizeof` on the right (which gives 64-bits value on x64),
but I've added an explicit conversion to 64-bit value for `GnuHashTable->maskwords` too.
Differential revision: https://reviews.llvm.org/D81103
Dmitri Gribenko [Thu, 4 Jun 2020 08:35:43 +0000 (10:35 +0200)]
Make syntax tree test print the line number when it fails
Summary:
The syntax tree test uses a helper function that executes all testing
assertions. When an assertion fails, the only line number that gets
printed to the log refers to the helper function. After this change, we
would also get the line number of the EXPECT_TRUE macro invocation
(unfortunately, the line number of the last token of it, not the first
one, but there's not much I can do about it).
Reviewers: hlopko, eduucaldas
Reviewed By: hlopko, eduucaldas
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81107
Qiu Chaofan [Thu, 4 Jun 2020 08:30:17 +0000 (16:30 +0800)]
[PowerPC] Require nsz flag for c-a*b to FNMSUB
On PowerPC, FNMSUB (both VSX and non-VSX version) means -(a*b-c). But
the backend used to generate these instructions regardless whether nsz
flag exists or not. If a*b-c==0, such transformation changes sign of
zero.
This patch introduces PPC specific FNMSUB ISD opcode, which may help
improving combined FMA code sequence.
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D76585
Yevgeny Rouban [Thu, 4 Jun 2020 08:34:14 +0000 (15:34 +0700)]
Extend InvokeInst !prof branch_weights metadata to unwind branches
Allow InvokeInst to have the second optional prof branch weight for
its unwind branch. InvokeInst is a terminator with two successors.
It might have its unwind branch taken many times. If so
the BranchProbabilityInfo unwind branch heuristic can be inaccurate.
This patch allows a higher accuracy calculated with both branch
weights set.
Changes:
- A new section about InvokeInst is added to
the BranchWeightMetadata page. It states the old information that
missed in the doc and adds new about the second branch weight.
- Verifier is changed to allow either 1 or 2 branch weights
for InvokeInst.
- A new test is written for BranchProbabilityInfo to demonstrate
the main improvement of the simple fix in calcMetadataWeights().
- Several new testcases are created for Inliner. Those check that
both weights are accounted for invoke instruction weight
calculation.
- PGOUseFunc::setBranchWeights() is fixed to be applicable to
InvokeInst.
Reviewers: davidxl, reames, xur, yamauchi
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80618
Raphael Isemann [Thu, 4 Jun 2020 08:27:03 +0000 (10:27 +0200)]
[lldb][NFC] Address some review feedback for D80775 ('command script delete' completion)
In the similar review D81128, Jonas pointed out some style errors that also
apply to D80775 (which is already committed). Also applying the changes
suggested there to this code.
Jan Korous [Thu, 4 Jun 2020 04:39:55 +0000 (21:39 -0700)]
Relands "[YAMLVFSWriter][Test][NFC] Add couple tests" vol. 2
This reverts commit
e4e3e41905d182c0f3d5b0b9406e3cbf2aabb30f.
Fixed dangling StringRef in test.
Gongyu Deng [Thu, 4 Jun 2020 07:53:05 +0000 (09:53 +0200)]
[lldb] tab completion for `command script delete'
Summary: Added the tab completion for `command script delete`.
Reviewers: teemperor, JDevlieghere
Reviewed By: teemperor
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D80775
Jan Korous [Thu, 4 Jun 2020 08:10:49 +0000 (01:10 -0700)]
[Support][NFC] Tests for root_name(), root_directory() and root_path()
It's literally just doc comments converted to unittests.
Yevgeny Rouban [Thu, 4 Jun 2020 07:30:58 +0000 (14:30 +0700)]
[Instruction] Remove setProfWeight()
Remove the function Instruction::setProfWeight() and make
use of Instruction::copyMetadata(.., {LLVMContext::MD_prof}).
This is correct for all use cases of setProfWeight() as it
is applied to CallBase instructions only.
This change results in prof metadata copied intact even if
the source has "VP". The old pair of calls
extractProfTotalWeight() + setProfWeight() resulted in
setting branch_weights if the source had "VP" data.
Reviewers: yamauchi, davidxl
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80987
Mikael Holmen [Thu, 4 Jun 2020 07:38:56 +0000 (09:38 +0200)]
[WebAssembly] Fix gcc warning [NFC]
gcc 7.4 complained with
../lib/Target/WebAssembly/WebAssemblyFixBrTableDefaults.cpp:125:23: warning: extra ';' [-Wpedantic]
false);
^
Sam Parker [Tue, 2 Jun 2020 11:29:42 +0000 (12:29 +0100)]
[NFCI][CostModel][AMDGPU] Simplify getUserCost
Casts and intrinsics are now handled by the default implementation
of getUserCost, so remove them from the backends switch statement.
https://reviews.llvm.org/D80994
Jean Perier [Thu, 4 Jun 2020 07:41:28 +0000 (09:41 +0200)]
[flang] Fix IsConstantExpr for division expressions
Summary:
Fortran::evaluate::IsConstantExpr did not check that the numerator
was a constant expression. This patch fixes the issue.
Reviewers: DavidTruby, klausler, schweitz, PeteSteinfeld, jdoerfert, sscalpone
Reviewed By: klausler, PeteSteinfeld, sscalpone
Subscribers: llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D81096
Kazu Hirata [Thu, 4 Jun 2020 07:40:17 +0000 (00:40 -0700)]
[Inlining] Introduce -enable-npm-pgo-inline-deferral
Summary:
Experiments show that inline deferral past pre-inlining slightly
pessimizes the performance.
This patch introduces an option to control inline deferral during PGO.
The option defaults to true for now (that is, NFC).
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: eraman, hiraditya, haicheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80776
Craig Topper [Thu, 4 Jun 2020 06:19:03 +0000 (23:19 -0700)]
[X86] Remove (V)MOVHPDrm patterns that involve bitcast+scalar_to_vec+loadi64.
I think these are left over from when we used to type legalize
v2f32 loads using bitcast+scalar_to_vec+loadi64 on 64-bit targets.
These days we use loadf64. If this becomes a problem a better
solution would be a DAG combine to turn it into scalar_to_vec+loadf64.
Kazushi (Jam) Marukawa [Thu, 4 Jun 2020 07:05:19 +0000 (09:05 +0200)]
[VE] Change to use EXTRACT_SUBREG instead of COPY_TO_REGCLASS
Summary:
Change to use EXTRACT_SUBREG instead of COPY_TO_REGCLASS in order to
remove unnecessary copy instructions.
Differential Revision: https://reviews.llvm.org/D81129
David Sherwood [Tue, 2 Jun 2020 13:44:24 +0000 (14:44 +0100)]
[SVE] Fix ubsan issues in DecodeIITType
In an earlier patch I removed the need for
IITDescriptor::ScalableVecArgument, which involved changing
DecodeIITType to pull out the last IIT_Info from the list. However,
it turns out this is unsafe and causes ubsan failures. I've tried to
fix this a different way by simply passing the last IIT_Info as an
additional argument to DecodeIITType.
Differential Revision: https://reviews.llvm.org/D81057
Martin Boehme [Fri, 29 May 2020 08:36:19 +0000 (10:36 +0200)]
[clang] Always allow including builtin headers in [no_undeclared_headers] modules.
Previously, this would fail if the builtin headers had been "claimed" by
a different module that wraps these builtin headers. libc++ does this,
for example.
This change adds a test demonstrating this situation; the test fails
without the fix.
Madhur Amilkanthwar [Thu, 4 Jun 2020 04:21:18 +0000 (09:51 +0530)]
Utility to dump .dot representation of SelectionDAG without firing viewer
Summary:
This patch adds support for dumping .dot
representation of SelectionDAG. It is inspired from the fact that,
a developer may want to just dump the graph at
a predictable path with a simple name to compare.
The exisitng utility (i.e. viewGraph) are overkill
for this motive hence this patch adds the requires support
while using the core routines from GraphWriter.
Example usage: DAG.dumpDotGraph("/tmp/graph.dot", "MyGraph")
will create /tmp/graph.dot file when DAG is an
object of SelectionDAG class.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D80711
Siva Chandra Reddy [Thu, 4 Jun 2020 05:39:34 +0000 (22:39 -0700)]
[libc][NFC] Add ceil[f], floor[f] and trunc[f] to the spec and config files.
Fangrui Song [Thu, 4 Jun 2020 05:05:15 +0000 (22:05 -0700)]
[gcov] Don't error 'unexpected end of memory buffe'
Fangrui Song [Thu, 4 Jun 2020 04:14:54 +0000 (21:14 -0700)]
[gcov] Make `Creating 'filename'` compatible with gcov
And clean up llvm-cov.test a bit
Philip Reames [Thu, 4 Jun 2020 03:31:17 +0000 (20:31 -0700)]
[Statepoint] Remove last of old ImmutableStatepoint code
To do so, I had to sink the old school inline operand handling into GCStatepointInst which is non ideal. This code should be removed shortly and I was able to at least clean it up a bunch.
Philip Reames [Thu, 4 Jun 2020 03:05:19 +0000 (20:05 -0700)]
[Statepoint] Delete more dead code from old wrappers
The verify() routine duplicates IR/Verifier.cpp checks, so while not technically dead it doesn't add any value either.
Philip Reames [Thu, 4 Jun 2020 02:49:25 +0000 (19:49 -0700)]
[Statepoint] Start the process of removing old interfaces
We introduced the GCStatepointInst class and have migrated almost all users of Statepoint/ImmutableStatepoint to the new API. Given downstream consumers have had a week to migrate, remove code which is now dead.
Eric Christopher [Thu, 4 Jun 2020 02:59:26 +0000 (19:59 -0700)]
Replace integer usage with enumeration.
Fangrui Song [Thu, 4 Jun 2020 02:58:28 +0000 (19:58 -0700)]
[gcov] Delete XFAIL: host-byteorder-big-endian
Add two to function-numbering.ll and exit-block.ll
Fangrui Song [Thu, 4 Jun 2020 02:29:21 +0000 (19:29 -0700)]
[gcov] Improve .gcno compatibility with gcov and use DataExtractor
llvm-cov.test and many Inputs/test* files contain wrong tests.
This patch rewrites a large portion of these files.
The pre-canned .gcno & .gcda are replaced by binaries produced by
clang --coverage (compatible with gcov 4.8~7)
(after some GCDAProfiling.c bugs were fixed by my previous commits).
Also make llvm-cov gcov on a little-endian host capable to parse big-endian .gcno and .gcda,
and make llvm-cov gcov on big-endian host capable to parse little-endian .gcno and .gcda
Yaxun (Sam) Liu [Fri, 1 May 2020 15:30:24 +0000 (11:30 -0400)]
[CUDA][HIP] Fix constexpr variables for C++17
constexpr variables are compile time constants and implicitly const, therefore
they are safe to emit on both device and host side. Besides, in many cases
they are intended for both device and host, therefore it makes sense
to emit them on both device and host sides if necessary.
In most cases constexpr variables are used as rvalue and the variables
themselves do not need to be emitted. However if their address is taken,
then they need to be emitted.
For C++14, clang is able to handle that since clang emits them with
available_externally linkage together with the initializer.
However for C++17, the constexpr static data member of a class or template class
become inline variables implicitly. Therefore they become definitions with
linkonce_odr or weak_odr linkages. As such, they can not have available_externally
linkage.
This patch fixes that by adding implicit constant attribute to
file scope constexpr variables and constexpr static data members
in device compilation.
Differential Revision: https://reviews.llvm.org/D79237
Xing GUO [Thu, 4 Jun 2020 01:25:26 +0000 (09:25 +0800)]
[ObjectYAML][ELF] Let the endianness of DWARF sections be inferred from FileHeader.
This patch helps infer the endianness of DWARF sections from `FileHeader`.
Reviewed By: jhenderson, grimar
Differential Revision: https://reviews.llvm.org/D81051
Xing GUO [Thu, 4 Jun 2020 00:53:40 +0000 (08:53 +0800)]
[ObjectYAML][DWARF] Support emitting the .debug_aranges section in ELFYAML.
This patch enables yaml2obj to emit the .debug_aranges section in ELFYAML.
Known issues:
- The current implementation of `debug_aranges` doesn't support emitting `segment` in the `(segment, address, length)` tuple. I will fix it in a follow-up patch.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D80972
Julian Lettner [Thu, 21 May 2020 18:14:55 +0000 (11:14 -0700)]
[Darwin] Add tests for OS version checking
Extract ParseVersion helper function for testing.
Reviewed By: delcypher
Differential Revision: https://reviews.llvm.org/D80761
Matt Arsenault [Sun, 31 May 2020 15:58:56 +0000 (11:58 -0400)]
GlobalISel: Start defining strict FP instructions
The AMDGPU lowering for unconstrained G_FDIV sometimes needs to
introduce a mode switch in the middle, so it's helpful to have
constrained instructions available to legalize this. Right now nothing
is preventing reordering of the mode switch with the other
instructions in the expansion.
Quentin Colombet [Wed, 3 Jun 2020 23:15:23 +0000 (16:15 -0700)]
[RegisterCoalescer] Update empty subranges when rematerializing
When we rematerialize a value as part of the coalescing, we may
widen the register class of the destination register.
When this happens, updateRegDefUses may create additional subranges
to account for the wider register class.
The created subranges are empty and if they are not defined by
the rematerialized instruction we clean them up.
However, if they are defined by the rematerialized instruction but
unused, we failed to flag them as dead definition and would leave
them as empty live-range.
This is wrong because empty live-ranges don't interfere with anything,
thus if we don't fix them, we would fail to account that the
rematerialized instruction clobbers some lanes.
E.g., let us consider the following pseudo code:
def.lane_low64:reg128 = ldimm
newdef:reg32 = COPY def.lane_low64_low32
When rematerialization happens for newdef, we end up with:
newdef.lane_low64:reg128 = ldimm
= use newdef.lane_low64_low32
Let's look at the live interval of newdef.
Before rematerialization, we would get:
newdef [defIdx, useIdx:0) 0@defIdx
Right after updateRegDefUses, newdef register class is widen to reg128
and the subrange definitions will be augmented to fill the subreg that
is used at the definition point, here lane_low64.
The resulting live interval would be:
newdef [newDefIdx, useIdx:0) 0@newDefIdx
* lane_low64_high32 EMPTY
* lane_low64_low32 [newDefIdx, useIdx:0)
Before this patch this would be the final status of the live interval.
Therefore we miss that lane_low64_high32 is actually live on the
definition point of newdef.
With this patch, after rematerializing, we check all the added subranges
and for the ones that are defined but empty, we flag them as dead def.
Thus, in that case, newdef would look like this:
newdef [newDefIdx, useIdx:0) 0@newDefIdx
* lane_low64_high32 [newDefIdx, newDefIdxDead) ; <-- instead of EMPTY
* lane_low64_low32 [newDefIdx, useIdx:0)
This fixes https://www.llvm.org/PR46154