lldb.git
2 years ago[lldb] [test] Pass LLVM_LIBS_DIR from CMake for linking liblldb
Michał Górny [Fri, 31 Jan 2020 08:35:34 +0000 (09:35 +0100)]
[lldb] [test] Pass LLVM_LIBS_DIR from CMake for linking liblldb

Pass the correct library directory from CMake to dotest.py when linking
liblldb, instead of trying to reconstruct the path from executable path.
This fixes link failures on platforms having non-null
LLVM_LIBDIR_SUFFIX.

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

2 years agoAMDGPU: Fix divergence analysis of control flow intrinsics
Matt Arsenault [Fri, 31 Jan 2020 22:23:59 +0000 (17:23 -0500)]
AMDGPU: Fix divergence analysis of control flow intrinsics

The mask results of these should be uniform. The trickier part is the
dummy booleans used as IR glue need to be treated as divergent. This
should make the divergence analysis results correct for the IR the DAG
is constructed from.

This should allow us to eliminate requiresUniformRegister, which has
an expensive, recursive scan over all users looking for control flow
intrinsics. This should avoid recent compile time regressions.

2 years ago[clang-format] Do not treat C# attribute targets as labels
Jonathan Coe [Wed, 5 Feb 2020 16:51:31 +0000 (16:51 +0000)]
[clang-format] Do not treat C# attribute targets as labels

Summary: Merge '[', 'target' , ':' into a single token for C# attributes to
prevent the target from being seen as a label.

Reviewers: MyDeveloperDay, krasimir

Reviewed By: krasimir

Tags: #clang-format

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

2 years agoNFC: fix unused var warnings in no-assert builds
Jordan Rupprecht [Wed, 5 Feb 2020 17:22:41 +0000 (09:22 -0800)]
NFC: fix unused var warnings in no-assert builds

2 years agoResubmit^2: [JumpThreading] Thread jumps through two basic blocks
Kazu Hirata [Wed, 5 Feb 2020 16:24:01 +0000 (08:24 -0800)]
Resubmit^2: [JumpThreading] Thread jumps through two basic blocks

This reverts commit 41784bed01543315a1d03141e6ddc023fd914c0b.

Since the original revision ead815924e6ebeaf02c31c37ebf7a560b5fdf67b,
this revision fixes three issues:

- This revision fixes the Windows build.  My original patch improperly
  copied EH pads on Windows.  This patch disregards jump threading
  opportunities having to do with EH pads.

- This revision fixes jump threading to a wrong destination.
  Specifically, my original patch treated any Constant other than 0 as 1
  while evaluating the branch condition.  This bug led to treating
  constant expressions like:

    icmp ugt i8* null, inttoptr (i64 4 to i8*)

  to "true".  This patch fixes the bug by calling isOneValue.

- This revision fixes the cost calculation of two basic blocks being
  threaded through.  Note that getJumpThreadDuplicationCost returns
  "(unsigned)~0" for those basic blocks that cannot be duplicated.  If
  we sum of two return values from getJumpThreadDuplicationCost, we
  could have an unsigned overflow like:

    (unsigned)~0 + 5 = 4

  and mistakenly determine that it's safe and profitable to proceed
  with the jump threading opportunity.  The patch fixes the bug by
  checking each return value before summing them up.

[JumpThreading] Thread jumps through two basic blocks

Summary:
This patch teaches JumpThreading.cpp to thread through two basic
blocks like:

  bb3:
    %var = phi i32* [ null, %bb1 ], [ @a, %bb2 ]
    %tobool = icmp eq i32 %cond, 0
    br i1 %tobool, label %bb4, label ...

  bb4:
    %cmp = icmp eq i32* %var, null
    br i1 %cmp, label bb5, label bb6

by duplicating basic blocks like bb3 above.  Once we duplicate bb3 as
bb3.dup and redirect edge bb2->bb3 to bb2->bb3.dup, we have:

  bb3:
    %var = phi i32* [ @a, %bb2 ]
    %tobool = icmp eq i32 %cond, 0
    br i1 %tobool, label %bb4, label ...

  bb3.dup:
    %var = phi i32* [ null, %bb1 ]
    %tobool = icmp eq i32 %cond, 0
    br i1 %tobool, label %bb4, label ...

  bb4:
    %cmp = icmp eq i32* %var, null
    br i1 %cmp, label bb5, label bb6

Then the existing code in JumpThreading.cpp can thread edge
bb3.dup->bb4 through bb4 and eventually create bb3.dup->bb5.

Reviewers: wmi

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

2 years ago[IRCE] Make IRCE a Function pass.
Alina Sbirlea [Mon, 27 Jan 2020 21:33:34 +0000 (13:33 -0800)]
[IRCE] Make IRCE a Function pass.

Summary: Make InductiveRangeCheckElimination a FunctionPass.

Reviewers: reames, mkazantsev

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

2 years ago[MLIR][GPU] Fix build files for mlir-opt.
Stephan Herhut [Wed, 5 Feb 2020 17:06:36 +0000 (17:06 +0000)]
[MLIR][GPU] Fix build files for mlir-opt.

The recent refactoring of build files broke building with the MIR CUDA
integration enabled. This fixes it by adding some additional
dependencies to mlir-opt.

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

2 years ago[gn build] Port b198f16e1e1
LLVM GN Syncbot [Wed, 5 Feb 2020 17:03:12 +0000 (17:03 +0000)]
[gn build] Port b198f16e1e1

2 years agoAMDGPU/GlobalISel: Legalize llvm.amdgcn.s.buffer.load
Matt Arsenault [Thu, 30 Jan 2020 22:34:33 +0000 (17:34 -0500)]
AMDGPU/GlobalISel: Legalize llvm.amdgcn.s.buffer.load

The 96-bit results need to be widened.

I find the interaction between LegalizerHelper and MIRBuilder somewhat
awkward. The custom legalization is called by the LegalizerHelper, but
then does not have access to the helper. You have to construct a new
helper, which then does not own the MachineIRBuilder, but does modify
it. Maybe custom legalization should be passed the helper?

2 years ago[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP
Teresa Johnson [Wed, 22 Jan 2020 22:06:23 +0000 (14:06 -0800)]
[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP

Summary:
Currently type test assume sequences inserted for devirtualization are
removed during WPD. This patch delays their removal until later in the
optimization pipeline. This is an enabler for upcoming enhancements to
indirect call promotion, for example streamlined promotion guard
sequences that compare against vtable address instead of the target
function, when there are small number of possible vtables (either
determined via WPD or by in-progress type profiling). We need the type
tests to correlate the callsites with the address point offset needed in
the compare sequence, and optionally to associated type summary info
computed during WPD.

This depends on work in D71913 to enable invocation of LowerTypeTests to
drop type test assume sequences, which will now be invoked following ICP
in the ThinLTO post-LTO link pipelines, and also after the existing
export phase LowerTypeTests invocation in regular LTO (which is already
after ICP). We cannot simply move the existing import phase
LowerTypeTests pass later in the ThinLTO post link pipelines, as the
comment in PassBuilder.cpp notes (it must run early because when
performing CFI other passes may disturb the sequences it looks for).

This necessitated adding a new type test resolution "Unknown" that we
can use on the type test assume sequences previously removed by WPD,
that we now want LTT to ignore.

Depends on D71913.

Reviewers: pcc, evgeny777

Subscribers: mehdi_amini, Prazek, hiraditya, steven_wu, dexonsmith, arphaman, davidxl, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

2 years ago[Analyzer] Model STL Algoirthms to improve the iterator checkers
Adam Balogh [Wed, 20 Nov 2019 08:15:42 +0000 (09:15 +0100)]
[Analyzer] Model STL Algoirthms to improve the iterator checkers

STL Algorithms are usually implemented in a tricky for performance
reasons which is too complicated for the analyzer. Furthermore inlining
them is costly. Instead of inlining we should model their behavior
according to the specifications.

This patch is the first step towards STL Algorithm modeling. It models
all the `find()`-like functions in a simple way: the result is either
found or not. In the future it can be extended to only return success if
container modeling is also extended in a way the it keeps track of
trivial insertions and deletions.

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

2 years agoAMDGPU/GlobalISel: Fix processing new phi in waterfall loop
Matt Arsenault [Sun, 2 Feb 2020 01:21:44 +0000 (20:21 -0500)]
AMDGPU/GlobalISel: Fix processing new phi in waterfall loop

The adjusted iterator range included the last we just inserted, and
don't want to process. Figure out the new iterator range before
inserting phis. This was a harmless problem, but added an unnecessary
complication for a future patch.

2 years agoGlobalISel: Make LegalizerHelper primitives public
Matt Arsenault [Thu, 30 Jan 2020 23:05:12 +0000 (18:05 -0500)]
GlobalISel: Make LegalizerHelper primitives public

I want to re-use widenScalarDst/moreElementsVectorDst directly.

2 years agoAMDGPU/GlobalISel: Don't use legal v2s16 G_BUILD_VECTOR
Matt Arsenault [Sat, 4 Jan 2020 20:35:26 +0000 (15:35 -0500)]
AMDGPU/GlobalISel: Don't use legal v2s16 G_BUILD_VECTOR

If we have s_pack_* instructions, legalize this to
G_BUILD_VECTOR_TRUNC from s32 elements. This is closer to how how the
s_pack_* instructions really behave.

If we don't have s_pack_ instructions, expand this by creating a merge
to s32 and bitcasting. This expands to the expected bit operations. I
think this eventually should go in a new bitcast legalize action type
in LegalizerHelper.

We already directly emit the shift operations in RegBankSelect for the
vector case. This could possibly be cleaned up, but I also may want to
defer doing this expansion to selection anyway. I'll see about that
when I try to actually match VOP3P instructions.

This breaks the selection of the build_vector since tablegen doesn't
know how to match G_BUILD_VECTOR_TRUNC yet, so just xfail it for now.

2 years ago[lldb/Target] Add Assert StackFrame Recognizer
Med Ismail Bennani [Tue, 4 Feb 2020 16:53:26 +0000 (17:53 +0100)]
[lldb/Target] Add Assert StackFrame Recognizer

When a thread stops, this checks depending on the platform if the top frame is
an abort stack frame. If so, it looks for an assert stack frame in the upper
frames and set it as the most relavant frame when found.

To do so, the StackFrameRecognizer class holds a "Most Relevant Frame" and a
"cooked" stop reason description. When the thread is about to stop, it checks
if the current frame is recognized, and if so, it fetches the recognized frame's
attributes and applies them.

rdar://58528686

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years ago[ARM][TargetParser] Improve handling of dependencies between target features
Momchil Velikov [Wed, 5 Feb 2020 15:19:03 +0000 (15:19 +0000)]
[ARM][TargetParser] Improve handling of dependencies between target features

The patch at https://reviews.llvm.org/D64048 added "negative"
dependency handling in `ARM::appendArchExtFeatures`: feature "noX"
removes all features, which imply "X".

This patch adds the "positive" handling: feature "X" adds all the
feature strings implied by "X".

(This patch also comes from the suggestion here
https://reviews.llvm.org/D72633#inline-658582)

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

2 years ago[OpenCL] Fix tblgen support for cl_khr_mipmap_image_writes
Sven van Haastregt [Wed, 5 Feb 2020 16:05:20 +0000 (16:05 +0000)]
[OpenCL] Fix tblgen support for cl_khr_mipmap_image_writes

Apply the fix of f780e15caf1 ("[OpenCL] Fix support for
cl_khr_mipmap_image_writes", 2020-01-27) also to the TableGen OpenCL
builtin function definitions.

2 years agoRe-enable a update_cc_test_checks.py tests
Alex Richardson [Wed, 5 Feb 2020 15:36:43 +0000 (15:36 +0000)]
Re-enable a update_cc_test_checks.py tests

This test was not running because it still had a REQUIRES: python3 line.
As this is no longer necessary, remove the REQUIRES to run the test
again.

2 years ago[clang][driver] Fix null pointer dereference warning inside PrintActions1 (PR43462)
Simon Pilgrim [Wed, 5 Feb 2020 15:31:38 +0000 (15:31 +0000)]
[clang][driver] Fix null pointer dereference warning inside PrintActions1 (PR43462)

As detailed on PR43462, clang static analyzer is complaining about a null pointer dereference as we provide a 'host' toolchain fallback if the ToolChain pointer is null, but then use that pointer anyhow to report the triple.

Tests indicate the ToolChain pointer is always valid and the 'host' code path is redundant.

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

2 years ago[ARM][MVE] LowOverheadLoops: DCE on the iteration count setup expression
Sjoerd Meijer [Wed, 5 Feb 2020 15:15:46 +0000 (15:15 +0000)]
[ARM][MVE] LowOverheadLoops: DCE on the iteration count setup expression

Once we have created a tail-predicated hardware-loop, and thus know the number
of elements that are processed, we want to clean-up the iteration count
expression of that loop. In D73682, we bailed the analysis on conditionally
executed instructions. This adds support for IT-blocks, so that we can handle
these cases again. The restriction is that we only support IT blocks containing
1 statement, but that seems to cover most cases and forms of the iteration
count expression.

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

2 years ago[OPNEMP50][DOCS]Mark array shaping expression as claimed, NFC.
Alexey Bataev [Wed, 5 Feb 2020 15:02:39 +0000 (10:02 -0500)]
[OPNEMP50][DOCS]Mark array shaping expression as claimed, NFC.

2 years ago[OPENMP][NVPTX]Add NVPTX specific definitions for new/delete operators.
Alexey Bataev [Tue, 21 Jan 2020 19:16:29 +0000 (14:16 -0500)]
[OPENMP][NVPTX]Add NVPTX specific definitions for new/delete operators.

Summary:
To use new/delete in NVPTX code we need to define them. Implementation
copied from CUDA wrappers.

Reviewers: hfinkel, jdoerfert

Subscribers: mgorny, guansong, kkwli0, caomhin, cfe-commits

Tags: #clang

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

2 years ago[MLIR] Add mapping based on ValueRange to BlockAndValueMapper.
Stephan Herhut [Mon, 3 Feb 2020 15:33:36 +0000 (16:33 +0100)]
[MLIR] Add mapping based on ValueRange to BlockAndValueMapper.

Summary:
It is often needed to map entire ranges rather than single values. To avoid
writing the same for loop every time, I have added an overload to the map
method.

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

2 years ago[analyzer] Fix a couple of bugs in HTML report generation.
Artem Dergachev [Tue, 4 Feb 2020 19:48:19 +0000 (22:48 +0300)]
[analyzer] Fix a couple of bugs in HTML report generation.

It should now produce valid HTML again.

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

2 years ago[ARM] Correct syntax of the CLRM insn
Momchil Velikov [Wed, 5 Feb 2020 13:54:18 +0000 (13:54 +0000)]
[ARM] Correct syntax of the CLRM insn

The predicate should be adjacent to the opcode.

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

2 years ago[MCA] Remove verification check on MayLoad and MayStore. NFCI
Andrea Di Biagio [Wed, 5 Feb 2020 12:51:29 +0000 (12:51 +0000)]
[MCA] Remove verification check on MayLoad and MayStore. NFCI

Field NumMicroOpcodes is currently used by mca to model the number of uOPs
dispatched from the uOp-Queue to the out of order backend.  From a 'dispatch'
point of view, an instruction with zero opcodes is still valid; it simply
doesn't consume any dispatch group slots.

However, mca doesn't expect an instruction with zero uOPs to consume pipeline
resources because it is seen as a contradiction.  In practice, it only makes
sense if such an instruction is eliminated and never really executed. It may be
that mca is being too conservative here. However I believe that mca is right,
and we should probably check that inconsistency in CodeGenSchedule.cpp (when we
also verify scheduling classes in general).

This patch removes the check for MayLoad and MayStore in mca.  That check is
probably too conservative: we are already checking if a zero-uops instruction
consumes any processor resources. Note also that instructions with unmodelled
side-effects also tend to set the MayLoad/MayStore flags even if - theoretically
speaking - they might not even consume any hw resources in practice.

In future we may want to implement different checks (possibly outside of mca)
and potentially revisit the logic in mca that verifies instructions.
For that reason I have raised PR44797.

2 years agovisitINSERT_VECTOR_ELT - pull out repeated dyn_cast. NFCI.
Simon Pilgrim [Wed, 5 Feb 2020 12:32:25 +0000 (12:32 +0000)]
visitINSERT_VECTOR_ELT - pull out repeated dyn_cast. NFCI.

This always gets called at least once.

2 years ago[ARM][LowOverheadLoops] Fix loop count chain
Sam Parker [Wed, 5 Feb 2020 13:20:50 +0000 (13:20 +0000)]
[ARM][LowOverheadLoops] Fix loop count chain

Checking that the use-def chain that performs the loop count
isSafeToRemove is not sufficient because it means that we can
remove register copies that we need to restore lr to its correct
value. This change now prevents the transform from kicking in for the
'remove-elem-moves' test which needs to addressed later on.

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

2 years ago[ARM][LowOverheadLoops] Ensure memory predication
Sam Parker [Wed, 5 Feb 2020 12:47:03 +0000 (12:47 +0000)]
[ARM][LowOverheadLoops] Ensure memory predication

While validating each MVE instruction, check that all instructions
that touch memory are somehow predicated upon the VCTP.

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

2 years ago[lldb] Revert some change in data-formatter-objc/main.m that broke TestDataFormatterO...
Raphael Isemann [Wed, 5 Feb 2020 13:07:19 +0000 (14:07 +0100)]
[lldb] Revert some change in data-formatter-objc/main.m that broke TestDataFormatterObjCNSDate.py

Changing the date2 to an timezone independent value broke the test as the data formatters
uses the current time zone for the summary (so changing it to a time zone independent value
would again break the test in some time zones). We anyway just care about this for date2
which will be printed in a timezone-independent summary.

2 years ago[clangd] Add the missing elaborated types in FindTarget.
Haojian Wu [Wed, 5 Feb 2020 08:56:13 +0000 (09:56 +0100)]
[clangd] Add the missing elaborated types in FindTarget.

Reviewers: sammccall

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

Tags: #clang

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

2 years ago[lldb][NFC] Remove some unnecessary curly braces
Raphael Isemann [Wed, 5 Feb 2020 12:28:42 +0000 (13:28 +0100)]
[lldb][NFC] Remove some unnecessary curly braces

2 years ago[lldb] Introduce i386 support in NetBSD Process plugin
Michał Górny [Sun, 12 Jan 2020 21:49:36 +0000 (22:49 +0100)]
[lldb] Introduce i386 support in NetBSD Process plugin

Introduce support for i386 platform that is shared with amd64
in the same plugin.  The concept is partially based on the Linux
implementation.

The plugin tries to reuse as much code as possible.  As a result, i386
register enums are mapped into amd64 values and those are used in actual
code.  The code for accessing FPU and debug registers is shared,
although general-purpose register layouts do not match between the two
kernel APIs and need to be #ifdef-ed.

This layout will also make it possible to add support for debugging
32-bit programs on amd64 with minimal added code.

In order for this to work, I had to add missing data for debug registers
on i386.

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

2 years ago[lldb] Make TestDataFormatterObjCCF.py pass outside California
Raphael Isemann [Wed, 5 Feb 2020 12:23:49 +0000 (13:23 +0100)]
[lldb] Make TestDataFormatterObjCCF.py pass outside California

Summary:
This test creates its dates with `NSDate dateWithNaturalLanguageString` which is deprecated and uses the current time zone of the machine to
interpret the input string. This causes that the created NSDate has a different value depending on the locale of the machine
and we hardcoded the value for California's time zone (PST) but the data formatter gives out the GMT value as a string.

This just replaces the use with the timezone-independent dateWithTimeIntervalSince1970 (which we also use in the rest of the test)
to make this pass independently of the time zone of the machine running the test.

Reviewers: mib

Reviewed By: mib

Subscribers: lldb-commits, JDevlieghere

Tags: #lldb

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

2 years ago[OpenCL] Fix support for cl_khr_mipmap_image_writes
Alexey Sotkin [Mon, 27 Jan 2020 09:25:03 +0000 (12:25 +0300)]
[OpenCL] Fix support for cl_khr_mipmap_image_writes

Text of the extension is available here:
https://github.com/KhronosGroup/OpenCL-Docs/blob/master/ext/cl_khr_mipmap_image.asciidoc

Patch by Ilya Mashkov

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

2 years ago[X86] Fix missing load latencies (PR36894)
Simon Pilgrim [Wed, 5 Feb 2020 11:36:36 +0000 (11:36 +0000)]
[X86] Fix missing load latencies (PR36894)

We weren't account for load latencies in the SSE42/AES/CLMUL schedule classes

2 years agoFix MSVC signed/unsigned warning. NFCI.
Simon Pilgrim [Wed, 5 Feb 2020 10:49:43 +0000 (10:49 +0000)]
Fix MSVC signed/unsigned warning. NFCI.

2 years ago[AVR] Add disassembly tests for supported instructions
Ayke van Laethem [Mon, 3 Feb 2020 19:01:44 +0000 (20:01 +0100)]
[AVR] Add disassembly tests for supported instructions

The disassembler of the AVR backend is incomplete: most instructions do
not correctly disassemble yet.

This patch is the first in a series to add disassembly support to the
AVR backend. It starts with adding disassembler tests for instructions
that already disassemble correctly.

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

2 years agoPartially revert c1c9819ef91aab51b5a23fb3027adac5a2f551cc
Martin Storsjö [Wed, 5 Feb 2020 11:29:48 +0000 (13:29 +0200)]
Partially revert c1c9819ef91aab51b5a23fb3027adac5a2f551cc

Revert the part of that change that broke the
test Passes/./PluginsTests/PluginsTests.LoadPlugin.

2 years ago[CMake] Add missing component dependencies, to fix building for mingw with BUILD_SHAR...
Martin Storsjö [Sat, 1 Feb 2020 20:46:27 +0000 (22:46 +0200)]
[CMake] Add missing component dependencies, to fix building for mingw with BUILD_SHARED_LIBS

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

2 years ago[clangd] Pull out a isProtoFile function.
Haojian Wu [Wed, 5 Feb 2020 11:03:29 +0000 (12:03 +0100)]
[clangd] Pull out a isProtoFile function.

Reviewers: kadircet

Reviewed By: kadircet

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

Tags: #clang

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

2 years ago[lldb] Ignore type sugar in TypeSystemClang::GetPointerType
Raphael Isemann [Wed, 5 Feb 2020 10:44:28 +0000 (11:44 +0100)]
[lldb] Ignore type sugar in TypeSystemClang::GetPointerType

Summary:
Currently having a typedef for ObjC types is breaking member access in LLDB:
```
typedef NSString Str;
NSString *s; s.length; // OK
Str *s; s.length; // Causes: member reference base type 'Str *' (aka 'NSString *') is not a structure or union
```

This works for NSString as there the type building from `NSString` -> `NSString *` will correctly
build a ObjCObjectPointerType (which is necessary to make member access with a dot possible),
but for the typedef the `Str` -> `Str *` conversion will produce an incorrect PointerType. The reason
for this is that our check in TypeSystemClang::GetPointerType is not desugaring the base type,
which causes that `Str` is not recognised as a type to a `ObjCInterface` as the check only sees the
typedef sugar that was put around it. This causes that we fall back to constructing a PointerType
instead which does not allow member access with the dot operator.

This patch just changes the check to look at the desugared type instead.

Fixes rdar://17525603

Reviewers: shafik, mib

Reviewed By: mib

Subscribers: mib, JDevlieghere, lldb-commits

Tags: #lldb

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

2 years ago[AMDGPU] Fix lowering a16 image intrinsics
Sebastian Neubauer [Thu, 23 Jan 2020 13:58:38 +0000 (14:58 +0100)]
[AMDGPU] Fix lowering a16 image intrinsics

scalar_to_vector takes only one argument, not two.
The a16 tests now also check the packing of coordinates into registers

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

2 years ago[AMDGPU] Use v3f32 type in image instructions
Sebastian Neubauer [Wed, 29 Jan 2020 13:04:56 +0000 (14:04 +0100)]
[AMDGPU] Use v3f32 type in image instructions

This should lower the amount of used registers for gfx9.

I updated some of the changed tests with the update script because
changing them by hand is tedious.

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

2 years ago[yaml2obj][obj2yaml] - Simplify format of the SHT_LLVM_ADDRSIG section.
Georgii Rymar [Mon, 3 Feb 2020 14:10:36 +0000 (17:10 +0300)]
[yaml2obj][obj2yaml] - Simplify format of the SHT_LLVM_ADDRSIG section.

Previously the description allowed to describe symbols with use of
`Name` and `Index` keys. This patch removes them and now it is still
possible to use either names or symbol indexes, but the code is simpler
and the format is slightly different.

Such a change will be useful for another patches, e.g:
https://reviews.llvm.org/D73788#inline-671077

Differential revision: https://reviews.llvm.org/D73888

2 years ago[clangd] Use printf instead of `echo -e` to be compliant with dash
Kadir Cetinkaya [Wed, 5 Feb 2020 09:21:26 +0000 (10:21 +0100)]
[clangd] Use printf instead of `echo -e` to be compliant with dash

2 years ago[DebugInfo] Avoid the call site param for mem instrs with multiple defs
Djordje Todorovic [Wed, 5 Feb 2020 08:50:05 +0000 (09:50 +0100)]
[DebugInfo] Avoid the call site param for mem instrs with multiple defs

We currently only handle mem instructions with a single define.
Avoid the call site parameter debug info when we find the case with
multiple defs, rather than throwing an assert.

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

2 years ago[clangd] Preserve -nostdinc and --sysroot when calling query driver
Kadir Cetinkaya [Wed, 5 Feb 2020 08:55:56 +0000 (09:55 +0100)]
[clangd] Preserve -nostdinc and --sysroot when calling query driver

Solves this issue: https://github.com/clangd/clangd/issues/157

This is my first contribution to an llvm project, so I hope I'm doing it right!

Patch by @topisani (Tobias Pisani)!

Reviewers: kadircet, klimek

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

2 years ago[X86] Add a DAG combine for (i32 (sext (i8 (x86isd::setcc_carry)))) -> (i32 (x86isd...
Craig Topper [Tue, 4 Feb 2020 07:35:16 +0000 (23:35 -0800)]
[X86] Add a DAG combine for (i32 (sext (i8 (x86isd::setcc_carry)))) -> (i32 (x86isd::setcc_carry)) and remove isel patterns.

Same for any_extend though we don't have coverage for that.

The test changes are because isel didn't check one use of the
setcc_carry. So in isel we would end up with two different
sized setcc_carry instructions. And since it clobbers
the flags we would need to recreate the flags for the second
instruction.

This code handles additional uses by truncating the new wide
setcc_carry back to the original size for those uses.

2 years ago[CMake] Passthrough CMAKE_SYSTEM_NAME to default builtin and runtimes target
Petr Hosek [Fri, 31 Jan 2020 22:53:07 +0000 (14:53 -0800)]
[CMake] Passthrough CMAKE_SYSTEM_NAME to default builtin and runtimes target

When building the default builtin and runtimes target, set the
CMAKE_SYSTEM_NAME to the current one. This is not necessary on
Linux and Darwin, but it appears to be necessary on Windows,
otherwise CMake fails.

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

2 years ago[CMake][compiler-rt] Replace Windows backslashes with CMake ones
Petr Hosek [Tue, 28 Jan 2020 03:20:02 +0000 (19:20 -0800)]
[CMake][compiler-rt] Replace Windows backslashes with CMake ones

XRay builds uses llvm-config to obtain the ldflags and libs and then
passes those to CMake. Unfortunately, this breaks on Windows because
CMake tries to interpret backslashes followed by certain characters
as flags. We need to rewrite these into forward slashes that are used
by CMake (even on Windows).

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

2 years agoRemove leftover artifacts from use of gtest.
Paula Toth [Wed, 5 Feb 2020 05:41:30 +0000 (21:41 -0800)]
Remove leftover artifacts from use of gtest.

Reviewers: abrachet

Reviewed By: abrachet

Subscribers: mgorny, MaskRay, libc-commits

Tags: #libc-project

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

2 years agoAMDGPU/EG,CM: Implement fsqrt using recip(rsqrt(x)) instead of x * rsqrt(x)
Jan Vesely [Wed, 5 Feb 2020 00:27:19 +0000 (19:27 -0500)]
AMDGPU/EG,CM: Implement fsqrt using recip(rsqrt(x)) instead of x * rsqrt(x)

The old version might be faster on EG (RECIP_IEEE is Trans only),
but it'd need extra corner case checks.
This gives correct corner case behaviour and saves a register.
Fixes OCL CTS sqrt test (1-thread, scalar) on Turks.

Reviewer: arsenm
Differential Revision: https://reviews.llvm.org/D74017

2 years ago[WebAssembly] Add experimental multivalue calling ABI
Thomas Lively [Sat, 18 Jan 2020 02:28:43 +0000 (18:28 -0800)]
[WebAssembly] Add experimental multivalue calling ABI

Summary:
For now, this ABI simply expands all possible aggregate arguments and
returns all possible aggregates directly. This ABI will change rapidly
as we prototype and benchmark a new ABI that takes advantage of
multivalue return and possibly other changes from the MVP ABI.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits

Tags: #clang

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

2 years agoRevert "[WebAssembly][InstrEmitter] Foundation for multivalue call lowering"
Thomas Lively [Mon, 3 Feb 2020 22:37:10 +0000 (14:37 -0800)]
Revert "[WebAssembly][InstrEmitter] Foundation for multivalue call lowering"

Summary:
This reverts commit 3ef169e586f4d14efe690c23c878d5aa92a80eb5. The
purpose of this commit was to allow stack machines to perform
instruction selection for instructions with variadic defs. However,
MachineInstrs fundamentally cannot support variadic defs right now, so
this change does not turn out to be useful.

Depends on D73927.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

2 years agoEnhance debugserver's err reporting on attach fails
Jason Molenda [Wed, 5 Feb 2020 03:43:33 +0000 (19:43 -0800)]
Enhance debugserver's err reporting on attach fails

Explicitly check for a request to attach to a pid that doesn't
exist, to attach to a pid that is already being debugged, unify the
SIP process check, and an attempt at checking if developer mode is
enabled on the system (which isn't working in debugserver, for some
reason; I can't get the authorization record which should be an
unprivileged operation and works in a standalone program I wrote).

I'll debug the developer mode check later, but I wanted to land it
along with everything else; right now it will claim that developer
mode is always enabled so it's harmless to include as-is.

2 years ago[mlir] Mark the MLIR tools for installation in CMake
Kern Handa [Wed, 5 Feb 2020 03:42:17 +0000 (03:42 +0000)]
[mlir] Mark the MLIR tools for installation in CMake

This binplaces `mlir-translate`, `mlir-cuda-runner`, and `mlir-cpu-runner` when building the CMake install target.

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

2 years agoAMDGPU: Correct memory size for image intrinsics
Matt Arsenault [Tue, 28 Jan 2020 15:26:52 +0000 (10:26 -0500)]
AMDGPU: Correct memory size for image intrinsics

This was incorrectly rounding up to the next power of 2. v4f32 was
rounding up to v8f32, which was just wrong. There are also v3i16/v3f16
available in MVT, so we don't even need to round the f16 cases
anymore. Additionally, this field is really an EVT so we don't even
need to consider this.

Also switch some asserts to return invalid. We should have an IR
verifier for these intrinsic return types, but for now it's better to
not assert on IR that passes the verifier.

This should also probably be fixed to consider that dmask is really
eliminating some of the loaded components.

2 years agoDebugInfo: Hash DW_OP_convert in loclists when using Split DWARF
David Blaikie [Wed, 5 Feb 2020 03:25:47 +0000 (19:25 -0800)]
DebugInfo: Hash DW_OP_convert in loclists when using Split DWARF

Originally committed in: 1ced28cbe75ff81f35ac2c71e941041eb3afcd00
            Reverted in: f75301d16d444d8cb6810d679290df744bc79ec7

(reverted due to tests failing on non-linux/x86 targets, tests have since been
generalized and specialized... since Split DWARF isn't supported on non-elf
targets anyway and we have no way to run on "whatever elf target is available"
so they fail on MacOS without an explicit target triple)

This code was incorrectly emitting extra bytes into arbitrary parts of
the object file when it was meant to be hashing them to compute the DWO
ID.

Follow-up patch(es) will refactor this API somewhat to make such bugs
harder to introduce, hopefully.

2 years agoDebugInfo: Add a couple of missing COFF sections to make convert-loclist.ll pass...
David Blaikie [Wed, 5 Feb 2020 03:23:57 +0000 (19:23 -0800)]
DebugInfo: Add a couple of missing COFF sections to make convert-loclist.ll pass on Windows

2 years agoDebugInfo: convert-debugloc.ll generalize to run on ppc64le
David Blaikie [Wed, 5 Feb 2020 03:13:42 +0000 (19:13 -0800)]
DebugInfo: convert-debugloc.ll generalize to run on ppc64le

This target produces a location list for the location, so split the
match between lines to allow for a location list match.

2 years ago[lldb/Reproducers] Change the way we instrument void* arguments
Jonas Devlieghere [Wed, 5 Feb 2020 03:00:10 +0000 (19:00 -0800)]
[lldb/Reproducers] Change the way we instrument void* arguments

The reproducer instrumentation cannot automatically serialize and
deserialize void* arguments. Currently we deal with this by explicitly
preventing these methods from being instrumented. This has the undesired
side effect of breaking replay when that method returns a value later
used by another SB API call.

The solution is to change our approach and instrument these methods.
Instead of using the DUMMY macro, we just make (de)serialization of the
void pointer a NOOP and always return a nullptr.

2 years agoDebugInfo: Fix convert-loclist.ll Split DWARF variant to use a hardcoded triple
David Blaikie [Wed, 5 Feb 2020 02:59:23 +0000 (18:59 -0800)]
DebugInfo: Fix convert-loclist.ll Split DWARF variant to use a hardcoded triple

Since we don't support Split DWARF emission on non-ELF formats, hardcode
an elfine triple (we don't have a way to ask for "any ELF triple" it
seems, so hardcoded will have to do)

2 years agoRevert "[WebAssembly] Split and recombine multivalue calls for ISel"
Thomas Lively [Mon, 3 Feb 2020 22:27:03 +0000 (14:27 -0800)]
Revert "[WebAssembly] Split and recombine multivalue calls for ISel"

Summary:
This reverts commit 28857d14a86b1e99a9d2795636a5faf17674f5a2. This
commit worked toward a solution that did not turn out to be feasible
because MachineInstrs cannot contain an arbitrary number of defs.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

2 years ago[BPF] disable ReduceLoadWidth during SelectionDag phase
Yonghong Song [Tue, 4 Feb 2020 19:21:54 +0000 (11:21 -0800)]
[BPF] disable ReduceLoadWidth during SelectionDag phase

The compiler may transform the following code
  ctx = ctx + reloc_offset
  ... (*(u32 *)ctx) & 0x8000 ...
to
  ctx = ctx + reloc_offset
  ... (*(u8 *)(ctx + 1)) & 0x80 ...
where reloc_offset will be replaced with a constant during
AsmPrinter phase.

The above transformed code will be rejected the kernel verifier
as it does not allow
  *(type *)((ctx + non_zero_offset1) + non_zero_offset2)
style access pattern.

It is hard at SelectionDag phase to identify whether a load
is related to context or not. Sometime, interprocedure analysis
may be needed. So let us simply prevent such optimization
from happening.

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

2 years agoRecommit: DebugInfo: Check DW_OP_convert in loclists with Split DWARF
David Blaikie [Wed, 5 Feb 2020 02:34:34 +0000 (18:34 -0800)]
Recommit: DebugInfo: Check DW_OP_convert in loclists with Split DWARF

Originally committed in: 552a8fe12bd1822f48dda2e9e8728a179f82d356
            Reverted in: f75301d16d444d8cb6810d679290df744bc79ec7

Reverted because it was running llc directly (rather than %llc_dwarf)
which uses COFF files on Windows which LLVM doesn't support all DWARF
features in.

This functionality isn't fully working, but sets up the testing for a
follow-on patch that demonstrates and fixes the brokenness related to
DWO ID hashing this construct.

2 years ago[WebAssembly] Enable recently implemented SIMD operations
Thomas Lively [Fri, 31 Jan 2020 02:23:14 +0000 (18:23 -0800)]
[WebAssembly] Enable recently implemented SIMD operations

Summary:
Moves a batch of instructions from unimplemented-simd128 to simd128
because they have recently become available in V8.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

2 years ago[mlir][spirv] Add dialect-specific attribute for target environment
Lei Zhang [Sun, 2 Feb 2020 12:40:18 +0000 (07:40 -0500)]
[mlir][spirv] Add dialect-specific attribute for target environment

We were using normal dictionary attribute for target environment
specification. It becomes cumbersome with more and more fields.
This commit changes the modelling to a dialect-specific attribute,
where we can have control over its storage and assembly form.

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

2 years agoPR44786: Don't assert when profiling <=> expressions.
Richard Smith [Wed, 5 Feb 2020 02:28:36 +0000 (18:28 -0800)]
PR44786: Don't assert when profiling <=> expressions.

2 years agoDebugInfo: use a symbolic DIE reference in convert-loclist.ll
David Blaikie [Wed, 5 Feb 2020 02:23:22 +0000 (18:23 -0800)]
DebugInfo: use a symbolic DIE reference in convert-loclist.ll

2 years agoReapply: DebugInfo: Add missing test coverage for DW_OP_convert in loclists
David Blaikie [Wed, 5 Feb 2020 02:08:16 +0000 (18:08 -0800)]
Reapply: DebugInfo: Add missing test coverage for DW_OP_convert in loclists

Originally committed in: 5327b917e3bd0b3db352cb5a61eea7409f2d1972
      and follow on fix: 4f281f047457ce3f1870a93253476222314f420b

            Reverted in: 191a9a78b3f4bdf35a30d3480bd630d787a2fdf6
            and: f75301d16d444d8cb6810d679290df744bc79ec7

Reverted because it wasn't portable between the targets it was running
on. Using %llc_dwarf ensures the target triple is always elfine and thus
DWARF compatible.

2 years agoDebugInfo: Generalize test/DebugInfo/X86/convert-linked.ll to run with different...
David Blaikie [Wed, 5 Feb 2020 02:02:03 +0000 (18:02 -0800)]
DebugInfo: Generalize test/DebugInfo/X86/convert-linked.ll to run with different architectures

2 years agoDebugInfo: Generalize test/DebugInfo/X86/convert-inlined.ll
David Blaikie [Wed, 5 Feb 2020 01:50:55 +0000 (17:50 -0800)]
DebugInfo: Generalize test/DebugInfo/X86/convert-inlined.ll

This test was hardcoded to only run on x86-64-linux-gnu and was overly
constrained by CHECK-NEXTing every line for an exact match.

2 years agoFix warning on trailing `;`. NFC.
Michael Liao [Wed, 5 Feb 2020 01:47:36 +0000 (20:47 -0500)]
Fix warning on trailing `;`. NFC.

2 years ago[Remarks] Fix gcc build
Francis Visoiu Mistrih [Wed, 5 Feb 2020 01:42:47 +0000 (17:42 -0800)]
[Remarks] Fix gcc build

2 years agoFix warning on trailing `;`. NFC.
Michael Liao [Wed, 5 Feb 2020 01:42:05 +0000 (20:42 -0500)]
Fix warning on trailing `;`. NFC.

2 years agoDebugInfo: convert-debugloc.ll remove erroneous CHECK
David Blaikie [Wed, 5 Feb 2020 01:39:38 +0000 (17:39 -0800)]
DebugInfo: convert-debugloc.ll remove erroneous CHECK

2 years agoDebugInfo: Generalize convert-debugloc.ll to run for multiple target architectures
David Blaikie [Wed, 5 Feb 2020 01:33:20 +0000 (17:33 -0800)]
DebugInfo: Generalize convert-debugloc.ll to run for multiple target architectures

This test was overly constrained & hardcoded only to x86-linux-gnu -
generalize the test & remove the hardcoded target triple.

2 years ago[gn build] Port b8a847c0a3e
LLVM GN Syncbot [Wed, 5 Feb 2020 01:27:20 +0000 (01:27 +0000)]
[gn build] Port b8a847c0a3e

2 years ago[gn build] Port 7531a5039fd
LLVM GN Syncbot [Wed, 5 Feb 2020 01:27:19 +0000 (01:27 +0000)]
[gn build] Port 7531a5039fd

2 years ago[cuda][hip] Temporarily XFAIL on arm
Michael Liao [Wed, 5 Feb 2020 01:25:12 +0000 (20:25 -0500)]
[cuda][hip] Temporarily XFAIL on arm

2 years agoFix BroadcasterManager::RemoveListener to really remove the listener
Reid Kleckner [Tue, 4 Feb 2020 23:56:51 +0000 (15:56 -0800)]
Fix BroadcasterManager::RemoveListener to really remove the listener

This appears to be a real bug caught by -Wunused-value. std::find_if
doesn't modify the underlying collection, it just returns an iterator
pointing to the matching element.

Reviewed By: JDevlieghere

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

2 years ago[Remarks] Extend the RemarkStreamer to support other emitters
Francis Visoiu Mistrih [Mon, 28 Oct 2019 21:53:31 +0000 (14:53 -0700)]
[Remarks] Extend the RemarkStreamer to support other emitters

This extends the RemarkStreamer to allow for other emitters (e.g.
frontends, SIL, etc.) to emit remarks through a common interface.

See changes in llvm/docs/Remarks.rst for motivation and design choices.

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

2 years ago[NFCI] Update according to style.
Alina Sbirlea [Wed, 5 Feb 2020 00:29:04 +0000 (16:29 -0800)]
[NFCI] Update according to style.

clang-tidy + clang-format

2 years agoFix some more -Wrange-loop-analysis warnings in AArch64TargetParser
Reid Kleckner [Wed, 5 Feb 2020 00:57:49 +0000 (16:57 -0800)]
Fix some more -Wrange-loop-analysis warnings in AArch64TargetParser

2 years ago[lldb] Fix -Wdocumentation warnings
Jonas Devlieghere [Wed, 5 Feb 2020 00:44:30 +0000 (16:44 -0800)]
[lldb] Fix -Wdocumentation warnings

2 years agoFix after c25938d
Adrian McCarthy [Tue, 4 Feb 2020 23:02:28 +0000 (15:02 -0800)]
Fix after c25938d

My refactor caused some changes in error reporting that TestAddDsymCommand.py
was checking, so this restores some of the changes to preserve the old
behavior and to un-xfail the affected test.

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

2 years ago[Driver][Darwin] Improve tests for -nostdinc & friends
Louis Dionne [Tue, 4 Feb 2020 23:34:28 +0000 (18:34 -0500)]
[Driver][Darwin] Improve tests for -nostdinc & friends

The tests were slightly underspecifying the current behavior of Clang.

2 years ago[lldb/Reproducers] Add underscore to varaibles in LLDB_RECORD macros
Jonas Devlieghere [Wed, 5 Feb 2020 00:21:31 +0000 (16:21 -0800)]
[lldb/Reproducers] Add underscore to varaibles in LLDB_RECORD macros

Rename all variables used in the LLDB_RECORD macros to start with an
underscore to avoid conflicts with the arguments being recorded.

2 years ago[lldb/Reproducers] Change record logging to mirror replay logging
Jonas Devlieghere [Wed, 5 Feb 2020 00:10:10 +0000 (16:10 -0800)]
[lldb/Reproducers] Change record logging to mirror replay logging

Pretty printing the return value, although a good idea in theory, turned
out to be more confusing than anything else because they require
printing the log statement after the arguments and resulting value have
been serialized.

This changes the logging to behave more like how deserialization is
traced, although a bit more verbose because some of the serializers are
are calling each other.

2 years ago[X86] Add custom lowering for lrint/llrint to either cvtss2si/cvtsd2si or fist.
Craig Topper [Tue, 4 Feb 2020 23:25:16 +0000 (15:25 -0800)]
[X86] Add custom lowering for lrint/llrint to either cvtss2si/cvtsd2si or fist.

lrint/llrint are defined as rounding using the current rounding
mode. Numbers that can't be converted raise FE_INVALID and an
implementation defined value is returned. They may also write to
errno.

I believe this means we can use cvtss2si/cvtsd2si or fist to
convert as long as -fno-math-errno is passed on the command line.
Clang will leave them as libcalls if errno is enabled so they
won't become ISD::LRINT/LLRINT in SelectionDAG.

For 64-bit results on a 32-bit target we can't use cvtss2si/cvtsd2si
but we can use fist since it can write to a 64-bit memory location.
Though maybe we could consider using vcvtps2qq/vcvtpd2qq on avx512dq
targets?

gcc also does this optimization.

I think we might be able to do this with STRICT_LRINT/LLRINT as
well, but I've left that for future work.

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

2 years agoFix x86 32bits MLIR build (NFC)
Dimitry Andric [Tue, 4 Feb 2020 23:57:02 +0000 (23:57 +0000)]
Fix x86 32bits MLIR build (NFC)

This is fixing a build error:

error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'Region::iterator::difference_type' (aka 'int') in initializer list

Fix pr44767

2 years agoFix -Wunused-result warnings in LLDB
Reid Kleckner [Tue, 4 Feb 2020 23:50:44 +0000 (15:50 -0800)]
Fix -Wunused-result warnings in LLDB

These try_lock usages intentionally ignore the result, as commented.

Similar to 4d23764dddc23e74ad165086d7f471a3e0e52bf8, which was reviewed
previously.

2 years ago[compiler-rt] fix OpenBSD and Solaris build with sigaltstack interception
Evgenii Stepanov [Tue, 4 Feb 2020 23:50:44 +0000 (15:50 -0800)]
[compiler-rt] fix OpenBSD and Solaris build with sigaltstack interception

Summary:
`sigaltstack` interception is implemented D73816. This updated OpenBSD and Solaris bits to fix the build errors.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: fedor.sergeev, krytarowski, emaste, eugenis, dberris, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Patch by Igor Sugak.

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

2 years ago[Support] Fix warnings in ARMTargetParser.cpp
Reid Kleckner [Tue, 4 Feb 2020 23:48:22 +0000 (15:48 -0800)]
[Support] Fix warnings in ARMTargetParser.cpp

2 years ago[lldb] Rename Type::ResolveClangType to Type::ResolveCompilerType
Alex Langford [Tue, 4 Feb 2020 23:40:43 +0000 (15:40 -0800)]
[lldb] Rename Type::ResolveClangType to Type::ResolveCompilerType

This is not specific to clang types. It operates on CompilerTypes in
general.

2 years ago[lldb] Delete commented-out code
Alex Langford [Tue, 4 Feb 2020 22:59:20 +0000 (14:59 -0800)]
[lldb] Delete commented-out code

2 years agoAvoid many std::tie/tuple instantiations in ASTImporter
Reid Kleckner [Tue, 4 Feb 2020 23:22:15 +0000 (15:22 -0800)]
Avoid many std::tie/tuple instantiations in ASTImporter

To factor the error checking, use importChecked instead of importSeq.
This avoids repeating the names of all of the imported child nodes once,
and allows errors to be checked with a single conditional as it is with
importSeq.

After:
  peak memory: 601.63MB
  real: 0m19.172s
  obj size: 8,352kb

Before:
  peak memory: 954.11MB
  real: 0m26.188s
  obj size: 10,000kb

The speed is not as impressive as I hoped, but the memory use reduction
is impressive, and seems worth it.

Reviewed By: martong, shafik

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

2 years ago[X86] Give KSET0* and KSET1* pseudos the same scheduler resource usage as KXOR/KXNOR.
Craig Topper [Tue, 4 Feb 2020 20:37:19 +0000 (12:37 -0800)]
[X86] Give KSET0* and KSET1* pseudos the same scheduler resource usage as KXOR/KXNOR.

These aren't recognized as idioms by the CPU so they still use
execution resources. We just use the pseudo to force the input
register to k0.

2 years ago[SEH] Remove CATCHPAD SDNode and X86::EH_RESTORE MachineInstr
Reid Kleckner [Thu, 30 Jan 2020 23:15:57 +0000 (15:15 -0800)]
[SEH] Remove CATCHPAD SDNode and X86::EH_RESTORE MachineInstr

The CATCHPAD node mostly existed to be selected into the EH_RESTORE
instruction, which sets the frame back up when 32-bit Windows exceptions
return to the parent function. However, creating this MachineInstr early
increases the risk that other passes will come along and insert
instructions that use the stack before ESP and EBP are restored. That
happened in PR44697.

Instead of representing these in the instruction stream early, delay it
until PEI. Mark the blocks where this needs to happen as EHPads, but not
funclet entry blocks. Passes after PEI have to be careful not to hoist
instructions that can use stack across frame setup instructions, so this
should be relatively reliable.

Fixes PR44697

Reviewed By: hans

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