platform/upstream/llvm.git
7 years ago[SCCP] Add a test for switches on undef.
Davide Italiano [Wed, 23 Nov 2016 01:42:39 +0000 (01:42 +0000)]
[SCCP] Add a test for switches on undef.

Without this test, you can just remove the code fixing the
switch to the first constant in ResolvedUndefs in and everything
pass. This test, instead, fails with an assertion if the code
is removed. Found while refactoring SCCP to integrate undef in
the solver.

llvm-svn: 287731

7 years agoRevert r287727: Use SHA1::hash and MD5::hash functions.
Rui Ueyama [Wed, 23 Nov 2016 01:19:13 +0000 (01:19 +0000)]
Revert r287727: Use SHA1::hash and MD5::hash functions.

It broke buildbots.

llvm-svn: 287730

7 years ago[libcxx] Fix max_size() across all containers
Eric Fiselier [Wed, 23 Nov 2016 01:18:56 +0000 (01:18 +0000)]
[libcxx] Fix max_size() across all containers

Summary: The `max_size()` method of containers should respect both the allocator's reported `max_size` and the range of the `difference_type`. This patch makes all containers choose the smallest of those two values.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 287729

7 years agoAdd <variant> tests but disable them for libc++
Eric Fiselier [Wed, 23 Nov 2016 01:02:51 +0000 (01:02 +0000)]
Add <variant> tests but disable them for libc++

llvm-svn: 287728

7 years agoUse SHA1::hash and MD5::hash functions.
Rui Ueyama [Wed, 23 Nov 2016 00:52:28 +0000 (00:52 +0000)]
Use SHA1::hash and MD5::hash functions.

llvm-svn: 287727

7 years agoAdd convenient functions to compute hashes of byte vectors.
Rui Ueyama [Wed, 23 Nov 2016 00:46:09 +0000 (00:46 +0000)]
Add convenient functions to compute hashes of byte vectors.

In many sitautions, you just want to compute a hash for one chunk
of data. This patch adds convenient functions for that purpose.

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

llvm-svn: 287726

7 years ago[ADT] Fix some Clang-tidy modernize-use-default and Include What You Use warnings...
Eugene Zelenko [Wed, 23 Nov 2016 00:30:24 +0000 (00:30 +0000)]
[ADT] Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes.

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

llvm-svn: 287725

7 years agoMake STL range adapter naming consistent.
Zachary Turner [Wed, 23 Nov 2016 00:27:23 +0000 (00:27 +0000)]
Make STL range adapter naming consistent.

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

llvm-svn: 287724

7 years agoDump not only type records but symbol records.
Rui Ueyama [Tue, 22 Nov 2016 23:51:34 +0000 (23:51 +0000)]
Dump not only type records but symbol records.

llvm-svn: 287723

7 years agoAdd some searching functions for ArrayRef<T>.
Zachary Turner [Tue, 22 Nov 2016 23:22:19 +0000 (23:22 +0000)]
Add some searching functions for ArrayRef<T>.

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

llvm-svn: 287722

7 years ago[StructurizeCFG] Refactor OrderNodes.
Justin Lebar [Tue, 22 Nov 2016 23:14:11 +0000 (23:14 +0000)]
[StructurizeCFG] Refactor OrderNodes.

Summary:
No need to copy the RPOT vector before using it.  Switch from std::map
to SmallDenseMap.  Get rid of an unused variable (TempVisited).  Get rid
of a typedef, RNVector, which is now used only once.

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

llvm-svn: 287721

7 years ago[StructurizeCFG] Add whitespace in getAnalysisUsage.
Justin Lebar [Tue, 22 Nov 2016 23:14:07 +0000 (23:14 +0000)]
[StructurizeCFG] Add whitespace in getAnalysisUsage.

Summary:
"addRequired" and "addPreserved" look very similar when squished up next
to each other -- without the newline this code looked to me like it was
addRequired'ing DominatorTreeWrapperPass twice.

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

llvm-svn: 287720

7 years ago[StructurizeCFG] Remove unnecessary "using" in class.
Justin Lebar [Tue, 22 Nov 2016 23:13:49 +0000 (23:13 +0000)]
[StructurizeCFG] Remove unnecessary "using" in class.

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

llvm-svn: 287719

7 years ago[StructurizeCFG] Merge the two constructors into one.
Justin Lebar [Tue, 22 Nov 2016 23:13:44 +0000 (23:13 +0000)]
[StructurizeCFG] Merge the two constructors into one.

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

llvm-svn: 287718

7 years ago[StructurizeCFG] Use a for-each loop instead of iterators in runOnRegion.
Justin Lebar [Tue, 22 Nov 2016 23:13:37 +0000 (23:13 +0000)]
[StructurizeCFG] Use a for-each loop instead of iterators in runOnRegion.

Summary:

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

llvm-svn: 287717

7 years ago[StructurizeCFG] Make hasOnlyUniformBranches a non-member function.
Justin Lebar [Tue, 22 Nov 2016 23:13:33 +0000 (23:13 +0000)]
[StructurizeCFG] Make hasOnlyUniformBranches a non-member function.

Summary: Lets us get rid of one member variable too.

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

llvm-svn: 287716

7 years ago[CUDA] Note in docs that you need to build with -lcudart on MacOS
Justin Lebar [Tue, 22 Nov 2016 23:13:29 +0000 (23:13 +0000)]
[CUDA] Note in docs that you need to build with -lcudart on MacOS

-lcudart_static doesn't work.  We don't know why.

llvm-svn: 287715

7 years agoFix memory leak detected by asan.
Rui Ueyama [Tue, 22 Nov 2016 23:13:08 +0000 (23:13 +0000)]
Fix memory leak detected by asan.

llvm-svn: 287714

7 years agoMake diagnostic for use of default member initializer before enclosing class is
Richard Smith [Tue, 22 Nov 2016 22:55:12 +0000 (22:55 +0000)]
Make diagnostic for use of default member initializer before enclosing class is
complete a little more general; it is produced in other cases than the one that
it previously talked about.

llvm-svn: 287713

7 years agoadd and use isBitwiseLogicOp() helper function; NFCI
Sanjay Patel [Tue, 22 Nov 2016 22:54:36 +0000 (22:54 +0000)]
add and use isBitwiseLogicOp() helper function; NFCI

llvm-svn: 287712

7 years agoAccept -script=<file> in addition to -script <file>.
Rui Ueyama [Tue, 22 Nov 2016 22:54:03 +0000 (22:54 +0000)]
Accept -script=<file> in addition to -script <file>.

Fixes PR31126.

llvm-svn: 287711

7 years agoBefore sample pgo annotation, do not inline a function that has no debug info. (NFC)
Dehao Chen [Tue, 22 Nov 2016 22:50:01 +0000 (22:50 +0000)]
Before sample pgo annotation, do not inline a function that has no debug info. (NFC)

If there is no debug info in the callee, inlining it will not help annotator. This avoids infinite loop as reported in PR/31119.

llvm-svn: 287710

7 years ago[SCCP] Remove code in visitBinaryOperator (and add tests).
Davide Italiano [Tue, 22 Nov 2016 22:11:25 +0000 (22:11 +0000)]
[SCCP] Remove code in visitBinaryOperator (and add tests).

We visit and/or, we try to derive a lattice value for the
instruction even if one of the operands is overdefined.
If the non-overdefined value is still 'unknown' just return and wait
for ResolvedUndefsIn to "plug in" the correct value. This simplifies
the logic a bit. While I'm here add tests for missing cases.

llvm-svn: 287709

7 years agoTargetSubtargetInfo: Move implementation to lib/CodeGen; NFC
Matthias Braun [Tue, 22 Nov 2016 22:09:03 +0000 (22:09 +0000)]
TargetSubtargetInfo: Move implementation to lib/CodeGen; NFC

TargetSubtargetInfo is filled with CodeGen specific interfaces nowadays
(getInstrInfo(), getFrameLowering(), getSelectionDAGInfo()) most of the
tuning flags like enablePostRAScheduler(), getAntiDepBreakMode(),
enableRALocalReassignment(), ... also do not seem to be universal enough
to make sense outside of CodeGen.

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

llvm-svn: 287708

7 years ago[InstCombine] change bitwise logic type to eliminate bitcasts
Sanjay Patel [Tue, 22 Nov 2016 22:05:48 +0000 (22:05 +0000)]
[InstCombine] change bitwise logic type to eliminate bitcasts

In PR27925:
https://llvm.org/bugs/show_bug.cgi?id=27925

...we proposed adding this fold to eliminate a bitcast. In D20774, there was
some concern about changing the type of a bitwise op as well as creating
bitcasts that might not be free for a target. However, if we're strictly
eliminating an instruction (by limiting this to one-use ops), then we should
be able to do this in InstCombine.

But we're cautiously restricting the transform for now to vector types to
avoid possible backend problems. A transform to make sure the logic op is
legal for the target should be added to reverse this transform and improve
codegen.

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

llvm-svn: 287707

7 years ago[X86][AVX512DQ] Add fp <-> int tests for AVX512DQ/AVX512DQ+VL
Simon Pilgrim [Tue, 22 Nov 2016 22:04:50 +0000 (22:04 +0000)]
[X86][AVX512DQ] Add fp <-> int tests for AVX512DQ/AVX512DQ+VL

llvm-svn: 287706

7 years ago[LCG] Add a previously missing assert about the relationship of RefSCCs.
Chandler Carruth [Tue, 22 Nov 2016 21:40:10 +0000 (21:40 +0000)]
[LCG] Add a previously missing assert about the relationship of RefSCCs.

No intended change, everything seems to be in working order already.

llvm-svn: 287705

7 years agoFix test to not depend on the path size.
Rafael Espindola [Tue, 22 Nov 2016 21:37:38 +0000 (21:37 +0000)]
Fix test to not depend on the path size.

llvm-svn: 287704

7 years agoUpdate to isl-0.17.1-284-gbb38638
Tobias Grosser [Tue, 22 Nov 2016 21:31:59 +0000 (21:31 +0000)]
Update to isl-0.17.1-284-gbb38638

Regular maintenance update with only minor changes.

llvm-svn: 287703

7 years agoLTO: Remove a now-unused InputFile accessor.
Peter Collingbourne [Tue, 22 Nov 2016 21:25:30 +0000 (21:25 +0000)]
LTO: Remove a now-unused InputFile accessor.

llvm-svn: 287702

7 years agomove VerDef finalization before DynStrTab
Rafael Espindola [Tue, 22 Nov 2016 21:12:20 +0000 (21:12 +0000)]
move VerDef finalization before DynStrTab

llvm-svn: 287701

7 years agoFixed the lost FastMathFlags in GVN(Global Value Numbering).
Vyacheslav Klochkov [Tue, 22 Nov 2016 20:52:53 +0000 (20:52 +0000)]
Fixed the lost FastMathFlags in GVN(Global Value Numbering).
Reviewer: Hal Finkel.
Differential Revision: https://reviews.llvm.org/D26952

llvm-svn: 287700

7 years ago[LTO] Remove a check on datalayout.
Davide Italiano [Tue, 22 Nov 2016 20:37:37 +0000 (20:37 +0000)]
[LTO] Remove a check on datalayout.

Now that lld switched to lib/LTO, which always calls setDataLayout(),
we don't need this check anymore.
Thanks to Peter for pointing out!

llvm-svn: 287699

7 years ago[LCG] Start using SCC relationship predicates in the unittest.
Chandler Carruth [Tue, 22 Nov 2016 20:35:32 +0000 (20:35 +0000)]
[LCG] Start using SCC relationship predicates in the unittest.

This mostly gives us nice unittesting of the predicates themselves. I'll
start using them further in subsequent commits to help test the actual
operations performed on the graph.

llvm-svn: 287698

7 years agoRemove PDBFileBuilder::build() and related functions.
Rui Ueyama [Tue, 22 Nov 2016 20:32:22 +0000 (20:32 +0000)]
Remove PDBFileBuilder::build() and related functions.

PDBFileBuilder supports two different ways to create files.
One is PDBFileBuilder::commit. That function takes a filename
and write a result to the file. The other is PDBFileBuilder::build.
That returns a new PDBFile object.

This patch removes the latter because no one is using it and
in a real life situation we are very unlikely to need it.
Even if you need it, it'd be easy to write a new PDB to a memory
buffer and read it back.

Removing PDBFileBuilder::build enables us to remove other classes
build transitively.

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

llvm-svn: 287697

7 years ago[sanitizer] Fix the dedup_token_length_test.cc testcase to not fail when user's home...
Kuba Mracek [Tue, 22 Nov 2016 20:24:26 +0000 (20:24 +0000)]
[sanitizer] Fix the dedup_token_length_test.cc testcase to not fail when user's home directory contains "bar"

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

llvm-svn: 287696

7 years agoFixed the lost FastMathFlags in Reassociate optimization.
Vyacheslav Klochkov [Tue, 22 Nov 2016 20:23:04 +0000 (20:23 +0000)]
Fixed the lost FastMathFlags in Reassociate optimization.
Reviewer: Hal Finkel.
Differential Revision: https://reviews.llvm.org/D26957

llvm-svn: 287695

7 years ago[CodeGen] Add flag to code-generate most memory access expressions
Tobias Grosser [Tue, 22 Nov 2016 20:21:16 +0000 (20:21 +0000)]
[CodeGen] Add flag to code-generate most memory access expressions

Introduce the new flag -polly-codegen-generate-expressions which forces Polly
to code generate AST expressions instead of using our SCEV based access
expression generation even for cases where the original memory access relation
was not changed and the SCEV based access expression could be code generated
without any issue.

This is an experimental option for better testing the isl ast expression
generation. The default behavior of Polly remains unchanged. We also exclude
a couple of cases for which the AST expression is not yet working.

llvm-svn: 287694

7 years agoAllow libc++ to use modules in C++03.
Eric Fiselier [Tue, 22 Nov 2016 20:15:39 +0000 (20:15 +0000)]
Allow libc++ to use modules in C++03.

Libc++ internal uses <atomic> in C++03 code but the module map forbids its use.
This causes the libc++ 'std' module to fail to build in C++03.

This patch removes the requirement to fix this issue.

llvm-svn: 287693

7 years agoRemove '.' from a help message.
Rui Ueyama [Tue, 22 Nov 2016 20:15:35 +0000 (20:15 +0000)]
Remove '.' from a help message.

llvm-svn: 287692

7 years agoRemove variable only used in an assertion.
John McCall [Tue, 22 Nov 2016 20:12:32 +0000 (20:12 +0000)]
Remove variable only used in an assertion.

llvm-svn: 287691

7 years agoAttempt to fix stdint/cstdint modules try 2
Eric Fiselier [Tue, 22 Nov 2016 20:05:19 +0000 (20:05 +0000)]
Attempt to fix stdint/cstdint modules try 2

llvm-svn: 287690

7 years agoAdd test for D21736.
Marcin Koscielnicki [Tue, 22 Nov 2016 20:03:40 +0000 (20:03 +0000)]
Add test for D21736.

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

llvm-svn: 287689

7 years ago[CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.
Marcin Koscielnicki [Tue, 22 Nov 2016 20:03:35 +0000 (20:03 +0000)]
[CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.

Currently, TargetLibraryInfoWrapperPass is inserted by PMBuilder.
However, some passes are inserted manually before the PMBuilder
ones - if any of them happens to use TargetLibraryInfoWrapperPass,
it'll get a default-constructed one, with an unknown target triple.
This happens to InstrProfiling in D21736, breaking it.

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

llvm-svn: 287688

7 years agoCleanup module.modulemap
Eric Fiselier [Tue, 22 Nov 2016 20:00:21 +0000 (20:00 +0000)]
Cleanup module.modulemap

llvm-svn: 287687

7 years agoRestructure DwarfDebug::beginInstruction(). [NFC]
Paul Robinson [Tue, 22 Nov 2016 19:46:51 +0000 (19:46 +0000)]
Restructure DwarfDebug::beginInstruction(). [NFC]
Will help a pending patch.

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

llvm-svn: 287686

7 years agodarwin: Unconditionally pass -lto_library, remove -Wliblto warning.
Nico Weber [Tue, 22 Nov 2016 19:38:07 +0000 (19:38 +0000)]
darwin: Unconditionally pass -lto_library, remove -Wliblto warning.

https://reviews.llvm.org/D25932 made it so that clang always checks if
libLTO.dylib is present on disk, even if -flto is not being used. The
motivation for that change was that if a dependency happens to contain bitcode,
ld64 will try to load libLTO without -flto explicitly being enabled. However,
the change had the undesirable side effect of warning if libLTO.dylib doesn't
exist even if it isn't needed.

Change things so that -lto_library is always passes, independent of if it
exists or not. ld64 only looks at this flag if it uses LTO. If the dylib
exists, all is well. If it doesn't, and LTO is not being used, all is well too.
If ld64 does end up using LTO and the dylib does not exist, ld64 will print
something like

    ld: could not process llvm bitcode object file, because foo/libLTO.dylib could not be loaded file 'test.o' for architecture x86_64

https://reviews.llvm.org/D26984

llvm-svn: 287685

7 years ago[Triple] Add Facebook vendor
Shoaib Meenai [Tue, 22 Nov 2016 19:36:26 +0000 (19:36 +0000)]
[Triple] Add Facebook vendor

Add a compiler vendor for Facebook, to enable future vendor-specific
behavior.

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

llvm-svn: 287684

7 years agoFix build breakage.
Rui Ueyama [Tue, 22 Nov 2016 19:24:52 +0000 (19:24 +0000)]
Fix build breakage.

We cannot have MipsRldMap class and In<ELFT>::MipsRldMap.
Renamed the class.

llvm-svn: 287683

7 years ago[LCG] Add utilities to compute parent and ascestor relationships between
Chandler Carruth [Tue, 22 Nov 2016 19:23:31 +0000 (19:23 +0000)]
[LCG] Add utilities to compute parent and ascestor relationships between
SCCs.

These will be fairly expensive routines to call and might be abused in
real code, but are quite useful when debugging or in asserts and are
reasonable and well formed properties to query.

I've used one of them in an assert that was requested in a code review
here. In subsequent commits I'll start using these routines more
heavily, for example in unittests etc. But this at least gets the
groundwork in place.

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

llvm-svn: 287682

7 years ago[mips] seb, seh instruction aliases
Simon Dardis [Tue, 22 Nov 2016 19:17:23 +0000 (19:17 +0000)]
[mips] seb, seh instruction aliases

Add the single operand form.

Reviewers: vkalintiris

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

llvm-svn: 287681

7 years agoAdd IntrInaccessibleMemOnly property for intrinsics
Andrew Kaylor [Tue, 22 Nov 2016 19:16:04 +0000 (19:16 +0000)]
Add IntrInaccessibleMemOnly property for intrinsics

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

llvm-svn: 287680

7 years ago[PowerPC] Emit VMX loads/stores for aligned ops to avoid adding swaps on LE
Nemanja Ivanovic [Tue, 22 Nov 2016 19:02:07 +0000 (19:02 +0000)]
[PowerPC] Emit VMX loads/stores for aligned ops to avoid adding swaps on LE

This patch corresponds to review:
https://reviews.llvm.org/D26861

It also fixes PR30730.

Committing on behalf of Lei Huang.

llvm-svn: 287679

7 years ago[CostModel][X86] Updated sitofp/uitofp scalar/vector cost tests
Simon Pilgrim [Tue, 22 Nov 2016 18:55:49 +0000 (18:55 +0000)]
[CostModel][X86] Updated sitofp/uitofp scalar/vector cost tests

Better coverage of all legal types + special cases.

Removed old fptoui tests which are all handled in fptoui.ll

llvm-svn: 287678

7 years ago[ELF] Allow `ASSERT` in output section descriptions
Meador Inge [Tue, 22 Nov 2016 18:01:50 +0000 (18:01 +0000)]
[ELF] Allow `ASSERT` in output section descriptions

GNU LD allows `ASSERT` commands to be in output section descriptions.
Note that LD also mandates that `ASSERT` commands in this context must
end with a semicolon.

llvm-svn: 287677

7 years ago[X86][SSE] Combine UNPCKL(FHADD,FHADD) -> FHADD for v2f64 shuffles.
Simon Pilgrim [Tue, 22 Nov 2016 17:50:06 +0000 (17:50 +0000)]
[X86][SSE] Combine UNPCKL(FHADD,FHADD) -> FHADD for v2f64 shuffles.

This occurs during UINT_TO_FP v2f64 lowering.

We can easily generalize this to other horizontal ops (FHSUB, PACKSS, PACKUS) as required - we are doing something similar with PACKUS in lowerV2I64VectorShuffle

llvm-svn: 287676

7 years ago[ELF] Convert .rld_map to input section
Eugene Leviant [Tue, 22 Nov 2016 17:49:14 +0000 (17:49 +0000)]
[ELF] Convert .rld_map to input section

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

llvm-svn: 287675

7 years ago[clang-rename] Prune away AST nodes more correctly and effectively when looking for...
Benjamin Kramer [Tue, 22 Nov 2016 17:29:45 +0000 (17:29 +0000)]
[clang-rename] Prune away AST nodes more correctly and effectively when looking for a point

Due to the way the preprocessor works nodes can be half in a macro or a
different file. This means checking the file name of the start location
of a Decl is not a correct way of checking if the entire Decl is in that
file. Remove that flawed assumption and replace it with a more effective
check: If the point we're looking for is *inside* of the begin and end
location of a Decl, look inside.

This should make clang-rename more reliable (for example macro'd namespaces
threw it off before, as seen in the test case) and maybe a little faster
by pruning off more stuff that the RecursiveASTVisitor doesn't have to
drill into.

llvm-svn: 287649

7 years agoRe-add "demonstrate new Args API"
Zachary Turner [Tue, 22 Nov 2016 17:10:15 +0000 (17:10 +0000)]
Re-add "demonstrate new Args API"

This fixes the build breakage due to the use of C++14.

llvm-svn: 287647

7 years ago[mips] Add support for unaligned load/store macros.
Vasileios Kalintiris [Tue, 22 Nov 2016 16:43:49 +0000 (16:43 +0000)]
[mips] Add support for unaligned load/store macros.

Add missing unaligned store macros (ush/usw) and fix the exisiting
implementation of the unaligned load macros in order to generate
identical expansions with the GNU assembler.

llvm-svn: 287646

7 years agoCodeGen: simplify TargetMachine::getSymbol interface. NFC.
Tim Northover [Tue, 22 Nov 2016 16:17:20 +0000 (16:17 +0000)]
CodeGen: simplify TargetMachine::getSymbol interface. NFC.

No-one actually had a mangler handy when calling this function, and
getSymbol itself went most of the way towards getting its own mangler
(with a local TLOF variable) so forcing all callers to supply one was
just extra complication.

llvm-svn: 287645

7 years ago[X86] Change lowerBuildVectorToBitOp() to take a BuildVectorSDNode. NFC.
Zvi Rackover [Tue, 22 Nov 2016 15:33:28 +0000 (15:33 +0000)]
[X86] Change lowerBuildVectorToBitOp() to take a BuildVectorSDNode. NFC.

llvm-svn: 287644

7 years ago[X86] Remove dead code from LowerVectorBroadcast
Zvi Rackover [Tue, 22 Nov 2016 15:17:52 +0000 (15:17 +0000)]
[X86] Remove dead code from LowerVectorBroadcast

Summary: Splat vectors are canonicalized to BUILD_VECTOR's so the code can be simplified. NFC-ish.

Reviewers: craig.topper, delena, RKSimon, andreadb

Subscribers: RKSimon, llvm-commits

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

llvm-svn: 287643

7 years ago[AArch64] Set the max interleave factor for Falkor.
Chad Rosier [Tue, 22 Nov 2016 14:25:02 +0000 (14:25 +0000)]
[AArch64] Set the max interleave factor for Falkor.

llvm-svn: 287642

7 years ago[AArch64] Maximize 80-column. NFC.
Chad Rosier [Tue, 22 Nov 2016 14:12:09 +0000 (14:12 +0000)]
[AArch64] Maximize 80-column. NFC.

llvm-svn: 287640

7 years agoMake llvm::Error generated from replacement interfaces more specific.
Eric Liu [Tue, 22 Nov 2016 13:46:42 +0000 (13:46 +0000)]
Make llvm::Error generated from replacement interfaces more specific.

Summary:
The new error information contains the type of error (e.g. overlap or bad file path)
and the replacement(s) that is causing the error. This enables us to resolve some errors.
For example, for insertion at the same location conflict, we need to know the
existing replacement which conflicts with the new replacement in order to calculate
the new position to be insert before/after the existing replacement (for merging).

Reviewers: klimek, bkramer

Subscribers: djasper, cfe-commits

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

llvm-svn: 287639

7 years agoFix line endings
Simon Pilgrim [Tue, 22 Nov 2016 13:27:29 +0000 (13:27 +0000)]
Fix line endings

llvm-svn: 287638

7 years ago[wasm] hack around test failure after r287553.
Benjamin Kramer [Tue, 22 Nov 2016 13:13:33 +0000 (13:13 +0000)]
[wasm] hack around test failure after r287553.

This test is very brittle as small changes to block layout break the
check patterns. Hack around a change one more time.

llvm-svn: 287637

7 years agoImprove detection of global vs local variables
Sam McCall [Tue, 22 Nov 2016 11:40:25 +0000 (11:40 +0000)]
Improve detection of global vs local variables

Summary:
Improve detection of global vs local variables.

Currently when a global variable is optimized out or otherwise has an unknown
location (DW_AT_location is empty) it gets reported as local.

I added two new heuristics:
 - if a mangled name is present, the variable is global (or static)
 - if DW_AT_location is present but invalid, the variable is global (or static)

Subscribers: lldb-commits

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

llvm-svn: 287636

7 years ago[SelectionDAG] ComputeNumSignBits of TRUNCATE operations
Simon Pilgrim [Tue, 22 Nov 2016 11:29:19 +0000 (11:29 +0000)]
[SelectionDAG] ComputeNumSignBits of TRUNCATE operations

Add basic ComputeNumSignBits support for TRUNCATE ops for cases where the source's number of sign bits overlaps with the truncated size.

Improves X86 SIGN_EXTEND_IN_REG vector cases which were needlessly sign extending boolean vector results.

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

llvm-svn: 287635

7 years agotsan: fix build after 287632
Dmitry Vyukov [Tue, 22 Nov 2016 11:09:35 +0000 (11:09 +0000)]
tsan: fix build after 287632

1. Mac does not have MAP_32BIT.
Define it to 0 if it is not defined.

2. We are lacking nolibc stub for ListOfModules::init.
Add it.

llvm-svn: 287634

7 years agoMissing initializer.
Axel Naumann [Tue, 22 Nov 2016 10:00:23 +0000 (10:00 +0000)]
Missing initializer.

llvm-svn: 287633

7 years agotsan: switch libignore from /proc/self/maps to dl_iterate_phdr
Dmitry Vyukov [Tue, 22 Nov 2016 09:49:11 +0000 (09:49 +0000)]
tsan: switch libignore from /proc/self/maps to dl_iterate_phdr

/proc/self/maps can't be read atomically, this leads to episodic
crashes in libignore as it thinks that a module is loaded twice.
See the new test for an example.
dl_iterate_phdr does not have this problem.
Switch libignore to dl_iterate_phdr.

llvm-svn: 287632

7 years agoFix build failure on Linux and BSD by reverting r287597
Omair Javaid [Tue, 22 Nov 2016 09:47:00 +0000 (09:47 +0000)]
Fix build failure on Linux and BSD by reverting r287597

Linux and BSD builds failing after this changes from rev 287597.

llvm-svn: 287631

7 years ago[AVX512][inline-asm] Fix AVX512 inline assembly instruction resolution when the size...
Coby Tayree [Tue, 22 Nov 2016 09:30:29 +0000 (09:30 +0000)]
[AVX512][inline-asm] Fix AVX512 inline assembly instruction resolution when the size qualifier of a memory operand is not specified explicitly.

This commit handles cases where the size qualifier of an indirect memory reference operand in Intel syntax is missing (e.g. "vaddps xmm1, xmm2, [a]").

GCC will deduce the size qualifier for AVX512 vector and broadcast memory operands based on the possible matches:
"vaddps xmm1, xmm2, [a]" matches only “XMMWORD PTR” qualifier.
"vaddps xmm1, xmm2, [a]{1to4}" matches only “DWORD PTR” qualifier.

This is different from the current behavior of LLVM, which deduces the size qualifier based on the size of the memory operand.
For "vaddps xmm1, xmm2, [a]"
"char a;" will imply "BYTE PTR" qualifier
"short a;" will imply "WORD PTR" qualifier.

This commit aligns LLVM to GCC’s behavior.

This is the LLVM part of the review.
The Clang part of the review: https://reviews.llvm.org/D26587

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

llvm-svn: 287630

7 years agotsan: mark cur_thread_placeholder definition as initial-exec
Dmitry Vyukov [Tue, 22 Nov 2016 08:59:17 +0000 (08:59 +0000)]
tsan: mark cur_thread_placeholder definition as initial-exec

See https://sourceware.org/bugzilla/show_bug.cgi?id=20805 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78294 for context.
Previously we marked only declaration as initial-exec. But compilers treat
initial-exec attribute somewhat differently. Mark definition as well.

llvm-svn: 287629

7 years agoRename option to -lto-pass-remarks-output
Adam Nemet [Tue, 22 Nov 2016 07:35:19 +0000 (07:35 +0000)]
Rename option to -lto-pass-remarks-output

The new option -pass-remarks-output broke LLVM_LINK_LLVM_DYLIB because
of the duplicate option name with opt.

llvm-svn: 287628

7 years agoRename option to -lto-pass-remarks-output
Adam Nemet [Tue, 22 Nov 2016 07:35:14 +0000 (07:35 +0000)]
Rename option to -lto-pass-remarks-output

The new option -pass-remarks-output broke LLVM_LINK_LLVM_DYLIB because
of the duplicate option name with opt.

llvm-svn: 287627

7 years ago[test] Simplify test case by removing unreferenced instructions [NFC]
Tobias Grosser [Tue, 22 Nov 2016 07:18:57 +0000 (07:18 +0000)]
[test] Simplify test case by removing unreferenced instructions [NFC]

Drop instructions that do not influence the memory impact of a basic block.
They are not needed to reproduce the original bug (verified) and will cause
random test noise if we would decide to only model the instructions that
have visible side-effects.

llvm-svn: 287626

7 years ago[test] Ensure important basic blocks in test case have side effects
Tobias Grosser [Tue, 22 Nov 2016 07:06:59 +0000 (07:06 +0000)]
[test] Ensure important basic blocks in test case have side effects

Add two store instructions at the end of basic blocks that are required to
reproduce the original bug to ensure we always process and model these basic
blocks. This makes this test case stable even in case we would decide to bail
out early of basic blocks which do not modify the global state. Also add
additional check lines to verify how we model the basic block.

llvm-svn: 287625

7 years ago[TableGen][ISel] When factoring ScopeMatcher, if the child of the ScopeMatcher we...
Craig Topper [Tue, 22 Nov 2016 07:00:06 +0000 (07:00 +0000)]
[TableGen][ISel] When factoring ScopeMatcher, if the child of the ScopeMatcher we're working on is also a ScopeMatcher, merge all its children into the one we're working on.

There were several cases in X86 where we were unable to fully factor a ScopeMatcher but created nested ScopeMatchers for some portions of it. Then we created a SwitchType that split it up and further factored it so that we ended up with something like this:

SwitchType
  Scope
    Scope
      Sequence of matchers
      Some other sequence of matchers
    EndScope
    Another sequence of matchers
  EndScope
...Next type

This change turns it into this:

SwitchType
  Scope
    Sequence of matchers
    Some other sequence of matchers
    Another sequence of matchers
  EndScope
...Next type

Several other in-tree targets had similar nested scopes like this. Overall this doesn't save many bytes, but makes the isel output a little more regular.

llvm-svn: 287624

7 years agotest: add more details to non-affine test case
Tobias Grosser [Tue, 22 Nov 2016 06:28:08 +0000 (06:28 +0000)]
test: add more details to non-affine test case

We add CHECK lines to this test case to make it easier to see the difference
between affine and non-affine memory accesses. We also change the test case to
use a parameteric index expression as otherwise our range analysis will
understand that the non-affine memory access can only access input[1],
which makes it difficult to see that the memory access is in-fact modeled as
non-affine access.

llvm-svn: 287623

7 years ago[X86] Remove alternate CodeGenOnly version of (v)movq that declared the load size...
Craig Topper [Tue, 22 Nov 2016 05:31:43 +0000 (05:31 +0000)]
[X86] Remove alternate CodeGenOnly version of (v)movq that declared the load size as i128mem. Change all uses to the use the i64mem version.

I'm sure this caused the load size to misprint in Intel syntax output. We were also inconsistent about which patterns used which instruction between VEX and EVEX.

There are two different reg/reg versions of movq, one from a GPR and one from the lower 64-bits of an XMM register. This changes the loading folding table to use the single i64mem memory form for folding both cases. But we need to use TB_NO_REVERSE to prevent a duplicate entry in the unfolding table.

llvm-svn: 287622

7 years ago[AVX-512] Add support for commuting VPERMT2(B/W/D/Q/PS/PD) to/from VPERMI2(B/W/D...
Craig Topper [Tue, 22 Nov 2016 04:57:34 +0000 (04:57 +0000)]
[AVX-512] Add support for commuting VPERMT2(B/W/D/Q/PS/PD) to/from VPERMI2(B/W/D/Q/PS/PD).

Summary:
The index and one of the table operands can be swapped by changing the opcode to the other version. Neither of these operands are the one that can load from memory so this can't be used to increase memory folding opportunities.

We need to handle the unmasked forms and the kz forms. Since the load operand isn't being commuted we can commute the load and broadcast instructions too.

Reviewers: igorb, delena, Ayal, Farhana, RKSimon

Subscribers: llvm-commits

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

llvm-svn: 287621

7 years agoInline small function. NFC.
Rui Ueyama [Tue, 22 Nov 2016 04:33:01 +0000 (04:33 +0000)]
Inline small function. NFC.

llvm-svn: 287620

7 years agoMC: ensure that we have a section before accessing it
Saleem Abdulrasool [Tue, 22 Nov 2016 04:32:54 +0000 (04:32 +0000)]
MC: ensure that we have a section before accessing it

We would attempt to access the symbol section without ensuring that the symbol
was not absolute.  When the assembler referenced relocation is not evaluated to
the absolute, but when we record the relocation, we would query the section.
Because the symbol is absolute, it does not have a section associated with it,
triggering an assertion.  Just be more careful about the access of the section.

Addresses PR31064!

llvm-svn: 287619

7 years ago[analyzer] Fix a crash on accessing a field within a literal-initialized union.
Artem Dergachev [Tue, 22 Nov 2016 04:29:23 +0000 (04:29 +0000)]
[analyzer] Fix a crash on accessing a field within a literal-initialized union.

Because in case of unions we currently default-bind compound values in the
store, this quick fix avoids the crash for this case.

Patch by Ilya Palachev and independently by Alexander Shaposhnikov!

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

llvm-svn: 287618

7 years agoDo not save unused pointers to In<ELFT>.
Rui Ueyama [Tue, 22 Nov 2016 04:28:39 +0000 (04:28 +0000)]
Do not save unused pointers to In<ELFT>.

llvm-svn: 287617

7 years agoRemove default definition no one uses.
Rui Ueyama [Tue, 22 Nov 2016 04:17:12 +0000 (04:17 +0000)]
Remove default definition no one uses.

llvm-svn: 287616

7 years agoConvert MipsOptionsSection to SyntheticSection.
Rui Ueyama [Tue, 22 Nov 2016 04:13:09 +0000 (04:13 +0000)]
Convert MipsOptionsSection to SyntheticSection.

llvm-svn: 287615

7 years agoConvert MipsReginfoSection to SyntheticSection.
Rui Ueyama [Tue, 22 Nov 2016 03:57:08 +0000 (03:57 +0000)]
Convert MipsReginfoSection to SyntheticSection.

llvm-svn: 287614

7 years agoConvert MipsAbiFlagsSection to SyntheticSection.
Rui Ueyama [Tue, 22 Nov 2016 03:57:06 +0000 (03:57 +0000)]
Convert MipsAbiFlagsSection to SyntheticSection.

llvm-svn: 287613

7 years ago[AVX-512] Add support for changing the element size of PALIGNR/VALIGND/VALIGNQ shuffl...
Craig Topper [Tue, 22 Nov 2016 03:51:53 +0000 (03:51 +0000)]
[AVX-512] Add support for changing the element size of PALIGNR/VALIGND/VALIGNQ shuffles if they feed a vselect with a different type

Summary:
Shuffle lowering widens the element size of a shuffle if elements are contiguous. This is sometimes help because wider element types have more shuffle options. If the shuffle is one of the arguments to a vselect this shuffle widening can introduce a bitcast between the vselect and the shuffle. This will prevent isel from selecting a masked operation. If the shuffle can be written equally efficiently with a different element size to match the vselect type we should change the shuffle type to allow masking.

This patch does this conversion for all VALIGND/VALIGNQ sizes. It also supports turning 128-bit PALIGNR into VALIGND/VALIGNQ. This fixes the case shown in PR31018.

I plan to add support for more operations in future patches.

Reviewers: RKSimon, zvi, delena

Subscribers: llvm-commits

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

llvm-svn: 287612

7 years agoObject: Make SymbolicFile::symbol_{begin,end}() virtual and remove unnecessary wrappers.
Peter Collingbourne [Tue, 22 Nov 2016 03:38:40 +0000 (03:38 +0000)]
Object: Make SymbolicFile::symbol_{begin,end}() virtual and remove unnecessary wrappers.

llvm-svn: 287611

7 years ago[ADT] Add initializer list support to SmallPtrSet so that sets can be
Chandler Carruth [Tue, 22 Nov 2016 03:27:43 +0000 (03:27 +0000)]
[ADT] Add initializer list support to SmallPtrSet so that sets can be
easily initialized with some initial values.

llvm-svn: 287610

7 years agoTurn on LLDB_EDITLINE_USE_WCHAR on FreeBSD
Ed Maste [Tue, 22 Nov 2016 02:25:41 +0000 (02:25 +0000)]
Turn on LLDB_EDITLINE_USE_WCHAR on FreeBSD

llvm-svn: 287609

7 years ago[AMDGPU] Fix multiple vreg definitions in si-lower-control-flow
Stanislav Mekhanoshin [Tue, 22 Nov 2016 01:42:34 +0000 (01:42 +0000)]
[AMDGPU] Fix multiple vreg definitions in si-lower-control-flow

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

llvm-svn: 287608

7 years agoRemove redundant assignment.
Rui Ueyama [Tue, 22 Nov 2016 01:36:19 +0000 (01:36 +0000)]
Remove redundant assignment.

llvm-svn: 287607

7 years agoConvert BuildId a derived class of SyntheticSection.
Rui Ueyama [Tue, 22 Nov 2016 01:31:32 +0000 (01:31 +0000)]
Convert BuildId a derived class of SyntheticSection.

Some synthetic sections are not derived calsses of SyntehticSection.
They are derived directly from InputSection. For consistencly, we should
use SyntheticSection.

llvm-svn: 287606

7 years agoRemove a parameter from getOutputLoc and rename for readability. NFC.
Rui Ueyama [Tue, 22 Nov 2016 01:10:34 +0000 (01:10 +0000)]
Remove a parameter from getOutputLoc and rename for readability. NFC.

llvm-svn: 287605