Simon Pilgrim [Wed, 26 Dec 2018 12:09:10 +0000 (12:09 +0000)]
[AMDGPU] Regenerate i64 shift tests.
To show codegen diff due to a future SimplifyDemandedBits patch.
llvm-svn: 350065
Max Kazantsev [Wed, 26 Dec 2018 08:22:25 +0000 (08:22 +0000)]
[NFC] Use utility function for guards detection
llvm-svn: 350064
Petar Avramovic [Tue, 25 Dec 2018 14:42:30 +0000 (14:42 +0000)]
[MIPS GlobalISel] Select G_SELECT
Add widen scalar for type index 1 (i1 condition) for G_SELECT.
Select G_SELECT for pointer, s32(integer) and smaller low level
types on MIPS32.
Differential Revision: https://reviews.llvm.org/D56001
llvm-svn: 350063
Max Kazantsev [Tue, 25 Dec 2018 07:20:06 +0000 (07:20 +0000)]
[NFC] Reuse variables instead of re-calling getParent
llvm-svn: 350062
Kang Zhang [Tue, 25 Dec 2018 03:29:51 +0000 (03:29 +0000)]
[PowerPC] Fix the bug of ISD::ADDE to set its second return type to glue
Summary:
This patch is to fix the bug imported by rL341634.
In above submit , the the return type of ISD::ADDE is
14224: SDVTList VTs = DAG.getVTList(MVT::i64, MVT::i64),
but in fact, the second return type of ISD::ADDE should be
MVT::Glue not MVT::i64.
Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D55977
llvm-svn: 350061
Nico Weber [Mon, 24 Dec 2018 23:06:29 +0000 (23:06 +0000)]
[gn build] Make NOSORT line actually work
GN wants the NOSORT line to be the first line of a comment block, not the last
line.
I sent https://gn-review.googlesource.com/c/gn/+/3560 to support having it in
the last line too, but since it will be a while until everyone has that change
even if it's expected, use the form that works today.
Differential Revision: https://reviews.llvm.org/D56065
llvm-svn: 350060
Craig Topper [Mon, 24 Dec 2018 19:40:20 +0000 (19:40 +0000)]
[X86] Use GetDemandedBits to simplify the operands of PMULDQ/PMULUDQ.
This is an alternative to what I attempted in D56057.
GetDemandedBits is a special version of SimplifyDemandedBits that allows simplifications even when the operand has other uses. GetDemandedBits will only do simplifications that allow a node to be bypassed. It won't create new nodes or alter any of the other users.
I had to add support for bypassing SIGN_EXTEND_INREG to GetDemandedBits.
Based on a patch that Simon Pilgrim sent me in email.
Fixes PR40142.
llvm-svn: 350059
Craig Topper [Mon, 24 Dec 2018 19:40:17 +0000 (19:40 +0000)]
[X86] Add test cases for PR40142. NFC
llvm-svn: 350058
George Karpenkov [Mon, 24 Dec 2018 18:45:18 +0000 (18:45 +0000)]
[analyzer] [NFC] Clean up the mess of constructing argument effects in RetainCountChecker
Previously, argument effects were stored in a method variable, which was
effectively global.
The global state was reset at each (hopefully) entrance point to the
summary construction,
and every function could modify it.
Differential Revision: https://reviews.llvm.org/D56036
llvm-svn: 350057
Miklos Vajna [Mon, 24 Dec 2018 17:47:32 +0000 (17:47 +0000)]
[clang-tidy] add IgnoreMacros option to readability-uppercase-literal-suffix
And also enable it by default to be consistent with e.g.
modernize-use-using.
This helps e.g. when running this check on client code where the macro
is provided by the system, so there is no easy way to modify it.
Reviewed By: JonasToth, lebedev.ri
Differential Revision: https://reviews.llvm.org/D56025
llvm-svn: 350056
Eugene Leviant [Mon, 24 Dec 2018 16:02:48 +0000 (16:02 +0000)]
[HWASAN] Instrument memorty intrinsics by default
Differential revision: https://reviews.llvm.org/D55926
llvm-svn: 350055
Nico Weber [Mon, 24 Dec 2018 15:45:04 +0000 (15:45 +0000)]
[gn build] Add build files for clang/tools/{c-arcmt-test,c-index-test} and their dependency clang/tools/libclang
libclang is somewhat incomplete. It's just enough to get check-clang to pass,
but that requires it to be pretty complete. The biggest thing is that it's not
built as a shared library on Linux. The libclang/BUILD.gn file has a comment
with details on what else is missing.
Differential Revision: https://reviews.llvm.org/D56059
llvm-svn: 350054
Roman Lebedev [Mon, 24 Dec 2018 12:12:26 +0000 (12:12 +0000)]
ReleaseNotes: X86 Target: bdver2 sched model was added (D52779)
llvm-svn: 350053
Max Kazantsev [Mon, 24 Dec 2018 10:30:04 +0000 (10:30 +0000)]
Revert rL350048 and rL350050
These patches have broken almost all buildbots on test
DebugInfo/X86/addr_comments.ll. Reverting to green.
llvm-svn: 350052
George Rimar [Mon, 24 Dec 2018 10:18:07 +0000 (10:18 +0000)]
[LLD][ELF] - Cleanup gdb-index-dwarf5-low-high.s. NFC.
Remove tabs and .debug_macinfo sections.
llvm-svn: 350051
David Blaikie [Mon, 24 Dec 2018 07:56:40 +0000 (07:56 +0000)]
Fix build - follow-up to r350048 which broke headerless (v4) address pool
llvm-svn: 350050
Max Kazantsev [Mon, 24 Dec 2018 07:41:33 +0000 (07:41 +0000)]
[LoopSimplifyCFG] Delete dead exiting edges
This patch teaches LoopSimplifyCFG to remove dead exiting edges
from loops.
Differential Revision: https://reviews.llvm.org/D54025
Reviewed By: fedor.sergeev
llvm-svn: 350049
David Blaikie [Mon, 24 Dec 2018 07:35:10 +0000 (07:35 +0000)]
DebugInfo: Use assembly label arithmetic for address pool size for easier reading/editing
llvm-svn: 350048
David Blaikie [Mon, 24 Dec 2018 07:09:50 +0000 (07:09 +0000)]
DebugInfo: Add assembly comments for debug_addr contribution header fields
llvm-svn: 350047
David Blaikie [Mon, 24 Dec 2018 06:52:31 +0000 (06:52 +0000)]
llvm-dwarfdump: Skip address index info (and dump only the address, if found) when non-verbose dumping addrx forms
There's a few bugs here still - demonstrated with FIXITs in the test.
llvm-svn: 350046
Max Kazantsev [Mon, 24 Dec 2018 06:06:17 +0000 (06:06 +0000)]
Return "[LoopSimplifyCFG] Delete dead in-loop blocks"
The underlying bug that caused the revert should be fixed by rL348567.
Differential Revision: https://reviews.llvm.org/D54023
llvm-svn: 350045
George Burgess IV [Mon, 24 Dec 2018 05:55:50 +0000 (05:55 +0000)]
[LoopIdioms] More LocationSize::precise annotations; NFC
Both of these places reference memset-like loops. Memset is precise.
Trying to keep these patches super small so they're easily post-commit
verifiable, as requested in D44748.
llvm-svn: 350044
Craig Topper [Mon, 24 Dec 2018 05:45:45 +0000 (05:45 +0000)]
[X86] Remove unused variables left after r350041. NFC
llvm-svn: 350043
George Burgess IV [Mon, 24 Dec 2018 05:34:21 +0000 (05:34 +0000)]
[SelectionDAGBuilder] Use ::precise LocationSizes; NFC
More migration so we can disable the implicit int -> LocationSize
conversion.
All of these are either scatter/gather'ed vector instructions, or direct
loads. Hence, they're all precise.
Perhaps if we see way more getTypeStoreSize calls, we can make a
getTypeStoreLocationSize (or similar) as a wrapper that applies this
::precise. Doesn't appear that it's a good idea to make getTypeStoreSize
return a LocationSize itself, however.
llvm-svn: 350042
Craig Topper [Mon, 24 Dec 2018 05:27:13 +0000 (05:27 +0000)]
[X86] Move the optimization that turns 'CMP (AND+IMM64), 0' into SRL/SHL+TEST to X86ISelDAGToDAG.
This cleans more code out of EmitTest.
llvm-svn: 350041
Fangrui Song [Mon, 24 Dec 2018 03:19:53 +0000 (03:19 +0000)]
[clangd] Delete stray semicolon. NFC
llvm-svn: 350040
Craig Topper [Mon, 24 Dec 2018 01:59:31 +0000 (01:59 +0000)]
[X86] Autogenerate complete checks. NFC
llvm-svn: 350039
Craig Topper [Mon, 24 Dec 2018 01:10:13 +0000 (01:10 +0000)]
[X86] Remove the ANDN check from EmitTest.
Remove the TESTmr isel patterns and add another postprocessing combine for TESTrr+ANDrm->TESTmr. We already have a postprocessing combine for TESTrr+ANDrr->TESTrr. With this we can give ANDN a chance to match first. And clean it up during post processing if we ended up with just a regular AND.
This is another step towards my plan to gut EmitTest and do more flag handling during isel matching or by using optimizeCompare.
llvm-svn: 350038
Fangrui Song [Sun, 23 Dec 2018 22:20:34 +0000 (22:20 +0000)]
[clangd] Delete trailing ; NFC
llvm-svn: 350037
Kamil Rytarowski [Sun, 23 Dec 2018 21:20:09 +0000 (21:20 +0000)]
Tolerate flaky LLD tests on NetBSD
Summary:
For unknown reasons LLD tests are flaky on the NetBSD buildbot,
but not on local machines of developers.
Unless the linker will be fully functional on this target,
allow to pass flaky tests with optional retry.
Reviewers: joerg, mgorny, ruiu
Reviewed By: mgorny
Subscribers: lebedev.ri, MaskRay, llvm-commits, #lld
Tags: #lld
Differential Revision: https://reviews.llvm.org/D56053
llvm-svn: 350036
Fangrui Song [Sun, 23 Dec 2018 20:48:52 +0000 (20:48 +0000)]
[llvm-exegesis] Clustering: don't enqueue a point multiple times
Summary:
SetVector uses both DenseSet and vector, which is time/memory inefficient. The points are represented as natural numbers so we can replace the DenseSet part by indexing into a vector<char> instead.
Don't cargo cult the pseudocode on the wikipedia DBSCAN page. This is a standard BFS style algorithm (the similar loops have been used several times in other LLVM components): every point is processed at most once, thus the queue has at most NumPoints elements. We represent it with a vector and allocate it outside of the loop to avoid allocation in the loop body.
We check `Processed[P]` to avoid enqueueing a point more than once, which also nicely saves us a `ClusterIdForPoint_[Q].isUndef()` check.
Many people hate the oneshot abstraction but some favor it, therefore we make a compromise, use a lambda to abstract away the neighbor adding process.
Delete the comment `assert(Neighbors.capacity() == (Points_.size() - 1));` as it is wrong.
llvm-svn: 350035
Sanjay Patel [Sun, 23 Dec 2018 20:48:31 +0000 (20:48 +0000)]
[DAGCombiner] limit shuffle to extend transform (PR40146)
It's dangerous to knowingly create an illegal vector type
no matter what stage of combining we're in.
This prevents the missed folding/scalarization seen in:
https://bugs.llvm.org/show_bug.cgi?id=40146
llvm-svn: 350034
Sanjay Patel [Sun, 23 Dec 2018 20:36:52 +0000 (20:36 +0000)]
[x86] add test for vector shuffle --> extend transform (PR40146); NFC
llvm-svn: 350033
Sanjay Patel [Sun, 23 Dec 2018 19:58:16 +0000 (19:58 +0000)]
[DAGCombiner] allow hoisting vector bitwise logic ahead of extends
llvm-svn: 350032
Sanjay Patel [Sun, 23 Dec 2018 18:37:44 +0000 (18:37 +0000)]
[x86] add tests for vector extend + logic ops; NFC
llvm-svn: 350031
Michal Gorny [Sun, 23 Dec 2018 15:09:28 +0000 (15:09 +0000)]
[xray] Detect MPROTECT and error out when it's enabled (on NetBSD)
Add a CheckMPROTECT() routine to detect when pax MPROTECT is enabled
on NetBSD, and error xray out when it is. The solution is adapted
from existing CheckASLR().
Differential Revision: https://reviews.llvm.org/D56049
llvm-svn: 350030
Michal Gorny [Sun, 23 Dec 2018 15:09:20 +0000 (15:09 +0000)]
[xray] Disable alignas() for thread_local objects on NetBSD
Disable enforcing alignas() for structs that are used as thread_local
data on NetBSD. The NetBSD ld.so implementation is buggy and does
not enforce correct alignment; however, clang seems to take it for
granted and generates instructions that segv on wrongly aligned objects.
Therefore, disable those alignas() statements on NetBSD until we can
establish a better fix.
Apparently, std::aligned_storage<> does not have any real effect
at the moment, so we can leave it as-is.
Differential Revision: https://reviews.llvm.org/D56000
llvm-svn: 350029
Michal Gorny [Sun, 23 Dec 2018 15:07:26 +0000 (15:07 +0000)]
[Driver] Disable -faddrsig on Gentoo by default
Gentoo supports combining clang toolchain with GNU binutils, and many
users actually do that. As -faddrsig is not supported by GNU strip,
this results in a lot of warnings. Disable it by default and let users
enable it explicitly if they want it; with the intent of reevaluating
when the underlying feature becomes standarized.
See also: https://bugs.gentoo.org/667854
Differential Revision: https://reviews.llvm.org/D56047
llvm-svn: 350028
Michal Gorny [Sun, 23 Dec 2018 15:07:19 +0000 (15:07 +0000)]
[Distro] Support detecting Gentoo
Add support for distinguishing plain Gentoo distribution, and a unit
test for it. This is going to be used to introduce distro-specific
customizations in the driver code; most notably, it is going to be used
to disable -faddrsig.
Differential Revision: https://reviews.llvm.org/D56024
llvm-svn: 350027
Nico Weber [Sun, 23 Dec 2018 14:19:53 +0000 (14:19 +0000)]
[gn build] Add build files for clang/tools/{arcmt-test,clang-check,clang-func-mapping}
Needed for check-clang.
Differential Revision: https://reviews.llvm.org/D56056
llvm-svn: 350026
Nico Weber [Sun, 23 Dec 2018 14:17:13 +0000 (14:17 +0000)]
[gn build] Add build files for clang/tools/{clang-refactor,clang-rename}, clang/utils/hmaptool, clang/lib/Tooling/Refactoring
Needed for check-clang.
Differential Revision: https://reviews.llvm.org/D56055
llvm-svn: 350025
Nico Weber [Sun, 23 Dec 2018 14:15:26 +0000 (14:15 +0000)]
[gn build] Add build files for clang/tools/{clang-diff,clang-import-test,diagtool and clang/lib/Tooling, clang/lib/Tooling/ASTDiff
Needed for check-clang.
Differential Revision: https://reviews.llvm.org/D56054
llvm-svn: 350024
Simon Atanasyan [Sun, 23 Dec 2018 12:05:04 +0000 (12:05 +0000)]
[ORC] Rename register in the OrcMips64 resolver code comments. NFC
The `fp` and `s8` register names are synonyms. But `fp` better reflects
a purpose of the register.
llvm-svn: 350023
Simon Atanasyan [Sun, 23 Dec 2018 12:05:00 +0000 (12:05 +0000)]
[ORC] clang-format OrcMips32 and OrcMips64 code. NFC
llvm-svn: 350022
Simon Atanasyan [Sun, 23 Dec 2018 12:04:55 +0000 (12:04 +0000)]
[ORC] Remove redundant instruction from MIPS resolver code. NFC
It's redundant to restore the `$a3` register twice.
llvm-svn: 350021
Dimitry Andric [Sun, 23 Dec 2018 11:49:47 +0000 (11:49 +0000)]
Set the default SANITIZER_CXX_ABI library to libc++ for FreeBSD, and
also mark it as a system library, like on macOS.
llvm-svn: 350020
George Burgess IV [Sun, 23 Dec 2018 06:40:39 +0000 (06:40 +0000)]
[MemCpyOpt] Use LocationSize instead of ints; NFC
Trying to keep these patches super small so they're easily post-commit
verifiable, as requested in D44748.
srcSize is derived from the size of an alloca, and we quit out if the
size of that is > the size of the thing we're copying to. Hence, we
should always copy everything over, so these sizes are precise.
Don't make srcSize itself a LocationSize, since optionality isn't
helpful, and we do some comparisons against other sizes elsewhere in
that function.
llvm-svn: 350019
Craig Topper [Sun, 23 Dec 2018 05:52:55 +0000 (05:52 +0000)]
[X86] Return false from hasAndNotCompare if the comparision value is a constant.
We won't end up using an ANDN instruction in this case so we should generate the same code we do for pre-BMI targets.
llvm-svn: 350018
George Burgess IV [Sun, 23 Dec 2018 03:36:44 +0000 (03:36 +0000)]
[MemoryLocation] Use LocationSize instead of ints; NFC
Trying to keep these patches super small so they're easily post-commit
verifiable, as requested in D44748.
This one sadly isn't *super* small, but all of the changes here are
either to:
- libfuncs that are passed a constant size (memcpy, memset, ...)
- instructions that store/load a constant size
So they have to be precise
llvm-svn: 350017
George Burgess IV [Sun, 23 Dec 2018 03:10:56 +0000 (03:10 +0000)]
[Loads] Use LocationSize instead of ints; NFC
Keeping these patches super small so they're easily post-commit
verifiable, as requested in D44748.
This tries to find literal loads/stores of the given type, so this has
to be precise.
llvm-svn: 350016
George Burgess IV [Sun, 23 Dec 2018 02:50:08 +0000 (02:50 +0000)]
[Lint] Use LocationSize instead of ints; NFC
Keeping these patches super small so they're easily post-commit
verifiable, as requested in D44748.
llvm-svn: 350015
George Burgess IV [Sun, 23 Dec 2018 02:39:58 +0000 (02:39 +0000)]
[AAEval] Use LocationSize instead of ints; NFC
Keeping these patches super small so they're easily post-commit
verifiable, as requested in D44748.
llvm-svn: 350014
Craig Topper [Sun, 23 Dec 2018 01:54:43 +0000 (01:54 +0000)]
[X86] Fix an old FIXME about folding the zero constant into the OR instruction we use for sequentially consistent fence in 32-bit mode without SSE2.
llvm-svn: 350013
Craig Topper [Sun, 23 Dec 2018 01:54:41 +0000 (01:54 +0000)]
[X86] Autogenerate complete checks. NFC
llvm-svn: 350012
David Blaikie [Sat, 22 Dec 2018 22:20:47 +0000 (22:20 +0000)]
Test DWARFv5 with gdb-index and low_pc/high_pc on the CU (rather than ranges)
There was a bug in LLVM's libDebugInfo where it did not porpagate the
section index through the range query built from low_pc/high_pc. Hard to
test in LLVM, so I'm adding a test here.
llvm-svn: 350011
David Blaikie [Sat, 22 Dec 2018 22:20:40 +0000 (22:20 +0000)]
DebugInfo: Accurately propagate the section used by a relocation when accessing ranges defined by low/high_pc
This is difficult/not possible to test in LLVM, but is visible as a
crash in LLD when parsing DWARF to generate gdb-index.
This function is called by llvm-dwarfdump when parsing high_pc for
non-verbose output (to print the actual high_pc rather than the low_pc
relative value), but in that case llvm-dwarfdump doesn't print section
names (if it did, it would hit this problem).
We could add some other features to llvm-dwarfdump to expose this, but
nothing really springs to my mind. I will add a test to lld, though.
llvm-svn: 350010
David Blaikie [Sat, 22 Dec 2018 20:34:58 +0000 (20:34 +0000)]
llvm-dwarfdump: Dump the section name/number for addr attributes
llvm-svn: 350009
George Burgess IV [Sat, 22 Dec 2018 18:23:21 +0000 (18:23 +0000)]
[Analysis] More LocationSize cleanup; NFC
Keeping these patches super small so they're easily post-commit
verifiable, as requested in D44748.
llvm-svn: 350008
George Burgess IV [Sat, 22 Dec 2018 17:42:08 +0000 (17:42 +0000)]
[Analysis] s/uint64_t/LocationSize; NFC
Let the gradual cleanup from D44748 continue. :)
llvm-svn: 350007
Sanjay Patel [Sat, 22 Dec 2018 17:10:31 +0000 (17:10 +0000)]
[DAGCombiner] allow narrowing of add followed by truncate
trunc (add X, C ) --> add (trunc X), C'
If we're throwing away the top bits of an 'add' instruction, do it in the narrow destination type.
This makes the truncate-able opcode list identical to the sibling transform done in IR (in instcombine).
This change used to show regressions for x86, but those are gone after D55494.
This gets us closer to deleting the x86 custom function (combineTruncatedArithmetic)
that does almost the same thing.
Differential Revision: https://reviews.llvm.org/D55866
llvm-svn: 350006
Sanjay Patel [Sat, 22 Dec 2018 16:59:02 +0000 (16:59 +0000)]
[x86] add load fold patterns for movddup with vzext_load
The missed load folding noticed in D55898 is visible independent of that change
either with an adjusted IR pattern to start or with AVX2/AVX512 (where the build
vector becomes a broadcast first; movddup is not produced until we get into isel
via tablegen patterns).
Differential Revision: https://reviews.llvm.org/D55936
llvm-svn: 350005
Aaron Ballman [Sat, 22 Dec 2018 15:31:57 +0000 (15:31 +0000)]
Improving this fatal diagnostic to help checker developers figure out what's actually gone wrong when they hit it.
llvm-svn: 350004
Bruno Ricci [Sat, 22 Dec 2018 14:39:30 +0000 (14:39 +0000)]
[AST] Store the arguments of CXXConstructExpr in a trailing array
Store the arguments of CXXConstructExpr in a trailing array. This is very
similar to the CallExpr case in D55771, with the exception that there is
only one derived class (CXXTemporaryObjectExpr) and that we compute the
offset to the trailing array instead of storing it.
This saves one pointer per CXXConstructExpr and CXXTemporaryObjectExpr.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D56022
llvm-svn: 350003
David Carlier [Sat, 22 Dec 2018 11:17:27 +0000 (11:17 +0000)]
[Sanitizer] Enable POSIX regex api on FreeBSD.
Reviewers: krytarowski
Reviewed By: krytarowski
Differential Revision: https://reviews.llvm.org/D56009
M lib/sanitizer_common/sanitizer_common_interceptors.inc
M lib/sanitizer_common/sanitizer_platform_interceptors.h
M lib/sanitizer_common/sanitizer_platform_limits_freebsd.cc
M lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
D test/sanitizer_common/TestCases/NetBSD/regex.cc
A + test/sanitizer_common/TestCases/Posix/regex.cc
llvm-svn: 350002
Michal Gorny [Sat, 22 Dec 2018 10:51:53 +0000 (10:51 +0000)]
[runtime] [test] Fix using %python path
Fix the newly-added tests to use %python substitution in order to use
the correct path to Python interpreter. Otherwise, they fail on NetBSD
where there is no 'python', just 'pythonX.Y'.
Differential Revision: https://reviews.llvm.org/D56048
llvm-svn: 350001
Roman Lebedev [Sat, 22 Dec 2018 10:38:05 +0000 (10:38 +0000)]
NFC][CodeGen][X86][AArch64] Tests for bit extract (pat. a/c/d) with trunc (PR36419)
llvm-svn: 350000
Roman Lebedev [Sat, 22 Dec 2018 09:58:13 +0000 (09:58 +0000)]
[NFC][CodeGen][X86][AArch64] Bit extract: add nounwind attr to drop .cfi noise
Forgot about that.
llvm-svn: 349999
Roman Lebedev [Sat, 22 Dec 2018 09:40:14 +0000 (09:40 +0000)]
[NFC][CodeGen][X86][AArch64] Tests for bit extract (pat. b) with trunc (PR36419)
@bextr64_32_b1 is extracted from hotpath of real-world code
(RawSpeed BitStream<>::peekBitsNoFill()) after `clang -O3`.
@bextr64_32_b2/@bextr64_32_b0 is the same pattern,
but with trunc done last, showing how i think it can be handled:
https://rise4fun.com/Alive/K4B
https://rise4fun.com/Alive/qC9
It is possible that middle-end should do some of this, too.
https://bugs.llvm.org/show_bug.cgi?id=36419
llvm-svn: 349998
David Blaikie [Sat, 22 Dec 2018 08:43:08 +0000 (08:43 +0000)]
llvm-dwarfdump: Remove extraneous space between '(' and 'indexed'
When dumping string or address indexes
llvm-svn: 349997
David Blaikie [Sat, 22 Dec 2018 08:33:55 +0000 (08:33 +0000)]
llvm-dwarfdump: Print the section name/number for addr_index attributes
(addr attributes coming shortly)
llvm-svn: 349996
David Blaikie [Sat, 22 Dec 2018 08:23:10 +0000 (08:23 +0000)]
DebugInfo: Refactor named section dumping into a reusable helper
Currently the section name (& possibly number) is only printed on
addresses in ranges - but no reason it couldn't also be displayed on
other addresses (like low/high PC).
Refactor in that direction by pulling out the section lookup and name
ambiguity dumping logic into a reusable helper.
llvm-svn: 349995
Kamil Rytarowski [Sat, 22 Dec 2018 06:56:19 +0000 (06:56 +0000)]
Add support for LLVM profile for NetBSD
Summary:
NetBSD uses typical UNIX interfaces.
All tests pass except instrprof-dlopen-dlclose-gcov.test, as there
is not supported semantics of atexit(3) in dlopen(3)ed+dlclose(3)d
DSO.
NetBSD also ships an older version of LLVM profile (ABI v.2 predating
ABI v.4 in upstream version) inside libc. That copy has been manually
removed during the porting and testing process of the upstream version
to NetBSD. Otherwise there were conflicts between them two.
Reviewers: joerg, vitalybuka, vsk
Subscribers: srhines, fedor.sergeev, llvm-commits, mgorny, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D55997
llvm-svn: 349994
Nico Weber [Sat, 22 Dec 2018 03:51:10 +0000 (03:51 +0000)]
[gn build] Embed __TEXT __info_plist section into clang binary on macOS
Verified by comparing the output of `otool -P bin/clang` between the GN and the
CMake build.
Differential Revision: https://reviews.llvm.org/D55984
llvm-svn: 349992
Nico Weber [Sat, 22 Dec 2018 03:49:44 +0000 (03:49 +0000)]
[gn build] Add build files for clang, clang-offload-bundler, and clang/lib/Headers
With this, the GN build can build clang!
Differential Revision: https://reviews.llvm.org/D55981
llvm-svn: 349991
Tom Stellard [Sat, 22 Dec 2018 03:43:08 +0000 (03:43 +0000)]
Fix mingw build failures caused by r349839
Reviewers: mstorsjo
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D56004
llvm-svn: 349990
Nico Weber [Sat, 22 Dec 2018 03:40:35 +0000 (03:40 +0000)]
[gn build] Add build files for llvm-cat, llvm-lto, llvm-lto2, llvm-modextract, llvm-profdata, llvm-symbolizer
These are the llvm/tools needed by check-clang.
Differential Revision: https://reviews.llvm.org/D56018
llvm-svn: 349989
Nico Weber [Sat, 22 Dec 2018 03:15:56 +0000 (03:15 +0000)]
[gn build] Add build file for clang/lib/FrontendTool
Differential Revision: https://reviews.llvm.org/D55980
llvm-svn: 349988
Nico Weber [Sat, 22 Dec 2018 03:15:08 +0000 (03:15 +0000)]
[gn build] Add build file for clang/lib/ARCMigrate
Differential Revision: https://reviews.llvm.org/D55979
llvm-svn: 349987
Nico Weber [Sat, 22 Dec 2018 03:14:05 +0000 (03:14 +0000)]
[gn build] Add build files for clang/lib/{ASTMatchers,CrossTU}, clang/lib/StaticAnalyzer/{Checkers,Core,Frontend}
The intent is to add the build file for clang/lib/StaticAnalyzer/Frontend; everything else is pulled in by that.
Differential Revision: https://reviews.llvm.org/D55978
llvm-svn: 349986
David Blaikie [Sat, 22 Dec 2018 02:24:13 +0000 (02:24 +0000)]
DebugInfo: Remove extra attribute lookup
llvm-svn: 349985
Artem Dergachev [Sat, 22 Dec 2018 02:06:51 +0000 (02:06 +0000)]
[analyzer] pr38668: Do not attempt to cast loaded integers to floats.
This patch is a different approach to landing the reverted r349701.
It is expected to have the same object (memory region) treated as if it has
different types in different program points. The correct behavior for
RegionStore when an object is stored as an object of type T1 but loaded as
an object of type T2 is to store the object as if it has type T1 but cast it
to T2 during load.
Note that the cast here is some sort of a "reinterpret_cast" (even in C). For
instance, if you store an integer and load a float, you won't get your integer
represented as a float; instead, you will get garbage.
Admit that we cannot perform the cast and return an unknown value.
Differential Revision: https://reviews.llvm.org/D55875
rdar://problem/
45062567
llvm-svn: 349984
Craig Topper [Sat, 22 Dec 2018 01:34:47 +0000 (01:34 +0000)]
[X86] FixupLEAs, reduce number of calls to getOperand and use X86::AddrBaseReg/AddrIndexReg, etc. instead of hardcoded constants.
Makes the code a little more readable.
llvm-svn: 349983
Justin Lebar [Sat, 22 Dec 2018 01:30:37 +0000 (01:30 +0000)]
[NVPTX] Reduce stack size in NVPTXAsmPrinter::doInitialization().
NVPTXAsmPrinter::doInitialization() was creating an NVPTXSubtarget on
the stack. This object is huge, about 80kb. Also it's slow to create.
And it's all redundant; we have one in NVPTXTargetMachine anyway!
llvm-svn: 349982
Artem Belevich [Sat, 22 Dec 2018 01:11:09 +0000 (01:11 +0000)]
[CUDA] Treat extern global variable shadows same as regular extern vars.
This fixes compiler crash when we attempted to compile this code:
extern __device__ int data;
__device__ int data = 1;
Differential Revision: https://reviews.llvm.org/D56033
llvm-svn: 349981
David Blaikie [Sat, 22 Dec 2018 00:31:05 +0000 (00:31 +0000)]
gdb-index: Handle errors when parsing ranges
When parsing CU ranges for gdb-index, handle the error (now propagated
up though the API lld is calling here - previously the error was
printed within the libDebugInfo API, not allowing lld to format or
handle the message at all) - including information about the object and
archive name, as well as failing the link.
llvm-svn: 349979
David Blaikie [Sat, 22 Dec 2018 00:31:02 +0000 (00:31 +0000)]
libDebugInfo: Refactor error handling in range list parsing
Propagate the llvm::Error a little further up. This is NFC for
llvm-dwarfdump in this change, but allows ld.lld to emit more precise
error messages about which object and archive the erroneous DWARF is in.
llvm-svn: 349978
Stella Stamenova [Fri, 21 Dec 2018 23:59:24 +0000 (23:59 +0000)]
[cmake] Suppress 'warning C4201: nonstandard extension used: nameless struct/union' on Windows
This warning comes up in the ObjC language plugin because of the use of nameless structs. This change suppresses the warning.
llvm-svn: 349977
Reid Kleckner [Fri, 21 Dec 2018 23:35:48 +0000 (23:35 +0000)]
[MC] Enable .file support on COFF and diagnose it on unsupported targets
Summary:
The "single parameter" .file directive appears to be an ELF-only feature
that is intended to insert the main source filename into the string
table table.
I noticed that if you assemble an ELF .s file for COFF, typically it
will assert right away on a .file directive near the top of the file. My
first change was to make this emit a proper error in the asm parser so
that we don't assert so easily.
However, COFF actually does have some support for this directive, and if
you emit an object file, llvm-mc does not assert. When emitting a COFF
object, MC will take those file names and create "debug" symbol table
entries for them. I'm not familiar with these kinds of symbol table
entries, and I'm not aware of any users of them, but @compnerd added
them a while ago. They don't introduce absolute paths, and most main
source file paths are short enough that this extra entry shouldn't cause
any problems, so I enabled the flag in MCAsmInfoCOFF that indicates that
it's supported.
This has the side effect of adding an extra debug symbol to every object
produced by clang, which is a pretty big functional change. My question
is, should we keep the functionality or remove it in the name of symbol
table minimalism?
Reviewers: mstorsjo, compnerd
Subscribers: hiraditya, compnerd, llvm-commits
Differential Revision: https://reviews.llvm.org/D55900
llvm-svn: 349976
Mircea Trofin [Fri, 21 Dec 2018 23:02:10 +0000 (23:02 +0000)]
Silence warning in assert introduced in rL349973.
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D56030
llvm-svn: 349975
Fangrui Song [Fri, 21 Dec 2018 22:57:11 +0000 (22:57 +0000)]
keymethod -> keyfunction
Pointed out by ruiu in rLLD349969
llvm-svn: 349974
Mircea Trofin [Fri, 21 Dec 2018 22:48:50 +0000 (22:48 +0000)]
[llvm] API for encoding/decoding DWARF discriminators.
Summary:
Added a pair of APIs for encoding/decoding the 3 components of a DWARF discriminator described in http://lists.llvm.org/pipermail/llvm-dev/2016-October/106532.html: the base discriminator, the duplication factor (useful in profile-guided optimization) and the copy index (used to identify copies of code in cases like loop unrolling)
The encoding packs 3 unsigned values in 32 bits. This CL addresses 2 issues:
- communicates overflow back to the user
- supports encoding all 3 components together. Current APIs assume a sequencing of events. For example, creating a new discriminator based on an existing one by changing the base discriminator was not supported.
Reviewers: davidxl, danielcdh, wmi, dblaikie
Reviewed By: dblaikie
Subscribers: zzheng, dmgreen, aprantl, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D55681
llvm-svn: 349973
Jonas Devlieghere [Fri, 21 Dec 2018 22:46:10 +0000 (22:46 +0000)]
[NFC] Replace `compare` with (in)equality operator where applicable.
Using compare is verbose, bug prone and potentially inefficient (because
of early termination). Replace relevant call sites with the (in)equality
operator.
llvm-svn: 349972
Davide Italiano [Fri, 21 Dec 2018 22:45:07 +0000 (22:45 +0000)]
[Scalar] Simplify as Jonas suggested. NFCI.
llvm-svn: 349971
Davide Italiano [Fri, 21 Dec 2018 22:42:00 +0000 (22:42 +0000)]
[Scalar] Implement operator!= using operator==.
Summary: Adding some test coverage while I'm around.
Reviewers: JDevlieghere, aprantl, zturner, clayborg, jingham
Differential Revision: https://reviews.llvm.org/D56017
llvm-svn: 349970
Fangrui Song [Fri, 21 Dec 2018 22:40:10 +0000 (22:40 +0000)]
key method -> key function
The latter is what is actually called in the ABI http://itanium-cxx-abi.github.io/cxx-abi/abi.html#vague-vtable
Pointed out by rsmith
llvm-svn: 349969
David Blaikie [Fri, 21 Dec 2018 22:25:01 +0000 (22:25 +0000)]
Reapply: DebugInfo: Assume an absence of ranges or high_pc on a CU means the CU is empty (devoid of code addresses)
Originally committed in r349333, reverted in r349353.
GCC emitted these unconditionally on/before 4.4/March 2012
Clang emitted these unconditionally on/before 3.5/March 2014
This improves performance when parsing CUs (especially those using split
DWARF) that contain no code ranges (such as the mini CUs that may be
created by ThinLTO importing - though generally they should be/are
avoided, especially for Split DWARF because it produces a lot of very
small CUs, which don't scale well in a bunch of other ways too
(including size)).
The revert was due to a (Google internal) test that had some checked in old
object files missing DW_AT_ranges. That's since been fixed.
llvm-svn: 349968
Jonas Devlieghere [Fri, 21 Dec 2018 22:16:10 +0000 (22:16 +0000)]
[ExpressionParser] Reserve size before copying over args
We already know the final size here so we might as well reserve it so we
don't have to re-allocate during the loop.
llvm-svn: 349967
Fangrui Song [Fri, 21 Dec 2018 21:59:34 +0000 (21:59 +0000)]
[ELF] .gnu.hash bloom filter: use Shift2 = 26 instead of 6
Summary:
For the 2-bit bloom filter, we currently pick the bits Hash%64 and Hash>>6%64 (Shift2=6), but bits [6:...] are also used to select a word, causing a loss of precision.
In this patch, we choose Shift2=26, with is suggested by Ambrose Feinstein.
Note, Shift2 is computed as maskbitslog2 in bfd/elflink.c and gold/dynobj.cc
It is varying with the number of dynamic symbols but we don't
necessarily copy its rule.
Reviewers: ruiu, espindola
Reviewed By: ruiu
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D55971
llvm-svn: 349966
Vedant Kumar [Fri, 21 Dec 2018 21:49:40 +0000 (21:49 +0000)]
[IR] Add Instruction::isLifetimeStartOrEnd, NFC
Instruction::isLifetimeStartOrEnd() checks whether an Instruction is an
llvm.lifetime.start or an llvm.lifetime.end intrinsic.
This was suggested as a cleanup in D55967.
Differential Revision: https://reviews.llvm.org/D56019
llvm-svn: 349964
Armando Montanez [Fri, 21 Dec 2018 21:44:09 +0000 (21:44 +0000)]
[TextAPI][elfabi] Fix failing tests from D56020
llvm-svn: 349963