Commit Graph

329655 Commits

Author SHA1 Message Date
Walter Erquinigo d04855f820 [lldb-server/android] Show more processes by relaxing some checks
By default `platform process list` only shows the processes of the current user that lldb-server can parse.
There are several problems:
- apk programs don't have an executable file. They instead use a package name as identifier. We should show them instead.
- each apk also runs under a different user. That's how android works
- because of the user permission, some files like /proc/<pid>/{environ,exe} can't be read.

This results in a very small process list.

This is a local run on my machine
```
(lldb) platform process list
2 matching processes were found on "remote-android"
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
23291  3177              aarch64-unknown-linux-android sh
23301  23291            aarch64-unknown-linux-android lldb-server
```
However, I have 700 processes running at this time.

By implementing a few fallbacks for android, I've expanded this list to 202, filtering out kernel processes, which would presumably appear in this list if the device was rooted.

```
(lldb) platform process list
202 matching processes were found on "remote-android"
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
...
12647  3208              aarch64-unknown-linux-android sh
12649  12647             aarch64-unknown-linux-android lldb-server
12653  982                                        com.samsung.faceservice
13185  982                                        com.samsung.vvm
15899  982                                        com.samsung.android.spay
16220  982                                        com.sec.spp.push
17126  982                                        com.sec.spp.push:RemoteDlcProcess
19772  983                                        com.android.chrome
20209  982                                        com.samsung.cmh:CMH
20380  982                                        com.google.android.inputmethod.latin
20879  982                                        com.samsung.android.oneconnect:Receiver
21212  983                                        com.tencent.mm
24459  1                 aarch64-unknown-linux-android wpa_supplicant
25974  982                                        com.samsung.android.contacts
26293  982                                        com.samsung.android.messaging
28714  982                                        com.samsung.android.dialer
31605  982                                        com.samsung.android.MtpApplication
32256  982                                        com.bezobidny
```

Something to notice is that the architecture is unkonwn for all apks. And that's fine, because run-as would be required to gather this information and that would make this entire functionality massively slow.

There are still several improvements to make here, like displaying actual user names, which I'll try to do in a following diff.

Note: Regarding overall apk debugging support from lldb. I'm planning on having lldb spawn lldb-server by itself with the correct user, so that everything works well. The initial lldb-server used for connecting to the remote platform can be reused for such purpose. Furthermore, eventually lldb could also launch that initial lldb-server on its own.

Differential Revision: D68289

llvm-svn: 374853
2019-10-15 00:00:05 +00:00
Walter Erquinigo 1473b9f205 Revert "fix"
This reverts commit d8af64c9a0228301f6fd0e1c841e4abe0b6f4801.

llvm-svn: 374852
2019-10-14 23:56:54 +00:00
Sanjay Patel 4335d8f0e8 Revert [InstCombine] fold a shifted bool zext to a select
This reverts r374828 (git commit 1f40f15d54) due to bot breakage

llvm-svn: 374851
2019-10-14 23:55:39 +00:00
Alina Sbirlea b7a3353061 [MemorySSA] Update for partial unswitch.
Update MSSA for blocks cloned when doing partial unswitching.
Enable additional testing with MSSA.
Resolves PR43641.

llvm-svn: 374850
2019-10-14 23:52:39 +00:00
Craig Topper 9586d85ab3 [X86] Teach X86MCodeEmitter to properly encode zmm16-zmm31 as index register to vgatherpf/vscatterpf.
We need to encode bit 4 into the EVEX.V' bit. We do this right
for regular gather/scatter which use either MRMSrcMem or MRMDestMem
formats.  The prefetches use MRM*m formats.

Fixes an issue recently added to PR36202.

llvm-svn: 374849
2019-10-14 23:48:24 +00:00
Craig Topper 5e80715508 [X86] Add encoding tests for avx512pf vgatherpf/vscatterpf instructions.
llvm-svn: 374848
2019-10-14 23:48:12 +00:00
Julian Lettner 98aa3c1de9 [lit] Add argument check: --timeout must be non-negative integer
llvm-svn: 374847
2019-10-14 23:43:18 +00:00
Walter Erquinigo ed57fb7665 fix
llvm-svn: 374846
2019-10-14 23:32:46 +00:00
Jorge Gorbe Moya b052331bd6 Revert "Dead Virtual Function Elimination"
This reverts commit 9f6a873268.

llvm-svn: 374844
2019-10-14 23:25:25 +00:00
Eric Christopher 3be9169caa Temporarily Revert [Modules][PCH] Hash input files content
as it's breaking a few bots.

This reverts r374841 (git commit 2a1386c81d)

llvm-svn: 374842
2019-10-14 23:14:24 +00:00
Bruno Cardoso Lopes 2a1386c81d [Modules][PCH] Hash input files content
Summary:
When files often get touched during builds, the mtime based validation
leads to different problems in implicit modules builds, even when the
content doesn't actually change:

- Modules only: module invalidation due to out of date files. Usually causing rebuild traffic.
- Modules + PCH: build failures because clang cannot rebuild a module if it comes from building a PCH.
- PCH: build failures because clang cannot rebuild a PCH in case one of the input headers has different mtime.

This patch proposes hashing the content of input files (headers and
module maps), which is performed during serialization time. When looking
at input files for validation, clang only computes the hash in case
there's a mtime mismatch.

I've tested a couple of different hash algorithms availble in LLVM in
face of building modules+pch for `#import <Cocoa/Cocoa.h>`:
- `hash_code`: performace diff within the noise, total module cache increased by 0.07%.
- `SHA1`: 5% slowdown. Haven't done real size measurements, but it'd be BLOCK_ID+20 bytes per input file, instead of BLOCK_ID+8 bytes from `hash_code`.
- `MD5`: 3% slowdown. Like above, but BLOCK_ID+16 bytes per input file.

Given the numbers above, the patch uses `hash_code`. The patch also
improves invalidation error msgs to point out which type of problem the
user is facing: "mtime", "size" or "content".

rdar://problem/29320105

Reviewers: dexonsmith, arphaman, rsmith, aprantl

Subscribers: jkorous, cfe-commits, ributzka

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67249

llvm-svn: 374841
2019-10-14 23:02:03 +00:00
Eric Christopher d93d001cba Add -fno-experimental-pass-manager to make clear which pass manager
we're running and to make flipping the default not regress testing.

llvm-svn: 374840
2019-10-14 23:01:48 +00:00
Eric Christopher c3649a0871 In the new pass manager use PTO.LoopUnrolling to determine when and how
we will unroll loops. Also comment a few occasions where we need to
know whether or not we're forcing the unwinder or not.

The default before and after this patch is for LoopUnroll to be enabled,
and for it to use a cost model to determine whether to unroll the loop
(`OnlyWhenForced = false`). Before this patch, disabling loop unroll
would not run the LoopUnroll pass. After this patch, the LoopUnroll pass
is being run, but it restricts unrolling to only the loops marked by a
pragma (`OnlyWhenForced = true`).

In addition, this patch disables the UnrollAndJam pass when disabling unrolling.

Testcase is in clang because it's controlling how the loop optimizer
is being set up and there's no other way to trigger the behavior.

llvm-svn: 374838
2019-10-14 22:56:07 +00:00
Jian Cai 72593d3bdc [clang] add requirements to -Wa,-W test cases.
Include linux as a test requirement.

llvm-svn: 374837
2019-10-14 22:51:12 +00:00
Eli Friedman 4498d41932 [test] Fix test failure
The version mismatch symbol is version 9 on 32 bit android. Since
this test isn't actually testing any android specific functionality,
we force the target triple to x86_64-unknown-unknown in order to have
a consistent version number. It seems the test was already trying to
do this, just not doing it right

Patch by Christopher Tetrault

Differential Revision: https://reviews.llvm.org/D68882

llvm-svn: 374836
2019-10-14 22:44:42 +00:00
Philip Reames a40162d475 [Tests] Add a SCEV analysis test for llvm.widenable.condition
Mostly because we don't appear to have one and a prototype patch I just saw would have broken the example committed.

llvm-svn: 374835
2019-10-14 22:42:35 +00:00
Jian Cai 4ec5205da7 Add support to -Wa,-W in clang
Summary:
Currently clang does not support -Wa,-W, which suppresses warning
messages in GNU assembler. Add this option for gcc compatibility.
https://bugs.llvm.org/show_bug.cgi?id=43651. Reland with differential
information.

Reviewers: bcain

Reviewed By: bcain

Subscribers: george.burgess.iv, gbiv, llozano, manojgupta, nickdesaulniers, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68884

llvm-svn: 374834
2019-10-14 22:28:03 +00:00
Jian Cai 89478148d8 Revert "Add support to -Wa,-W in clang"
This reverts commit e72eeca43b9577be2aae55f7603febbf223a6ab3.

llvm-svn: 374833
2019-10-14 22:28:01 +00:00
Jian Cai e9089c223c [ARM][AsmParser] handles offset expression in parentheses
Summary:
Integrated assembler does not accept offset expressions surrounded by
parenthesis. Handle this case for GAS compability.
https://bugs.llvm.org/show_bug.cgi?id=43631

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68764

llvm-svn: 374832
2019-10-14 22:22:26 +00:00
David Blaikie be744ea54f DebugInfo: Remove unnecessary/mistaken inclusion of Bitcode/BitcodeAnalyzer.h
Introduced in r374582, Michael Spencer pointed out this broke the
modules build due to a missing tblgen dependency on
llvm/IR/Attributes.inc.

Michael fixed the dependency in r374827.

So this removes the inclusion and the new dependency (effectively
reverting r374827 and including the alternative fix of removing rather
than supporting the new dependency).

Thanks for the quick fix/notice, Michael!

llvm-svn: 374831
2019-10-14 22:12:45 +00:00
Roman Tereshin 044297ccbf [update_mir_test_checks] Handle MI flags properly
previously we would generate literal check lines w/ no reg-exps for
vregs as MI flags (nsw, ninf, etc.) won't be recognized as a part of MI.

Fixing that. Includes updating the MIR tests that suffered from the
problem.

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D68905

llvm-svn: 374829
2019-10-14 22:01:58 +00:00
Sanjay Patel 1f40f15d54 [InstCombine] fold a shifted bool zext to a select
For a constant shift amount, add the following fold.
shl (zext (i1 X)), ShAmt --> select (X, 1 << ShAmt, 0)

https://rise4fun.com/Alive/IZ9

Fixes PR42257.

Based on original patch by @zvi (Zvi Rackover)

Differential Revision: https://reviews.llvm.org/D63382

llvm-svn: 374828
2019-10-14 21:56:40 +00:00
Michael J. Spencer 9585d8c11a [Modules Build] Add missing dependency.
A previous commit made libLLVMDebugInfoDWARF depend on the LLVM_Bitcode module which depends on the LLVM_intrinsic_gen module which depends on "llvm/IR/Attributes.inc" which is a generated header not depended on by libLLVMDebugInfo. Add that dependency.

llvm-svn: 374827
2019-10-14 21:53:51 +00:00
Richard Smith 7e8fe67f0e PR43080: Do not build context-sensitive expressions during name classification.
Summary:
We don't know what context to use until the classification result is
consumed by the parser, which could happen in a different semantic
context. So don't build the expression that results from name
classification until we get to that point and can handle it properly.

This covers everything except C++ implicit class member access, which
is a little awkward to handle properly in the face of the protected
member access check. But it at least fixes all the currently-filed
instances of PR43080.

Reviewers: efriedma

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68896

llvm-svn: 374826
2019-10-14 21:53:03 +00:00
Lawrence D'Anna 9efbc564ba build fix for SBInstruction.
oops!  I cherry-picked  rL374820 thinking it was completely
independent of D68737, but it wasn't.  It makes an incidental
use of SBFile::GetFile, which is introduced there, so I broke the
build.

The docs say you can commit without review for "obvious".   I think
this qualifies.   If this kind of fix isn't considered obvious, let
me know and I'll revert instead.

Fixes: rL374820
llvm-svn: 374825
2019-10-14 21:51:02 +00:00
Julian Lettner 31a26001a1 [lit] Create Run object later and only when it is needed
Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68843

llvm-svn: 374823
2019-10-14 21:23:40 +00:00
Jian Cai 753d789c44 Add support to -Wa,-W in clang
Currently clang does not support -Wa,-W, which suppresses warning
messages in GNU assembler. Add this option for gcc compatibility.
https://bugs.llvm.org/show_bug.cgi?id=43651

llvm-svn: 374822
2019-10-14 21:21:39 +00:00
Jan Korous 9d0a84f5f3 [NFC] Fix ClangScanDeps/static-analyzer.c test on Windows
Follow-up to c5d14b5c6f

llvm-svn: 374821
2019-10-14 21:06:11 +00:00
Lawrence D'Anna e7a9115680 remove FILE* bindings from SBInstruction.
Summary:
This patch replaces the FILE* python bindings for SBInstruction and
SBInstructionList and replaces them with the new, safe SBFile and FileSP
bindings.

I also re-enable `Test_Disassemble_VST1_64`, because now we can use
the file bindings as an additional test of the disassembler, and we
can use the disassembler test as a test of the file bindings.

The bugs referred to in the comments appear to have been fixed.   The
radar is closed now and the bugzilla bug does not reproduce with the
instructions given.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D68890

llvm-svn: 374820
2019-10-14 20:59:57 +00:00
Alexey Bataev d88c7dec21 [OPNEMP]Allow num_tasks clause in combined task-based directives.
The expression of the num_tasks clause must be captured in the combined
task-based directives, like 'parallel master taskloop' directive.

llvm-svn: 374819
2019-10-14 20:44:34 +00:00
Sanjay Patel bfaa1082e1 [InstCombine] add tests for select/shift transforms; NFC
A transform proposal for the shift form is in D63382.

llvm-svn: 374818
2019-10-14 20:28:03 +00:00
Lawrence D'Anna 62c9fe4273 uint32_t options -> File::OpenOptions options
Summary:
This patch re-types everywhere that passes a File::OpenOptions
as a uint32_t so it actually uses File::OpenOptions.

It also converts some OpenOptions related functions that fail
by returning 0 or NULL into llvm::Expected

split off from https://reviews.llvm.org/D68737

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D68853

llvm-svn: 374817
2019-10-14 20:15:34 +00:00
Lawrence D'Anna 322f12afc3 remove FILE* usage from ReportEventState() and HandleProcessEvent()
Summary:
This patch adds FileSP and SBFile versions of the API methods
ReportEventState and  HandleProcessEvent.   It points the SWIG
wrappers at these instead of the ones that use FILE* streams.

Reviewers: JDevlieghere, jasonmolenda, labath, jingham

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D68546

llvm-svn: 374816
2019-10-14 20:15:28 +00:00
Jan Korous c5d14b5c6f [clang-scan-deps] Support for clang --analyze in clang-scan-deps
The goal is to have 100% fidelity in clang-scan-deps behavior when
--analyze is present in compilation command.

At the same time I don't want to break clang-tidy which expects
__static_analyzer__ macro defined as built-in.

I introduce new cc1 options (-setup-static-analyzer) that controls
the macro definition and is conditionally set in driver.

Differential Revision: https://reviews.llvm.org/D68093

llvm-svn: 374815
2019-10-14 20:15:01 +00:00
Joel E. Denny 7e385bd2f5 [lit] Extend internal diff to support -U
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff -U1 file -
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-U` as a command-line option.  This patch adds `-U`
support.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D68668

llvm-svn: 374814
2019-10-14 19:59:30 +00:00
Philip Reames 2b161cd0a4 [Tests] Add a test demonstrating a miscompile in the off-by-default loop-pred transform
Credit goes to Evgeny Brevnov for figuring out the problematic case.

Fuzzing probably also found it (lots of failures), but due to some silly infrastructure problems I hadn't gotten to the results before Evgeny hand reduced it from a benchmark.  

llvm-svn: 374812
2019-10-14 19:49:40 +00:00
Roman Lebedev 76e02af704 [LoopIdiom] BCmp: loop exit count must not be wider than size_t that `bcmp` takes
As reported by Joerg Sonnenberger in IRC, for 32-bit systems,
where pointer and size_t are 32-bit, if you use 64-bit-wide variable
in the loop, you could end up with loop exit count being of the type
wider than the size_t. Now, i'm not sure if we can produce `bcmp`
from that (just truncate?), but we certainly should not assert/miscompile.

llvm-svn: 374811
2019-10-14 19:46:34 +00:00
Alexey Bataev b9c55e2760 [OPNEMP]Allow grainsize clause in combined task-based directives.
The expression of the grainsize clause must be captured in the combined
task-based directives, like 'parallel master taskloop' directive.

llvm-svn: 374810
2019-10-14 19:29:52 +00:00
Cameron McInally 6362a2168b [ASan] Fix IRTests/InstructionsTest.UnaryOperator
Fix ASan regression from r374782.

llvm-svn: 374808
2019-10-14 19:17:31 +00:00
Philip Reames 02945107f8 [Tests] Add a few more tests for idioms with FP induction variables
llvm-svn: 374807
2019-10-14 19:10:39 +00:00
Casey Carter fcad66f165 [libc++][test] Portability fix for std::any tests
Ensure that `large_tracked_t` defined in `any_helpers.h` is in fact too large to fit in `std::any`'s small object buffer.

llvm-svn: 374806
2019-10-14 19:05:04 +00:00
Puyan Lotfi 4e4b4f4099 [clang][IFS][test] Fixing lit test breakages on macOS due to r374798
Adding the quotes breaks tests because on Darwin the name mangling is prefixed
with an underscore.

llvm-svn: 374805
2019-10-14 18:57:29 +00:00
Lawrence D'Anna d5768e3d0e Fix test breakage caused by r374424
Summary:
The build directory name is based on the test method name, so having
two test methods with the same name in the same test file is a
problem, even if they're in different test classes.

On linux and darwin this conflict can go unnoticed, but windows
has different filesystem semantics and it will fail when one
process tries to delete files still held open by another.

The problem is fixed just by changing the name of one of the test
methods.

Reviewers: JDevlieghere, jasonmolenda, labath, stella.stamenova

Reviewed By: stella.stamenova

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D68951

llvm-svn: 374803
2019-10-14 18:53:27 +00:00
Teresa Johnson 8408d95e31 [ThinLTO] Fix printing of NoInline function summary flag
Summary:
The guard for printing function flags in the summary was not checking
the NoInline flag.

Reviewers: wmi

Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68948

llvm-svn: 374802
2019-10-14 18:37:31 +00:00
Matt Arsenault 2bd166ad94 AMDGPU: Fix redundant setting of m0 for atomic load/store
Atomic load/store would have their setting of m0 handled twice, which
happened to be optimized out later.

llvm-svn: 374801
2019-10-14 18:30:31 +00:00
Matt Arsenault e8f1ad2ad8 AMDGPU: Remove unnecessary IR from test
llvm-svn: 374800
2019-10-14 18:30:29 +00:00
Nathan Ridge 37e31e629d [clangd] Improve semantic highlighting in dependent contexts (fixes #154)
Reviewers: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67901

llvm-svn: 374799
2019-10-14 18:26:13 +00:00
Puyan Lotfi 76f9869bf2 [clang][IFS] Escape mangled names so MS ABI doesn't break YAML parsing.
Microsoft's ABI mangles names differently than Itanium and this breaks the LLVM
yaml parser unless the name is escaped in quotes. Quotes are being added to the
mangled names of the IFS file generation so that llvm-ifs doesn't break when
Windows triples are passed to the driver.

Differential Revision: https://reviews.llvm.org/D68915

llvm-svn: 374798
2019-10-14 18:03:03 +00:00
Casey Carter c86ba58188 [libc++][test] Add license headers to test/support/archetypes.*
Differential Revision: https://reviews.llvm.org/D68947

llvm-svn: 374797
2019-10-14 18:00:34 +00:00
Hans Wennborg 0b33417cd4 Fix copy-pasto in r374759
llvm-svn: 374796
2019-10-14 17:52:31 +00:00