platform/upstream/llvm.git
6 years ago[FileCheck] Add -allow-deprecated-dag-overlap to failing clang tests
Joel E. Denny [Wed, 11 Jul 2018 20:26:20 +0000 (20:26 +0000)]
[FileCheck] Add -allow-deprecated-dag-overlap to failing clang tests

See https://reviews.llvm.org/D47106 for details.

Reviewed By: probinson

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

llvm-svn: 336844

6 years ago[FileCheck] Add -allow-deprecated-dag-overlap to failing llvm tests
Joel E. Denny [Wed, 11 Jul 2018 20:25:49 +0000 (20:25 +0000)]
[FileCheck] Add -allow-deprecated-dag-overlap to failing llvm tests

See https://reviews.llvm.org/D47106 for details.

Reviewed By: probinson

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

This commit drops that patch's changes to:

  llvm/test/CodeGen/NVPTX/f16x2-instructions.ll
  llvm/test/CodeGen/NVPTX/param-load-store.ll

For some reason, the dos line endings there prevent me from commiting
via the monorepo.  A follow-up commit (not via the monorepo) will
finish the patch.

llvm-svn: 336843

6 years agoFix setting of empty implicit-section-name attribute
Petr Pavlu [Wed, 11 Jul 2018 20:17:54 +0000 (20:17 +0000)]
Fix setting of empty implicit-section-name attribute

Code in `CodeGenModule::SetFunctionAttributes()` could set an empty
attribute `implicit-section-name` on a function that is affected by
`#pragma clang text="section"`. This is incorrect because the attribute
should contain a valid section name. If the function additionally also
used `__attribute__((section("section")))` then this could result in
emitting the function in a section with an empty name.

The patch fixes the issue by removing the problematic code that sets
empty `implicit-section-name` from
`CodeGenModule::SetFunctionAttributes()` because it is sufficient to set
this attribute only from a similar code in `setNonAliasAttributes()`
when the function is emitted.

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

llvm-svn: 336842

6 years agoRevert "[docs] As of binutils 2.21.51.0.2, ld.bfd supports plugins too, represent...
Teresa Johnson [Wed, 11 Jul 2018 20:08:32 +0000 (20:08 +0000)]
Revert "[docs] As of binutils 2.21.51.0.2, ld.bfd supports plugins too, represent this in docs"

This reverts commit r306102.

This change was made without any review, and has a couple of issues.
First, AFAIK we do not test the combination of the LLVM gold plugin with
ld.bfd. Second, the change removed documentation for how to build gold
and replaced it with instructions for building ld.bfd.

llvm-svn: 336841

6 years ago[NFC] typo
JF Bastien [Wed, 11 Jul 2018 19:51:40 +0000 (19:51 +0000)]
[NFC] typo

llvm-svn: 336840

6 years agoRemove ppc64 BE XFAILs now that gcov profiling works, after starting a clean
Zaara Syeda [Wed, 11 Jul 2018 19:17:43 +0000 (19:17 +0000)]
Remove ppc64 BE XFAILs now that gcov profiling works, after starting a clean
build this time.

llvm-svn: 336839

6 years agogold: Add ability to toggle function/data sections
Bill Wendling [Wed, 11 Jul 2018 19:13:26 +0000 (19:13 +0000)]
gold: Add ability to toggle function/data sections

Some programs (e.g. Linux) aren't able to handle function/data sections when
LTO is used. Thus they need a way to disable it. That can be done with these
plugin options:

    -plugin-opt=-function-sections=0
    -plugin-opt=-data-sections=0

llvm-svn: 336838

6 years ago[DebugInfo] Fix getPreviousSibling after r336823
Fangrui Song [Wed, 11 Jul 2018 19:09:37 +0000 (19:09 +0000)]
[DebugInfo] Fix getPreviousSibling after r336823

llvm-svn: 336837

6 years ago[NFC] Replace usage of QualType.getTypePtr()-> with operator->
Erich Keane [Wed, 11 Jul 2018 19:09:21 +0000 (19:09 +0000)]
[NFC] Replace usage of QualType.getTypePtr()-> with operator->

llvm-svn: 336836

6 years ago[analyzer] Track multiple raw pointer symbols in DanglingInternalBufferChecker.
Reka Kovacs [Wed, 11 Jul 2018 19:08:02 +0000 (19:08 +0000)]
[analyzer] Track multiple raw pointer symbols in DanglingInternalBufferChecker.

Previously, the checker only tracked one raw pointer symbol for each
container object. But member functions returning a pointer to the
object's inner buffer may be called on the object several times. These
pointer symbols are now collected in a set inside the program state map
and thus all of them is checked for use-after-free problems.

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

llvm-svn: 336835

6 years ago[InstCombine] Fold x & (-1 >> y) == x to x u<= (-1 >> y)
Roman Lebedev [Wed, 11 Jul 2018 19:05:04 +0000 (19:05 +0000)]
[InstCombine] Fold  x & (-1 >> y) == x  to  x u<= (-1 >> y)

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

This pattern will be produced by Implicit Integer Truncation sanitizer,
https://reviews.llvm.org/D48958
https://bugs.llvm.org/show_bug.cgi?id=21530
in unsigned case, therefore it is probably a good idea to improve it.

https://rise4fun.com/Alive/Rny
^ there are more opportunities for folds, i will follow up with them afterwards.

Caveat: this somehow exposes a missing opportunities
in `test/Transforms/InstCombine/icmp-logical.ll`
It seems, the problem is in `foldLogOpOfMaskedICmps()` in `InstCombineAndOrXor.cpp`.
But i'm not quite sure what is wrong, because it calls `getMaskedTypeForICmpPair()`,
which calls `decomposeBitTestICmp()` which should already work for these cases...
As @spatel notes in https://reviews.llvm.org/D49179#1158760,
that code is a rather complex mess, so we'll let it slide.

Reviewers: spatel, craig.topper

Reviewed By: spatel

Subscribers: yamauchi, majnemer, t.p.northover, llvm-commits

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

llvm-svn: 336834

6 years agoRevert r336830: [FileCheck] Don't permit overlapping CHECK-DAG
Joel E. Denny [Wed, 11 Jul 2018 19:03:00 +0000 (19:03 +0000)]
Revert r336830: [FileCheck] Don't permit overlapping CHECK-DAG

Companion patches are failing to commit, and this patch alone breaks
many tests.

llvm-svn: 336833

6 years agoQuick fix for some Windows bots
Paul Robinson [Wed, 11 Jul 2018 18:51:15 +0000 (18:51 +0000)]
Quick fix for some Windows bots

llvm-svn: 336832

6 years agoRevert "[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the...
Eric Liu [Wed, 11 Jul 2018 18:43:07 +0000 (18:43 +0000)]
Revert "[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name"

This reverts commit r336807. This breaks users of
ClangTool::mapVirtualFile. Will try to investigate a fix. See also the
discussion on https://reviews.llvm.org/D48903

llvm-svn: 336831

6 years ago[FileCheck] Don't permit overlapping CHECK-DAG
Joel E. Denny [Wed, 11 Jul 2018 18:42:58 +0000 (18:42 +0000)]
[FileCheck] Don't permit overlapping CHECK-DAG

That is, make CHECK-DAG skip matches that overlap the matches of any
preceding consecutive CHECK-DAG directives.  This change makes
CHECK-DAG more consistent with other directives, and there is evidence
it makes CHECK-DAG more intuitive and less error-prone.  See the RFC
discussion starting at:

  http://lists.llvm.org/pipermail/llvm-dev/2018-May/123010.html

Moreover, this behavior enables CHECK-DAG groups for unordered,
non-unique strings or patterns.  For example, it is useful for
verifying output or logs from a parallel program, such as the OpenMP
runtime.

This patch also implements the command-line option
-allow-deprecated-dag-overlap, which reverts CHECK-DAG to the old
overlapping behavior.  This option should not be used in new tests.
It is meant only for the existing tests that are broken by this change
and that need time to update.

See the following bugzilla issue for tracking of such tests:

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

Patches to add -allow-deprecated-dag-overlap to those tests will
follow immediately.

Reviewed By: probinson

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

llvm-svn: 336830

6 years agoRevert "[llvm-objdump] Add -demangle (-C) option"
Paul Semel [Wed, 11 Jul 2018 18:09:52 +0000 (18:09 +0000)]
Revert "[llvm-objdump] Add -demangle (-C) option"

This reverts commit 3a44ccd156e0edd2e89226f8ed63928e227900bb.
This reverts commit d5cfc836bb5552e20507d3612d13ff66ff9e36a0.

llvm-svn: 336829

6 years ago[X86] Remove patterns for inserting a load into a zero vector.
Craig Topper [Wed, 11 Jul 2018 18:09:04 +0000 (18:09 +0000)]
[X86] Remove patterns for inserting a load into a zero vector.

We can instead block the load folding isProfitableToFold. Then isel will emit a register->register move for the zeroing part and a separate load. The PostProcessISelDAG should be able to remove the register->register move.

This saves us patterns and fixes the fact that we only had unaligned load patterns. The test changes show places where we should have been using an aligned load.

llvm-svn: 336828

6 years ago[TargetTransformInfo] Add pow2 analysis for scalar constants
Simon Pilgrim [Wed, 11 Jul 2018 17:51:27 +0000 (17:51 +0000)]
[TargetTransformInfo] Add pow2 analysis for scalar constants

Add ConstantInt analysis to getOperandInfo so we get more realistic div/rem expansion costs comparable to the vector costs.

llvm-svn: 336827

6 years agoAlso search BitcodeFiles for exclude-lib symbols
Yi Kong [Wed, 11 Jul 2018 17:45:28 +0000 (17:45 +0000)]
Also search BitcodeFiles for exclude-lib symbols

Archives created with ThinLTO are bitcodes, they also need to be searched for excluded symbols.

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

llvm-svn: 336826

6 years agoAMDGPU/NFC: Use already available explicit kernarg
Konstantin Zhuravlyov [Wed, 11 Jul 2018 17:27:17 +0000 (17:27 +0000)]
AMDGPU/NFC: Use already available explicit kernarg
size instead of calculating it again when filling
out the metadata.

llvm-svn: 336825

6 years agoAllow specifying an exit code for the 'quit' command
Raphael Isemann [Wed, 11 Jul 2018 17:18:01 +0000 (17:18 +0000)]
Allow specifying an exit code for the 'quit' command

Summary:
This patch adds the possibility to specify an exit code when calling quit.
We accept any int, even though it depends on the user what happens if the int is
out of the range of what the operating system supports as exit codes.

Fixes rdar://problem/38452312

Reviewers: davide, jingham, clayborg

Reviewed By: jingham

Subscribers: clayborg, jingham, lldb-commits

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

llvm-svn: 336824

6 years ago[DebugInfo] Make children iterator bidirectional
Jonas Devlieghere [Wed, 11 Jul 2018 17:11:11 +0000 (17:11 +0000)]
[DebugInfo] Make children iterator bidirectional

Make the DIE iterator bidirectional so we can move to the previous
sibling of a DIE.

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

llvm-svn: 336823

6 years ago[InstSimplify] add/move tests for add folds; NFC
Sanjay Patel [Wed, 11 Jul 2018 16:52:18 +0000 (16:52 +0000)]
[InstSimplify] add/move tests for add folds; NFC

isKnownNegation() is currently proposed as part of D48754,
but it could be used to make InstSimplify stronger independently
of any abs() improvements.

llvm-svn: 336822

6 years agoFix llvm-objdump demangle test (added triple option)
Paul Semel [Wed, 11 Jul 2018 16:31:33 +0000 (16:31 +0000)]
Fix llvm-objdump demangle test (added triple option)

llvm-svn: 336821

6 years agoLink to the correct bug number about the Mac failure for instrprof-shared-gcov-flush...
Marco Castelluccio [Wed, 11 Jul 2018 15:44:15 +0000 (15:44 +0000)]
Link to the correct bug number about the Mac failure for instrprof-shared-gcov-flush.test.

llvm-svn: 336820

6 years agoRevert 336811, there are still some problems with the tests.
Zaara Syeda [Wed, 11 Jul 2018 15:37:19 +0000 (15:37 +0000)]
Revert 336811, there are still some problems with the tests.

llvm-svn: 336819

6 years ago[X86] Fix MayLoad/HasSideEffect flag for (V)MOVLPSrm instructions.
Andrea Di Biagio [Wed, 11 Jul 2018 15:27:50 +0000 (15:27 +0000)]
[X86] Fix MayLoad/HasSideEffect flag for (V)MOVLPSrm instructions.

Before revision 336728, the "mayLoad" flag for instruction (V)MOVLPSrm was
inferred directly from the "default" pattern associated with the instruction
definition.

r336728 removed special node X86Movlps, and all the patterns associated to it.
Now instruction (V)MOVLPSrm doesn't have a pattern associated to it, and the
'mayLoad/hasSideEffects' flags are left unset.

When the instruction info is emitted by tablegen, method
CodeGenDAGPatterns::InferInstructionFlags() sees that (V)MOVLPSrm doesn't have a
pattern, and flags are undefined. So, it conservatively sets the
"hasSideEffects" flag for it.

As a consequence, we were losing the 'mayLoad' flag, and we were gaining a
'hasSideEffect' flag in its place.
This patch fixes the issue (originally reported by Michael Holmen).

The mca tests show the differences in the instruction info flags.  Instructions
that were affected by this problem were: MOVLPSrm/VMOVLPSrm/VMOVLPSZ128rm.

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

llvm-svn: 336818

6 years ago[AST] Fix for structural equivalence tests in rL336776.
Balazs Keri [Wed, 11 Jul 2018 15:26:26 +0000 (15:26 +0000)]
[AST] Fix for structural equivalence tests in rL336776.

llvm-svn: 336817

6 years ago[llvm-objdump] Add -demangle (-C) option
Paul Semel [Wed, 11 Jul 2018 15:25:39 +0000 (15:25 +0000)]
[llvm-objdump] Add -demangle (-C) option

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

llvm-svn: 336816

6 years ago[ELF] - Simplify code. NFC.
George Rimar [Wed, 11 Jul 2018 15:23:33 +0000 (15:23 +0000)]
[ELF] - Simplify code. NFC.

This looks a bit simpler IMO.

llvm-svn: 336815

6 years ago[ELF] - Simplify. NFCI.
George Rimar [Wed, 11 Jul 2018 15:18:23 +0000 (15:18 +0000)]
[ELF] - Simplify. NFCI.

It does not look possible to end up with empty Sections
at this place. And this knowledge allows simplifying the code.

llvm-svn: 336814

6 years ago[ELF] - Add classof() member for ARMExidxSentinelSection.
George Rimar [Wed, 11 Jul 2018 15:11:13 +0000 (15:11 +0000)]
[ELF] - Add classof() member for ARMExidxSentinelSection.

Or code uses constructions like isa<ARMExidxSentinelSection>:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L1428
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L2944

That is confusing, because without ARMExidxSentinelSection::classof()
these lines are equal to isa<SyntheticSection> and the code does not really do
the same what it expected to. I found no good way to break it though, but it is not nice.

Patch adds ARMExidxSentinelSection::classof().

llvm-svn: 336813

6 years ago[SLPVectorizer] Add initial alternate opcode support for cast instructions. (REAPPLIED)
Simon Pilgrim [Wed, 11 Jul 2018 15:05:10 +0000 (15:05 +0000)]
[SLPVectorizer] Add initial alternate opcode support for cast instructions. (REAPPLIED)

We currently only support binary instructions in the alternate opcode shuffles.

This patch is an initial attempt at adding cast instructions as well, this raises several issues that we probably want to address as we continue to generalize the alternate mechanism:

1 - Duplication of cost determination - we should probably add scalar/vector costs helper functions and get BoUpSLP::getEntryCost to use them instead of determining costs directly.
2 - Support alternate instructions with the same opcode (e.g. casts with different src types) - alternate vectorization of calls with different IntrinsicIDs will require this.
3 - Allow alternates to be a different instruction type - mixing binary/cast/call etc.
4 - Allow passthrough of unsupported alternate instructions - related to PR30787/D28907 'copyable' elements.

Reapplied with fix to only accept 2 different casts if they come from the same source type.

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

llvm-svn: 336812

6 years agoRemove ppc64 BE XFAILs now that gcov profiling works.
Zaara Syeda [Wed, 11 Jul 2018 14:55:19 +0000 (14:55 +0000)]
Remove ppc64 BE XFAILs now that gcov profiling works.

llvm-svn: 336811

6 years ago[clangd] Uprank delcarations when "using q::name" is present in the main file
Kirill Bobyrev [Wed, 11 Jul 2018 14:49:49 +0000 (14:49 +0000)]
[clangd] Uprank delcarations when "using q::name" is present in the main file

Having `using qualified::name;` for some symbol is an important signal
for clangd code completion as the user is more likely to use such
symbol.  This patch helps to uprank the relevant symbols by saving
UsingShadowDecl in the new field of CodeCompletionResult and checking
whether the corresponding UsingShadowDecl is located in the main file
later in ClangD code completion routine. While the relative importance
of such signal is a subject to change in the future, this patch simply
bumps DeclProximity score to the value of 1.0 which should be enough for
now.

The patch was tested using

`$ ninja check-clang check-clang-tools`

No unexpected failures were noticed after running the relevant testsets.

Reviewers: sammccall, ioeric

Subscribers: MaskRay, jkorous, cfe-commits

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

llvm-svn: 336810

6 years ago[SLPVectorizer] Ensure alternate/passthrough doesn't vectorize sdiv with undef elts
Simon Pilgrim [Wed, 11 Jul 2018 14:34:43 +0000 (14:34 +0000)]
[SLPVectorizer] Ensure alternate/passthrough doesn't vectorize sdiv with undef elts

llvm-svn: 336809

6 years ago[SLPVectorizer] Add some additional alternate cast tests
Simon Pilgrim [Wed, 11 Jul 2018 14:29:13 +0000 (14:29 +0000)]
[SLPVectorizer] Add some additional alternate cast tests

Initial attempt at D49135 failed as we weren't correctly handling casts with different source types.

llvm-svn: 336808

6 years ago[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested...
Simon Marchi [Wed, 11 Jul 2018 14:08:17 +0000 (14:08 +0000)]
[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name

Summary:
InMemoryFileSystem::status behaves differently than
RealFileSystem::status.  The Name contained in the Status returned by
RealFileSystem::status will be the path as requested by the caller,
whereas InMemoryFileSystem::status returns the normalized path.

For example, when requested the status for "../src/first.h",
RealFileSystem returns a Status with "../src/first.h" as the Name.
InMemoryFileSystem returns "/absolute/path/to/src/first.h".

The reason for this change is that I want to make a unit test in the
clangd testsuite (where we use an InMemoryFileSystem) to reproduce a
bug I get with the clangd program (where a RealFileSystem is used).
This difference in behavior "hides" the bug in the unit test version.

In general, I guess it's good if InMemoryFileSystem works as much as
possible like RealFileSystem.

Doing so made the FileEntry::RealPathName value (assigned in
FileManager::getFile) wrong when using the InMemoryFileSystem.  That's
because it assumes that vfs::File::getName will always return the real
path.  I changed to to use FileSystem::getRealPath instead.

Subscribers: ilya-biryukov, ioeric, cfe-commits

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

llvm-svn: 336807

6 years agoRevert rL336804: [SLPVectorizer] Add initial alternate opcode support for cast instru...
Simon Pilgrim [Wed, 11 Jul 2018 14:08:16 +0000 (14:08 +0000)]
Revert rL336804: [SLPVectorizer] Add initial alternate opcode support for cast instructions.

Reverting due to buildbot failures

llvm-svn: 336806

6 years agoRecommit r334887: [SmallSet] Add SmallSetIterator.
Florian Hahn [Wed, 11 Jul 2018 13:39:59 +0000 (13:39 +0000)]
Recommit r334887: [SmallSet] Add SmallSetIterator.

This version now uses the subset of is_trivially_XXX provided by
GCC 4.8 and llvm/Support/type_traits.h

llvm-svn: 336805

6 years ago[SLPVectorizer] Add initial alternate opcode support for cast instructions.
Simon Pilgrim [Wed, 11 Jul 2018 13:34:09 +0000 (13:34 +0000)]
[SLPVectorizer] Add initial alternate opcode support for cast instructions.

We currently only support binary instructions in the alternate opcode shuffles.

This patch is an initial attempt at adding cast instructions as well, this raises several issues that we probably want to address as we continue to generalize the alternate mechanism:

1 - Duplication of cost determination - we should probably add scalar/vector costs helper functions and get BoUpSLP::getEntryCost to use them instead of determining costs directly.
2 - Support alternate instructions with the same opcode (e.g. casts with different src types) - alternate vectorization of calls with different IntrinsicIDs will require this.
3 - Allow alternates to be a different instruction type - mixing binary/cast/call etc.
4 - Allow passthrough of unsupported alternate instructions - related to PR30787/D28907 'copyable' elements.

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

llvm-svn: 336804

6 years ago[CodeGen] Ignore debug uses in MachineCopyPropagation
Krzysztof Parzyszek [Wed, 11 Jul 2018 13:30:27 +0000 (13:30 +0000)]
[CodeGen] Ignore debug uses in MachineCopyPropagation

Debug uses should not count as real uses, since the presence of debug
information could affect the generated code.

llvm-svn: 336803

6 years ago[mips] Update the P5600 scheduler model not to use instruction itineraries.
Simon Atanasyan [Wed, 11 Jul 2018 13:21:10 +0000 (13:21 +0000)]
[mips] Update the P5600 scheduler model not to use instruction itineraries.

This mostly brings the P5600 scheduler model to a mostly complete
status. There are a number of instructions which trigger the
`error:'MipsP5600Model' lacks information for` error. These are certain
codegen only instructions relating to MIPS64 which can be addressed by
using the correct predicates for them. That will be done in a full-up
patch.

Patch by Simon Dardis.

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

llvm-svn: 336802

6 years ago[clangd] Ignore sema code complete callback with recovery context.
Eric Liu [Wed, 11 Jul 2018 13:15:31 +0000 (13:15 +0000)]
[clangd] Ignore sema code complete callback with recovery context.

Summary:
Sema code complete in the recovery mode is generally useless. For many
cases, sema first completes in recovery context and then recovers to more useful
context, in which it's favorable to ignore results from recovery (as results are
often bad e.g. all builtin symbols and top-level symbols). There is also case
where only sema would fail to recover e.g. completions in excluded #if block.
Sema would try to give results, but the results are often useless (see the updated
excluded #if block test).

Reviewers: sammccall, ilya-biryukov

Subscribers: MaskRay, jkorous, cfe-commits

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

llvm-svn: 336801

6 years ago[NFC][InstCombine] Converts isLegalNarrowLoad into isLegalNarrowLdSt
Diogo N. Sampaio [Wed, 11 Jul 2018 12:59:42 +0000 (12:59 +0000)]
[NFC][InstCombine] Converts isLegalNarrowLoad into isLegalNarrowLdSt

Reuse this function as to test correctness and profitability of
reducing width of either load or store operations.

Reviewsers: samparker

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

llvm-svn: 336800

6 years ago[ELF] Update addends in non-allocatable sections for REL targets when creating a...
Igor Kudrin [Wed, 11 Jul 2018 12:52:04 +0000 (12:52 +0000)]
[ELF] Update addends in non-allocatable sections for REL targets when creating a relocatable output.

This fixes PR37735.

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

llvm-svn: 336799

6 years ago[mips] Add '-mvirt', '-mno-virt', '-mginv', '-mno-ginv' options
Vladimir Stefanovic [Wed, 11 Jul 2018 12:45:25 +0000 (12:45 +0000)]
[mips] Add '-mvirt', '-mno-virt', '-mginv', '-mno-ginv' options

'-mvirt'/'-mno-virt' enables/disables Virtualization ASE.
'-mginv'/'-mno-ginv' enables/disables GINV (Global Invalidate) ASE.

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

llvm-svn: 336798

6 years ago[llvm-mca] Use a different character to flag instructions with side-effects in the...
Andrea Di Biagio [Wed, 11 Jul 2018 12:44:44 +0000 (12:44 +0000)]
[llvm-mca] Use a different character to flag instructions with side-effects in the Instruction Info View. NFC

This makes easier to identify changes in the instruction info flags.  It also
helps spotting potential regressions similar to the one recently introduced at
r336728.

Using the same character to mark MayLoad/MayStore/HasSideEffects is problematic
for llvm-lit. When pattern matching substrings, llvm-lit consumes tabs and
spaces. A change in position of the flag marker may not trigger a test failure.

This patch only changes the character used for flag `hasSideEffects`. The reason
why I didn't touch other flags is because I want to avoid spamming the mailing
because of the massive diff due to the numerous tests affected by this change.

In future, each instruction flag should be associated with a different character
in the Instruction Info View.

llvm-svn: 336797

6 years ago[NFC][InstCombine] Tests for x & (-1 >> y) == x -> x u<= (-1 >> y) fold
Roman Lebedev [Wed, 11 Jul 2018 12:37:12 +0000 (12:37 +0000)]
[NFC][InstCombine] Tests for  x & (-1 >> y) == x  ->  x u<= (-1 >> y)  fold

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

This pattern will be produced by Implicit Integer Truncation sanitizer,
https://reviews.llvm.org/D48958
https://bugs.llvm.org/show_bug.cgi?id=21530
in unsigned case, therefore it is probably a good idea to improve it.

https://rise4fun.com/Alive/Rny

llvm-svn: 336796

6 years ago[ARM] ParallelDSP: multiple reduction stmts in loop
Sjoerd Meijer [Wed, 11 Jul 2018 12:36:25 +0000 (12:36 +0000)]
[ARM] ParallelDSP: multiple reduction stmts in loop

This fixes an issue that we were not properly supporting multiple reduction
stmts in a loop, and not generating SMLADs for these cases. The alias analysis
checks were done too early, making it too conservative.

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

llvm-svn: 336795

6 years ago[ELF] - Report proper error message about mixing bitcode files.
George Rimar [Wed, 11 Jul 2018 12:32:00 +0000 (12:32 +0000)]
[ELF] - Report proper error message about mixing bitcode files.

If we have 2 bitcode inputs for different targets, LLD would
print "<internal>" instead of the name of one of the files.

The patch adds a test and fixes this issue.

llvm-svn: 336794

6 years agoUse debug-prefix-map for AT_NAME
Jonas Devlieghere [Wed, 11 Jul 2018 12:30:35 +0000 (12:30 +0000)]
Use debug-prefix-map for AT_NAME

AT_NAME was being emitted before the directory paths were remapped. This
ensures that all paths are remapped before anything is emitted.

An additional test case has been added.

Note that this only works if the replacement string is an absolute path.
If not, then AT_decl_file believes the new path is a relative path, and
joins that path with the compilation directory. I do not know of a good
way to resolve this.

Patch by: Siddhartha Bagaria (starsid)

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

llvm-svn: 336793

6 years agoRecommit r336653: [VPlan] Add VPlanTestBase.h with helper
Florian Hahn [Wed, 11 Jul 2018 11:54:30 +0000 (11:54 +0000)]
Recommit r336653: [VPlan] Add VPlanTestBase.h with helper

The original version caused a memsan failure.

llvm-svn: 336792

6 years agoRemove dead code.
Rui Ueyama [Wed, 11 Jul 2018 11:52:13 +0000 (11:52 +0000)]
Remove dead code.

llvm-svn: 336791

6 years agoParallelize GdbIndexSection's symbol table creation.
Rui Ueyama [Wed, 11 Jul 2018 11:37:10 +0000 (11:37 +0000)]
Parallelize GdbIndexSection's symbol table creation.

Since .gdb_index sections contain all known symbols, they can be very large.
One of my executables has a .gdb_index section of 1350 GiB. Uniquifying
symbols by name takes 3.77 seconds on my machine. This patch parallelize it.

  Time to call createSymbols() with 8.4 million unique symbols:

  Without this patch: 3773 ms
  Parallelism = 1:    4374 ms
  Parallelism = 2:    2628 ms
  Parallelism = 16:    837 ms

As you can see above, this algorithm is a bit more inefficient
than the non-parallelized version, but even with dual-core, it is
faster than that, so I think it is overall a win.

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

llvm-svn: 336790

6 years ago[AArch64][SVE] Asm: Support for COMPACT instruction.
Sander de Smalen [Wed, 11 Jul 2018 11:22:26 +0000 (11:22 +0000)]
[AArch64][SVE] Asm: Support for COMPACT instruction.

The compact instruction shuffles active elements of vector
into lowest numbered elements and sets remaining elements
to zero.

e.g.
  compact z0.s, p0, z1.s

llvm-svn: 336789

6 years agoRemove a workaround for an old GCC bug.
Rui Ueyama [Wed, 11 Jul 2018 10:52:00 +0000 (10:52 +0000)]
Remove a workaround for an old GCC bug.

This workaround is for GCC 5.4.1. Without this workaround, lld will
produce larger .gdb_index sections for object files compiled with the
buggy version of the compiler.

Since it is not for correctness, and it affects only debug builds (since
you are generating .gdb_index sections), perhaps the hack shouldn't have been
added in the first place. At least, I think it is time to remove this hack.

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

llvm-svn: 336788

6 years agoFix check-prefix vs check-prefixes typo in updated test
Simon Pilgrim [Wed, 11 Jul 2018 10:42:51 +0000 (10:42 +0000)]
Fix check-prefix vs check-prefixes typo in updated test

llvm-svn: 336787

6 years ago[AArch64] Regenerate SDIV tests
Simon Pilgrim [Wed, 11 Jul 2018 10:39:50 +0000 (10:39 +0000)]
[AArch64] Regenerate SDIV tests

Will make codegen diffs much easier to grok in a future patch

llvm-svn: 336786

6 years ago[clangd] Upgrade logging facilities with levels and formatv.
Sam McCall [Wed, 11 Jul 2018 10:35:11 +0000 (10:35 +0000)]
[clangd] Upgrade logging facilities with levels and formatv.

Summary:
log() is split into four functions:
 - elog()/log()/vlog() have different severity levels, allowing filtering
 - dlog() is a lazy macro which uses LLVM_DEBUG - it logs to the logger, but
   conditionally based on -debug-only flag and is omitted in release builds

All logging functions use formatv-style format strings now, e.g:
  log("Could not resolve URI {0}: {1}", URI, Result.takeError());

Existing log sites have been split between elog/log/vlog by best guess.

This includes a workaround for passing Error to formatv that can be
simplified when D49170 or similar lands.

Subscribers: ilya-biryukov, javed.absar, ioeric, MaskRay, jkorous, cfe-commits

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

llvm-svn: 336785

6 years ago[NFC][InstCombine] icmp-logical.ll: add a few more tests.
Roman Lebedev [Wed, 11 Jul 2018 10:31:12 +0000 (10:31 +0000)]
[NFC][InstCombine] icmp-logical.ll: add a few more tests.

The @masked_and_notA_slightly_optimized and @masked_or_A
will break when PR38123 will be fixed:
https://rise4fun.com/Alive/Rny
Clearly, they aren't optimized currently.

https://rise4fun.com/Alive/ERo

llvm-svn: 336784

6 years ago[AArch64][SVE] Asm: Support for LAST(A|B) and CLAST(A|B) instructions.
Sander de Smalen [Wed, 11 Jul 2018 10:08:00 +0000 (10:08 +0000)]
[AArch64][SVE] Asm: Support for LAST(A|B) and CLAST(A|B) instructions.

The LASTB and LASTA instructions extract the last active element,
or element after the last active, from the source vector.

The added variants are:

  Scalar:
  last(a|b)  w0, p0, z0.b
  last(a|b)  w0, p0, z0.h
  last(a|b)  w0, p0, z0.s
  last(a|b)  x0, p0, z0.d

  SIMD & FP Scalar:
  last(a|b)  b0, p0, z0.b
  last(a|b)  h0, p0, z0.h
  last(a|b)  s0, p0, z0.s
  last(a|b)  d0, p0, z0.d

The CLASTB and CLASTA conditionally extract the last or element after
the last active element from the source vector.

The added variants are:

  Scalar:
  clast(a|b)  w0, p0, w0, z0.b
  clast(a|b)  w0, p0, w0, z0.h
  clast(a|b)  w0, p0, w0, z0.s
  clast(a|b)  x0, p0, x0, z0.d

  SIMD & FP Scalar:
  clast(a|b)  b0, p0, b0, z0.b
  clast(a|b)  h0, p0, h0, z0.h
  clast(a|b)  s0, p0, s0, z0.s
  clast(a|b)  d0, p0, d0, z0.d

  Vector:
  clast(a|b)  z0.b, p0, z0.b, z1.b
  clast(a|b)  z0.h, p0, z0.h, z1.h
  clast(a|b)  z0.s, p0, z0.s, z1.s
  clast(a|b)  z0.d, p0, z0.d, z1.d

Please refer to the architecture specification for more details on
the semantics of the added instructions.

llvm-svn: 336783

6 years ago[llvm-readobj] Add -hex-dump (-x) option
Paul Semel [Wed, 11 Jul 2018 10:00:29 +0000 (10:00 +0000)]
[llvm-readobj] Add -hex-dump (-x) option

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

llvm-svn: 336782

6 years ago[NFC][InstCombine] Fix extra space padding in icmp-mul-zext.ll test
Roman Lebedev [Wed, 11 Jul 2018 09:57:53 +0000 (09:57 +0000)]
[NFC][InstCombine] Fix extra space padding in icmp-mul-zext.ll test

update_test_checks will drop it anyway, creating noise..

llvm-svn: 336781

6 years ago[NFC][InstCombine] Add variable names and regenerate icmp-logical.ll test.
Roman Lebedev [Wed, 11 Jul 2018 09:57:46 +0000 (09:57 +0000)]
[NFC][InstCombine] Add variable names and regenerate icmp-logical.ll test.

llvm-svn: 336780

6 years ago[SelectionDAG] Add constant buildvector support to isKnownNeverZero
Simon Pilgrim [Wed, 11 Jul 2018 09:56:41 +0000 (09:56 +0000)]
[SelectionDAG] Add constant buildvector support to isKnownNeverZero

This allows us to use SelectionDAG::isKnownNeverZero in DAGCombiner::visitREM (visitSDIVLike/visitUDIVLike handle the checking for constants).

llvm-svn: 336779

6 years ago[llvm-mca] Add tests for partial register writes.
Andrea Di Biagio [Wed, 11 Jul 2018 09:50:00 +0000 (09:50 +0000)]
[llvm-mca] Add tests for partial register writes.

llvm-mca doesn't know that on modern AMD processors, portions of a general
purpose register are not treated independently. So, a partial register write has
a false dependency on the super-register.

The issue with partial register writes will be addressed by a follow-up patch.

llvm-svn: 336778

6 years ago[mips] Remove dead code. NFC
Simon Atanasyan [Wed, 11 Jul 2018 09:41:28 +0000 (09:41 +0000)]
[mips] Remove dead code. NFC

llvm-svn: 336777

6 years ago[AST] Structural equivalence of methods
Balazs Keri [Wed, 11 Jul 2018 09:37:24 +0000 (09:37 +0000)]
[AST] Structural equivalence of methods

Summary:
Added structural equivalence check for C++ methods.
Improved structural equivalence tests.
Added related ASTImporter tests.

Reviewers: a.sidorin, szepet, xazax.hun, martong, a_sidorin

Reviewed By: martong, a_sidorin

Subscribers: a_sidorin, rnkovacs, cfe-commits

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

llvm-svn: 336776

6 years agoFix reading 32 bit gcov tag values on little-endian machines
Marco Castelluccio [Wed, 11 Jul 2018 09:30:25 +0000 (09:30 +0000)]
Fix reading 32 bit gcov tag values on little-endian machines

Summary:
The write buffer contains signed chars, which means the shift operations caused values such as the arc tag value (0x01a10000) to be read incorrectly (0xffa10000).

This fixes a regression from https://reviews.llvm.org/D49132.

Reviewers: uweigand, davidxl

Reviewed By: uweigand

Subscribers: llvm-commits, #sanitizers

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

llvm-svn: 336775

6 years ago[DAGCombiner] Support non-uniform X%C -> X-(X/C)*C folds
Simon Pilgrim [Wed, 11 Jul 2018 09:22:42 +0000 (09:22 +0000)]
[DAGCombiner] Support non-uniform X%C -> X-(X/C)*C folds

First stage in PR38057 - support non-uniform constant vectors in the combine to reuse the division-by-constant logic.

We can definitely do better for srem pow2 remainders (and avoid that extra multiply....) but this at least helps keep everything on the vector unit.

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

llvm-svn: 336774

6 years ago[DAGCombiner] Add (urem X, -1) -> select(X == -1, 0, x) fold
Simon Pilgrim [Wed, 11 Jul 2018 09:14:37 +0000 (09:14 +0000)]
[DAGCombiner] Add (urem X, -1) -> select(X == -1, 0, x) fold

llvm-svn: 336773

6 years ago[TableGen] Add missing std::moves to fix build failure.
Simon Tatham [Wed, 11 Jul 2018 08:57:56 +0000 (08:57 +0000)]
[TableGen] Add missing std::moves to fix build failure.

gcc 4.7 seems to disagree with gcc 5.3 about whether you need to say
'return std::move(thing)' instead of just 'return thing'. All the
json::Arrays and json::Objects that I was implicitly turning into
json::Values by returning them from functions now have explicit
std::move wrappers, so hopefully 4.7 will be happy now.

llvm-svn: 336772

6 years ago[TableGen] Add a general-purpose JSON backend.
Simon Tatham [Wed, 11 Jul 2018 08:40:19 +0000 (08:40 +0000)]
[TableGen] Add a general-purpose JSON backend.

The aim of this backend is to output everything TableGen knows about
the record set, similarly to the default -print-records backend. But
where -print-records produces output in TableGen's input syntax
(convenient for humans to read), this backend produces it as
structured JSON data, which is convenient for loading into standard
scripting languages such as Python, in order to extract information
from the data set in an automated way.

The output data contains a JSON representation of the variable
definitions in output 'def' records, and a few pieces of metadata such
as which of those definitions are tagged with the 'field' prefix and
which defs are derived from which classes. It doesn't dump out
absolutely every piece of knowledge it _could_ produce, such as type
information and complicated arithmetic operator nodes in abstract
superclasses; the main aim is to allow consumers of this JSON dump to
essentially act as new backends, and backends don't generally need to
depend on that kind of data.

The new backend is implemented as an EmitJSON() function similar to
all of llvm-tblgen's other EmitFoo functions, except that it lives in
lib/TableGen instead of utils/TableGen on the basis that I'm expecting
to add it to clang-tblgen too in a future patch.

To test it, I've written a Python script that loads the JSON output
and tests properties of it based on comments in the .td source - more
or less like FileCheck, except that the CHECK: lines have Python
expressions after them instead of textual pattern matches.

Reviewers: nhaehnle

Reviewed By: nhaehnle

Subscribers: arichardson, labath, mgorny, llvm-commits

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

llvm-svn: 336771

6 years ago[WebAssembly] Only call llvm::value::dump() in debug build.
Eric Liu [Wed, 11 Jul 2018 08:16:47 +0000 (08:16 +0000)]
[WebAssembly] Only call llvm::value::dump() in debug build.

This fixes compile error in r336759. llvm::value::dump is not available
in released build.

llvm-svn: 336770

6 years ago[XRay] basic mode PID and TID always fetch
Dean Michael Berris [Wed, 11 Jul 2018 07:14:27 +0000 (07:14 +0000)]
[XRay] basic mode PID and TID always fetch

Summary: XRayRecords now includes a PID field. Basic handlers fetch pid and tid each time they are called instead of caching the value. Added a testcase that calls fork and checks if the child TID is different from the parent TID to verify that the processes' TID are different in the trace.

Reviewers: dberris, Maknee

Reviewed By: dberris, Maknee

Subscribers: kpw, llvm-commits, #sanitizers

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

llvm-svn: 336769

6 years ago[X86] The TEST instruction is eliminated when BSF/TZCNT is used
Craig Topper [Wed, 11 Jul 2018 06:57:42 +0000 (06:57 +0000)]
[X86] The TEST instruction is eliminated when BSF/TZCNT is used

Summary:
These changes cover the PR#31399.
Now the ffs(x) function is lowered to (x != 0) ? llvm.cttz(x) + 1 : 0
and it corresponds to the following llvm code:
  %cnt = tail call i32 @llvm.cttz.i32(i32 %v, i1 true)
  %tobool = icmp eq i32 %v, 0
  %.op = add nuw nsw i32 %cnt, 1
  %add = select i1 %tobool, i32 0, i32 %.op
and x86 asm code:
  bsfl     %edi, %ecx
  addl     $1, %ecx
  testl    %edi, %edi
  movl     $0, %eax
  cmovnel  %ecx, %eax
In this case the 'test' instruction can't be eliminated because
the 'add' instruction modifies the EFLAGS, namely, ZF flag
that is set by the 'bsf' instruction when 'x' is zero.

We now produce the following code:
  bsfl     %edi, %ecx
  movl     $-1, %eax
  cmovnel  %ecx, %eax
  addl     $1, %eax

Patch by Ivan Kulagin

Reviewers: davide, craig.topper, spatel, RKSimon

Reviewed By: craig.topper

Subscribers: llvm-commits

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

llvm-svn: 336768

6 years agoRevert r336760: "[ORC] Add unit tests for the reexports utility that were..."
Lang Hames [Wed, 11 Jul 2018 06:46:17 +0000 (06:46 +0000)]
Revert r336760: "[ORC] Add unit tests for the reexports utility that were..."

This patch broke a few buildbots. I will investigate and re-apply when I have
a fix.

llvm-svn: 336767

6 years ago[X86] Remove some composite MOVSS/MOVSD isel patterns.
Craig Topper [Wed, 11 Jul 2018 04:51:40 +0000 (04:51 +0000)]
[X86] Remove some composite MOVSS/MOVSD isel patterns.

These patterns looked for a MOVSS/SD followed by a scalar_to_vector. Or a scalar_to_vector followed by a load.

In both cases we emitted a MOVSS/SD for the MOVSS/SD part, a REG_CLASS for the scalar_to_vector, and a MOVSS/SD for the load.

But we have patterns that do each of those 3 things individually so there's no reason to build large patterns.

Most of the test changes are just reorderings. The one test that had a meaningful change is pr30430.ll and it appears to be a regression. But its doing -O0 so I think it missed a lot of opportunities and was just getting lucky before.

llvm-svn: 336762

6 years ago[ORC] Remove a shadowing definition.
Lang Hames [Wed, 11 Jul 2018 04:39:12 +0000 (04:39 +0000)]
[ORC] Remove a shadowing definition.

There is already a VSO member V in the CoreAPIsStandardTest test fixture.

llvm-svn: 336761

6 years ago[ORC] Add unit tests for the reexports utility that were left out of r336741,
Lang Hames [Wed, 11 Jul 2018 04:39:11 +0000 (04:39 +0000)]
[ORC] Add unit tests for the reexports utility that were left out of r336741,
and fix a bug that these exposed.

llvm-svn: 336760

6 years ago[WebAssembly] Add pass to infer prototypes for prototype-less functions
Sam Clegg [Wed, 11 Jul 2018 04:29:36 +0000 (04:29 +0000)]
[WebAssembly] Add pass to infer prototypes for prototype-less functions

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

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

llvm-svn: 336759

6 years ago[ORC] Drop constexpr in unit test to appease a bot.
Lang Hames [Wed, 11 Jul 2018 03:58:47 +0000 (03:58 +0000)]
[ORC] Drop constexpr in unit test to appease a bot.

llvm-svn: 336758

6 years ago[ORC] Use a gtest fixture to remove a bunch of boilerplate in CoreAPIsTest.cpp.
Lang Hames [Wed, 11 Jul 2018 03:09:36 +0000 (03:09 +0000)]
[ORC] Use a gtest fixture to remove a bunch of boilerplate in CoreAPIsTest.cpp.

llvm-svn: 336757

6 years ago[analyzer] Fix bots by changing the analyzer-config tests.
George Karpenkov [Wed, 11 Jul 2018 02:01:18 +0000 (02:01 +0000)]
[analyzer] Fix bots by changing the analyzer-config tests.

To be investigated.

llvm-svn: 336756

6 years ago[analyzer] Partial revert of https://reviews.llvm.org/D49050
George Karpenkov [Wed, 11 Jul 2018 01:58:08 +0000 (01:58 +0000)]
[analyzer] Partial revert of https://reviews.llvm.org/D49050

llvm-svn: 336755

6 years ago[Power9] Add remaining __flaot128 builtin support for FMA round to odd
Stefan Pintilie [Wed, 11 Jul 2018 01:42:22 +0000 (01:42 +0000)]
[Power9] Add remaining __flaot128 builtin support for FMA round to odd

Implement this as it is done on GCC:

__float128 a, b, c, d;
a = __builtin_fmaf128_round_to_odd (b, c, d);         // generates xsmaddqpo
a = __builtin_fmaf128_round_to_odd (b, c, -d);        // generates xsmsubqpo
a = - __builtin_fmaf128_round_to_odd (b, c, d);       // generates xsnmaddqpo
a = - __builtin_fmaf128_round_to_odd (b, c, -d);      // generates xsnmsubpqp

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

llvm-svn: 336754

6 years ago[analyzer] Pass through all arguments from the registerChecker() to the checker const...
George Karpenkov [Wed, 11 Jul 2018 01:23:27 +0000 (01:23 +0000)]
[analyzer] Pass through all arguments from the registerChecker() to the checker constructor

A lot of checkers could be cleaned up in a similar way

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

llvm-svn: 336753

6 years ago [test cases] add test cases for find more abs pattern
Chen Zheng [Wed, 11 Jul 2018 01:07:21 +0000 (01:07 +0000)]
  [test cases] add test cases for find more abs pattern

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

llvm-svn: 336752

6 years ago[TableGen] Fix some bad formatting. NFC
Craig Topper [Wed, 11 Jul 2018 01:01:55 +0000 (01:01 +0000)]
[TableGen] Fix some bad formatting. NFC

llvm-svn: 336751

6 years ago[SemaCXX] Remove comment from coroutines test, NFC
Brian Gesiak [Wed, 11 Jul 2018 01:00:53 +0000 (01:00 +0000)]
[SemaCXX] Remove comment from coroutines test, NFC

Summary:
The file name was accidentally included when the test file was added.

Test Plan: check-clang

llvm-svn: 336750

6 years agoAdd libcxxabi option back for sanitizer use.
Stephen Hines [Wed, 11 Jul 2018 00:50:03 +0000 (00:50 +0000)]
Add libcxxabi option back for sanitizer use.

Summary:
A prior refactoring accidentally dropped the case for using libc++abi as
the out-of-tree C++ runtime library for sanitizers. This patch restores
that functionality, which is used by Android, which can't depend on the
full libc++ for these libraries.

Reviewers: phosek, EricWF

Reviewed By: phosek

Subscribers: meikeb, kongyi, chh, mgorny, delcypher, llvm-commits, #sanitizers, pirama

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

llvm-svn: 336749

6 years agoRemove qualtype qualifier in coroutine error to prevent assert in debug
Brian Gesiak [Wed, 11 Jul 2018 00:45:48 +0000 (00:45 +0000)]
Remove qualtype qualifier in coroutine error to prevent assert in debug

Summary:
A forward-declared coroutine_traits should trip an error; we need
a complete type.

Unfortunately, in debug mode only, we trip an assert when attempting
to provide the fully qualified type for the error message.
If you try to compile a program with a forward-declared
coroutine_traits in debug mode, clang will crash.

I've included a test for the behavior and removed the q modifier
on the error message. This prevents the crash in debug mode and
does not change the behavior for the error message on a
forward-declaration of a coroutine_traits type.

Test Plan:
I've included a test for the forward-declaration.

Patch by Tanoy Sinha!

Reviewers: modocache, GorNishanov

Reviewed By: modocache

Subscribers: cfe-commits

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

llvm-svn: 336748

6 years ago[docs] List correct default for -ftemplate-depth; also add missing
Richard Smith [Wed, 11 Jul 2018 00:34:54 +0000 (00:34 +0000)]
[docs] List correct default for -ftemplate-depth; also add missing
documentation for -fconstexpr-steps.

llvm-svn: 336747

6 years agoPR38095: Allow constant-folding of loads through bitcasted pointers if
Richard Smith [Wed, 11 Jul 2018 00:29:05 +0000 (00:29 +0000)]
PR38095: Allow constant-folding of loads through bitcasted pointers if
the bitcast only changed cvr-qualifications within the pointer type.

llvm-svn: 336746

6 years agoDR330: look through array types when forming the cv-decomposition of a type.
Richard Smith [Wed, 11 Jul 2018 00:19:19 +0000 (00:19 +0000)]
DR330: look through array types when forming the cv-decomposition of a type.

This allows more qualification conversions, eg. conversion from
   'int *(*)[]' -> 'const int *const (*)[]'
is now permitted, along with all the consequences of that: more types
are similar, more cases are permitted by const_cast, and conversely,
fewer "casting away constness" cases are permitted by reinterpret_cast.

llvm-svn: 336745

6 years ago[LangRef] Clarify alloca of zero bytes.
Eli Friedman [Wed, 11 Jul 2018 00:02:01 +0000 (00:02 +0000)]
[LangRef] Clarify alloca of zero bytes.

Let's be conservative here; it matches what we actually implemented, and
it should be rare in practice anyway.

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

llvm-svn: 336744

6 years agoRefactor GdbIndexSection. NFC.
Rui Ueyama [Tue, 10 Jul 2018 23:48:27 +0000 (23:48 +0000)]
Refactor GdbIndexSection. NFC.

This patch merges createGdbIndex function and GdbIndexSection's
constructor into a single static member function of the class.

This patch also change how we keep CU vectors. Previously, CuVector
and GdbSymbols were parallel arrays, but there's no reason to choose that
design. Now, CuVector is a member of GdbSymbol class.

A lot of members are removed from GdbIndexSection. Previously, it has
members that need to be kept in sync over several phases. I belive the new
design is less error-prone, and the new code is much easier to read
than before.

llvm-svn: 336743

6 years ago[ARM] Treat cmn immediates as legal in isLegalICmpImmediate.
Eli Friedman [Tue, 10 Jul 2018 23:44:37 +0000 (23:44 +0000)]
[ARM] Treat cmn immediates as legal in isLegalICmpImmediate.

The original code attempted to do this, but the std::abs() call didn't
actually do anything due to implicit type conversions.  Fix the type
conversions, and perform the correct check for negative immediates.

This probably has very little practical impact, but it's worth fixing
just to avoid confusion in the future, I think.

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

llvm-svn: 336742

6 years ago[ORC] Generalize alias materialization to support re-exports (i.e. aliasing of
Lang Hames [Tue, 10 Jul 2018 23:34:56 +0000 (23:34 +0000)]
[ORC] Generalize alias materialization to support re-exports (i.e. aliasing of
symbols in another VSO).

Also fixes a bug where chained aliases within a single VSO would deadlock on
materialization.

llvm-svn: 336741