Andrey Churbanov [Tue, 8 Oct 2019 12:23:25 +0000 (12:23 +0000)]
Don't link libm with -Wl,--as-needed on FreeBSD
Patch by jbeich (Jan Beich)
Differential Revision: https://reviews.llvm.org/D68051
llvm-svn: 374037
Florian Hahn [Tue, 8 Oct 2019 11:54:42 +0000 (11:54 +0000)]
[LoopRotate] Unconditionally get DomTree.
LoopRotate is a loop pass and the DomTree should always be available.
Similar to
a70c5261436322a53187d67b8bdc0445d0463a9a
llvm-svn: 374036
James Clarke [Tue, 8 Oct 2019 11:34:02 +0000 (11:34 +0000)]
[Diagnostics] Silence -Wsizeof-array-div for character buffers
Summary:
Character buffers are sometimes used to represent a pool of memory that
contains non-character objects, due to them being synonymous with a stream of
bytes on almost all modern architectures. Often, when interacting with hardware
devices, byte buffers are therefore used as an intermediary and so we can end
Character buffers are sometimes used to represent a pool of memory that
contains non-character objects, due to them being synonymous with a stream of
bytes on almost all modern architectures. Often, when interacting with hardware
devices, byte buffers are therefore used as an intermediary and so we can end
up generating lots of false-positives.
Moreover, due to the ability of character pointers to alias non-character
pointers, the strict aliasing violations that would generally be implied by the
calculations caught by the warning (if the calculation itself is in fact
correct) do not apply here, and so although the length calculation may be
wrong, that is the only possible issue.
Reviewers: rsmith, xbolva00, thakis
Reviewed By: xbolva00, thakis
Subscribers: thakis, lebedev.ri, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68526
llvm-svn: 374035
Andrea Di Biagio [Tue, 8 Oct 2019 10:46:01 +0000 (10:46 +0000)]
[MCA][LSUnit] Track loads and stores until retirement.
Before this patch, loads and stores were only tracked by their corresponding
queues in the LSUnit from dispatch until execute stage. In practice we should be
more conservative and assume that memory opcodes leave their queues at
retirement stage.
Basically, loads should leave the load queue only when they have completed and
delivered their data. We conservatively assume that a load is completed when it
is retired. Stores should be tracked by the store queue from dispatch until
retirement. In practice, stores can only leave the store queue if their data can
be written to the data cache.
This is mostly a mechanical change. With this patch, the retire stage notifies
the LSUnit when a memory instruction is retired. That would triggers the release
of LDQ/STQ entries. The only visible change is in memory tests for the bdver2
model. That is because bdver2 is the only model that defines the load/store
queue size.
This patch partially addresses PR39830.
Differential Revision: https://reviews.llvm.org/D68266
llvm-svn: 374034
Nikola Prica [Tue, 8 Oct 2019 09:43:05 +0000 (09:43 +0000)]
[ISEL][ARM][AARCH64] Tracking simple parameter forwarding registers
Support for tracking registers that forward function parameters into the
following function frame. For now we only support cases when parameter
is forwarded through single register.
Reviewers: aprantl, vsk, t.p.northover
Reviewed By: vsk
Differential Revision: https://reviews.llvm.org/D66953
llvm-svn: 374033
Sylvestre Ledru [Tue, 8 Oct 2019 09:17:46 +0000 (09:17 +0000)]
Remove an useless allocation (from by clang-analyzer/scan-build)
https://llvm.org/reports/scan-build/report-TargetInfo.cpp-detectFPCCEligibleStruct-9-1.html#EndPath
llvm-svn: 374032
Clement Courbet [Tue, 8 Oct 2019 09:06:48 +0000 (09:06 +0000)]
[llvm-exegesis] Finish plumbing the `Config` field.
Summary:
Right now there are no snippet generators that emit the `Config` Field,
but I plan to add it to investigate LEA operands for PR32326.
What was broken was:
- `Config` Was not propagated up until the BenchmarkResult::Key.
- Clustering should really consider different configs as measuring
different things, so we should stabilize on (Opcode, Config) instead of
just Opcode.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits, lebedev.ri
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68629
llvm-svn: 374031
Pavel Labath [Tue, 8 Oct 2019 09:05:31 +0000 (09:05 +0000)]
Revert "[lldb-server/android] Show more processes and package name when necessary"
This reverts r373758 because it causes several to test to be flaky (=
failing ~90% of the time) on linux.
llvm-svn: 374030
Pavel Labath [Tue, 8 Oct 2019 09:05:25 +0000 (09:05 +0000)]
Fix a -Wpedantic warning
namespace-closing '}' don't need ';'.
llvm-svn: 374029
George Rimar [Tue, 8 Oct 2019 08:59:12 +0000 (08:59 +0000)]
[llvm-readobj/llvm-readelf] - Add checks for GNU-style to "all.test" test case.
We do not check the GNU-style output when -all is given.
This patch does that.
Differential revision: https://reviews.llvm.org/D68462
llvm-svn: 374028
Zi Xuan Wu [Tue, 8 Oct 2019 08:49:15 +0000 (08:49 +0000)]
[NFC] Add REQUIRES for r374017 in testcase
llvm-svn: 374027
Florian Hahn [Tue, 8 Oct 2019 08:46:38 +0000 (08:46 +0000)]
[LoopRotate] Unconditionally get ScalarEvolution.
Summary: LoopRotate is a loop pass and SE should always be available.
Reviewers: anemet, asbirlea
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D68573
llvm-svn: 374026
Kristof Beyls [Tue, 8 Oct 2019 08:25:42 +0000 (08:25 +0000)]
[ARM] Generate vcmp instead of vcmpe
Based on the discussion in
http://lists.llvm.org/pipermail/llvm-dev/2019-October/135574.html, the
conclusion was reached that the ARM backend should produce vcmp instead
of vcmpe instructions by default, i.e. not be producing an Invalid
Operation exception when either arguments in a floating point compare
are quiet NaNs.
In the future, after constrained floating point intrinsics for floating
point compare have been introduced, vcmpe instructions probably should
be produced for those intrinsics - depending on the exact semantics
they'll be defined to have.
This patch logically consists of the following parts:
- Revert http://llvm.org/viewvc/llvm-project?rev=294945&view=rev and
http://llvm.org/viewvc/llvm-project?rev=294968&view=rev, which
implemented fine-tuning for when to produce vcmpe (i.e. not do it for
equality comparisons). The complexity introduced by those patches
isn't needed anymore if we just always produce vcmp instead. Maybe
these patches need to be reintroduced again once support is needed to
map potential LLVM-IR constrained floating point compare intrinsics to
the ARM instruction set.
- Simply select vcmp, instead of vcmpe, see simple changes in
lib/Target/ARM/ARMInstrVFP.td
- Adapt lots of tests that tested for vcmpe (instead of vcmp). For all
of these test, the intent of what is tested for isn't related to
whether the vcmp should produce an Invalid Operation exception or not.
Fixes PR43374.
Differential Revision: https://reviews.llvm.org/D68463
llvm-svn: 374025
Kai Nacke [Tue, 8 Oct 2019 08:21:20 +0000 (08:21 +0000)]
[Tools] Mark output of tools as text if it is text
Several LLVM tools write text files/streams without using OF_Text.
This can cause problems on platforms which distinguish between
text and binary output. This PR adds the OF_Text flag for the
following tools:
- llvm-dis
- llvm-dwarfdump
- llvm-mca
- llvm-mc (assembler files only)
- opt (assembler files only)
- RemarkStreamer (used e.g. by opt)
Reviewers: rnk, vivekvpandya, Bigcheese, andreadb
Differential Revision: https://reviews.llvm.org/D67696
llvm-svn: 374024
Rui Ueyama [Tue, 8 Oct 2019 08:03:44 +0000 (08:03 +0000)]
Use /dev/null for tests that we do not need outputs
llvm-svn: 374023
Rui Ueyama [Tue, 8 Oct 2019 08:03:40 +0000 (08:03 +0000)]
Report error if -export-dynamic is used with -r
The combination of the two flags doesn't make sense. And other linkers
seem to just ignore --export-dynamic if --relocatable is given, but
we probably should report it as an error to let users know that is
an invalid combination.
Fixes https://bugs.llvm.org/show_bug.cgi?id=43552
Differential Revision: https://reviews.llvm.org/D68441
llvm-svn: 374022
Kadir Cetinkaya [Tue, 8 Oct 2019 07:39:50 +0000 (07:39 +0000)]
[LoopVectorize] Fix non-debug builds after rL374017
llvm-svn: 374021
Clement Courbet [Tue, 8 Oct 2019 07:08:48 +0000 (07:08 +0000)]
[llvm-exegesis] Add stabilization test with config
In preparation for D68629.
llvm-svn: 374020
Bill Wendling [Tue, 8 Oct 2019 04:39:52 +0000 (04:39 +0000)]
[IA] Recognize hexadecimal escape sequences
Summary:
Implement support for hexadecimal escape sequences to match how GNU 'as'
handles them. I.e., read all hexadecimal characters and truncate to the
lower 16 bits.
Reviewers: nickdesaulniers, jcai19
Subscribers: llvm-commits, hiraditya
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68598
llvm-svn: 374018
Zi Xuan Wu [Tue, 8 Oct 2019 03:28:33 +0000 (03:28 +0000)]
[LoopVectorize][PowerPC] Estimate int and float register pressure separately in loop-vectorize
In loop-vectorize, interleave count and vector factor depend on target register number. Currently, it does not
estimate different register pressure for different register class separately(especially for scalar type,
float type should not be on the same position with int type), so it's not accurate. Specifically,
it causes too many times interleaving/unrolling, result in too many register spills in loop body and hurting performance.
So we need classify the register classes in IR level, and importantly these are abstract register classes,
and are not the target register class of backend provided in td file. It's used to establish the mapping between
the types of IR values and the number of simultaneous live ranges to which we'd like to limit for some set of those types.
For example, POWER target, register num is special when VSX is enabled. When VSX is enabled, the number of int scalar register is 32(GPR),
float is 64(VSR), but for int and float vector register both are 64(VSR). So there should be 2 kinds of register class when vsx is enabled,
and 3 kinds of register class when VSX is NOT enabled.
It runs on POWER target, it makes big(+~30%) performance improvement in one specific bmk(503.bwaves_r) of spec2017 and no other obvious degressions.
Differential revision: https://reviews.llvm.org/D67148
llvm-svn: 374017
Chen Zheng [Tue, 8 Oct 2019 03:00:31 +0000 (03:00 +0000)]
[ConstantRange] [NFC] replace addWithNoSignedWrap with addWithNoWrap.
llvm-svn: 374016
Heejin Ahn [Tue, 8 Oct 2019 02:50:27 +0000 (02:50 +0000)]
[WebAssembly] Add REQUIRES: asserts to cfg-stackify-eh.ll
This was missing in D68552.
llvm-svn: 374015
James Clarke [Tue, 8 Oct 2019 02:28:57 +0000 (02:28 +0000)]
[ItaniumMangle] Fix mangling of GNU __null in an expression to match GCC
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: erik.pilkington, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68368
llvm-svn: 374013
Jan Korous [Tue, 8 Oct 2019 02:26:17 +0000 (02:26 +0000)]
[NFC] Fix ubsan-blacklist test
Restored original test and marked tests for VFS as unsupported on Windows.
llvm-svn: 374011
Vitaly Buka [Tue, 8 Oct 2019 02:00:53 +0000 (02:00 +0000)]
[sanitizer] Fix signal_trap_handler.cpp on android
llvm-svn: 374010
Andrew Trick [Tue, 8 Oct 2019 01:31:02 +0000 (01:31 +0000)]
[LitConfig] Silenced notes/warnings on quiet.
Lit has a "quiet" option, -q, which is documented to "suppress no
error output". Previously, LitConfig displayed notes and warnings when
the quiet option was specified. The result was that it was not
possible to get only pertinent file/line information to be used by an
editor to jump to the location where checks were failing without
passing a number of unhelpful locations first. Here, the
implementations of LitConfig.note and LitConfig.warning are modified
to account for the quiet flag and avoid displaying if the flag has
indeed been set.
Patch by Nate Chandler
Reviewed by yln
Differential Revision: https://reviews.llvm.org/D68044
llvm-svn: 374009
Jonas Devlieghere [Tue, 8 Oct 2019 01:16:59 +0000 (01:16 +0000)]
Revert "ProcessInstanceInfoMatch: Don't match processes with no name if a name match was requested"
This breaks TestProcessAttach and TestHelloWorld on Darwin.
llvm-svn: 374008
Lawrence D'Anna [Tue, 8 Oct 2019 01:16:29 +0000 (01:16 +0000)]
test fix: TestLoadUsingPaths should use realpath
Summary:
TestLoadUsingPaths will fail if the build directory has
symlinks in its path, because the real paths reported by
the debugger won't match the symlink-laden paths it's expecting.
This can be solved just by using os.path.realpath on the base
path for the test.
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: JDevlieghere
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68618
llvm-svn: 374007
Jan Korous [Tue, 8 Oct 2019 01:13:17 +0000 (01:13 +0000)]
Reland 'Add VFS support for sanitizers' blacklist'
The original patch broke the test for Windows.
Trying to fix as per Reid's suggestions outlined here:
https://reviews.llvm.org/rC371663
Differential Revision: https://reviews.llvm.org/D67742
llvm-svn: 374006
Antonio Afonso [Tue, 8 Oct 2019 01:10:03 +0000 (01:10 +0000)]
Fixing missing lldb-scripts rename from D68370
llvm-svn: 374005
Jonas Devlieghere [Tue, 8 Oct 2019 00:44:54 +0000 (00:44 +0000)]
[CMake] Add two more uses of add_lldb_test_dependency
llvm-svn: 374000
Jan Korous [Tue, 8 Oct 2019 00:36:19 +0000 (00:36 +0000)]
Revert "Add VFS support for sanitizers' blacklist"
Fix tests on Windows for now.
This reverts commit
96ac97a4213287003f08636d0c372b3f71e9cfca.
llvm-svn: 373999
Haibo Huang [Tue, 8 Oct 2019 00:33:26 +0000 (00:33 +0000)]
[lldb] Reverts part of 61f471a
Seems I wrongly merged an old patch.
Reverts the change related to python dir for windows.
FileSpec should always contain normalized path. I.e. using '/' even in
windows.
llvm-svn: 373998
Lawrence D'Anna [Tue, 8 Oct 2019 00:26:53 +0000 (00:26 +0000)]
DWIMy filterspecs for dotest.py
Summary:
dotest.py currently requires a filterspec to be of the
form `TestCase.test_method`. This patch makes it more
flexible, so you can pass `TestModule.TestCase.test_method`
or `TestModule.TestCase` or `TestCase.test_method` or just
`test_method`.
This makes it more convenient to just copy a test name
out of the terminal after running a bunch of tests and use
it as a filterspec.
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: JDevlieghere
Subscribers: jingham, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68545
llvm-svn: 373997
Jonas Devlieghere [Tue, 8 Oct 2019 00:21:34 +0000 (00:21 +0000)]
[CMake] Track test dependencies with add_lldb_test_dependency
I often use `ninja lldb-test-deps` to build all the test dependencies
before running a subset of the tests with `lit --filter`. This
functionality seems to break relatively often because test dependencies
are tracked in an ad-hoc way acrooss cmake files. This patch adds a
helper function `add_lldb_test_dependency` to unify test dependency
tracking by adding dependencies to lldb-test-deps.
Differential revision: https://reviews.llvm.org/D68612
llvm-svn: 373996
Jonas Devlieghere [Tue, 8 Oct 2019 00:14:02 +0000 (00:14 +0000)]
[CMake] Remove stale comment
llvm-svn: 373995
Jonas Devlieghere [Tue, 8 Oct 2019 00:13:59 +0000 (00:13 +0000)]
[MachO] Fix symbol merging during symtab parsing.
The symtab parser in ObjectFileMachO has logic to coalesce debug (STAB)
and non-debug symbols, based on the address and the symbol name for
static (STSYM) and global symbols (GSYM) respectively. It makes the
assumption that the debug variant is always encountered first. Rather
than creating a second entry in the symbol table for the non-debug
symbol, the latter gets merged into the existing debug symbol.
This breaks when the linker emits the non-debug symbol first. We'd end
up with two entries in the symbol table, each containing part of the
information LLDB relies on. Indeed, commenting out the merging logic
breaks the test suite spectacularly.
This patch solves that problem by always parsing the debug symbols
first. This guarantees that the assumption for merging holds.
I'm not particularly happy with adding a lambda, but after numerous
attempts this is the best solution I could come up with. The symtab
parsing logic is pretty complex in that it touches a lot of things. I've
experienced first hand that it's very easy to break things. I believe
this approach strikes a balance between fixing the issue while limiting
the risk of regressions.
Differential revision: https://reviews.llvm.org/D68536
llvm-svn: 373994
Evgeniy Stepanov [Tue, 8 Oct 2019 00:00:30 +0000 (00:00 +0000)]
[msan] Add interceptors: crypt, crypt_r.
Reviewers: vitalybuka
Subscribers: srhines, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D68431
llvm-svn: 373993
Vitaly Buka [Mon, 7 Oct 2019 23:57:11 +0000 (23:57 +0000)]
[clang] Accept -ftrivial-auto-var-init in clang-cl
Reviewers: eugenis, rnk
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68608
llvm-svn: 373992
Haibo Huang [Mon, 7 Oct 2019 23:49:01 +0000 (23:49 +0000)]
[lldb] Unifying lldb python path
Based on mgorny@'s D67890
There are 3 places where python site-package path is calculated
independently:
1. finishSwigPythonLLDB.py where files are written to site-packages.
2. lldb/scripts/CMakeLists.txt where site-packages are installed.
3. ScriptInterpreterPython.cpp where site-packages are added to
PYTHONPATH.
This change creates the path once and use it everywhere. So that they
will not go out of sync.
Also it provides a chance for cross compiling users to specify the right
path for site-packages.
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68442
llvm-svn: 373991
Alex Langford [Mon, 7 Oct 2019 23:43:33 +0000 (23:43 +0000)]
[Symbol] Remove unused method ClangASTContext::GetObjCClassName
llvm-svn: 373990
Matt Arsenault [Mon, 7 Oct 2019 23:33:08 +0000 (23:33 +0000)]
AMDGPU/GlobalISel: Clamp G_SITOFP/G_UITOFP sources
llvm-svn: 373989
Johannes Doerfert [Mon, 7 Oct 2019 23:30:04 +0000 (23:30 +0000)]
[Attributor][NFC] Add debug output
llvm-svn: 373988
Johannes Doerfert [Mon, 7 Oct 2019 23:28:54 +0000 (23:28 +0000)]
[Attributor][FIX] Remove initialize calls and add undefs
The initialization logic has become part of the Attributor but the
patches that introduced these calls here were in development when the
transition happened.
We also now clean up (undefine) the macros used to create attributes.
llvm-svn: 373987
Johannes Doerfert [Mon, 7 Oct 2019 23:21:52 +0000 (23:21 +0000)]
[Attributor] Use local linkage instead of internal
Local linkage is internal or private, and private is a specialization of
internal, so either is fine for all our "local linkage" queries.
llvm-svn: 373986
Johannes Doerfert [Mon, 7 Oct 2019 23:14:58 +0000 (23:14 +0000)]
[Attributor] Use abstract call sites for call site callback
Summary:
When we iterate over uses of functions and expect them to be call sites,
we now use abstract call sites to allow callback calls.
Reviewers: sstefan1, uenoku
Subscribers: hiraditya, bollu, hfinkel, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67871
llvm-svn: 373985
Vitaly Buka [Mon, 7 Oct 2019 23:11:07 +0000 (23:11 +0000)]
[tsan, go] fix Go windows build
Summary:
Don't use weak exports when building tsan into a shared library for Go. gcc can't handle the pragmas used to make the weak references.
Include files that have been added since the last update to build.bat. (We should really find a better way to list all the files needed.)
Add windows version defines (WINVER and _WIN32_WINNT) to get AcquireSRWLockExclusive and ReleaseSRWLockExclusive defined.
Define GetProcessMemoryInfo to use the kernel32 version. This is kind of a hack, the windows header files should do this translation for us. I think we're not in the right family partition (we're using Desktop, but that translation only happens for App and System partitions???), but hacking the family partition seems equally gross and I have no idea what the consequences of that might be.
Patch by Keith Randall.
Reviewers: dvyukov, vitalybuka
Reviewed By: vitalybuka
Subscribers: jfb, delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D68599
llvm-svn: 373984
Vitaly Buka [Mon, 7 Oct 2019 23:04:16 +0000 (23:04 +0000)]
[tsan, go] break commands into multiple lines
Summary: Patch by Keith Randall.
Reviewers: dvyukov, vitalybuka
Subscribers: delcypher, jfb, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D68596
llvm-svn: 373983
Craig Topper [Mon, 7 Oct 2019 23:03:12 +0000 (23:03 +0000)]
[X86] Shrink zero extends of gather indices from type less than i32 to types larger than i32.
Gather instructions can use i32 or i64 elements for indices. If
the index is zero extended from a type smaller than i32 to i64, we
can shrink the extend to just extend to i32.
llvm-svn: 373982
Craig Topper [Mon, 7 Oct 2019 23:02:03 +0000 (23:02 +0000)]
[X86] Add test cases for zero extending a gather index from less than i32 to i64.
We should be able to use a smaller zero extend.
llvm-svn: 373981
Joerg Sonnenberger [Mon, 7 Oct 2019 22:55:42 +0000 (22:55 +0000)]
Fix the spelling of my name.
llvm-svn: 373980
Vitaly Buka [Mon, 7 Oct 2019 22:43:19 +0000 (22:43 +0000)]
[sanitizer] Print SIGTRAP for corresponding signal
Reviewers: eugenis, jfb
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D68603
llvm-svn: 373979
Vitaly Buka [Mon, 7 Oct 2019 22:43:17 +0000 (22:43 +0000)]
[tsan] Don't delay SIGTRAP handler
Reviewers: eugenis, jfb
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D68604
llvm-svn: 373978
Jan Korous [Mon, 7 Oct 2019 22:36:19 +0000 (22:36 +0000)]
Add VFS support for sanitizers' blacklist
Differential Revision: https://reviews.llvm.org/D67742
llvm-svn: 373977
Reid Kleckner [Mon, 7 Oct 2019 22:28:58 +0000 (22:28 +0000)]
[X86] Add new calling convention that guarantees tail call optimization
When the target option GuaranteedTailCallOpt is specified, calls with
the fastcc calling convention will be transformed into tail calls if
they are in tail position. This diff adds a new calling convention,
tailcc, currently supported only on X86, which behaves the same way as
fastcc, except that the GuaranteedTailCallOpt flag does not need to
enabled in order to enable tail call optimization.
Patch by Dwight Guth <dwight.guth@runtimeverification.com>!
Reviewed By: lebedev.ri, paquette, rnk
Differential Revision: https://reviews.llvm.org/D67855
llvm-svn: 373976
Heejin Ahn [Mon, 7 Oct 2019 22:19:40 +0000 (22:19 +0000)]
[WebAssembly] Fix unwind mismatch stat computation
Summary:
There was a bug when computing the number of unwind destination
mismatches in CFGStackify. When there are many mismatched calls that
share the same (original) destination BB, they have to be counted
separately.
This also fixes a typo and runs `fixUnwindMismatches` only when the wasm
exception handling is enabled. This is to prevent unnecessary
computations and does not change behavior.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68552
llvm-svn: 373975
Heejin Ahn [Mon, 7 Oct 2019 22:11:30 +0000 (22:11 +0000)]
[llvm-lipo] Add TextAPI to LINK_COMPONENTS
Summary:
D68319 uses `MachO::getCPUTypeFromArchitecture` and without this builds
with `-DBUILD_SHARED_LIBS=ON` fail.
Reviewers: alexshap
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68594
llvm-svn: 373974
David Bolvansky [Mon, 7 Oct 2019 21:57:03 +0000 (21:57 +0000)]
[Diagnostics] Emit better -Wbool-operation's warning message if we known that the result is always true
llvm-svn: 373973
Johannes Doerfert [Mon, 7 Oct 2019 21:48:08 +0000 (21:48 +0000)]
[Attributor][FIX] Remove assertion wrong for on invalid IRPositions
llvm-svn: 373972
Zoe Carver [Mon, 7 Oct 2019 21:41:15 +0000 (21:41 +0000)]
[libc++] Remove C++03 variadics in shared_ptr (v2)
Summary: In my last patch (D67675) I forgot a few variadics. This patch removes the remaining make_shared and allocate_shared C++03 variadics.
Reviewers: ldionne, EricWF, mclow.lists
Subscribers: christof, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D68000
llvm-svn: 373971
Davide Italiano [Mon, 7 Oct 2019 21:38:30 +0000 (21:38 +0000)]
[CMake] We only want to copy the headers for macOS.
<rdar://problem/
55916729>
llvm-svn: 373970
Cameron McInally [Mon, 7 Oct 2019 21:33:39 +0000 (21:33 +0000)]
[llvm-c] Add UnaryOperator to LLVM_FOR_EACH_VALUE_SUBCLASS macro
Note that we are not sure where the tests for these functions lives. This was discussed in the Phab Diff.
Differential Revision: https://reviews.llvm.org/D68588
llvm-svn: 373969
Adrian Prantl [Mon, 7 Oct 2019 21:23:19 +0000 (21:23 +0000)]
Mark constructor as default and remove implementation (NFC)
llvm-svn: 373968
Heejin Ahn [Mon, 7 Oct 2019 21:14:45 +0000 (21:14 +0000)]
[WebAssembly] Add memory intrinsics handling to mayThrow()
Summary:
Previously, `WebAssembly::mayThrow()` assumed all inputs are global
addresses. But when intrinsics, such as `memcpy`, `memmove`, or `memset`
are lowered to external symbols in instruction selection and later
emitted as library calls. And these functions don't throw.
This patch adds handling to those memory intrinsics to `mayThrow`
function. But while most of libcalls don't throw, we can't guarantee all
of them don't throw, so currently we conservatively return true for all
other external symbols.
I think a better way to solve this problem is to embed 'nounwind' info
in `TargetLowering::CallLoweringInfo`, so that we can access the info
from the backend. This will also enable transferring 'nounwind'
properties of LLVM IR instructions. Currently we don't transfer that
info and we can only access properties of callee functions, if the
callees are within the module. Other targets don't need this info in the
backend because they do all the processing before isel, but it will help
us because that info will reduce code size increase in fixing unwind
destination mismatches in CFGStackify.
But for now we return false for these memory intrinsics and true for all
other libcalls conservatively.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68553
llvm-svn: 373967
Alexander Shaposhnikov [Mon, 7 Oct 2019 21:14:22 +0000 (21:14 +0000)]
[llvm-lipo] Relax the check of the specified input file architecture
cctools lipo only compares the cputypes when it verifies that
the specified (via -arch) input file and the architecture match.
This diff adjusts the behavior of llvm-lipo accordingly.
Differential revision: https://reviews.llvm.org/D68319
Test plan: make check-all
llvm-svn: 373966
Johannes Doerfert [Mon, 7 Oct 2019 21:07:57 +0000 (21:07 +0000)]
[Attributor] Deduce memory behavior of functions and arguments
Deduce the memory behavior, aka "read-none", "read-only", or
"write-only", for functions and arguments.
Reviewers: sstefan1, uenoku
Subscribers: hiraditya, bollu, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67384
llvm-svn: 373965
Roman Lebedev [Mon, 7 Oct 2019 20:53:27 +0000 (20:53 +0000)]
[InstCombine] Fold conditional sign-extend of high-bit-extract into high-bit-extract-with-signext (PR42389)
This can come up in Bit Stream abstractions.
The pattern looks big/scary, but it can't be simplified any further.
It only is so simple because a number of my preparatory folds had
happened already (shift amount reassociation / shift amount
reassociation in bit test, sign bit test detection).
Highlights:
* There are two main flavors: https://rise4fun.com/Alive/zWi
The difference is add vs. sub, and left-shift of -1 vs. 1
* Since we only change the shift opcode,
we can preserve the exact-ness: https://rise4fun.com/Alive/4u4
* There can be truncation after high-bit-extraction:
https://rise4fun.com/Alive/slHc1 (the main pattern i'm after!)
Which means that we need to ignore zext of shift amounts and of NBits.
* The sign-extending magic can be extended itself (in add pattern
via sext, in sub pattern via zext. not the other way around!)
https://rise4fun.com/Alive/NhG
(or those sext/zext can be sinked into `select`!)
Which again means we should pay attention when matching NBits.
* We can have both truncation of extraction and widening of magic:
https://rise4fun.com/Alive/XTw
In other words, i don't believe we need to have any checks on
bitwidths of any of these constructs.
This is worsened in general by the fact that we may have `sext` instead
of `zext` for shift amounts, and we don't yet canonicalize to `zext`,
although we should. I have not done anything about that here.
Also, we really should have something to weed out `sub` like these,
by folding them into `add` variant.
https://bugs.llvm.org/show_bug.cgi?id=42389
llvm-svn: 373964
Roman Lebedev [Mon, 7 Oct 2019 20:53:16 +0000 (20:53 +0000)]
[InstCombine][NFC] Tests for "conditional sign-extend of high-bit-extract" pattern (PR42389)
https://bugs.llvm.org/show_bug.cgi?id=42389
llvm-svn: 373963
Roman Lebedev [Mon, 7 Oct 2019 20:53:08 +0000 (20:53 +0000)]
[InstCombine] Move isSignBitCheck(), handle rest of the predicates
True, no test coverage is being added here. But those non-canonical
predicates that are already handled here already have no test coverage
as far as i can tell. I tried to add tests for them, but all the patterns
already get handled elsewhere.
llvm-svn: 373962
Roman Lebedev [Mon, 7 Oct 2019 20:53:00 +0000 (20:53 +0000)]
[InstCombine][NFC] dropRedundantMaskingOfLeftShiftInput(): change how we deal with mask
Summary:
Currently, we pre-check whether we need to produce a mask or not.
This involves some rather magical constants.
I'd like to extend this fold to also handle the situation
when there's also a `trunc` before outer shift.
That will require another set of magical constants.
It's ugly.
Instead, we can just compute the mask, and check
whether mask is a pass-through (all-ones) or not.
This way we don't need to have any magical numbers.
This change is NFC other than the fact that we now compute
the mask and then check if we need (and can!) apply it.
Reviewers: spatel
Reviewed By: spatel
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68470
llvm-svn: 373961
Roman Lebedev [Mon, 7 Oct 2019 20:52:52 +0000 (20:52 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): propagate undef shift amounts
Summary:
When we do `ConstantExpr::getZExt()`, that "extends" `undef` to `0`,
which means that for patterns a/b we'd assume that we must not produce
any bits for that channel, while in reality we simply didn't care
about that channel - i.e. we don't need to mask it.
Reviewers: spatel
Reviewed By: spatel
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68239
llvm-svn: 373960
Cameron McInally [Mon, 7 Oct 2019 20:41:25 +0000 (20:41 +0000)]
[Bitcode] Update naming of UNOP_NEG to UNOP_FNEG
Differential Revision: https://reviews.llvm.org/D68588
llvm-svn: 373958
Davide Italiano [Mon, 7 Oct 2019 20:35:22 +0000 (20:35 +0000)]
[debugserver] Include the correct header.
<rdar://problem/
55916729>
llvm-svn: 373957
Jonas Devlieghere [Mon, 7 Oct 2019 20:33:20 +0000 (20:33 +0000)]
[AccelTable] Remove stale comment (NFC)
rdar://
55857228
llvm-svn: 373956
Jonas Devlieghere [Mon, 7 Oct 2019 20:31:28 +0000 (20:31 +0000)]
[test] Rename `Modules` to `ObjectFile` (NFC)
llvm-svn: 373955
Jonas Devlieghere [Mon, 7 Oct 2019 20:31:22 +0000 (20:31 +0000)]
[MachO] Shuffle some things around in ParseSymtab (NFC)
llvm-svn: 373954
Walter Erquinigo [Mon, 7 Oct 2019 20:26:49 +0000 (20:26 +0000)]
[gdb-remote] process properly effective uid
Summary:
Someone wrote SetEffectiveSetEffectiveGroupID instead of SetEffectiveUserID.
After this fix, the android process list can show user names, e.g.
```
PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE ARGUMENTS
====== ====== ========== ========== ========== ========== ============================== ============================
529 1 root 0 root 0 /sbin/ueventd
```
Reviewers: labath,clayborg,aadsm,xiaobai
Subscribers:
llvm-svn: 373953
Alexey Bataev [Mon, 7 Oct 2019 19:57:40 +0000 (19:57 +0000)]
[OPENMP]Fix caonical->canonical, NFC.
Fixed typo.
llvm-svn: 373952
Nico Weber [Mon, 7 Oct 2019 19:54:19 +0000 (19:54 +0000)]
Attempt to fix a few clang-tidy tests on Windows, see PR43593.
llvm-svn: 373951
Amy Huang [Mon, 7 Oct 2019 19:41:53 +0000 (19:41 +0000)]
Fix for expanding __pragmas in macro arguments
Summary:
Avoid parsing __pragma into an annotation token when macro arguments are pre-expanded.
This is what clang currently does when parsing _Pragmas.
Fixes https://bugs.llvm.org/show_bug.cgi?id=41128, where clang crashed
when trying to get the length of an annotation token.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68114
llvm-svn: 373950
Louis Dionne [Mon, 7 Oct 2019 19:22:04 +0000 (19:22 +0000)]
[libc++abi] Introduce a LIBCXXABI_LIBRARY_VERSION option
That option controls the 'VERSION' attribute of the libc++abi shared
library, which in turn controls the name of the actual dylib being
produced.
llvm-svn: 373949
Nico Weber [Mon, 7 Oct 2019 19:17:02 +0000 (19:17 +0000)]
gn build: try to make system-libs.windows.test pass
llvm-svn: 373948
Matt Arsenault [Mon, 7 Oct 2019 19:16:26 +0000 (19:16 +0000)]
AMDGPU/GlobalISel: Handle more G_INSERT cases
Start manually writing a table to get the subreg index. TableGen
should probably generate this, but I'm not sure what it looks like in
the arbitrary case where subregisters are allowed to not fully cover
the super-registers.
llvm-svn: 373947
Matt Arsenault [Mon, 7 Oct 2019 19:13:27 +0000 (19:13 +0000)]
GlobalISel: Partially implement lower for G_INSERT
llvm-svn: 373946
Matt Arsenault [Mon, 7 Oct 2019 19:10:44 +0000 (19:10 +0000)]
AMDGPU/GlobalISel: Fix selection of 16-bit shifts
llvm-svn: 373945
Matt Arsenault [Mon, 7 Oct 2019 19:10:43 +0000 (19:10 +0000)]
AMDGPU/GlobalISel: Select VALU G_AMDGPU_FFBH_U32
llvm-svn: 373944
Matt Arsenault [Mon, 7 Oct 2019 19:07:19 +0000 (19:07 +0000)]
AMDGPU/GlobalISel: Use S_MOV_B64 for inline constants
This hides some defects in SIFoldOperands when the immediates are
split.
llvm-svn: 373943
Matt Arsenault [Mon, 7 Oct 2019 19:05:58 +0000 (19:05 +0000)]
AMDGPU/GlobalISel: Widen 16-bit G_MERGE_VALUEs sources
Continue making a mess of merge/unmerge legality.
llvm-svn: 373942
Louis Dionne [Mon, 7 Oct 2019 18:55:15 +0000 (18:55 +0000)]
[libc++abi] Do not define -Dcxxabi_shared_EXPORTS when building libc++abi
CMake sets adds that definition automatically, but we don't need
or use it.
llvm-svn: 373940
Alexey Bataev [Mon, 7 Oct 2019 18:54:57 +0000 (18:54 +0000)]
[OPENMP50]Treat range-based for as canonical loop.
According to OpenMP 5.0, range-based for is also considered as a
canonical form of loops.
llvm-svn: 373939
Matt Arsenault [Mon, 7 Oct 2019 18:43:31 +0000 (18:43 +0000)]
AMDGPU/GlobalISel: Select more G_INSERT cases
At minimum handle the s64 insert type, which are emitted in real cases
during legalization.
We really need TableGen to emit something to emit something like the
inverse of composeSubRegIndices do determine the subreg index to use.
llvm-svn: 373938
Matt Arsenault [Mon, 7 Oct 2019 18:43:29 +0000 (18:43 +0000)]
GlobalISel: Add target pre-isel instructions
Allows targets to introduce regbankselectable
pseudo-instructions. Currently the closet feature to this is an
intrinsic. However this requires creating a public intrinsic
declaration. This litters the public intrinsic namespace with
operations we don't necessarily want to expose to IR producers, and
would rather leave as private to the backend.
Use a new instruction bit. A previous attempt tried to keep using enum
value ranges, but it turned into a mess.
llvm-svn: 373937
Michal Gorny [Mon, 7 Oct 2019 18:14:56 +0000 (18:14 +0000)]
[clang] [cmake] Support LLVM_DISTRIBUTION_COMPONENTS in stand-alone build
Differential Revision: https://reviews.llvm.org/D68412
llvm-svn: 373936
Jordan Rose [Mon, 7 Oct 2019 18:14:24 +0000 (18:14 +0000)]
Second attempt to add iterator_range::empty()
Doing this makes MSVC complain that `empty(someRange)` could refer to
either C++17's std::empty or LLVM's llvm::empty, which previously we
avoided via SFINAE because std::empty is defined in terms of an empty
member rather than begin and end. So, switch callers over to the new
method as it is added.
https://reviews.llvm.org/D68439
llvm-svn: 373935
Louis Dionne [Mon, 7 Oct 2019 18:12:10 +0000 (18:12 +0000)]
[libc++abi] Remove redundant link flags on Apple platforms
These flags are already set when we create the cxxabi_shared target
using the SOVERSION and VERSION target properties, and the install_name
was already being overriden to '@rpath/libc++abi.1.dylib' by CMake
because no 'CMAKE_INSTALL_NAME_DIR' option was specified. So this is
effectively a removal of dead code with no intended functionality change.
The only think we're losing here is that we used to link against
libSystem.B.dylib instead of libSystem.dylib when building libc++abi
for macOS 10.6 -- however, I strongly suspect nobody's building
libc++abi from source for that target anymore.
llvm-svn: 373934
Nico Weber [Mon, 7 Oct 2019 17:55:05 +0000 (17:55 +0000)]
Try to get clangd tests passing on Windows.
Part of PR43592. See also r328645.
llvm-svn: 373932
Walter Erquinigo [Mon, 7 Oct 2019 17:49:32 +0000 (17:49 +0000)]
[platform process list] add a flag for showing the processes of all users
Summary:
For context: https://reviews.llvm.org/D68293
We need a way to show all the processes on android regardless of the user id.
When you run `platform process list`, you only see the processes with the same user as the user that launched lldb-server. However, it's quite useful to see all the processes, though, and it will lay a foundation for full apk debugging support from lldb.
Before:
```
PID PARENT USER TRIPLE NAME
====== ====== ========== ======================== ============================
3234 1 aarch64-unknown-linux-android adbd
8034 3234 aarch64-unknown-linux-android sh
9096 3234 aarch64-unknown-linux-android sh
9098 9096 aarch64-unknown-linux-android lldb-server
(lldb) ^D
```
Now:
```
(lldb) platform process list -x
205 matching processes were found on "remote-android"
PID PARENT USER TRIPLE NAME
====== ====== ========== ======================== ============================
1 0 init
524 1 init
525 1 init
531 1 ueventd
568 1 logd
569 1 aarch64-unknown-linux-android servicemanager
570 1 aarch64-unknown-linux-android hwservicemanager
571 1 aarch64-unknown-linux-android vndservicemanager
577 1 aarch64-unknown-linux-android qseecomd
580 577 aarch64-unknown-linux-android qseecomd
...
23816 979 com.android.providers.calendar
24600 979 com.verizon.mips.services
27888 979 com.hualai
28043 2378 com.android.chrome:sandboxed_process0
31449 979 com.att.shm
31779 979 com.samsung.android.authfw
31846 979 com.samsung.android.server.iris
32014 979 com.samsung.android.MtpApplication
32045 979 com.samsung.InputEventApp
```
Reviewers: labath,xiaobai,aadsm,clayborg
Subscribers:
llvm-svn: 373931
Kostya Kortchinsky [Mon, 7 Oct 2019 17:37:39 +0000 (17:37 +0000)]
[scudo][standalone] Correct releaseToOS behavior
Summary:
There was an issue in `releaseToOSMaybe`: one of the criteria to
decide if we should proceed with the release was wrong. Namely:
```
const uptr N = Sci->Stats.PoppedBlocks - Sci->Stats.PushedBlocks;
if (N * BlockSize < PageSize)
return; // No chance to release anything.
```
I meant to check if the amount of bytes in the free list was lower
than a page, but this actually checks if the amount of **in use** bytes
was lower than a page.
The correct code is:
```
const uptr BytesInFreeList =
Region->AllocatedUser -
(Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks) * BlockSize;
if (BytesInFreeList < PageSize)
return 0; // No chance to release anything.
```
Consequences of the bug:
- if a class size has less than a page worth of in-use bytes (allocated
or in a cache), reclaiming would not occur, whatever the amount of
blocks in the free list; in real world scenarios this is unlikely to
happen and be impactful;
- if a class size had less than a page worth of free bytes (and enough
in-use bytes, etc), then reclaiming would be attempted, with likely
no result. This means the reclaiming was overzealous at times.
I didn't have a good way to test for this, so I changed the prototype
of the function to return the number of bytes released, allowing to
get the information needed. The test added fails with the initial
criteria.
Another issue is that `ReleaseToOsInterval` can actually be 0, meaning
we always try to release (side note: it's terrible for performances).
so change a `> 0` check to `>= 0`.
Additionally, decrease the `CanRelease` threshold to `PageSize / 32`.
I still have to make that configurable but I will do it at another time.
Finally, rename some variables in `printStats`: I feel like "available"
was too ambiguous, so change it to "total".
Reviewers: morehouse, hctim, eugenis, vitalybuka, cferris
Reviewed By: morehouse
Subscribers: delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D68471
llvm-svn: 373930
Erich Keane [Mon, 7 Oct 2019 17:28:03 +0000 (17:28 +0000)]
Fix Calling Convention through aliases
r369697 changed the behavior of stripPointerCasts to no longer include
aliases. However, the code in CGDeclCXX.cpp's createAtExitStub counted
on the looking through aliases to properly set the calling convention of
a call.
The result of the change was that the calling convention mismatch of the
call would be replaced with a llvm.trap, causing a runtime crash.
Differential Revision: https://reviews.llvm.org/D68584
llvm-svn: 373929
Yitzhak Mandelbaum [Mon, 7 Oct 2019 17:24:23 +0000 (17:24 +0000)]
[libTooling][NFC] Fix build break in r373916.
r373916 used raw strings inside macro calls, which breaks some builds.
llvm-svn: 373928