Commit Graph

328440 Commits

Author SHA1 Message Date
Lawrence D'Anna 96898eb6a9 SBDebugger::SetInputFile, SetOutputFile, etc.
Summary:
Add new methods to SBDebugger to set IO files as SBFiles instead of
as FILE* streams.

In future commits, the FILE* methods will be deprecated and these
will become the primary way to set the debugger I/O streams.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 373563
2019-10-03 04:04:48 +00:00
Lawrence D'Anna 5750453020 new api class: SBFile
Summary:
SBFile is a scripting API wrapper for lldb_private::File

This is the first step in a project to enable arbitrary python
io.IOBase file objects -- including those that override the read()
and write() methods -- to be used as the main debugger IOStreams.

Currently this is impossible because python file objects must first
be converted into FILE* streams by SWIG in order to be passed into
the debugger.

full prototype: https://github.com/smoofra/llvm-project/tree/files

Reviewers: JDevlieghere, jasonmolenda, zturner, jingham, labath

Reviewed By: labath

Subscribers: labath, mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 373562
2019-10-03 04:01:07 +00:00
Yaxun Liu f13b8d4fe9 [HIP] Support -emit-llvm for device compilation
Sometimes it is useful to compile HIP device code to LLVM BC. It is not convenient to use clang -cc1 since
there are lots of options needed.

This patch allows clang driver to compile HIP device code to LLVM BC with -emit-llvm -c.

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

llvm-svn: 373561
2019-10-03 03:27:43 +00:00
Craig Topper f849f41469 [X86] Add broadcast load folding patterns to NoVLX VPMULLQ/VPMAXSQ/VPMAXUQ/VPMINSQ/VPMINUQ patterns.
More fixes for PR36191.

llvm-svn: 373560
2019-10-03 03:16:27 +00:00
Craig Topper 241c72ddd9 [X86] Remove a couple redundant isel patterns that look to have been copy/pasted from right above them. NFC
llvm-svn: 373559
2019-10-03 03:16:21 +00:00
GN Sync Bot d7f93154b3 gn build: Merge r373556
llvm-svn: 373558
2019-10-03 02:43:27 +00:00
Nico Weber 6713f8235b Revert 373538 and follow-ups 373549 and 373552.
They break tests on (at least) macOS.

llvm-svn: 373556
2019-10-03 02:38:43 +00:00
Daniel Sanders 45f682f471 [gicombiner] Make rL373551 compatible with older cmakes
Newer cmakes appear to be more flexible w.r.t object libraries. Convert to
a static library so that it works with older cmakes too

llvm-svn: 373555
2019-10-03 01:49:04 +00:00
Nico Weber f79f68975d gn build: (manually) merge r373551
llvm-svn: 373554
2019-10-03 01:32:51 +00:00
Richard Smith 5258202a81 PR43519: don't inject a diagnostic when constant-evaulation of a
pointer-to-member call can't determine a callee.

We will have produced a diagnostic already if the callee is known to be
unevaluatable, and diagnosing here rejects valid code during potential
constant expression checking.

llvm-svn: 373553
2019-10-03 01:20:27 +00:00
Puyan Lotfi 30c8df02ba Fixing broken builds due to r373538, issues with filepath and hexagon toolchain.
It appears there are some issues with the hexagon toolchain, and also the file
path for the library file. If this doesn't fix the remaining breakages I will
attempt a revert.

llvm-svn: 373552
2019-10-03 01:19:51 +00:00
Daniel Sanders eb27b5de53 [gicombiner] Add a CodeExpander to handle C++ fragments with variable expansion
Summary:
This will handle expansion of C++ fragments in the declarative combiner
including custom predicates, and escapes into C++ to aid the migration
effort.

Reviewers: bogner, volkan

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 373551
2019-10-03 01:04:42 +00:00
GN Sync Bot 81f2da4d09 gn build: Merge r373538
llvm-svn: 373550
2019-10-03 00:47:13 +00:00
Puyan Lotfi 8581f860c7 Fixing broken builds due to r373538 due to test that should have been deleted.
test/InterfaceStubs/object.cpp should have been deleted.

llvm-svn: 373549
2019-10-03 00:41:13 +00:00
Richard Smith 69e9d84b1a Mark P0784R7 as complete and start defining its feature-test macro.
Note that this only covers the language side of this feature. (The
library side has its own feature test macro.)

llvm-svn: 373548
2019-10-03 00:39:37 +00:00
Richard Smith b542602c5f For P0784R7: support placement new-expressions in constant evaluation.
For now, we restrict this support to use from within the standard
library implementation, since we're required to make parts of the
standard library that use placement new work, but not permitted to
make uses of placement new from user code work.

llvm-svn: 373547
2019-10-03 00:39:35 +00:00
Richard Smith 19ad523971 For P0784R7: allow direct calls to operator new / operator delete from
std::allocator::{allocate,deallocate} in constant evaluation.

llvm-svn: 373546
2019-10-03 00:39:33 +00:00
Daniel Sanders 603e98948e [gicombiner] Fix windows issue where single quotes in the command are passed through to tablegen
llvm-svn: 373545
2019-10-02 23:38:06 +00:00
Stanislav Mekhanoshin 1384c3a5b8 [AMDGPU] Fix illegal agpr use by VALU
When SIFixSGPRCopies attempts to fix an illegal copy from vector to
scalar register it calls moveToVALU(). A copy from an agpr to sgpr
becomes a copy from agpr to agpr, which may result in the illegal
register class at a use of this copy.

Solution is to copy it always into a vgpr. This may result in a
subsequent copy into an agpr if that is what really needed, however
should not happen too often and likely will be folded later.

The opposite situation may not happen because an sgpr is always
illegal where agpr is legal, so such user instructions may not
exist.

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

llvm-svn: 373544
2019-10-02 23:23:46 +00:00
Daniel Sanders 2a964eabaa [gicombiner] Fix a nullptr dereference when -combiners is given a name that isn't defined
This is unlikely to be the root cause for the windows bot failures but
it would explain the stack trace seen.

llvm-svn: 373543
2019-10-02 23:03:21 +00:00
Roman Lebedev ae3315af07 [InstCombine] Bypass high bit extract before variable sign-extension (PR43523)
https://rise4fun.com/Alive/8BY - valid for lshr+trunc+variable sext
https://rise4fun.com/Alive/7jk - the variable sext can be redundant

https://rise4fun.com/Alive/Qslu - 'exact'-ness of first shift can be preserver

https://rise4fun.com/Alive/IF63 - without trunc we could view this as
                                  more general "drop redundant mask before right-shift",
                                  but let's handle it here for now
https://rise4fun.com/Alive/iip - likewise, without trunc, variable sext can be redundant.

There's more patterns for sure - e.g. we can have 'lshr' as the final shift,
but that might be best handled by some more generic transform, e.g.
"drop redundant masking before right-shift" (PR42456)

I'm singling-out this sext patch because you can only extract
high bits with `*shr` (unlike abstract bit masking),
and i *know* this fold is wanted by existing code.

I don't believe there is much to review here,
so i'm gonna opt into post-review mode here.

https://bugs.llvm.org/show_bug.cgi?id=43523

llvm-svn: 373542
2019-10-02 23:02:12 +00:00
Roman Lebedev 29339149c3 [NFC][InstCombine] Add tests for 'variable sext of variable high bit extract' pattern (PR43523)
https://bugs.llvm.org/show_bug.cgi?id=43523

llvm-svn: 373541
2019-10-02 23:01:58 +00:00
David Blaikie 11e0bcf8a2 DebugInfo: Rename DebugLocStream::Entry::Begin/EndSym to just Begin/End
Brings this struct in line with the RangeSpan class so they might
eventually be used by common template code for generating range/loc
lists with less duplicate code.

llvm-svn: 373540
2019-10-02 22:58:02 +00:00
Matt Morehouse 629cad1266 Move SanitizerInitializeUnwinder outside anonymous namespace.
Fixes the Android build breakage introduced in r373528.

llvm-svn: 373539
2019-10-02 22:57:37 +00:00
Puyan Lotfi 406de17b9b [clang][ifs] Clang Interface Stubs ToolChain plumbing.
This patch enables end to end support for generating ELF interface stubs
directly from clang. Now the following:

clang -emit-interface-stubs -o libfoo.so a.cpp b.cpp c.cpp

will product an ELF binary with visible symbols populated. Visibility attributes
and -fvisibility can be used to control what gets populated.

* Adding ToolChain support for clang Driver IFS Merge Phase
* Implementing a default InterfaceStubs Merge clang Tool, used by ToolChain
* Adds support for the clang Driver to involve llvm-ifs on ifs files.
* Adds -emit-merged-ifs flag, to tell llvm-ifs to emit a merged ifs text file
  instead of the final object format (normally ELF)


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

llvm-svn: 373538
2019-10-02 22:50:07 +00:00
David Bolvansky 6b45029676 [InstCombine] Transform bcopy to memmove
bcopy is still widely used mainly for network apps. Sadly, LLVM has no optimizations for bcopy, but there are some for memmove. 
Since bcopy == memmove, it is profitable to transform bcopy to memmove and use current optimizations for memmove for free here.

llvm-svn: 373537
2019-10-02 22:49:20 +00:00
Craig Topper f5bda7fe24 [X86] Add test cases for suboptimal vselect+setcc splitting.
If the vselect result type needs to be split, it will try to
also try to split the condition if it happens to be a setcc.

With avx512 where k-registers are legal, its probably better
to just use a kshift to split the mask register.

llvm-svn: 373536
2019-10-02 22:35:03 +00:00
Craig Topper 2772b970e3 [LegalizeTypes] Check for already split condition before calilng SplitVecRes_SETCC in SplitRes_SELECT.
No point in manually splitting the SETCC if it was already done.

llvm-svn: 373535
2019-10-02 22:34:49 +00:00
Nico Weber 641ecbd014 gn build: (manually) merge r373527
llvm-svn: 373534
2019-10-02 22:33:07 +00:00
David Blaikie b677cb8dc7 DebugInfo: Simplify RangeSpan to be a plain struct
This is an effort to make RangeSpan and DebugLocStream::Entry more
similar to share code for their emission (to reuse the more complicated
code for using (& choosing when to use) base address selection entries,
etc).

It didn't seem like this struct was worth the complexity of
encapsulation - when the members could be initialized by the ctor to any
value (no validation) and the type is assignable (so there's no
mutability or other constraint being implemented by its interface).

llvm-svn: 373533
2019-10-02 22:27:24 +00:00
Matt Morehouse 4d39410b1e [sanitizer_common] Declare __sanitizer_on_print in Windows interception.
Speculative fix for Windows bot.

llvm-svn: 373532
2019-10-02 22:00:29 +00:00
Matt Morehouse 38ac6bdb83 [sanitizer_common] Disable onprint.cpp on Android.
The test fails to find the written file on Android.

llvm-svn: 373531
2019-10-02 21:38:22 +00:00
Matt Morehouse 62f190ce9a [sanitizer_common] Add __sanitizer_on_print to interface list.
Should fix the current Windows buildbot failure.

llvm-svn: 373530
2019-10-02 21:21:18 +00:00
Vitaly Buka d39e7e2cf1 [compiler-rt] Use GetNextInstructionPc in signal handlers
Summary:
All other stack trace callers assume that PC contains return address.
HWAsan already use GetNextInstructionPc in similar code.

PR43339

Reviewers: eugenis, kcc, jfb

Subscribers: dexonsmith, dberris, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373529
2019-10-02 21:20:37 +00:00
Vitaly Buka 59bf75caab NFC: add namespace {}
llvm-svn: 373528
2019-10-02 21:20:32 +00:00
Daniel Sanders 505d7f3105 [gicombiner] Add the boring boilerplate for the declarative combiner
Summary:
This is the first of a series of patches extracted from a much bigger WIP
patch. It merely establishes the tblgen pass and the way empty combiner
helpers are declared and integrated into a combiner info.

The tablegen pass takes a -combiners option to select the combiner helper
that will be generated. This can be given multiple values to generate
multiple combiner helpers at once. Doing so helps to minimize parsing
overhead.

The reason for creating a GlobalISel subdirectory in utils/TableGen is that
there will be quite a lot of non-pass files (~15) by the time the patch
series is done.

Reviewers: volkan

Subscribers: mgorny, hiraditya, simoncook, Petar.Avramovic, s.egerton, llvm-commits

Tags: #llvm

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

llvm-svn: 373527
2019-10-02 21:13:07 +00:00
Simon Pilgrim 426078a781 Fix uninitialized variable warning in CodeGenPGO constructor. NFCI.
llvm-svn: 373526
2019-10-02 21:05:21 +00:00
Simon Pilgrim f2805470e6 ItaniumCXXABI - silence static analyzer getAs<RecordType> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but we should be able to use castAs<RecordType> directly and if not assert will fire for us.

llvm-svn: 373525
2019-10-02 20:45:16 +00:00
Louis Dionne c5d2746fbe [NFC][libc++abi] Convert stray tabs to spaces
llvm-svn: 373524
2019-10-02 20:45:06 +00:00
Sergey Dmitriev 5ac9d18e7d [Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments.
Differential Revision: https://reviews.llvm.org/D68355

llvm-svn: 373523
2019-10-02 20:44:45 +00:00
Florian Hahn a03d7b0f24 Recommit "[GlobalOpt] Pass DTU to removeUnreachableBlocks instead of recomputing."
The cause for the revert should be fixed by r373513 /
a80b6c1542

This reverts commit 47dbcbd8ec.

llvm-svn: 373522
2019-10-02 20:40:13 +00:00
Simon Pilgrim 5a8b229c97 CGObjCMac - silence static analyzer dyn_cast<>/getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but we should be able to use cast<>/castAs<> directly and if not assert will fire for us.

llvm-svn: 373520
2019-10-02 20:30:37 +00:00
Yi-Hong Lyu c7be067974 [PowerPC] Fix SH field overflow issue
Store rlwinm Rx, Ry, 32, 0, 31 as rlwinm Rx, Ry, 0, 0, 31 and store
rldicl Rx, Ry, 64, 0 as rldicl Rx, Ry, 0, 0. Otherwise SH field is overflow and
fails assertion in assembly printing stage.

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

llvm-svn: 373519
2019-10-02 20:25:16 +00:00
Matt Morehouse e55c442b1b [sanitizer_common] Rename OnPrint to __sanitizer_on_print.
Summary:
https://reviews.llvm.org/D28596 exposed OnPrint in the global namespace,
which can cause collisions with user-defined OnPrint() functions.

Reviewers: vitalybuka, dvyukov

Reviewed By: vitalybuka, dvyukov

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 373518
2019-10-02 20:13:21 +00:00
Louis Dionne 925d9d2e14 [libc++] Use functions instead of global variables to set libc++ build flags
This commit follows the trend of doing things per-target instead of
modifying the C++ flags globally. It does so for visibility-related
flags, other basic build flags and Windows-specific flags.

llvm-svn: 373517
2019-10-02 20:07:01 +00:00
Daniel Sanders 9ac0cda40a Fix inconsistent indentation in TableGen.cpp
The anonymous namespace starts out (incorrectly) indented but isn't
indented from the TimeRegionsOpt declaration onwards.

llvm-svn: 373516
2019-10-02 19:56:04 +00:00
Evgeniy Stepanov 464df87288 Handle llvm.launder.invariant.group in msan.
Summary:
[MSan] handle llvm.launder.invariant.group

    Msan used to give false-positives in

    class Foo {
     public:
      virtual ~Foo() {};
    };

    // Return true iff *x is set.
    bool f1(void **x, bool flag);

    Foo* f() {
      void *p;
      bool found;
      found = f1(&p,flag);
      if (found) {
        // p is always set here.
        return static_cast<Foo*>(p); // False positive here.
      }
      return nullptr;
    }

Patch by Ilya Tokar.

Reviewers: #sanitizers, eugenis

Reviewed By: #sanitizers, eugenis

Subscribers: eugenis, Prazek, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373515
2019-10-02 19:53:19 +00:00
Evandro Menezes e139a73c5f [TableGen] Improve error reporting of overlapping definitions (NFC)
llvm-svn: 373514
2019-10-02 19:44:53 +00:00
Florian Hahn a80b6c1542 [Local] Handle terminators with users in removeUnreachableBlocks.
Terminators like invoke can have users outside the current basic block.
We have to replace those users with undef, before replacing the
terminator.

This fixes a crash exposed by rL373430.

Reviewers: brzycki, asbirlea, davide, spatel

Reviewed By: asbirlea

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

llvm-svn: 373513
2019-10-02 19:38:24 +00:00
Louis Dionne c78c0e08be [libc++] Use a function to set warning flags per target
This is part of a larger shift to move to per-target settings and
eradicate global variables from the CMake build. I'm starting small
with warnings only because those are easy to transition over and I
want to see how it pans out, but we can handle all flags like exceptions
and RTTI in the future.

llvm-svn: 373511
2019-10-02 19:31:30 +00:00