platform/upstream/llvm.git
5 years agoRemove unused getMDNodeFwdRefOrNull interfaces (NFC)
Teresa Johnson [Wed, 14 Nov 2018 21:57:51 +0000 (21:57 +0000)]
Remove unused getMDNodeFwdRefOrNull interfaces (NFC)

Summary:
Followup from D53596/r346891. Remove the getMDNodeFwdRefOrNull interface
to the MDLoader since it is no longer used. Also improve error messages
when the internal implementation is used within the MDLoader.

Reviewers: steven_wu

Subscribers: llvm-commits

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

llvm-svn: 346899

5 years ago[X86][SSE] Add SSE2/SSE42 masked load/store tests
Simon Pilgrim [Wed, 14 Nov 2018 21:31:50 +0000 (21:31 +0000)]
[X86][SSE] Add SSE2/SSE42 masked load/store tests

Now that the load/store tests are split the impact of running the tests on multiple (illegal) targets is a lot less impactful

llvm-svn: 346896

5 years agoBias physical register immediate assignments
Nirav Dave [Wed, 14 Nov 2018 21:11:53 +0000 (21:11 +0000)]
Bias physical register immediate assignments

The machine scheduler currently biases register copies to/from
physical registers to be closer to their point of use / def to
minimize their live ranges. This change extends this to also physical
register assignments from immediate values.

This causes a reduction in reduction in overall register pressure and
minor reduction in spills and indirectly fixes an out-of-registers
assertion (PR39391).

Most test changes are from minor instruction reorderings and register
name selection changes and direct consequences of that.

Reviewers: MatzeB, qcolombet, myatsina, pcc

Subscribers: nemanjai, jvesely, nhaehnle, eraman, hiraditya,
  javed.absar, arphaman, jfb, jsji, llvm-commits

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

llvm-svn: 346894

5 years ago[ELF] Make TrapInstr and Filler byte arrays. NFC.
Simon Atanasyan [Wed, 14 Nov 2018 21:05:20 +0000 (21:05 +0000)]
[ELF] Make TrapInstr and Filler byte arrays. NFC.

The uint32_t type does not clearly convey that these fields are interpreted
in the target endianness. Converting them to byte arrays should make this
more obvious and less error-prone.

Patch by James Clarke

Differential Revision: http://reviews.llvm.org/D54207

llvm-svn: 346893

5 years ago[c++20] Implement P0482R6: enable -fchar8_t by default in C++20 mode.
Richard Smith [Wed, 14 Nov 2018 21:04:34 +0000 (21:04 +0000)]
[c++20] Implement P0482R6: enable -fchar8_t by default in C++20 mode.

This unfortunately results in a substantial breaking change when
switching to C++20, but it's not yet clear what / how much we should
do about that. We may want to add a compatibility conversion from
u8 string literals to const char*, similar to how C++98 provided a
compatibility conversion from string literals to non-const char*,
but that's not handled by this patch.

The feature can be disabled in C++20 mode with -fno-char8_t.

llvm-svn: 346892

5 years ago[ThinLTO] Fix a crash in lazy loading of Metadata
Teresa Johnson [Wed, 14 Nov 2018 20:58:04 +0000 (20:58 +0000)]
[ThinLTO] Fix a crash in lazy loading of Metadata

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.

llvm-svn: 346891

5 years ago[X86] Split masked load/store test files
Simon Pilgrim [Wed, 14 Nov 2018 20:44:59 +0000 (20:44 +0000)]
[X86] Split masked load/store test files

llvm-svn: 346889

5 years agoRename cxx-benchmark-unittests target and convert to LIT.
Eric Fiselier [Wed, 14 Nov 2018 20:38:46 +0000 (20:38 +0000)]
Rename cxx-benchmark-unittests target and convert to LIT.

This patch renames the cxx-benchmark-unittests to check-cxx-benchmarks
and converts the target to use LIT in order to make the tests run faster
and provide better output.

In particular this runs each benchmark in a suite one by one, allowing
more parallelism while ensuring output isn't garbage with multiple threads.

Additionally, it adds the CMake flag '-DLIBCXX_BENCHMARK_TEST_ARGS=<list>'
to specify what options are passed when running the benchmarks.

llvm-svn: 346888

5 years ago[X86] Update masked load/store test names
Simon Pilgrim [Wed, 14 Nov 2018 20:25:50 +0000 (20:25 +0000)]
[X86] Update masked load/store test names

llvm-svn: 346887

5 years agoAMDGPU: Additional pattern for i16 median3 matching
Aakanksha Patil [Wed, 14 Nov 2018 20:10:41 +0000 (20:10 +0000)]
AMDGPU: Additional pattern for i16 median3 matching

min(max(a, b), max(min(a, b), c))

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

llvm-svn: 346886

5 years agoMark @llvm.trap cold
Vedant Kumar [Wed, 14 Nov 2018 19:53:41 +0000 (19:53 +0000)]
Mark @llvm.trap cold

A call to @llvm.trap can be expected to be cold (i.e. unlikely to be
reached in a normal program execution).

Outlining paths which unconditionally trap is an important memory
saving. As the hot/cold splitting pass (imho) should not treat all
noreturn calls as cold, explicitly mark @llvm.trap cold so that it can
be outlined.

Split out of https://reviews.llvm.org/D54244.

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

llvm-svn: 346885

5 years ago[Support] Teach YAMLIO about polymorphic types
Scott Linder [Wed, 14 Nov 2018 19:39:59 +0000 (19:39 +0000)]
[Support] Teach YAMLIO about polymorphic types

Add support for "polymorphic" types to YAMLIO.

PolymorphicTraits can dynamically switch between other traits (Scalar, Map, or
Sequence). When inputting, the PolymorphicTraits type is told which type to
become, and when outputting the PolymorphicTraits type is asked which type it
currently is.

Also add support for TaggedScalarTraits to allow dynamically differentiating
between multiple scalar types using YAML tags.

Serialize empty maps as "{}" and empty sequences as "[]", so that types
are preserved when round-tripping PolymorphicTraits. This change has
equivalent semantics, but may break e.g. tests which compare output
verbatim.

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

llvm-svn: 346884

5 years ago[ThinLTO] Update handling of vararg functions to match inliner
Teresa Johnson [Wed, 14 Nov 2018 19:30:13 +0000 (19:30 +0000)]
[ThinLTO] Update handling of vararg functions to match inliner

Summary:
Previously we marked all vararg functions as non-inlinable in the
function summary, which prevented their importing. However, the
corresponding inliner restriction was loosened in r321940/r342675
to only apply to functions calling va_start. Adjust the summary
flag computation to match.

Reviewers: davidxl

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

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

llvm-svn: 346883

5 years ago[AST] Fix typo in MicrosoftMangle
Shoaib Meenai [Wed, 14 Nov 2018 19:16:22 +0000 (19:16 +0000)]
[AST] Fix typo in MicrosoftMangle

Correct the spelling from Artifical to Artificial.

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

llvm-svn: 346882

5 years ago[InstSimplify] add tests for funnel shift with select; NFC
Sanjay Patel [Wed, 14 Nov 2018 19:12:54 +0000 (19:12 +0000)]
[InstSimplify] add tests for funnel shift with select; NFC

llvm-svn: 346881

5 years ago[WebAssembly] Add support for dylink section in object format
Sam Clegg [Wed, 14 Nov 2018 18:36:24 +0000 (18:36 +0000)]
[WebAssembly] Add support for dylink section in object format

See https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md.

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

llvm-svn: 346880

5 years ago[X86] Allow pmulh to be formed from narrow vXi16 vectors under -x86-experimental...
Craig Topper [Wed, 14 Nov 2018 18:16:21 +0000 (18:16 +0000)]
[X86] Allow pmulh to be formed from narrow vXi16 vectors under -x86-experimental-vector-widening-legalization

Narrower vectors will be widened to 128 bits without changing the element size. And generic type legalization can already handle widening mulhu/mulhs.

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

llvm-svn: 346879

5 years ago[libcxx] [test] Fix running tests on macOS with python3
Alexander Richardson [Wed, 14 Nov 2018 17:58:55 +0000 (17:58 +0000)]
[libcxx] [test] Fix running tests on macOS with python3

Summary:
The result of subprocess.check_output() is bytes in python3 which we need
to convert to str(). Simplify this by using the executeCommand() helper.

Reviewers: ldionne, EricWF

Reviewed By: ldionne

Subscribers: christof, libcxx-commits

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

llvm-svn: 346878

5 years ago[PPC64] Long branch thunks.
Sean Fertile [Wed, 14 Nov 2018 17:56:43 +0000 (17:56 +0000)]
[PPC64] Long branch thunks.

On PowerPC64, when a function call offset is too large to encode in a call
instruction the address is stored in a table in the data segment. A thunk is
used to load the branch target address from the table relative to the
TOC-pointer and indirectly branch to the callee. When linking position-dependent
code the addresses are stored directly in the table, for position-independent
code the table is allocated and filled in at load time by the dynamic linker.

For position-independent code the branch targets could have gone in the .got.plt
but using the .branch_lt section for both position dependent and position
independent binaries keeps it consitent and helps keep this PPC64 specific logic
seperated from the target-independent code handling the .got.plt.

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

llvm-svn: 346877

5 years ago[NFC] Change address __tls_getaddr is defined at so it does not need a thunk.
Sean Fertile [Wed, 14 Nov 2018 17:56:38 +0000 (17:56 +0000)]
[NFC] Change address __tls_getaddr is defined at so it does not need a thunk.

Minor update to a ppc64 tls test so that it won't need to use a thunk once the
range-extending thunk patch is landed.

llvm-svn: 346876

5 years ago[InstCombine] Remove a couple of asserts based on incorrect assumptions
Mandeep Singh Grang [Wed, 14 Nov 2018 17:55:07 +0000 (17:55 +0000)]
[InstCombine] Remove a couple of asserts based on incorrect assumptions

Summary:
These asserts are based on the assumption that the order of true/false operands in a select and those in the compare would always be the same.
This fixes PR39595.

Reviewers: craig.topper, spatel, dmgreen

Reviewed By: craig.topper

Subscribers: llvm-commits

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

llvm-svn: 346874

5 years agoFix some compilation failures introduced in recent patches.
Zachary Turner [Wed, 14 Nov 2018 17:22:09 +0000 (17:22 +0000)]
Fix some compilation failures introduced in recent patches.

This fixes two compilation failures:

  1) Designated initializers are C++20.  We can't use them in LLVM.
  2) thread_result_t is not a pointer type on all platforms, so
     returning nullptr is an error.

llvm-svn: 346873

5 years ago[clangd] Delete unused includes.
Kadir Cetinkaya [Wed, 14 Nov 2018 17:07:39 +0000 (17:07 +0000)]
[clangd] Delete unused includes.

llvm-svn: 346872

5 years ago[InstCombine] fix formatting for matchBSwap(); NFC
Sanjay Patel [Wed, 14 Nov 2018 16:03:36 +0000 (16:03 +0000)]
[InstCombine] fix formatting for matchBSwap(); NFC

We should have a similar function for matching rotate and/or
funnel shift, so tidy up the related existing call.

llvm-svn: 346871

5 years ago[VPlan, SLP] Use SmallPtrSet for Candidates.
Florian Hahn [Wed, 14 Nov 2018 15:58:40 +0000 (15:58 +0000)]
[VPlan, SLP] Use SmallPtrSet for Candidates.

This slightly improves the candidate handling in getBest().

llvm-svn: 346870

5 years ago[SimplifyCFG] Regenerate preserve-branchweights.ll test. NFC
John Brawn [Wed, 14 Nov 2018 15:27:07 +0000 (15:27 +0000)]
[SimplifyCFG] Regenerate preserve-branchweights.ll test. NFC

Regenerate this test using update_test_checks.py in preparation for an
upcomming commit, to make it not depend on the names of instructions.

llvm-svn: 346869

5 years ago[TTI] getOperandInfo - a broadcast shuffle means the result is OK_UniformValue
Simon Pilgrim [Wed, 14 Nov 2018 15:04:08 +0000 (15:04 +0000)]
[TTI] getOperandInfo - a broadcast shuffle means the result is OK_UniformValue

llvm-svn: 346868

5 years agoMove DataExtractorTest to unittests/Utility
Pavel Labath [Wed, 14 Nov 2018 14:58:36 +0000 (14:58 +0000)]
Move DataExtractorTest to unittests/Utility

The DataExtractor class itself was moved to Utility some time ago, but
it seems this was not reflected in the location of the test code. Fix
that.

llvm-svn: 346867

5 years agoReverted D52835 to fix review comments
David Bolvansky [Wed, 14 Nov 2018 14:27:51 +0000 (14:27 +0000)]
Reverted D52835 to fix review comments

llvm-svn: 346866

5 years ago[Diagnostics] Check integer to floating point number implicit conversions
David Bolvansky [Wed, 14 Nov 2018 14:24:33 +0000 (14:24 +0000)]
[Diagnostics] Check integer to floating point number implicit conversions

Summary:
GCC already catches these situations so we should handle it too.

GCC warns in C++ mode only (does anybody know why?). I think it is useful in C mode too.

Reviewers: rsmith, erichkeane, aaron.ballman, efriedma, xbolva00

Reviewed By: xbolva00

Subscribers: efriedma, craig.topper, scanon, cfe-commits

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

llvm-svn: 346865

5 years ago[AST][NFC] Order the bit-field classes of Stmt like in StmtNodes.td
Bruno Ricci [Wed, 14 Nov 2018 14:19:34 +0000 (14:19 +0000)]
[AST][NFC] Order the bit-field classes of Stmt like in StmtNodes.td

Reorder the bit-field classes and the members of the anonymous union
so that they both match the order in StmtNodes.td.

There is already a fair amount of them, and this is not going to
improve. Therefore lets try to keep some order here.

Strictly NFC.

llvm-svn: 346864

5 years ago[AArch64] Fix resolution of R_PLT_PAGE RelExpr
Peter Smith [Wed, 14 Nov 2018 13:53:47 +0000 (13:53 +0000)]
[AArch64] Fix resolution of R_PLT_PAGE RelExpr

The R_AARCH64_ADR_PREL_PG_HI21 relocation type is given the R_PAGE_PC
RelExpr. This can be transformed to R_PLT_PAGE_PC via toPlt().
Unfortunately the resolution is identical to R_PAGE_PC so instead of
getting the address of the PLT entry we get the address of the symbol
which may not be correct in the case of static ifuncs. The fix is to
handle the cases separately and use getPltVA() + A with R_PLT_PAGE_PC.

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

llvm-svn: 346863

5 years agoFix for bugzilla https://bugs.llvm.org/show_bug.cgi?id=39137.
Andrey Churbanov [Wed, 14 Nov 2018 13:49:41 +0000 (13:49 +0000)]
Fix for bugzilla https://bugs.llvm.org/show_bug.cgi?id=39137.

Do not write to internal structure if it keeps same value.

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

llvm-svn: 346862

5 years agoDocument how to comment an actual parameter.
Paul Robinson [Wed, 14 Nov 2018 13:43:19 +0000 (13:43 +0000)]
Document how to comment an actual parameter.

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

llvm-svn: 346861

5 years ago[VPlan] Remove LLVM_DEBUG from VPlanSlp::dumpBundle.
Florian Hahn [Wed, 14 Nov 2018 13:33:44 +0000 (13:33 +0000)]
[VPlan] Remove LLVM_DEBUG from VPlanSlp::dumpBundle.

The caller should take care of only calling it with debug enabled.

llvm-svn: 346860

5 years ago[TTI] Pull out repeated 'ConcreteTTI' static_casts. NFCI.
Simon Pilgrim [Wed, 14 Nov 2018 13:23:28 +0000 (13:23 +0000)]
[TTI] Pull out repeated 'ConcreteTTI' static_casts. NFCI.

llvm-svn: 346859

5 years ago[VPlan] Update ifdef.
Florian Hahn [Wed, 14 Nov 2018 13:21:26 +0000 (13:21 +0000)]
[VPlan] Update ifdef.

llvm-svn: 346858

5 years ago[VPlan, SLP] Add simple SLP analysis on top of VPlan.
Florian Hahn [Wed, 14 Nov 2018 13:11:49 +0000 (13:11 +0000)]
[VPlan, SLP] Add simple SLP analysis on top of VPlan.

This patch adds an initial implementation of the look-ahead SLP tree
construction described in 'Look-Ahead SLP: Auto-vectorization in the Presence
of Commutative Operations, CGO 2018 by Vasileios Porpodas, Rodrigo C. O. Rocha,
Luís F. W. Góes'.

It returns an SLP tree represented as VPInstructions, with combined
instructions represented as a single, wider VPInstruction.

This initial version does not support instructions with multiple
different users (either inside or outside the SLP tree) or
non-instruction operands; it won't generate any shuffles or
insertelement instructions.

It also just adds the analysis that builds an SLP tree rooted in a set
of stores. It does not include any cost modeling or memory legality
checks. The plan is to integrate it with VPlan based cost modeling, once
available and to only apply it to operations that can be widened.

A follow-up patch will add a support for replacing instructions in a
VPlan with their SLP counter parts.

Reviewers: Ayal, mssimpso, rengolin, mkuper, hfinkel, hsaito, dcaballe, vporpo, RKSimon, ABataev

Reviewed By: rengolin

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

llvm-svn: 346857

5 years agoAdding myself as the code owner for clang-query as discussed in https://reviews.llvm...
Aaron Ballman [Wed, 14 Nov 2018 13:03:50 +0000 (13:03 +0000)]
Adding myself as the code owner for clang-query as discussed in https://reviews.llvm.org/D54453.

llvm-svn: 346856

5 years ago[LLDB] - Recommit r346848 "[LLDB] - Support the single file split DWARF.".
George Rimar [Wed, 14 Nov 2018 13:01:15 +0000 (13:01 +0000)]
[LLDB] - Recommit r346848 "[LLDB] - Support the single file split DWARF.".

Test cases were updated to not use the local compilation dir which
is different between development pc and build bots.

Original commit message:

[LLDB] - Support the single file split DWARF.

DWARF5 spec describes a single file split dwarf case
(when .dwo sections are in the .o files).

Problem is that LLDB does not work correctly in that case.
The issue is that, for example, both .debug_info and .debug_info.dwo
has the same type: eSectionTypeDWARFDebugInfo. And when code searches
section by type it might find the regular debug section
and not the .dwo one.

The patch fixes that. With it, LLDB is able to work with
output compiled with -gsplit-dwarf=single flag correctly.

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

llvm-svn: 346855

5 years ago[CostModel] Add generic expansion funnel shift cost support
Simon Pilgrim [Wed, 14 Nov 2018 12:24:50 +0000 (12:24 +0000)]
[CostModel] Add generic expansion funnel shift cost support

Add support for the expansion of funnelshift/rotates to getIntrinsicInstrCost.

This also required us to move the X86 fshl/fshr costs to the same place as the rotates to avoid expansion and get correct scalarization vs vectorization costs.

llvm-svn: 346854

5 years agoRevert r346848 "[LLDB] - Support the single file split DWARF."
George Rimar [Wed, 14 Nov 2018 12:04:31 +0000 (12:04 +0000)]
Revert r346848 "[LLDB] - Support the single file split DWARF."

It broke BB:
http://green.lab.llvm.org/green/job/lldb-cmake/12522/testReport/junit/LLDB/Breakpoint/single_file_split_dwarf_test/

llvm-svn: 346853

5 years ago[clangd] Replace StringRef in SymbolLocation with a char pointer.
Haojian Wu [Wed, 14 Nov 2018 11:55:45 +0000 (11:55 +0000)]
[clangd] Replace StringRef in SymbolLocation with a char pointer.

Summary:
This would save us 8 bytes per ref, and buy us ~40MB in total
for llvm index (from ~300MB to ~260 MB).

The char pointer must be null-terminated, and llvm::StringSaver
guarantees it.

Reviewers: sammccall

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

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

llvm-svn: 346852

5 years ago[llvm-objdump] Improve ELF file type checking statements (D54509)
Xing GUO [Wed, 14 Nov 2018 11:30:34 +0000 (11:30 +0000)]
[llvm-objdump] Improve ELF file type checking statements (D54509)

llvm-svn: 346851

5 years ago[X86][AVX512] Remove constant pool shuffle decoding from SelectionDAG
Simon Pilgrim [Wed, 14 Nov 2018 11:26:35 +0000 (11:26 +0000)]
[X86][AVX512] Remove constant pool shuffle decoding from SelectionDAG

This patch removes the last use of the constant pool shuffle decode helper and consistently uses the 'getTargetShuffleMaskIndices' versions instead. The constant pool versions are now purely used for assembly comments.

The avx512vbmi intrinsic upgrades had to be altered as they were being decoded as broadcasts, similar to what I fixed in rL346032. I don't think the change is critical - although its annoying that we lose the {k}{z} instruction test coverage as they are tricky to generate....

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

llvm-svn: 346850

5 years agoFix a crash when parsing incorrect DWARF
Pavel Labath [Wed, 14 Nov 2018 11:12:40 +0000 (11:12 +0000)]
Fix a crash when parsing incorrect DWARF

Summary:
While parsing a childless compile unit DIE we could crash if the DIE was
followed by any extra data (such as a superfluous end-of-children
marker). This happened because the break-on-depth=0 check was performed
only when parsing the null DIE, which was not correct because with a
childless root DIE, we could reach the end of the unit without ever
encountering the null DIE.

If the compile unit contribution ended directly after the CU DIE,
everything would be fine as we would terminate parsing due to reaching
EOF. However, if the contribution contained extra data (perhaps a
superfluous end-of-children marker), we would crash because we would
treat that data as the begging of another compile unit.

This fixes the crash by moving the depth=0 check to a more generic
place, and also adds a regression test.

Reviewers: clayborg, jankratochvil, JDevlieghere

Subscribers: lldb-commits

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

llvm-svn: 346849

5 years ago[LLDB] - Support the single file split DWARF.
George Rimar [Wed, 14 Nov 2018 10:35:14 +0000 (10:35 +0000)]
[LLDB] - Support the single file split DWARF.

DWARF5 spec describes a single file split dwarf case
(when .dwo sections are in the .o files).

Problem is that LLDB does not work correctly in that case.
The issue is that, for example, both .debug_info and .debug_info.dwo
has the same type: eSectionTypeDWARFDebugInfo. And when code searches
section by type it might find the regular debug section
and not the .dwo one.

The patch fixes that. With it, LLDB is able to work with
output compiled with -gsplit-dwarf=single flag correctly.

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

llvm-svn: 346848

5 years ago[AST] Allow limiting the scope of common AST traversals (getParents, RAV).
Sam McCall [Wed, 14 Nov 2018 10:33:30 +0000 (10:33 +0000)]
[AST] Allow limiting the scope of common AST traversals (getParents, RAV).

Summary:
The goal is to allow analyses such as clang-tidy checks to run on a
subset of the AST, e.g. "only on main-file decls" for interactive tools.

Today, these become "problematically global" by running RecursiveASTVisitors
rooted at the TUDecl, or by navigating up via ASTContext::getParent().

The scope is restricted using a set of top-level-decls that RecursiveASTVisitors
should be rooted at. This also applies to the visitor that populates the
parent map, and so the top-level-decls are considered to have no parents.

This patch makes the traversal scope a mutable property of ASTContext.
The more obvious way to do this is to pass the top-level decls to
relevant functions directly, but this has some problems:
 - it's error-prone: accidentally mixing restricted and unrestricted
   scopes is a performance trap. Interleaving multiple analyses is
   common (many clang-tidy checks run matchers or RAVs from matcher callbacks)
 - it doesn't map well to the actual use cases, where we really do want
   *all* traversals to be restricted.
 - it involves a lot of plumbing in parts of the code that don't care
   about traversals.
This approach was tried out in D54259 and D54261, I wanted to like it
but it feels pretty awful in practice.

Caveats: to get scope-limiting behavior of RecursiveASTVisitors, callers
have to call the new TraverseAST(Ctx) function instead of TraverseDecl(TU).
I think this is an improvement to the API regardless.

Reviewers: klimek, ioeric

Subscribers: mgorny, cfe-commits

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

llvm-svn: 346847

5 years ago[COFF] Fix a longstanding typo in a variable name. NFC.
Martin Storsjo [Wed, 14 Nov 2018 10:26:47 +0000 (10:26 +0000)]
[COFF] Fix a longstanding typo in a variable name. NFC.

llvm-svn: 346846

5 years ago[WebAssembly] Make sure event-section XFAILs for build options
Heejin Ahn [Wed, 14 Nov 2018 10:11:22 +0000 (10:11 +0000)]
[WebAssembly] Make sure event-section XFAILs for build options

rL346840 temporarily marked event-section.ll as XFAIL because it was
failing for builds with LLVM_ENABLE_EXPENSIVE_CHECKS turned on, but
to make sure it XFAILs even without LLVM_ENABLE_EXPENSIVE_CHECKS on we
need this `-verify-machineinstrs` flag, which was missing in the
previous commit.

llvm-svn: 346845

5 years agoPrint newline after banner for ModulePass
Sven van Haastregt [Wed, 14 Nov 2018 10:05:28 +0000 (10:05 +0000)]
Print newline after banner for ModulePass

Before this commit, `llc -print-after-all` would print something like:

  *** IR Dump After Pre-ISel Intrinsic Lowering ***; ModuleID = ...

Emit a newline such that ModuleID appears on a line by its own.

llvm-svn: 346844

5 years agoRecommit r346483: [CallSiteSplitting] Only record conditions up to the IDom(call...
Florian Hahn [Wed, 14 Nov 2018 10:04:30 +0000 (10:04 +0000)]
Recommit r346483: [CallSiteSplitting] Only record conditions up to the IDom(call site).

The underlying problem causing the expensive-check failure was fixed in
rL346769.

llvm-svn: 346843

5 years agoFix r346747 and r346796
Diana Picus [Wed, 14 Nov 2018 09:58:17 +0000 (09:58 +0000)]
Fix r346747 and r346796

Require x86 for the tests in order to fix non-x86 bots. This seems to be
the case for all other tests in that directory.

llvm-svn: 346842

5 years agoSuppress a "-Wliteral-conversion" compiler warning.
Haojian Wu [Wed, 14 Nov 2018 09:53:45 +0000 (09:53 +0000)]
Suppress a "-Wliteral-conversion" compiler warning.

error: implicit conversion from 'double' to 'uint64_t' (aka 'unsigned long') changes value from -0 to 0 [-Werror,-Wliteral-conversion]
llvm-svn: 346841

5 years ago[WebAssembly] Temporarily disable event-section.ll
Heejin Ahn [Wed, 14 Nov 2018 09:51:21 +0000 (09:51 +0000)]
[WebAssembly] Temporarily disable event-section.ll

This test is failing in builds with LLVM_ENABLE_EXPENSIVE_CHECKS after
rL346825 not because of the patch but due to a pre-existing codegen
problem. Marking this as XFAIL temporarily until the bug is fixed.

llvm-svn: 346840

5 years agoFix the "make_unique is ambiguous" compiler error.
Haojian Wu [Wed, 14 Nov 2018 09:42:28 +0000 (09:42 +0000)]
Fix the "make_unique is ambiguous" compiler error.

llvm-svn: 346839

5 years ago[OpenCL] Fix invalid address space generation for clk_event_t
Alexey Sotkin [Wed, 14 Nov 2018 09:40:05 +0000 (09:40 +0000)]
[OpenCL] Fix invalid address space generation for clk_event_t

Summary:
Addrspace(32) was generated when putting 0 in clk_event_t * event_ret
parameter for enqueue_kernel function.

Patch by Viktoria Maksimova

Reviewers: Anastasia, yaxunl, AlexeySotkin

Reviewed By:  Anastasia, AlexeySotkin

Subscribers: cfe-commits

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

llvm-svn: 346838

5 years ago[Clang] - Add '-gsplit-dwarf[=split,=single]' version for '-gsplit-dwarf' option.
George Rimar [Wed, 14 Nov 2018 09:22:16 +0000 (09:22 +0000)]
[Clang] - Add '-gsplit-dwarf[=split,=single]' version for '-gsplit-dwarf' option.

The DWARF5 specification says(Appendix F.1):

"The sections that do not require relocation, however, can be
written to the relocatable object (.o) file but ignored by the
linker or they can be written to a separate DWARF object (.dwo)
file that need not be accessed by the linker."

The first part describes a single file split DWARF feature and there
is no way to trigger this behavior atm.
Fortunately, no many changes are required to keep *.dwo sections
in a .o, the patch does that.

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

llvm-svn: 346837

5 years ago[clangd] Improve code completion for ObjC methods
Sam McCall [Wed, 14 Nov 2018 09:05:19 +0000 (09:05 +0000)]
[clangd] Improve code completion for ObjC methods

Summary:
Previously code completion did not work well for Objective-C methods
which contained multiple arguments as clangd did not expect to see
multiple typed-text chunks when handling code completion.

Note that even with this change, we do not consider selector fragments
from previous arguments to be part of the signature (although we
could in the future).

Reviewers: sammccall

Reviewed By: sammccall

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

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

llvm-svn: 346836

5 years ago[clang-tidy] Avoid C arrays check
Roman Lebedev [Wed, 14 Nov 2018 09:01:08 +0000 (09:01 +0000)]
[clang-tidy] Avoid C arrays check

Summary:
[[ https://bugs.llvm.org/show_bug.cgi?id=39224 | PR39224 ]]
As discussed, we can't always do the transform automatically due to that array-to-pointer decay of C array.
In order to detect whether we can do said transform, we'd need to be able to see all usages of said array,
which is, i would say, rather impossible if e.g. it is in the header.
Thus right now no fixit exists.

Exceptions: `extern "C"` code.

References:
* [[ https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es27-use-stdarray-or-stack_array-for-arrays-on-the-stack | CPPCG ES.27: Use std::array or stack_array for arrays on the stack ]]
* [[ https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#slcon1-prefer-using-stl-array-or-vector-instead-of-a-c-array | CPPCG SL.con.1: Prefer using STL array or vector instead of a C array ]]
* HICPP `4.1.1 Ensure that a function argument does not undergo an array-to-pointer conversion`
* MISRA `5-2-12 An identifier with array type passed as a function argument shall not decay to a pointer`

Reviewers: aaron.ballman, JonasToth, alexfh, hokein, xazax.hun

Reviewed By: JonasToth

Subscribers: Eugene.Zelenko, mgorny, rnkovacs, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 346835

5 years ago[X86] Add -x86-experimental-vector-widening command lines to pmulh.ll
Craig Topper [Wed, 14 Nov 2018 07:51:26 +0000 (07:51 +0000)]
[X86] Add -x86-experimental-vector-widening command lines to pmulh.ll

I've only added sse2 and sse4.1 variants as I'm only interested in the two v4i16 tests and I don't expect that to different with AVX other than a v prefix.

llvm-svn: 346834

5 years agoCorrectly instantiate `iterator_adaptor_base` when defining `pointer_iterator`
David Blaikie [Wed, 14 Nov 2018 07:19:21 +0000 (07:19 +0000)]
Correctly instantiate `iterator_adaptor_base` when defining `pointer_iterator`

The definition of `pointer_iterator` omits what should be a `iterator_traits::<>::iterator_category` parameter from `iterator_adaptor_base`. As a result, iterators based on `pointer_iterator` always have defaulted value types and the wrong iterator category.

The definition of `pointee_iterator` just a few lines above does this correctly.

This resolves [[ https://bugs.llvm.org/show_bug.cgi?id=39617 | bug 39617 ]].

Patch by Dylan MacKenzie!

Reviewers: dblaikie

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

llvm-svn: 346833

5 years ago[HIP] Fix device only compilation
Yaxun Liu [Wed, 14 Nov 2018 04:47:31 +0000 (04:47 +0000)]
[HIP] Fix device only compilation

Fix a bug causing host code being compiled when --cude-device-only is set.

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

llvm-svn: 346828

5 years ago[CMake] Include clang-apply-replacements in Fuchsia toolchain
Petr Hosek [Wed, 14 Nov 2018 04:06:47 +0000 (04:06 +0000)]
[CMake] Include clang-apply-replacements in Fuchsia toolchain

This is needed for run-clang-tidy.py.

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

llvm-svn: 346827

5 years ago[libcxx] [test] Strip trailing whitespace. NFC.
Stephan T. Lavavej [Wed, 14 Nov 2018 03:06:06 +0000 (03:06 +0000)]
[libcxx] [test] Strip trailing whitespace. NFC.

llvm-svn: 346826

5 years ago[WebAssembly] Add support for the event section
Heejin Ahn [Wed, 14 Nov 2018 02:46:21 +0000 (02:46 +0000)]
[WebAssembly] Add support for the event section

Summary:
This adds support for the 'event section' specified in the exception
handling proposal. (This was named 'exception section' first, but later
renamed to 'event section' to take possibilities of other kinds of
events into consideration. But currently we only store exception info in
this section.)

The event section is added between the global section and the export
section. This is for ease of validation per request of the V8 team.

This patch:
- Creates the event symbol type, which is a weak symbol
- Makes 'throw' instruction take the event symbol '__cpp_exception'
- Adds relocation support for events
- Adds WasmObjectWriter / WasmObjectFile (Reader) support
- Adds obj2yaml / yaml2obj support
- Adds '.eventtype' printing support

Reviewers: dschuff, sbc100, aardappel

Subscribers: jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 346825

5 years ago[PowerPC] Enhance the selection(ISD::VSELECT) of vector type
Zi Xuan Wu [Wed, 14 Nov 2018 02:34:45 +0000 (02:34 +0000)]
[PowerPC] Enhance the selection(ISD::VSELECT) of vector type

To make ISD::VSELECT available(legal) so long as there are altivec instruction, otherwise it's default behavior is expanding,
which is legalized at type-legalization phase. Use xxsel to match vselect if vsx is open, or use vsel.

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

llvm-svn: 346824

5 years agoRevert r346810 "Preserve loop metadata when splitting exit blocks"
Reid Kleckner [Wed, 14 Nov 2018 01:47:32 +0000 (01:47 +0000)]
Revert r346810 "Preserve loop metadata when splitting exit blocks"

It broke the Windows self-host:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/1457

llvm-svn: 346823

5 years ago[HeaderSearch] loadSubdirectoryModuleMaps should respect -working-directory
Alex Lorenz [Wed, 14 Nov 2018 01:08:03 +0000 (01:08 +0000)]
[HeaderSearch] loadSubdirectoryModuleMaps should respect -working-directory

Include search paths can be relative paths. The loadSubdirectoryModuleMaps function
should account for that and respect the -working-directory parameter given to Clang.

rdar://46045849

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

llvm-svn: 346822

5 years ago[CodeGen] Fix forward scan in MachineBasicBlock::computeRegisterLiveness.
Eli Friedman [Wed, 14 Nov 2018 00:39:29 +0000 (00:39 +0000)]
[CodeGen] Fix forward scan in MachineBasicBlock::computeRegisterLiveness.

The scan was incorrectly skipping the first instruction, so a register
could appear to be dead when it was actually live. This eventually leads
to a machine verifier failure and miscompile in arm-ldst-opt.

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

llvm-svn: 346821

5 years ago[CMake] Passthrough CFLAGS when checking the compiler-rt path
Petr Hosek [Wed, 14 Nov 2018 00:09:26 +0000 (00:09 +0000)]
[CMake] Passthrough CFLAGS when checking the compiler-rt path

This is needed when cross-compiling for a different target since
CFLAGS may contain additional flags like -resource-dir which
change the location in which compiler-rt builtins are found.

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

llvm-svn: 346820

5 years agoComplete reverting r346191
Tatyana Krasnukha [Wed, 14 Nov 2018 00:08:34 +0000 (00:08 +0000)]
Complete reverting r346191

llvm-svn: 346819

5 years agoComplete reverting r346191
Tatyana Krasnukha [Tue, 13 Nov 2018 23:59:25 +0000 (23:59 +0000)]
Complete reverting r346191

llvm-svn: 346818

5 years ago[PDB] Simplify symbol handling code, NFC
Reid Kleckner [Tue, 13 Nov 2018 23:44:39 +0000 (23:44 +0000)]
[PDB] Simplify symbol handling code, NFC

- Make mergeSymbolRecords a method of PDBLinker to reduce the number of
parameters it needs.

- Remove a stale FIXME comment about error handling. We already drop
unknown symbol records, log them, and continue.

- Update a comment about why we're copying the symbol record. We do it
to realign the record. We can already mutate the symbol record memory,
it's memory allocated by relocateDebugChunk.

- Avoid the extra `CVSymbol NewSym` variable. We can mutate Sym in
place, which is best, since we're mutating the underlying record anyway.

llvm-svn: 346817

5 years ago[MachineOutliner][NFC] Use flags set in all candidates to check for calls
Jessica Paquette [Tue, 13 Nov 2018 23:41:31 +0000 (23:41 +0000)]
[MachineOutliner][NFC] Use flags set in all candidates to check for calls

If we keep track of if the ContainsCalls bit is set in the MBB flags for each
candidate, then we have a better chance of not checking the candidate for calls
at all.

This saves quite a few checks in some CTMark tests (~200 in Bullet, for
example.)

llvm-svn: 346816

5 years agoMake dsymutil more robust when parsing load commands.
Adrian Prantl [Tue, 13 Nov 2018 23:31:25 +0000 (23:31 +0000)]
Make dsymutil more robust when parsing load commands.

rdar://problem/45883463

llvm-svn: 346815

5 years ago[InstCombine] fold funnel shift amount based on demanded bits
Sanjay Patel [Tue, 13 Nov 2018 23:27:23 +0000 (23:27 +0000)]
[InstCombine] fold funnel shift amount based on demanded bits

The shift amount of a funnel shift is modulo the scalar bitwidth:
http://llvm.org/docs/LangRef.html#llvm-fshl-intrinsic
...so we can use demanded bits analysis on that operand to simplify it
when we have a power-of-2 bitwidth.

This is another step towards canonicalizing {shift/shift/or} to the
intrinsics in IR.

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

llvm-svn: 346814

5 years agoMake the ExpandTilde unit test expect "\" (not "/") on Win32
Matthew Voss [Tue, 13 Nov 2018 23:21:00 +0000 (23:21 +0000)]
Make the ExpandTilde unit test expect "\" (not "/") on Win32

llvm-svn: 346813

5 years agoFix a bug in the parsing of the LC_BUILD_VERSION Mach-O load command.
Adrian Prantl [Tue, 13 Nov 2018 23:14:37 +0000 (23:14 +0000)]
Fix a bug in the parsing of the LC_BUILD_VERSION Mach-O load command.

LC_BUILD_VERSION records are of variable length. The original code
would use uninitialized memory when the size of a record was exactly 24.

rdar://problem/46032185

llvm-svn: 346812

5 years agoAdd cxx-benchmark-unittests target
Eric Fiselier [Tue, 13 Nov 2018 23:08:31 +0000 (23:08 +0000)]
Add cxx-benchmark-unittests target

This patch adds the cxx-benchmark-unittests target so we can start
getting test coverage on the benchmarks, including building with
sanitizers. Because we're only looking for test-coverage, the benchmarks
run for the shortest time possible, and in parallel.

The target is excluded from all by default. It only
builds and runs the libcxx configurations of the benchmarks, and not
any versions built against the systems native standard library.

llvm-svn: 346811

5 years agoPreserve loop metadata when splitting exit blocks
Craig Topper [Tue, 13 Nov 2018 23:06:49 +0000 (23:06 +0000)]
Preserve loop metadata when splitting exit blocks

LoopUtils.cpp contains a utility that splits an loop exit block, so that the new block contains only edges coming from the loop. In the case of nested loops, the exit path for the inner loop might also be the back-edge of the outer loop. The new block which is inserted on this path, is now a latch for the outer loop, and it needs to hold the loop metadata for the outer loop. (The test case gives a more concrete view of the situation.)

Patch by Chang Lin (clin1)

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

llvm-svn: 346810

5 years ago[MachineOutliner][NFC] Use MBB flags to avoid call checks in getOutliningInfo
Jessica Paquette [Tue, 13 Nov 2018 23:01:34 +0000 (23:01 +0000)]
[MachineOutliner][NFC] Use MBB flags to avoid call checks in getOutliningInfo

We already determine a bunch of information about an MBB in
getMachineOutlinerMBBFlags. We can reuse that information to avoid calculating
things that must be false/true.

The first thing we can easily check is if an outlined sequence could ever
contain calls. There's no reason to walk over the outlined range, checking for
calls, if we already know that there are no calls in the block containing the
sequence.

llvm-svn: 346809

5 years agoFix "use of" uninitialized memory in benchmark.
Eric Fiselier [Tue, 13 Nov 2018 23:00:55 +0000 (23:00 +0000)]
Fix "use of" uninitialized memory in benchmark.

An argument to DoNotOptimize was not fully initialized, which caused
msan to complain.

llvm-svn: 346808

5 years ago[InstCombine] canonicalize rotate patterns with cmp/select
Sanjay Patel [Tue, 13 Nov 2018 22:47:24 +0000 (22:47 +0000)]
[InstCombine] canonicalize rotate patterns with cmp/select

The cmp+branch variant of this pattern is shown in:
https://bugs.llvm.org/show_bug.cgi?id=34924
...and as discussed there, we probably can't transform
that without a rotate intrinsic. We do have that now
via funnel shift, but we're not quite ready to
canonicalize IR to that form yet. The case with 'select'
should already be transformed though, so that's this patch.

The sequence with negation followed by masking is what we
use in the backend and partly in clang (though that part
should be updated).

https://rise4fun.com/Alive/TplC
  %cmp = icmp eq i32 %shamt, 0
  %sub = sub i32 32, %shamt
  %shr = lshr i32 %x, %shamt
  %shl = shl i32 %x, %sub
  %or = or i32 %shr, %shl
  %r = select i1 %cmp, i32 %x, i32 %or
  =>
  %neg = sub i32 0, %shamt
  %masked = and i32 %shamt, 31
  %maskedneg = and i32 %neg, 31
  %shl2 = lshr i32 %x, %masked
  %shr2 = shl i32 %x, %maskedneg
  %r = or i32 %shl2, %shr2

llvm-svn: 346807

5 years agoOpenCL: Don't warn on v printf modifier
Matt Arsenault [Tue, 13 Nov 2018 22:30:35 +0000 (22:30 +0000)]
OpenCL: Don't warn on v printf modifier

This avoids spurious warnings, but could use
a lot of work. For example the number of vector
elements is not verified, and the passed
value type is not checked.

Fixes bug 39486

llvm-svn: 346806

5 years agoMark #2184 as complete; the tests are fine. (I thought that they were wrong before)
Marshall Clow [Tue, 13 Nov 2018 22:26:03 +0000 (22:26 +0000)]
Mark #2184 as complete; the tests are fine. (I thought that they were wrong before)

llvm-svn: 346805

5 years ago[lsan] [FIXUP] Fixup for http://reviews.llvm.org/D54484
George Karpenkov [Tue, 13 Nov 2018 22:17:16 +0000 (22:17 +0000)]
[lsan] [FIXUP] Fixup for reviews.llvm.org/D54484

After the change, the tests started failing, as skipped sections can be
equal in size to kMaxSegName.
Changing `<` to `<=` to address the off-by-one problem.

llvm-svn: 346804

5 years ago[MachineOutliner][NFC] Exit getOutliningType if there are < 2 candidates
Jessica Paquette [Tue, 13 Nov 2018 22:16:27 +0000 (22:16 +0000)]
[MachineOutliner][NFC] Exit getOutliningType if there are < 2 candidates

Since we never outline anything with fewer than 2 occurrences, there's no
reason to compute cost model information if there's less than that.

llvm-svn: 346803

5 years ago[Driver] Support g++ headers in include/g++
David Greene [Tue, 13 Nov 2018 21:38:45 +0000 (21:38 +0000)]
[Driver] Support g++ headers in include/g++

ray's gcc installation puts C++ headers in PREFIX/include/g++ without
indicating a gcc version at all. Typically this is because the version
is encoded somewhere in PREFIX.

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

llvm-svn: 346802

5 years ago[AST] Revert r346793 and r346781
Bruno Ricci [Tue, 13 Nov 2018 21:33:22 +0000 (21:33 +0000)]
[AST] Revert r346793 and r346781

This somehow breaks the msan bots. Revert while I figure it out.

llvm-svn: 346801

5 years ago[AMDGPU] combine extractelement into several selects
Stanislav Mekhanoshin [Tue, 13 Nov 2018 21:18:21 +0000 (21:18 +0000)]
[AMDGPU] combine extractelement into several selects

An extractelement with non-constant index will be lowered either to
scratch or movrel loop in most cases. This patch converts such
instruction into a set of selects if vector size is not too big.

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

llvm-svn: 346800

5 years ago[NFC] Mark LWG3128 and LWG3132 as requiring no work
Louis Dionne [Tue, 13 Nov 2018 21:13:10 +0000 (21:13 +0000)]
[NFC] Mark LWG3128 and LWG3132 as requiring no work

Those LWG issues were adopted in San Diego and require no work
on our side.

llvm-svn: 346799

5 years ago[MemorySSA] Create query after checking if instruction is a fence.
Alina Sbirlea [Tue, 13 Nov 2018 21:12:49 +0000 (21:12 +0000)]
[MemorySSA] Create query after checking if instruction is a fence.

The alternative is checking if I is a fence in the Query constructor, so
as to not attempt to get a non-existent MemoryLocation.

llvm-svn: 346798

5 years ago[AsmPrinter] Fix DebugInfo/X86/gnu-public-names.ll after rL346790
Fangrui Song [Tue, 13 Nov 2018 20:59:25 +0000 (20:59 +0000)]
[AsmPrinter] Fix DebugInfo/X86/gnu-public-names.ll after rL346790

llvm-svn: 346797

5 years ago[ELF] Add a better test for the multi-CU .gdb_index bug that D54361 fixed
Fangrui Song [Tue, 13 Nov 2018 20:49:36 +0000 (20:49 +0000)]
[ELF] Add a better test for the multi-CU .gdb_index bug that D54361 fixed

gdb-index-multiple-cu-2.s puts the symbol in question to another object file %t1.o, so that its CuIndex is affected by the number of CUs in %t.o

Also change `Kind:` in a comment to `Attributes:` as a follow-up of D54480 and D54481

llvm-svn: 346796

5 years agoFixed DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT i1 handling
Stanislav Mekhanoshin [Tue, 13 Nov 2018 20:26:27 +0000 (20:26 +0000)]
Fixed DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT i1 handling

Legalizer used to request an ext load from i8 to i1 when promoting
vector element type to i8. Fixed.

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

llvm-svn: 346795

5 years ago[ELF] Rename NameTypeEntry to NameAttrEntry and its field "Type" to CuIndexAndAttrs
Fangrui Song [Tue, 13 Nov 2018 20:25:51 +0000 (20:25 +0000)]
[ELF] Rename NameTypeEntry to NameAttrEntry and its field "Type" to CuIndexAndAttrs

Summary:
NameTypeEntry::Type is a bit-packed value of CU index+attributes (https://sourceware.org/gdb//onlinedocs/gdb/Index-Section-Format.html), which is named cu_index_and_attrs in a local variable in gdb/dwarf2read.c:dw2_symtab_iter_next

The new name CuIndexAndAttrs is more meaningful.

Reviewers: ruiu, dblaikie, espindola

Reviewed By: dblaikie

Subscribers: emaste, aprantl, arichardson, JDevlieghere, arphaman, llvm-commits

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

llvm-svn: 346794

5 years ago[AST][NFC] Order the bit-field classes of Stmt like in StmtNodes.td
Bruno Ricci [Tue, 13 Nov 2018 20:23:11 +0000 (20:23 +0000)]
[AST][NFC] Order the bit-field classes of Stmt like in StmtNodes.td

Reorder the bit-field classes and the members of the anonymous union
so that they both match the order in StmtNodes.td.

There is already a fair amount of them, and this is not going to
improve. Therefore lets try to keep some order here.

Strictly NFC.

llvm-svn: 346793

5 years ago[lsan] [NFC] Change ARRAY_SIZE to internal_strnlen
George Karpenkov [Tue, 13 Nov 2018 20:19:38 +0000 (20:19 +0000)]
[lsan] [NFC] Change ARRAY_SIZE to internal_strnlen

Calling ARRAY_SIZE on a char* will not actually compute it's size, but just the pointer size.
A new Clang warning enabled by default warns about this.

Replaced the call with internal_strnlen.

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

llvm-svn: 346792

5 years ago[MS Demangler] Print public:, protected:, private: if set in FunctionClass or a varia...
Nico Weber [Tue, 13 Nov 2018 20:18:26 +0000 (20:18 +0000)]
[MS Demangler] Print public:, protected:, private: if set in FunctionClass or a variable's StorageClass.

undname prints them, and the information is in the decorated name, so we probably shouldn't lose it when undecorating.

I spot-checked a few of the funnier-looking outputs, and undname has the same output.

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

llvm-svn: 346791