platform/upstream/llvm.git
5 years ago[llvm-mca] Replace InstRef::isValid with operator bool. NFC.
Matt Davis [Wed, 24 Oct 2018 20:27:47 +0000 (20:27 +0000)]
[llvm-mca] Replace InstRef::isValid with operator bool. NFC.

llvm-svn: 345190

5 years ago[MC] Separate masm integer literal lexer support from inline asm
Reid Kleckner [Wed, 24 Oct 2018 20:23:57 +0000 (20:23 +0000)]
[MC] Separate masm integer literal lexer support from inline asm

Summary:
This renames the IsParsingMSInlineAsm member variable of AsmLexer to
LexMasmIntegers and moves it up to MCAsmLexer. This is the only behavior
controlled by that variable. I added a public setter, so that it can be
set from outside or from the llvm-mc command line. We may need to
arrange things so that users can get this behavior from clang, but
that's future work.

I also put additional hex literal lexing functionality under this flag
to fix PR32973. It appears that this hex literal parsing wasn't intended
to be enabled in non-masm-style blocks.

Now, masm integers (0b1101 and 0ABCh) work in __asm blocks from clang,
but 0b label references work when using .intel_syntax in standalone .s
files.

However, 0b label references will *not* work from __asm blocks in clang.
They will work from GCC inline asm blocks, which it sounds like is
important for Crypto++ as mentioned in PR36144.

Essentially, we only lex masm literals for inline asm blobs that use
intel syntax. If the .intel_syntax directive is used inside a gnu-style
inline asm statement, masm literals will not be lexed, which is
compatible with gas and llvm-mc standalone .s assembly.

This fixes PR36144 and PR32973.

Reviewers: Gerolf, avt77

Subscribers: eraman, hiraditya, llvm-commits

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

llvm-svn: 345189

5 years agoAArch64: add a pass to compress jump-table entries when possible.
Tim Northover [Wed, 24 Oct 2018 20:19:09 +0000 (20:19 +0000)]
AArch64: add a pass to compress jump-table entries when possible.

llvm-svn: 345188

5 years ago[AArch64] Refactor Exynos machine model (NFC)
Evandro Menezes [Wed, 24 Oct 2018 20:03:24 +0000 (20:03 +0000)]
[AArch64] Refactor Exynos machine model (NFC)

llvm-svn: 345187

5 years ago[AArch64] Fix overlapping instructions
Evandro Menezes [Wed, 24 Oct 2018 20:03:20 +0000 (20:03 +0000)]
[AArch64] Fix overlapping instructions

Fix overlapping instruction descriptions in the machine model for Exynos M3.
Effectively, NFC.

llvm-svn: 345186

5 years ago[llvm-mca] Simplify the logic in FetchStage. NFCI
Andrea Di Biagio [Wed, 24 Oct 2018 19:37:45 +0000 (19:37 +0000)]
[llvm-mca] Simplify the logic in FetchStage. NFCI

Only method 'getNextInstruction()' needs to interact with the SourceMgr.

llvm-svn: 345185

5 years agoFix MSVC "truncation from 'double' to 'float'" warnings. NFCI.
Simon Pilgrim [Wed, 24 Oct 2018 19:31:24 +0000 (19:31 +0000)]
Fix MSVC "truncation from 'double' to 'float'" warnings. NFCI.

llvm-svn: 345184

5 years ago[X86] Explicitly list all KNL features of inheriting from IVB. NFC
Craig Topper [Wed, 24 Oct 2018 19:24:44 +0000 (19:24 +0000)]
[X86] Explicitly list all KNL features of inheriting from IVB. NFC

I'm not sure all the microarchitectural tuning flags that have been added to IVBFeatures are relevant for KNL. Separating will allow us to see and audit them. There might even be some simplification opportunities in the Sandy Bridge through Icelake inheritance line without KNL using the same chain.

llvm-svn: 345183

5 years ago[X86][SSE] Add SimplifyDemandedBitsForTargetNode PMULDQ/PMULUDQ handling
Simon Pilgrim [Wed, 24 Oct 2018 19:11:28 +0000 (19:11 +0000)]
[X86][SSE] Add SimplifyDemandedBitsForTargetNode PMULDQ/PMULUDQ handling

Add X86 SimplifyDemandedBitsForTargetNode and use it to simplify PMULDQ/PMULUDQ target nodes.

This enables us to repeatedly simplify the node's arguments after the previous approach had to be reverted due to PR39398.

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

llvm-svn: 345182

5 years agoAMDGPU: Handle gfx909 in AMDGPUTargetInfo::initFeatureMap
Konstantin Zhuravlyov [Wed, 24 Oct 2018 19:07:56 +0000 (19:07 +0000)]
AMDGPU: Handle gfx909 in AMDGPUTargetInfo::initFeatureMap

+ add required tests

llvm-svn: 345181

5 years agoDo not always request an implicit taskgroup region inside the kmpc_taskloop function
Alexey Bataev [Wed, 24 Oct 2018 19:06:37 +0000 (19:06 +0000)]
Do not always request an implicit taskgroup region inside the kmpc_taskloop function

Summary:
For the following code:
```
    int i;
    #pragma omp taskloop
    for (i = 0; i < 100; ++i)
    {}

    #pragma omp taskloop nogroup
    for (i = 0; i < 100; ++i)
    {}
```

Clang emits the following LLVM IR:

```
 ...
  call void @__kmpc_taskgroup(%struct.ident_t* @0, i32 %0)
  %2 = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @0, i32 %0, i32 1, i64 80, i64 8, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates*)* @.omp_task_entry. to i32 (i32, i8*)*))
  ...
  call void @__kmpc_taskloop(%struct.ident_t* @0, i32 %0, i8* %2, i32 1, i64* %8, i64* %9, i64 %13, i32 0, i32 0, i64 0, i8* null)
  call void @__kmpc_end_taskgroup(%struct.ident_t* @0, i32 %0)

  ...
  %15 = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @0, i32 %0, i32 1, i64 80, i64 8, i32 (i32, i8*)* bitcast (i32 (i32, %struct.kmp_task_t_with_privates.1*)* @.omp_task_entry..2 to i32 (i32, i8*)*))
  ...
  call void @__kmpc_taskloop(%struct.ident_t* @0, i32 %0, i8* %15, i32 1, i64* %21, i64* %22, i64 %26, i32 0, i32 0, i64 0, i8* null)

```

The first set of instructions corresponds to the first taskloop construct. It is important to note that the implicit taskgroup region associated with the taskloop construct has been materialized in our IR:  the `__kmpc_taskloop` occurs inside a taskgroup region. Note also that this taskgroup region does not exist in our second taskloop because we are using the `nogroup` clause.

The issue here is the 4th argument of the kmpc_taskloop call, starting from the end,  is always a zero. Checking the LLVM OpenMP RT implementation, we see that this argument corresponds to the nogroup parameter:

```
void __kmpc_taskloop(ident_t *loc, int gtid, kmp_task_t *task, int if_val,
                     kmp_uint64 *lb, kmp_uint64 *ub, kmp_int64 st, int nogroup,
                     int sched, kmp_uint64 grainsize, void *task_dup);
```

So basically we always tell to the RT to do another taskgroup region. For the first taskloop, this means that we create two taskgroup regions. For the second example, it means that despite the fact we had a nogroup clause we are going to have a taskgroup region, so we unnecessary wait until all descendant tasks have been executed.

Reviewers: ABataev

Reviewed By: ABataev

Subscribers: rogfer01, cfe-commits

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

llvm-svn: 345180

5 years ago[TargetLowering] Add SimplifyDemandedBitsForTargetNode callback
Simon Pilgrim [Wed, 24 Oct 2018 19:00:56 +0000 (19:00 +0000)]
[TargetLowering] Add SimplifyDemandedBitsForTargetNode callback

Add a SimplifyDemandedBitsForTargetNode callback to handle target nodes.

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

llvm-svn: 345179

5 years ago[hot-cold-split] Name split functions with ".cold" suffix
Teresa Johnson [Wed, 24 Oct 2018 18:53:47 +0000 (18:53 +0000)]
[hot-cold-split] Name split functions with ".cold" suffix

Summary:
The current default of appending "_"+entry block label to the new
extracted cold function breaks demangling. Change the deliminator from
"_" to "." to enable demangling. Because the header block label will
be empty for release compile code, use "extracted" after the "." when
the label is empty.

Additionally, add a mechanism for the client to pass in an alternate
suffix applied after the ".", and have the hot cold split pass use
"cold."+Count, where the Count is currently 1 but can be used to
uniquely number multiple cold functions split out from the same function
with D53588.

Reviewers: sebpop, hiraditya

Subscribers: llvm-commits, erik.pilkington

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

llvm-svn: 345178

5 years ago[OPENMP]Fix PR39366: do not try to private field if it is not captured.
Alexey Bataev [Wed, 24 Oct 2018 18:53:12 +0000 (18:53 +0000)]
[OPENMP]Fix PR39366: do not try to private field if it is not captured.

The compiler is crashing if we trying to post-capture the fields
implicitly captured inside of the task constructs. Seems, this kind of
processing is not supported and such fields should not be
firstprivatized.

llvm-svn: 345177

5 years ago[CodeGen] Update test checks missed in r345168.
Craig Topper [Wed, 24 Oct 2018 18:45:44 +0000 (18:45 +0000)]
[CodeGen] Update test checks missed in r345168.

These tests don't run unless the aarch64 target is registered and my testing had been on an x86 only build directory.

llvm-svn: 345176

5 years ago[CostModel][X86] Add vXi8 vector division by constants costs.
Simon Pilgrim [Wed, 24 Oct 2018 18:44:12 +0000 (18:44 +0000)]
[CostModel][X86] Add vXi8 vector division by constants costs.

ISD::MULHS/ISD::MULHU lowering of vXi8 types means we expand these in TargetLowering BuildSDIV/BuildUDIV.

llvm-svn: 345175

5 years ago[sanitizer] Avoid calling a nullptr in MonotonicNanoTime if interceptors are not...
Kuba Mracek [Wed, 24 Oct 2018 18:40:08 +0000 (18:40 +0000)]
[sanitizer] Avoid calling a nullptr in MonotonicNanoTime if interceptors are not yet initialized

There's a TSan startup crash on Linux when used in Swift programs, where MonotonicNanoTime will try to call real_clock_gettime and then jump to NULL because interceptors are not yet initialized. This is on Ubuntu 18.04. Looks like TSan's main Initialize() function is called at a point where __progname is already set, but interceptors aren't yet set up. Let's fix this by checking whether interceptors are initialized in MonotonicNanoTime.

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

llvm-svn: 345174

5 years agoFix use of libc++ specific macro in support/test_macros.h
Eric Fiselier [Wed, 24 Oct 2018 18:37:42 +0000 (18:37 +0000)]
Fix use of libc++ specific macro in support/test_macros.h

llvm-svn: 345173

5 years agoInclude input section name and output section name in an error message.
Rui Ueyama [Wed, 24 Oct 2018 18:15:40 +0000 (18:15 +0000)]
Include input section name and output section name in an error message.

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

llvm-svn: 345172

5 years agoARM: Use BKPT instead of TRAP to implement llvm.debugtrap.
Peter Collingbourne [Wed, 24 Oct 2018 18:10:38 +0000 (18:10 +0000)]
ARM: Use BKPT instead of TRAP to implement llvm.debugtrap.

The BKPT instruction is specified to cause a software breakpoint,
and at least on Linux results in a SIGTRAP. This makes it more
suitable for implementing debugtrap than TRAP (aka UDF #254), which
is specified to cause an undefined instruction exception and results
in a SIGILL on Linux.

Moreover, BKPT is not marked as a terminator, which is not only
consistent with the IR instruction but allows the analyzeBlock
function to correctly analyze a basic block containing the instruction,
which fixes an assertion failure in the machine block placement pass
previously triggered by the included test case.

Because BKPT is only supported starting with ARMv5T, we continue to
use UDF #254 when targeting v4T.

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

llvm-svn: 345171

5 years ago[Hexagon] Flip hexagon-autohvx to be true by default
Krzysztof Parzyszek [Wed, 24 Oct 2018 17:55:18 +0000 (17:55 +0000)]
[Hexagon] Flip hexagon-autohvx to be true by default

This will allow other generators of LLVM IR to use the auto-vectorizer
without having to change that flag.

Note: on its own, this patch will disable auto-vectorization on Hexagon
in all cases, regardless of the -fvectorize flag. There is a companion
LLVM patch that together with this one forms an NFC for clang users.

llvm-svn: 345170

5 years ago[Hexagon] Flip hexagon-autohvx to be true by default
Krzysztof Parzyszek [Wed, 24 Oct 2018 17:55:13 +0000 (17:55 +0000)]
[Hexagon] Flip hexagon-autohvx to be true by default

This will allow other generators of LLVM IR to use the auto-vectorizer
without having to change that flag.

Note: on its own, this patch will enable auto-vectorization on Hexagon
in all cases, regardless of the -fvectorize flag. There is a companion
clang patch that together with this one forms an NFC for clang users.

llvm-svn: 345169

5 years ago[CodeGen] Update min-legal-vector width based on function argument and return types
Craig Topper [Wed, 24 Oct 2018 17:42:17 +0000 (17:42 +0000)]
[CodeGen] Update min-legal-vector width based on function argument and return types

This is a continuation of my patches to inform the X86 backend about what the largest IR types are in the function so that we can restrict the backend type legalizer to prevent 512-bit vectors on SKX when -mprefer-vector-width=256 is specified if no explicit 512 bit vectors were specified by the user.

This patch updates the vector width based on the argument and return types of the current function and from the types of any functions it calls. This is intended to make sure the backend type legalizer doesn't disturb any types that are required for ABI.

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

llvm-svn: 345168

5 years ago[clang-tidy] Add the abseil-duration-factory-float check
Jonas Toth [Wed, 24 Oct 2018 17:40:50 +0000 (17:40 +0000)]
[clang-tidy] Add the abseil-duration-factory-float check

Summary:
This check finds cases where calls to an absl::Duration factory could use the more efficient integer overload.

For example:
// Original - Providing a floating-point literal.
absl::Duration d = absl::Seconds(10.0);

// Suggested - Use an integer instead.
absl::Duration d = absl::Seconds(10);

Patch by hwright.

Reviewers: alexfh, hokein, aaron.ballman, JonasToth

Reviewed By: hokein, JonasToth

Subscribers: zturner, xazax.hun, Eugene.Zelenko, mgorny, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 345167

5 years ago[docs] Add rawspeed to test-suite proposals.
Michael Kruse [Wed, 24 Oct 2018 17:35:35 +0000 (17:35 +0000)]
[docs] Add rawspeed to test-suite proposals.

rawspeed was suggested by Simon Pilgrim and Roman Lebedev in
llvm.org/PR34216 and reviews.llvm.org/D46714.

llvm-svn: 345166

5 years ago[X86] Bring back the MOV64r0 pseudo instruction
Craig Topper [Wed, 24 Oct 2018 17:32:09 +0000 (17:32 +0000)]
[X86] Bring back the MOV64r0 pseudo instruction

This patch brings back the MOV64r0 pseudo instruction for zeroing a 64-bit register. This replaces the SUBREG_TO_REG MOV32r0 sequence we use today. Post register allocation we will rewrite the MOV64r0 to a 32-bit xor with an implicit def of the 64-bit register similar to what we do for the various XMM/YMM/ZMM zeroing pseudos.

My main motivation is to enable the spill optimization in foldMemoryOperandImpl. As we were seeing some code that repeatedly did "xor eax, eax; store eax;" to spill several registers with a new xor for each store. With this optimization enabled we get a store of a 0 immediate instead of an xor. Though I admit the ideal solution would be one xor where there are multiple spills. I don't believe we have a test case that shows this optimization in here. I'll see if I can try to reduce one from the code were looking at.

There's definitely some other machine CSE(and maybe other passes) behavior changes exposed by this patch. So it seems like there might be some other deficiencies in SUBREG_TO_REG handling.

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

llvm-svn: 345165

5 years ago[CostModel][X86] Enable non-uniform vector division by constants costs.
Simon Pilgrim [Wed, 24 Oct 2018 17:30:29 +0000 (17:30 +0000)]
[CostModel][X86] Enable non-uniform vector division by constants costs.

Non-uniform division/remainder handling was added back at D49248/D50765 - so share the 'mul+sub' costs that already exist for uniform cases.

llvm-svn: 345164

5 years ago[CodeGen] skip lifetime end marker in isInTailCallPosition
Robert Lougher [Wed, 24 Oct 2018 17:03:19 +0000 (17:03 +0000)]
[CodeGen] skip lifetime end marker in isInTailCallPosition

A lifetime end intrinsic between a tail call and the return should not
prevent the call from being tail call optimized.

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

llvm-svn: 345163

5 years ago[InstCombine] add test for ComputeNumSignBits with shuffle; NFC
Sanjay Patel [Wed, 24 Oct 2018 17:01:42 +0000 (17:01 +0000)]
[InstCombine] add test for ComputeNumSignBits with shuffle; NFC

llvm-svn: 345162

5 years ago[llvm-mca] Remove dependency from InstrBuilder in class InstructionTables.
Andrea Di Biagio [Wed, 24 Oct 2018 16:56:43 +0000 (16:56 +0000)]
[llvm-mca] Remove dependency from InstrBuilder in class InstructionTables.

Also, removed the initialization of vectors used for processor resource masks.
Support function 'computeProcResourceMasks()' already calls method resize on
those vectors.
No functional change intended.

llvm-svn: 345161

5 years agoCodeGen: extract some local variables in CFConstantString creation (NFC)
Saleem Abdulrasool [Wed, 24 Oct 2018 16:56:36 +0000 (16:56 +0000)]
CodeGen: extract some local variables in CFConstantString creation (NFC)

Extract the reference to the ASTContext and Triple and use them throughout the
function.  This is simply a cosmetic cleanup while in the area.  NFC.

llvm-svn: 345160

5 years agoAST: unindent CFConstantStringDecl by inverting condition (NFC)
Saleem Abdulrasool [Wed, 24 Oct 2018 16:38:16 +0000 (16:38 +0000)]
AST: unindent CFConstantStringDecl by inverting condition (NFC)

Unindent the body of the function by inverting check at the top.  This is in
preparation for supporting CFString's new ABI with swift.  NFC.

llvm-svn: 345159

5 years ago[LegalizeDAG] ExpandLegalINT_TO_FP - cleanup UINT_TO_FP i64 -> f32 expansion.
Simon Pilgrim [Wed, 24 Oct 2018 16:35:01 +0000 (16:35 +0000)]
[LegalizeDAG] ExpandLegalINT_TO_FP - cleanup UINT_TO_FP i64 -> f32 expansion.

Use SrcVT/DestVT types and correct shift type.

Part of prep work for D52965

llvm-svn: 345158

5 years agoRevert rL345127: [LLDB] - Add support for DW_RLE_base_address and DW_RLE_offset_pair...
George Rimar [Wed, 24 Oct 2018 16:21:56 +0000 (16:21 +0000)]
Revert rL345127: [LLDB] - Add support for DW_RLE_base_address and DW_RLE_offset_pair entries

It broke BB:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/11671/consoleFull#434797663d489585b-5106-414a-ac11-3ff90657619c

llvm-svn: 345157

5 years ago[InstCombine] add test for select with shuffled condition (PR37549); NFC
Sanjay Patel [Wed, 24 Oct 2018 16:21:23 +0000 (16:21 +0000)]
[InstCombine] add test for select with shuffled condition (PR37549); NFC

llvm-svn: 345156

5 years ago[lldb] Remove enableThreadSanitizer from shared Xcode schemes
Kuba Mracek [Wed, 24 Oct 2018 15:59:31 +0000 (15:59 +0000)]
[lldb] Remove enableThreadSanitizer from shared Xcode schemes

This was probably committed accidentally and default Xcode builds of LLDB now have TSan on. Let's turn it off.

llvm-svn: 345155

5 years agoRefactor assignFileOffsets. NFC.
Rui Ueyama [Wed, 24 Oct 2018 15:47:46 +0000 (15:47 +0000)]
Refactor assignFileOffsets. NFC.

llvm-svn: 345154

5 years ago[clangd] Do not query index for new name completions.
Kadir Cetinkaya [Wed, 24 Oct 2018 15:24:29 +0000 (15:24 +0000)]
[clangd] Do not query index for new name completions.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 345153

5 years ago[clang] Introduce new completion context types
Kadir Cetinkaya [Wed, 24 Oct 2018 15:23:49 +0000 (15:23 +0000)]
[clang] Introduce new completion context types

Summary: New name suggestions were being used in places where existing names should have been used, this patch tries to fix some of those situations.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: arphaman, cfe-commits

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

llvm-svn: 345152

5 years agoIR: Optimize FunctionType::get to perform one hash lookup instead of two, NFCI
Krasimir Georgiev [Wed, 24 Oct 2018 15:18:51 +0000 (15:18 +0000)]
IR: Optimize FunctionType::get to perform one hash lookup instead of two, NFCI

Summary: This function was performing two hash lookups when a new function type was requested: first checking if it exists and second to insert it. This patch updates the function to perform a single hash lookup in this case by updating the value in the hash table in-place in case the function type was not there before.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: llvm-commits

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

llvm-svn: 345151

5 years ago[clangd] When replying, log the method name and latency.
Sam McCall [Wed, 24 Oct 2018 15:18:40 +0000 (15:18 +0000)]
[clangd] When replying, log the method name and latency.

Summary:
This information is strictly available in the log (you can find the original
call) but it makes the log easier to follow in practice.

Reviewers: kadircet

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 345150

5 years ago[InstCombine] try harder to form select from logic ops (2nd try)
Sanjay Patel [Wed, 24 Oct 2018 15:17:56 +0000 (15:17 +0000)]
[InstCombine] try harder to form select from logic ops (2nd try)

The original patch was committed here:
rL344609
...and reverted:
rL344612
...because it did not properly check/test data types before calling
ComputeNumSignBits().

The tests that caused bot failures for the previous commit are
over-reaching front-end tests that run the entire -O optimizer
pipeline:
    Clang :: CodeGen/builtins-systemz-zvector.c
    Clang :: CodeGen/builtins-systemz-zvector2.c

I've added a negative test here to ensure coverage for that case.
The new early exit check also tests the type of the 'B' parameter,
so we don't waste time on matching if either value is unsuitable.

Original commit message:

This is part of solving PR37549:
https://bugs.llvm.org/show_bug.cgi?id=37549

The patterns shown here are a special case of something
that we already convert to select. Using ComputeNumSignBits()
catches that case (but not the more complicated motivating
patterns yet).

The backend has hooks/logic to convert back to logic ops
if that's better for the target.

llvm-svn: 345149

5 years agoAdjust unsupported C++ versions in some tests
Mikhail Maltsev [Wed, 24 Oct 2018 15:09:08 +0000 (15:09 +0000)]
Adjust unsupported C++ versions in some tests

Summary:
Some tests (mainly the new C++20 calendar library) fail when libc++ is
tested with '--param=std=c++98'. The failures happen because the tests
actually don't support C++98, but don't mention C++98 in the
'UNSUPPORTED:' line.

This change fixes the issue.

Reviewers: mclow.lists, ldionne

Reviewed By: ldionne

Subscribers: arphaman, michaelplatings, libcxx-commits

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

llvm-svn: 345148

5 years ago[llvm-mca] Refactor class SourceMgr. NFCI
Andrea Di Biagio [Wed, 24 Oct 2018 15:06:27 +0000 (15:06 +0000)]
[llvm-mca] Refactor class SourceMgr. NFCI

Added begin()/end() methods to allow the usage of SourceMgr in foreach loops.
With this change, method getMCInstFromIndex() (as well as a couple of other
methods) are now redundant, and can be removed from the public interface.

llvm-svn: 345147

5 years ago[FPEnv] Convert more BinaryOperator::isFNeg(...) to m_FNeg(...)
Cameron McInally [Wed, 24 Oct 2018 14:45:18 +0000 (14:45 +0000)]
[FPEnv] Convert more BinaryOperator::isFNeg(...) to m_FNeg(...)

This work is to avoid regressions when we seperate FNeg from the FSub IR instruction.

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

llvm-svn: 345146

5 years agoRemove a pair of unused dispatch multiversion declarations.
Erich Keane [Wed, 24 Oct 2018 14:33:30 +0000 (14:33 +0000)]
Remove a pair of unused dispatch multiversion declarations.

These declarations somehow survived a cleanup that combined them with the target
multiversioning functions.  This patch removes them as they are no
longer necessary or used.

Change-Id: I318286401ace63bef1aa48018dabb25be0117ca0
llvm-svn: 345145

5 years ago[clangd] Ensure that we reply to each call exactly once. NFC (I think!)
Sam McCall [Wed, 24 Oct 2018 14:26:26 +0000 (14:26 +0000)]
[clangd] Ensure that we reply to each call exactly once. NFC (I think!)

Summary:
In debug builds, getting this wrong will trigger asserts.
In production builds, it will send an error reply if none was sent,
and drop redundant replies. (And log).

No tests because this is always a programming error.
(We did have some cases of this, but I fixed them with the new dispatcher).

Reviewers: ioeric

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

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

llvm-svn: 345144

5 years agoSplit a function. NFC.
Rui Ueyama [Wed, 24 Oct 2018 14:24:01 +0000 (14:24 +0000)]
Split a function. NFC.

llvm-svn: 345143

5 years ago[DEBUGINFO, NVPTX] Try to pack bytes data into a single string.
Alexey Bataev [Wed, 24 Oct 2018 14:04:00 +0000 (14:04 +0000)]
[DEBUGINFO, NVPTX] Try to pack bytes data into a single string.

Summary:
If the target does not support `.asciz` and `.ascii` directives, the
strings are represented as bytes and each byte is placed on the new line
as a separate byte directive `.b8 <data>`. NVPTX target allows to
represent the vector of the data of the same type as a vector, where
values are separated using `,` symbol: `.b8 <data1>,<data2>,...`. This
allows to reduce the size of the final PTX file. Ptxas tool includes ptx
files into the resulting binary object, so reducing the size of the PTX
file is important.

Reviewers: tra, jlebar, echristo

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 345142

5 years ago[clangd] Don't show base class versions of members as completions.
Sam McCall [Wed, 24 Oct 2018 13:51:44 +0000 (13:51 +0000)]
[clangd] Don't show base class versions of members as completions.

Summary:
These are available via qualifiers, but signal to noise level is low.
Keep required quailifier machinery around though, for cross-ns completion.

Reviewers: ioeric

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

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

llvm-svn: 345141

5 years ago[clangd] Downrank members from base class
Eric Liu [Wed, 24 Oct 2018 13:45:17 +0000 (13:45 +0000)]
[clangd] Downrank members from base class

Reviewers: sammccall, ilya-biryukov

Reviewed By: sammccall

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 345140

5 years agoAdd parenthese around a bitand.
Rui Ueyama [Wed, 24 Oct 2018 13:44:51 +0000 (13:44 +0000)]
Add parenthese around a bitand.

llvm-svn: 345139

5 years agoMake a local variable scope narrower. NFC.
Rui Ueyama [Wed, 24 Oct 2018 13:42:33 +0000 (13:42 +0000)]
Make a local variable scope narrower. NFC.

llvm-svn: 345138

5 years agoFix llvm-strings crash for negative char values
James Henderson [Wed, 24 Oct 2018 13:16:16 +0000 (13:16 +0000)]
Fix llvm-strings crash for negative char values

On Windows at least, llvm-strings was crashing if it encountered bytes
that mapped to negative chars, as it was passing these into
std::isgraph and std::isblank functions, resulting in undefined
behaviour. On debug builds using MSVC, these functions verfiy that the
value passed in is representable as an unsigned char. Since the char is
promoted to an int, a value greater than 127 would turn into a negative
integer value, and fail the check. Using the llvm::isPrint function is
sufficient to solve the issue.

Reviewed by: ruiu, mstorsjo

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

llvm-svn: 345137

5 years ago[X86][SSE] Update PMULDQ schedule tests to survive more aggressive SimplifyDemandedBits
Simon Pilgrim [Wed, 24 Oct 2018 13:13:36 +0000 (13:13 +0000)]
[X86][SSE] Update PMULDQ schedule tests to survive more aggressive SimplifyDemandedBits

llvm-svn: 345136

5 years ago[CodeComplete] Expose InBaseClass signal in code completion results.
Eric Liu [Wed, 24 Oct 2018 12:57:27 +0000 (12:57 +0000)]
[CodeComplete] Expose InBaseClass signal in code completion results.

Summary:
No new tests as the existing tests for result priority should give us
coverage. Also as the new flag is trivial enough, I'm reluctant to plumb the
flag to c-index-test output.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

llvm-svn: 345135

5 years ago[clangd] Hide position line and column fields.
Haojian Wu [Wed, 24 Oct 2018 12:56:41 +0000 (12:56 +0000)]
[clangd] Hide position line and column fields.

Reviewers: sammccall

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

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

llvm-svn: 345134

5 years ago[autocompletion] Handle the space before pressing tab
Yuka Takahashi [Wed, 24 Oct 2018 12:43:25 +0000 (12:43 +0000)]
[autocompletion] Handle the space before pressing tab

Summary:
Distinguish "--autocomplete=-someflag" and "--autocomplete=-someflag,"
because the latter indicates that the user put a space before pushing tab
which should end up in a file completion.

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

llvm-svn: 345133

5 years agoSupport accepting __gnu__ as a scoped attribute namespace that aliases to gnu.
Aaron Ballman [Wed, 24 Oct 2018 12:26:23 +0000 (12:26 +0000)]
Support accepting __gnu__ as a scoped attribute namespace that aliases to gnu.

This is useful in libstdc++ to avoid clashes with identifiers in the user's namespace.

llvm-svn: 345132

5 years ago[MinGW] Enable large file for mingw-w64
Martin Storsjo [Wed, 24 Oct 2018 12:22:12 +0000 (12:22 +0000)]
[MinGW] Enable large file for mingw-w64

64-bit mingw doesn't define _FILE_OFFSET_BITS=64 by default.

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

llvm-svn: 345131

5 years ago[llvm-exegesis] Implements a cache of Instruction objects.
Guillaume Chatelet [Wed, 24 Oct 2018 11:55:06 +0000 (11:55 +0000)]
[llvm-exegesis] Implements a cache of Instruction objects.

llvm-svn: 345130

5 years ago[llvm-mca] [llvm-mca] Improved error handling and error reporting from class InstrBui...
Andrea Di Biagio [Wed, 24 Oct 2018 10:56:47 +0000 (10:56 +0000)]
[llvm-mca] [llvm-mca] Improved error handling and error reporting from class InstrBuilder.

A new class named InstructionError has been added to Support.h in order to
improve the error reporting from class InstrBuilder.
The llvm-mca driver is responsible for handling InstructionError objects, and
printing them out to stderr.

The goal of this patch is to remove all the remaining error handling logic from
the library code.
In particular, this allows us to:
 - Simplify the logic in InstrBuilder by removing a needless dependency from
MCInstrPrinter.
 - Centralize all the error halding logic in a new function named 'runPipeline'
(see llvm-mca.cpp).

This is also a first step towards generalizing class InstrBuilder, so that in
future, we will be able to reuse its logic to also "lower" MachineInstr to
mca::Instruction objects.

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

llvm-svn: 345129

5 years ago[clangd] Simplify auto hover
Ilya Biryukov [Wed, 24 Oct 2018 10:09:34 +0000 (10:09 +0000)]
[clangd] Simplify auto hover

Summary:
Use helper from clang. Also fixes some weird corner cases, e.g.
    auto (*foo)() = bar;

Reviewers: kadircet, hokein

Reviewed By: kadircet, hokein

Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 345128

5 years ago[LLDB] - Add support for DW_RLE_base_address and DW_RLE_offset_pair entries (.debug_r...
George Rimar [Wed, 24 Oct 2018 09:56:20 +0000 (09:56 +0000)]
[LLDB] - Add support for DW_RLE_base_address and DW_RLE_offset_pair entries (.debug_rnglists)

The patch implements the support for DW_RLE_base_address and DW_RLE_offset_pair
.debug_rnglists entries

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

llvm-svn: 345127

5 years ago[clangd] Remove outdated comment-out code. NFC
Ilya Biryukov [Wed, 24 Oct 2018 09:47:24 +0000 (09:47 +0000)]
[clangd] Remove outdated comment-out code. NFC

llvm-svn: 345126

5 years ago[clangd] Fix a link in documentation. NFC
Ilya Biryukov [Wed, 24 Oct 2018 09:00:30 +0000 (09:00 +0000)]
[clangd] Fix a link in documentation. NFC

llvm-svn: 345125

5 years ago[ThinLTO] Change parameter type. NFC
Eugene Leviant [Wed, 24 Oct 2018 08:59:58 +0000 (08:59 +0000)]
[ThinLTO] Change parameter type. NFC

Change destination module type for consistency with r345118

llvm-svn: 345124

5 years agoRevert r345114
Gil Rapaport [Wed, 24 Oct 2018 08:41:22 +0000 (08:41 +0000)]
Revert r345114

Investigating fails.

llvm-svn: 345123

5 years ago[Sema] Do not show unused parameter warnings when body is skipped
Ilya Biryukov [Wed, 24 Oct 2018 08:29:24 +0000 (08:29 +0000)]
[Sema] Do not show unused parameter warnings when body is skipped

Summary: Without the function body, we cannot determine is parameter was used.

Reviewers: ioeric, sammccall

Reviewed By: sammccall

Subscribers: arphaman, cfe-commits

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

llvm-svn: 345122

5 years ago[bash-autocompletion] Fix bug when a flag ends with '='
Yuka Takahashi [Wed, 24 Oct 2018 08:24:16 +0000 (08:24 +0000)]
[bash-autocompletion] Fix bug when a flag ends with '='

There was a bug that when a flag ends with '=' and no value was suggested,
clang autocompletes the flag itself.
For example, in bash, it looked like this:
```
$ clang -fmodule-file=[tab]
-> $clang -fmodule-file=-fmodule-file
```
This is not what we expect. We expect a file autocompletion when no value
was found. With this patch, pressing tab suggests files in the current
directory.

Reviewers: teemperor, ruiu

Subscribers: cfe-commits
llvm-svn: 345121

5 years ago[AMDGPU] Defined gfx909 Raven Ridge 2
Tim Renouf [Wed, 24 Oct 2018 08:14:07 +0000 (08:14 +0000)]
[AMDGPU] Defined gfx909 Raven Ridge 2

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

Change-Id: Ie3d054f2e956c2768988c0f4c0ffd29a47294eef
llvm-svn: 345120

5 years ago[clangd] Embed fixes as CodeAction, instead of clangd_fixes. Clean up serialization.
Sam McCall [Wed, 24 Oct 2018 07:59:38 +0000 (07:59 +0000)]
[clangd] Embed fixes as CodeAction, instead of clangd_fixes. Clean up serialization.

Summary:
CodeAction provides us with a standard way of representing fixes inline, so
use it, replacing our existing ad-hoc extension.

After this, it's easy to serialize diagnostics using the structured
toJSON/Protocol.h mechanism rather than assembling JSON ad-hoc.

Reviewers: hokein, arphaman

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, kadircet, cfe-commits

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

llvm-svn: 345119

5 years ago[ThinLTO] Fix dot dumper for regular LTO modules
Eugene Leviant [Wed, 24 Oct 2018 07:48:32 +0000 (07:48 +0000)]
[ThinLTO] Fix dot dumper for regular LTO modules

Regular LTO module identifier is (unsigned)-1. This patch emits correct
module identifier while printing edges with source summary in regular
LTO module.

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

llvm-svn: 345118

5 years ago[MinGW] Support for multiarch runtimes layout
Martin Storsjo [Wed, 24 Oct 2018 07:42:10 +0000 (07:42 +0000)]
[MinGW] Support for multiarch runtimes layout

Patch by Peiyuan Song!

llvm-svn: 345117

5 years ago[ELF] Remove a superfluous semicolon, fixing warnings. NFC.
Martin Storsjo [Wed, 24 Oct 2018 07:42:06 +0000 (07:42 +0000)]
[ELF] Remove a superfluous semicolon, fixing warnings. NFC.

llvm-svn: 345116

5 years ago[LV] Don't have fold-tail under optsize invalidate interleave-groups when
Dorit Nuzman [Wed, 24 Oct 2018 07:11:38 +0000 (07:11 +0000)]
[LV] Don't have fold-tail under optsize invalidate interleave-groups when
masked-interleaving is enabled

Enable interleave-groups under fold-tail scenario for Opt for size compilation;
D50480 added support for vectorizing loops of arbitrary trip-count without a
remiander, which in turn makes everything in the loop conditional, including
interleave-groups if any. It therefore invalidated all interleave-groups
because we didn't have support for vectorizing predicated interleaved-groups
at the time. In the meantime, D53011 introduced this support, so we don't
have to invalidate interleave-groups when masked-interleaved support is enabled.

Reviewers: Ayal, hsaito, dcaballe, fhahn

Reviewed By: hsaito

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

llvm-svn: 345115

5 years ago[LSR] Combine unfolded offset into invariant register
Gil Rapaport [Wed, 24 Oct 2018 07:08:38 +0000 (07:08 +0000)]
[LSR] Combine unfolded offset into invariant register

LSR reassociates constants as unfolded offsets when the constants fit as
immediate add operands, which currently prevents such constants from being
combined later with loop invariant registers.
This patch modifies GenerateCombinations() to generate a second formula which
includes the unfolded offset in the combined loop-invariant register.

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

llvm-svn: 345114

5 years ago[clangd] Truncate SymbolID to 16 bytes.
Sam McCall [Wed, 24 Oct 2018 06:58:42 +0000 (06:58 +0000)]
[clangd] Truncate SymbolID to 16 bytes.

Summary:
The goal is 8 bytes, which has a nonzero risk of collisions with huge indexes.
This patch should shake out any issues with truncation at all, we can lower
further later.

Reviewers: ioeric

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

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

llvm-svn: 345113

5 years ago[X86] Correct a bad isel predicate. Though I don't think it can be exposed.
Craig Topper [Wed, 24 Oct 2018 06:13:36 +0000 (06:13 +0000)]
[X86] Correct a bad isel predicate. Though I don't think it can be exposed.

This B/W VPTEST instructions are only available with AVX512BW. But lowering should prevent any byte or word elements from getting to isel so this can't be exposed.

llvm-svn: 345112

5 years ago[Sema] Fix -Wcomma in dependent context
Richard Trieu [Wed, 24 Oct 2018 02:07:41 +0000 (02:07 +0000)]
[Sema] Fix -Wcomma in dependent context

When there is a dependent type inside a cast, the CastKind becomes CK_Dependent
instead of CK_ToVoid.  This fix will check that there is a dependent cast,
the original type is dependent, and the target type is void to ignore the cast.

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

llvm-svn: 345111

5 years ago[hwasan] when printing a stack-related bugs, also print stack frame descriptions...
Kostya Serebryany [Wed, 24 Oct 2018 01:35:50 +0000 (01:35 +0000)]
[hwasan] when printing a stack-related bugs, also print stack frame descriptions provided by the compiler

llvm-svn: 345110

5 years agoDebug Info (-gmodules): emit full types for non-anchored template specializations
Adrian Prantl [Wed, 24 Oct 2018 00:06:02 +0000 (00:06 +0000)]
Debug Info (-gmodules): emit full types for non-anchored template specializations

Before this patch, clang would emit a (module-)forward declaration for
template instantiations that are not anchored by an explicit template
instantiation, but still are guaranteed to be available in an imported
module. Unfortunately detecting the owning module doesn't reliably
work when local submodule visibility is enabled and the template is
inside a cross-module namespace.

This make clang debuggable again with -gmodules and LSV enabled.

rdar://problem/41552377

llvm-svn: 345109

5 years ago[ARM64][Windows] Add unwind support to llvm-readobj
Sanjin Sijaric [Wed, 24 Oct 2018 00:03:34 +0000 (00:03 +0000)]
[ARM64][Windows] Add unwind support to llvm-readobj

This patch adds support for dumping the unwind info from ARM64 COFF object
files.

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

llvm-svn: 345108

5 years agoARM: handle checking aliases with out-of-bounds GEPs
Saleem Abdulrasool [Wed, 24 Oct 2018 00:00:52 +0000 (00:00 +0000)]
ARM: handle checking aliases with out-of-bounds GEPs

A global alias may use indices which are not considered in bounds.  In
such a case, accessing the base object will fail as it only peers
through inbounds accesses.  This pattern is used by the swift compiler
to create references to preceeding members in the type metadata.  This
would cause the code generation to fail when targeting a platform that
used ELF as the object file format.  Be conservative and fail the
read-only check if we run into an alias that we cannot peer through.

llvm-svn: 345107

5 years agoSupport nwere versions of the Segger J-Link jtag board software.
Jason Molenda [Tue, 23 Oct 2018 23:45:56 +0000 (23:45 +0000)]
Support nwere versions of the Segger J-Link jtag board software.
Add support in ProcessGDBRemote::GetGDBServerRegisterInfo
for recognizing a generic "arm" architecture that will be used if
nothing better is available so that we don't ignore the register
definitions if we didn't already have an architecture set.
Also in ProcessGDBRemote::DoConnectRemote don't set the target
arch unless we have a valid architecture to set it to.

Platform::ConnectProcess will try to get the current target's
architecture, or the default architecture, when creating the
target for the connection to be attempted.  If lldb was started
with a target binary, we want to create this target with that
architecture in case the remote gdb stub doesn't supply a
qHostInfo arch.

Add logging to Target::MergeArchitecture.

<rdar://problem/34916465>

llvm-svn: 345106

5 years agoCommit missing comment edit and use correct cast to fix std::min overload
Reid Kleckner [Tue, 23 Oct 2018 23:44:44 +0000 (23:44 +0000)]
Commit missing comment edit and use correct cast to fix std::min overload

llvm-svn: 345105

5 years ago[hurd] Make getMainExecutable get the real binary path
Reid Kleckner [Tue, 23 Oct 2018 23:35:43 +0000 (23:35 +0000)]
[hurd] Make getMainExecutable get the real binary path

On GNU/Hurd, llvm-config is returning bogus value, such as:

$ llvm-config-6.0 --includedir
/usr/include

while it should be:
$ llvm-config-6.0 --includedir
/usr/lib/llvm-6.0/include

This is because getMainExecutable does not get the actual installation
path. On GNU/Hurd, /proc/self/exe is indeed a symlink to the path that
was used to start the program, and not the eventual binary file. Llvm's
getMainExecutable thus needs to run realpath over it to get the actual
place where llvm was installed (/usr/lib/llvm-6.0/bin/llvm-config), and
not /usr/bin/llvm-config-6.0. This will not change the result on Linux,
where /proc/self/exe already points to the eventual file.

Patch by Samuel Thibault!

While making changes here, I reformatted this block a bit to reduce
indentation and match 2 space indent style.

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

llvm-svn: 345104

5 years ago[PM] keeping history when original SCC split and then merge into itself
Wei Mi [Tue, 23 Oct 2018 23:29:45 +0000 (23:29 +0000)]
[PM] keeping history when original SCC split and then merge into itself
in the same round of SCC update.

In https://reviews.llvm.org/rL309784, inline history is added to prevent
infinite inlining across multiple run of inliner and SCC update, but the
history will only be kept when new SCC is actually generated during SCC update.

We found a case that SCC can be split and then merge into itself in the same
round of SCC update, so the same SCC will be pop out from UR.CWorklist and
then added back immediately, without any new SCC generated, that is why the
existing patch cannot catch the infinite inline case.

What the patch does is even if no new SCC is generated, if only the current
SCC appears in UR.CWorklist again, then keep the inline history.

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

llvm-svn: 345103

5 years agoSelectionDAG: Reuse bigger sized constants in memset expansion.
Matthias Braun [Tue, 23 Oct 2018 23:19:23 +0000 (23:19 +0000)]
SelectionDAG: Reuse bigger sized constants in memset expansion.

When implementing memset's today we often see this pattern:
$x0 = MOV 0xXYXYXYXYXYXYXYXY
store $x0, ...
$w1 = MOV 0xXYXYXYXY
store $w1, ...

We first create a 64bit constant in a 64bit register with all bytes the
same and then create a 32bit constant with all bytes the same in a 32bit
register. In many targets we could just access the lower byte of the
64bit register instead.

- Ideally this would be handled by the ConstantHoist pass but it runs
  too early when memset isn't expanded yet.
- The memset expansion code already had this optimization implemented,
  however SelectionDAG constantfolding would constantfold the
  "trunc(bigconstnat)" pattern to "smallconstant".
- This patch makes the memset expansion mark the constant as Opaque and
  stop DAGCombiner from constant folding in this situation. (Similar to
  how ConstantHoisting marks things as Opaque to avoid folding
  ADD/SUB/etc.)

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

llvm-svn: 345102

5 years ago[analyzer] [NFC] Change scanReachableSymbols to use ranges
George Karpenkov [Tue, 23 Oct 2018 23:12:12 +0000 (23:12 +0000)]
[analyzer] [NFC] Change scanReachableSymbols to use ranges

Remove unused overload. Clean up some usages.

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

llvm-svn: 345101

5 years ago[analyzer] Do not stop tracking CXX methods touching OSObject.
George Karpenkov [Tue, 23 Oct 2018 23:11:50 +0000 (23:11 +0000)]
[analyzer] Do not stop tracking CXX methods touching OSObject.

Trust generalized annotations for OSObject.

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

llvm-svn: 345100

5 years ago[analyzer] Trust summaries for OSObject::retain and OSObject::release
George Karpenkov [Tue, 23 Oct 2018 23:11:30 +0000 (23:11 +0000)]
[analyzer] Trust summaries for OSObject::retain and OSObject::release

Refactor the way in which summaries are consumed for safeMetaCast

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

llvm-svn: 345099

5 years ago[ORC] Re-apply r345077 with fixes to remove ambiguity in lookup calls.
Lang Hames [Tue, 23 Oct 2018 23:01:39 +0000 (23:01 +0000)]
[ORC] Re-apply r345077 with fixes to remove ambiguity in lookup calls.

llvm-svn: 345098

5 years agoRevert "[ThinLTO] Fix a crash in lazy loading of Metadata"
Teresa Johnson [Tue, 23 Oct 2018 23:00:29 +0000 (23:00 +0000)]
Revert "[ThinLTO] Fix a crash in lazy loading of Metadata"

This reverts commit r345095. It was accidentally committed.

llvm-svn: 345097

5 years ago[hot-cold-split] Only perform splitting in ThinLTO backend post-link
Teresa Johnson [Tue, 23 Oct 2018 22:57:40 +0000 (22:57 +0000)]
[hot-cold-split] Only perform splitting in ThinLTO backend post-link

Summary:
Fix the new PM to only perform hot cold splitting once during ThinLTO,
by skipping it in the pre-link phase.

This was already fixed in the old PM by the move of the hot cold split
pass later (after the early return when PrepareForThinLTO) by r344869.

Reviewers: vsk, sebpop, hiraditya

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

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

llvm-svn: 345096

5 years ago[ThinLTO] Fix a crash in lazy loading of Metadata
Teresa Johnson [Tue, 23 Oct 2018 22:57:21 +0000 (22:57 +0000)]
[ThinLTO] Fix a crash in lazy loading of Metadata

Summary:
This is a revised version of D41474.

When the debug location is parsed in BitcodeReader::parseFunction, the
scope and inlinedAt MDNodes are obtained via MDLoader->getMDNodeFwdRefOrNull(),
which will create a forward ref if they were not yet loaded.
Specifically, if one of these MDNodes is in the module level metadata
block, and this is during ThinLTO importing, that metadata block is
lazily loaded.

Most places in that invoke getMDNodeFwdRefOrNull have a corresponding call
to resolveForwardRefsAndPlaceholders which will take care of resolving them.
E.g. places that call getMetadataFwdRefOrLoad, or at the end of parsing a
function-level metadata block, or at the end of the initial lazy load of
module level metadata in order to handle invocations of getMDNodeFwdRefOrNull
for named metadata and global object attachments. However, the calls for
the scope/inlinedAt of debug locations are not backed by any such call to
resolveForwardRefsAndPlaceholders.

To fix this, change the scope and inlinedAt parsing to instead use
getMetadataFwdRefOrLoad, which will ensure the forward refs to lazily
loaded metadata are resolved.

Fixes PR35472.

Reviewers: dexonsmith, Sunil_Srivastava, vsk

Subscribers: inglorion, eraman, steven_wu, sebpop, mehdi_amini, dmikulin, vsk, hiraditya, llvm-commits

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

llvm-svn: 345095

5 years agoMove forward declarations to the top of the file and sort.
Rui Ueyama [Tue, 23 Oct 2018 22:37:14 +0000 (22:37 +0000)]
Move forward declarations to the top of the file and sort.

llvm-svn: 345094

5 years agoMove a function out of a class because it doesn't depend on any class member. NFC.
Rui Ueyama [Tue, 23 Oct 2018 22:31:08 +0000 (22:31 +0000)]
Move a function out of a class because it doesn't depend on any class member. NFC.

llvm-svn: 345093

5 years agoRemove unused private methods.
Zachary Turner [Tue, 23 Oct 2018 22:15:27 +0000 (22:15 +0000)]
Remove unused private methods.

llvm-svn: 345092

5 years agoFix some comments pointed out by Leonard Mosescu.
Zachary Turner [Tue, 23 Oct 2018 22:15:05 +0000 (22:15 +0000)]
Fix some comments pointed out by Leonard Mosescu.

These were originally pointed out in D53511 but I forgot
to incorporate them in my patch.

llvm-svn: 345091