platform/upstream/llvm.git
8 years ago[RDF] Handle undefined registers in RDF copy propagation
Krzysztof Parzyszek [Thu, 28 Apr 2016 15:09:19 +0000 (15:09 +0000)]
[RDF] Handle undefined registers in RDF copy propagation

When updating the graph, make sure that new uses without reaching defs
are handled correctly.

llvm-svn: 267891

8 years ago[EarlyCSE] Sort includes. NFC.
Geoff Berry [Thu, 28 Apr 2016 14:59:27 +0000 (14:59 +0000)]
[EarlyCSE] Sort includes.  NFC.

Reviewers: mcrosier

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 267890

8 years agoRangify for loops, NFC.
Yaron Keren [Thu, 28 Apr 2016 14:49:44 +0000 (14:49 +0000)]
Rangify for loops, NFC.

llvm-svn: 267889

8 years ago[Inliner] Formatting. NFC.
Chad Rosier [Thu, 28 Apr 2016 14:47:23 +0000 (14:47 +0000)]
[Inliner] Formatting. NFC.

Patch by Aditya Kumar!
Differential Revision: http://reviews.llvm.org/D19047

llvm-svn: 267888

8 years ago[InstCombine] Remove trailing whitespace. NFC.
Ahmed Bougacha [Thu, 28 Apr 2016 14:36:07 +0000 (14:36 +0000)]
[InstCombine] Remove trailing whitespace. NFC.

r267873.

llvm-svn: 267887

8 years agoRename isRelRelative
Rafael Espindola [Thu, 28 Apr 2016 14:34:39 +0000 (14:34 +0000)]
Rename isRelRelative

It was never a particularly good name and is now completely out of date.

llvm-svn: 267886

8 years ago[FIX] Correct assumption simplification
Johannes Doerfert [Thu, 28 Apr 2016 14:32:58 +0000 (14:32 +0000)]
[FIX] Correct assumption simplification

  Assumptions and restrictions can both be simplified with the domain of a
  statement but not the same way. After this patch we will correctly
  distinguish them.

llvm-svn: 267885

8 years agoAdd a test showing that we can gc parts of .eh_frame.
Rafael Espindola [Thu, 28 Apr 2016 14:31:09 +0000 (14:31 +0000)]
Add a test showing that we can gc parts of .eh_frame.

llvm-svn: 267884

8 years agoFix build.
Manuel Klimek [Thu, 28 Apr 2016 14:28:19 +0000 (14:28 +0000)]
Fix build.

llvm-svn: 267883

8 years agoReland r267691 fixing PR27535.
Vassil Vassilev [Thu, 28 Apr 2016 14:13:28 +0000 (14:13 +0000)]
Reland r267691 fixing PR27535.

llvm-svn: 267882

8 years agoAdd accidentally dropped test to r267880.
Tim Northover [Thu, 28 Apr 2016 14:01:49 +0000 (14:01 +0000)]
Add accidentally dropped test to r267880.

Forgot "git add".

llvm-svn: 267881

8 years agoARMv7k: define __ARM_PCS_VFP since we're hard-float.
Tim Northover [Thu, 28 Apr 2016 13:59:55 +0000 (13:59 +0000)]
ARMv7k: define __ARM_PCS_VFP since we're hard-float.

It's a little debateable because we're not truly AAPCS, so I'm
certainly not going to define __ARM_PCS, but __ARM_PCS_VFP seems to be
really an "hard-float" define, which is a useful thing to have.

llvm-svn: 267880

8 years ago[SystemZ] Support Swift calling convention
Bryan Chan [Thu, 28 Apr 2016 13:56:43 +0000 (13:56 +0000)]
[SystemZ] Support Swift calling convention

Summary:
Port rL265324 to SystemZ to allow using the 'swiftcall' attribute on that architecture.

Depends on D19414.

Reviewers: kbarton, rjmccall, uweigand

Subscribers: cfe-commits

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

llvm-svn: 267879

8 years agoFixed mistype in comment. NFC.
George Rimar [Thu, 28 Apr 2016 13:38:10 +0000 (13:38 +0000)]
Fixed mistype in comment. NFC.

llvm-svn: 267878

8 years agoFix spuriously dematerializing reference bug. Fixes PR26612.
Manuel Klimek [Thu, 28 Apr 2016 13:37:45 +0000 (13:37 +0000)]
Fix spuriously dematerializing reference bug. Fixes PR26612.

llvm-svn: 267877

8 years ago[Clang][BuiltIn][AVX512] Adding intrinsics fot align{d|q} and palignr instruction set
Michael Zuckerman [Thu, 28 Apr 2016 12:47:30 +0000 (12:47 +0000)]
[Clang][BuiltIn][AVX512] Adding intrinsics fot align{d|q} and palignr instruction set

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

llvm-svn: 267876

8 years agotest: Make test case independent of earlier instructions
Tobias Grosser [Thu, 28 Apr 2016 12:36:39 +0000 (12:36 +0000)]
test: Make test case independent of earlier instructions

Instead of matching for %6, we use a regexp to match for the result strings.
This test case caused unrelated noise in http://reviews.llvm.org/D15722.

llvm-svn: 267875

8 years agoBlockGenerator: Drop leftover debug statement
Tobias Grosser [Thu, 28 Apr 2016 12:31:05 +0000 (12:31 +0000)]
BlockGenerator: Drop leftover debug statement

llvm-svn: 267874

8 years ago[InstCombine][SSE] Add MOVMSK support to SimplifyDemandedUseBits
Simon Pilgrim [Thu, 28 Apr 2016 12:22:53 +0000 (12:22 +0000)]
[InstCombine][SSE] Add MOVMSK support to SimplifyDemandedUseBits

The MOVMSK instructions copies a vector elements' sign bits to the low bits of a scalar register and zeros the high bits.

This patch adds MOVMSK support to SimplifyDemandedUseBits so that its aware that the upper bits are known to be zero. It also removes the call to MOVMSK if none of the lower bits are actually required and just returns zero.

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

llvm-svn: 267873

8 years ago[OPENMP 4.5] Initial codegen for 'taskloop simd' directive.
Alexey Bataev [Thu, 28 Apr 2016 12:14:51 +0000 (12:14 +0000)]
[OPENMP 4.5] Initial codegen for 'taskloop simd' directive.

OpenMP 4.5 defines 'taskloop simd' directive, which is combined
directive for 'taskloop' and 'simd' directives. Patch adds initial
codegen support for this directive and its 2 basic clauses 'safelen' and
'simdlen'.

llvm-svn: 267872

8 years agoRevert r267784, r267824 and r267830.
Benjamin Kramer [Thu, 28 Apr 2016 12:14:47 +0000 (12:14 +0000)]
Revert r267784, r267824 and r267830.

It makes compiler-rt tests fail if the gold plugin is enabled.

Revert "Rework interface for bitset-using features to use a notion of LTO visibility."
Revert "Driver: only produce CFI -fvisibility= error when compiling."
Revert "clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi."

llvm-svn: 267871

8 years agoRevert "[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)"
Denis Zobnin [Thu, 28 Apr 2016 11:32:10 +0000 (11:32 +0000)]
Revert "[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)"

This reverts commit r267866.

llvm-svn: 267870

8 years agoPR27216: Only define __ARM_FEATURE_FMA when the target has VFPv4
Silviu Baranga [Thu, 28 Apr 2016 11:29:08 +0000 (11:29 +0000)]
PR27216: Only define __ARM_FEATURE_FMA when the target has VFPv4

Summary:
According to the ACLE spec, "__ARM_FEATURE_FMA is defined to 1 if
the hardware floating-point architecture supports fused floating-point
multiply-accumulate".

This changes clang's behaviour from emitting this macro for v7-A and v7-R
cores to only emitting it when the target has VFPv4 (and therefore support
for the floating point multiply-accumulate instruction).

Fixes PR27216

Reviewers: t.p.northover, rengolin

Subscribers: aemerson, rengolin, cfe-commits

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

llvm-svn: 267869

8 years ago[include-fixer] Add an option to minimize include paths.
Benjamin Kramer [Thu, 28 Apr 2016 11:21:29 +0000 (11:21 +0000)]
[include-fixer] Add an option to minimize include paths.

This will always pick the shortest possible path based on -I options. Based
on the #include suggestion code for modules.

llvm-svn: 267868

8 years agoRemote flaky decorator from TestSignalsAPI on linux
Pavel Labath [Thu, 28 Apr 2016 10:42:47 +0000 (10:42 +0000)]
Remote flaky decorator from TestSignalsAPI on linux

The test seems to pass now, and the test does not seem to be doing anything unusual, so I don't
expect it to cause problems.

llvm-svn: 267867

8 years ago[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)
Denis Zobnin [Thu, 28 Apr 2016 10:13:18 +0000 (10:13 +0000)]
[MS] Improved implementation of MS stack pragmas (vtordisp, *_seg)

Rework implementation of several MS pragmas that use internal stack:
vtordisp, {bss|code|const|data}_seg.
This patch:
  1. Makes #pragma vtordisp use PragmaStack class as *_seg pragmas do;
  2. Fixes "#pragma vtordisp()" behavior: it shouldn't affect stack;
  3. Saves/restores the stacks on enter/exit a C++ method body.

llvm-svn: 267866

8 years agoRevert "[MSVC] PR27337: allow static_cast from private base to derived for WTL"
Dmitry Polukhin [Thu, 28 Apr 2016 09:56:22 +0000 (09:56 +0000)]
Revert "[MSVC] PR27337: allow static_cast from private base to derived for WTL"

This reverts commit r267534.

llvm-svn: 267865

8 years ago[tsan] Fix Darwin GCD support after separation of Processor and ThreadState
Kuba Brecka [Thu, 28 Apr 2016 09:26:30 +0000 (09:26 +0000)]
[tsan] Fix Darwin GCD support after separation of Processor and ThreadState

Recent TSan changes (r267678) which factor out parts of ThreadState into a Processor structure broke worker threads on OS X.  This fixes it by properly calling ProcCreate for GCD worker threads and by replacing some CHECKs with RAW_CHECK in early process initialization.  CHECK() in TSan calls the allocator, which requires a valid Processor.

llvm-svn: 267864

8 years ago[OPENMP] Simplified interface for codegen of tasks, NFC.
Alexey Bataev [Thu, 28 Apr 2016 09:23:51 +0000 (09:23 +0000)]
[OPENMP] Simplified interface for codegen of tasks, NFC.

Reduced number of arguments in member functions of runtime support
library for task-based directives.

llvm-svn: 267863

8 years ago[OPENMP 4.5] Codegen for 'grainsize/num_tasks' clauses of 'taskloop'
Alexey Bataev [Thu, 28 Apr 2016 09:15:06 +0000 (09:15 +0000)]
[OPENMP 4.5] Codegen for 'grainsize/num_tasks' clauses of 'taskloop'
directive.

OpenMP 4.5 defines 'taskloop' directive and 2 additional clauses
'grainsize' and 'num_tasks' for this directive. Patch adds codegen for
these clauses.
These clauses are generated as arguments of the '__kmpc_taskloop'
libcall and are encoded the following way:

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

If 'grainsize' is specified, 'sched' argument must be set to '1' and
'grainsize' argument must be set to the value of the 'grainsize' clause.
If 'num_tasks' is specified, 'sched' argument must be set to '2' and
'grainsize' argument must be set to the value of the 'num_tasks' clause.
It is possible because these 2 clauses are mutually exclusive and can't
be used at the same time on the same directive.
If none of these clauses is specified, 'sched' argument must be set to
'0'.

llvm-svn: 267862

8 years agoRevert "Fixed a bug where const this would cause parser errors about $__lldb_expr."
Pavel Labath [Thu, 28 Apr 2016 08:16:19 +0000 (08:16 +0000)]
Revert "Fixed a bug where const this would cause parser errors about $__lldb_expr."

This reverts commit r267833 as it breaks the build. It looks like some work in progress got
committed together with the actual fix, but I'm not sure which one is which, so I'll revert the
whole patch and let author resumbit it after fixing the build error.

llvm-svn: 267861

8 years agoremoved redundant '#'
Eric Liu [Thu, 28 Apr 2016 07:52:06 +0000 (07:52 +0000)]
removed redundant '#'

llvm-svn: 267860

8 years agoAddressed reviewer's post-submission comments from http://reviews.llvm.org/D18551.
Eric Liu [Thu, 28 Apr 2016 07:52:03 +0000 (07:52 +0000)]
Addressed reviewer's post-submission comments from reviews.llvm.org/D18551.

Summary: Make SourceManager in Environment, WhitespaceManager, and FormatTokenAnalyzer etc constant members.

Reviewers: djasper, klimek

Subscribers: cfe-commits, klimek

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

llvm-svn: 267859

8 years agoAddressed review's comments.
Eric Liu [Thu, 28 Apr 2016 07:51:47 +0000 (07:51 +0000)]
Addressed review's comments.

llvm-svn: 267858

8 years agoAdd missing newline in clang-rename output.
Manuel Klimek [Thu, 28 Apr 2016 06:46:44 +0000 (06:46 +0000)]
Add missing newline in clang-rename output.

Patch by Miklos Vajna.

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

llvm-svn: 267855

8 years ago[X86] Remove unused operand from a function and all its callers. NFC
Craig Topper [Thu, 28 Apr 2016 05:58:46 +0000 (05:58 +0000)]
[X86] Remove unused operand from a function and all its callers. NFC

llvm-svn: 267854

8 years ago[CodeGen] Default CTTZ_ZERO_UNDEF/CTLZ_ZERO_UNDEF to Expand in TargetLoweringBase...
Craig Topper [Thu, 28 Apr 2016 03:34:31 +0000 (03:34 +0000)]
[CodeGen] Default CTTZ_ZERO_UNDEF/CTLZ_ZERO_UNDEF to Expand in TargetLoweringBase. This is what the majority of the targets want and removes a bunch of code. Set it to Legal explicitly in the few cases where that's the desired behavior.

llvm-svn: 267853

8 years agoRemove names of unreferenced parameters. Patch from STL@microsoft.com
Eric Fiselier [Thu, 28 Apr 2016 03:17:56 +0000 (03:17 +0000)]
Remove names of unreferenced parameters. Patch from STL@microsoft.com

llvm-svn: 267852

8 years agoCodeGen: Add DetectDeadLanes pass.
Matthias Braun [Thu, 28 Apr 2016 03:07:16 +0000 (03:07 +0000)]
CodeGen: Add DetectDeadLanes pass.

The DetectDeadLanes pass performs a dataflow analysis of used/defined
subregister lanes across COPY instructions and instructions that will
get lowered to copies. It detects dead definitions and uses reading
undefined values which are obscured by COPY and subregister usage.

These dead definitions cause trouble in the register coalescer which
cannot deal with definitions suddenly becoming dead after coalescing
COPY instructions.

For now the pass only adds dead and undef flags to machine operands. It
should be possible to extend it in the future to remove the dead
instructions and redo the analysis for the affected virtual
registers.

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

llvm-svn: 267851

8 years agoTableGen: Produce CoveredBySubRegs summary for register classes
Matthias Braun [Thu, 28 Apr 2016 03:07:11 +0000 (03:07 +0000)]
TableGen: Produce CoveredBySubRegs summary for register classes

This will be used in the upcoming "DetectDeadLanes" pass.

llvm-svn: 267850

8 years agoTargetRegisterInfo: Introduce reverseComposeSubRegIndexLaneMask()
Matthias Braun [Thu, 28 Apr 2016 03:07:07 +0000 (03:07 +0000)]
TargetRegisterInfo: Introduce reverseComposeSubRegIndexLaneMask()

This function performs the reverse computation of
composeSubRegIndexLaneMask().

It will be used in the upcoming "DetectDeadLanes" pass.

llvm-svn: 267849

8 years agoTableGen: Support lanemasks for classes without subregisters
Matthias Braun [Thu, 28 Apr 2016 03:07:04 +0000 (03:07 +0000)]
TableGen: Support lanemasks for classes without subregisters

Previously using lanemasks on registers without any subregisters was not
well defined. This commit extends TargetRegisterInfo/tablegen to:
- Report a lanemask of 1 for regclasses without subregisters
- Do the right thing when mapping a 0/1 lanemask from a class without
  subregisters into a class with subregisters in
  TargetRegisterInfo::composeSubRegIndexLaneMasks().

This will be used in the upcoming "DetectDeadLanes" patch.

llvm-svn: 267848

8 years agoAdd comment.
Rui Ueyama [Thu, 28 Apr 2016 03:04:15 +0000 (03:04 +0000)]
Add comment.

llvm-svn: 267847

8 years agoCGOpenMPRuntime.h: Prune extra comma in \param. [-Wdocumentation]
NAKAMURA Takumi [Thu, 28 Apr 2016 02:45:21 +0000 (02:45 +0000)]
CGOpenMPRuntime.h: Prune extra comma in \param. [-Wdocumentation]

llvm-svn: 267845

8 years agoAdd braces, move braces, and rename variables to avoid shadowing. Patch from STL...
Eric Fiselier [Thu, 28 Apr 2016 02:45:11 +0000 (02:45 +0000)]
Add braces, move braces, and rename variables to avoid shadowing. Patch from STL@microsoft.com

llvm-svn: 267844

8 years agoProvide member function definitions to avoid warnings. Patch from STL@microsoft.com
Eric Fiselier [Thu, 28 Apr 2016 02:18:48 +0000 (02:18 +0000)]
Provide member function definitions to avoid warnings. Patch from STL@microsoft.com

llvm-svn: 267843

8 years agoFix an inefficiency in the handling of $__lldb_local_vars in expressions.
Jim Ingham [Thu, 28 Apr 2016 02:17:02 +0000 (02:17 +0000)]
Fix an inefficiency in the handling of $__lldb_local_vars in expressions.

The code in ClangExpressionDeclMap::FindExternalVisibleDecls figures out what the token
means, and adds the namespace to the lookup context, but since it doesn't mark it as
special in the search context, we go on to pass the name $__lldb_local_vars to the ASTSource
for further lookup.  Unless we've done our job wrong, those lookups will always fail, but
the can be costly.

So I added a bit to m_found & use that to short-circuit the lookup.

<rdar://problem/25613384>

llvm-svn: 267842

8 years agoFindAllSymbolsTest.CTypedefTest: Tweak for LLP64 like x86_64-win32.
NAKAMURA Takumi [Thu, 28 Apr 2016 02:15:16 +0000 (02:15 +0000)]
FindAllSymbolsTest.CTypedefTest: Tweak for LLP64 like x86_64-win32.

  In file included from symbol.cc:1:
  symbols.h:2:24: error: typedef redefinition with different types ('unsigned int'
        vs 'unsigned long long')
        typedef unsigned size_t;
                         ^

llvm-svn: 267841

8 years agoLiveIntervalAnalysis: Fix handleMove() using wrong value numbers
Matthias Braun [Thu, 28 Apr 2016 02:11:49 +0000 (02:11 +0000)]
LiveIntervalAnalysis: Fix handleMove() using wrong value numbers

handleMove() was incorrectly swapping two value numbers. This was missed
before because the problem only occured when moving subregister definitions
and needed -verify-machineinstrs to be detected.

I cannot add a testcase as long as I cannot reapply r260905/r260806.

llvm-svn: 267840

8 years agoDo not call hasArg and getLastArg for the same option.
Rui Ueyama [Thu, 28 Apr 2016 02:08:54 +0000 (02:08 +0000)]
Do not call hasArg and getLastArg for the same option.

llvm-svn: 267839

8 years agoRename function parameters to avoid shadowing. Patch from STL@microsoft.com
Eric Fiselier [Thu, 28 Apr 2016 02:00:52 +0000 (02:00 +0000)]
Rename function parameters to avoid shadowing. Patch from STL@microsoft.com

llvm-svn: 267838

8 years ago[AArch64] Expand CTTZ for all vector types.
Craig Topper [Thu, 28 Apr 2016 01:58:21 +0000 (01:58 +0000)]
[AArch64] Expand CTTZ for all vector types.

llvm-svn: 267837

8 years agoGuard Clang and GCC specific pragmas. Patch from STL@microsoft.com
Eric Fiselier [Thu, 28 Apr 2016 01:49:03 +0000 (01:49 +0000)]
Guard Clang and GCC specific pragmas. Patch from STL@microsoft.com

llvm-svn: 267836

8 years agoFix include path in ClangTidy.cpp.
Stephen Hines [Thu, 28 Apr 2016 01:42:12 +0000 (01:42 +0000)]
Fix include path in ClangTidy.cpp.

Summary:
https://llvm.org/bugs/show_bug.cgi?id=27355
To compile with other binary output directory structures in build systems like Android.

Reviewers: srhines, alexfh

Subscribers: tberghammer, danalbert, cfe-commits

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

llvm-svn: 267835

8 years agoAdd the ability to limit "source regexp" breakpoints to a particular function
Jim Ingham [Thu, 28 Apr 2016 01:40:57 +0000 (01:40 +0000)]
Add the ability to limit "source regexp" breakpoints to a particular function
within a source file.

This isn't done, I need to make the name match smarter (right now it requires an
exact match which is annoying for methods of a class in a namespace.

Also, though we use it in tests all over the place, it doesn't look like we have
a test for Source Regexp breakpoints by themselves, I'll add that in a follow-on patch.

llvm-svn: 267834

8 years agoFixed a bug where const this would cause parser errors about $__lldb_expr.
Sean Callanan [Thu, 28 Apr 2016 01:36:21 +0000 (01:36 +0000)]
Fixed a bug where const this would cause parser errors about $__lldb_expr.

In templated const functions, trying to run an expression would produce the
error

error: out-of-line definition of '$__lldb_expr' does not match any declaration in 'foo'
member declaration does not match because it is const qualified
error: 1 error parsing expression

which is no good.  It turned out we don't actually need to worry about "const,"
we just need to be consistent about the declaration of the expression and the
FunctionDecl we inject into the class for "this."

Also added a test case.

<rdar://problem/24985958>

llvm-svn: 267833

8 years ago[analyzer] Move Checkers.inc to clang/include/...
Chih-Hung Hsieh [Thu, 28 Apr 2016 01:09:09 +0000 (01:09 +0000)]
[analyzer] Move Checkers.inc to clang/include/...

Simplify sharing of Checkers.inc with other files like ClangTidy.cpp.

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

llvm-svn: 267832

8 years agoFix bogus documentation for StringRef::slice in the End < Start case.
Richard Smith [Thu, 28 Apr 2016 00:57:14 +0000 (00:57 +0000)]
Fix bogus documentation for StringRef::slice in the End < Start case.

llvm-svn: 267831

8 years agoclang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi.
NAKAMURA Takumi [Thu, 28 Apr 2016 00:53:30 +0000 (00:53 +0000)]
clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi.

llvm-svn: 267830

8 years agoUse llvm:Twine instead of std::to_string.
Chaoren Lin [Thu, 28 Apr 2016 00:49:37 +0000 (00:49 +0000)]
Use llvm:Twine instead of std::to_string.

std::to_string is not available from the Android NDK.

Reviewers: lhames, ovyalov, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 267829

8 years agoclang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx98.cpp...
NAKAMURA Takumi [Thu, 28 Apr 2016 00:39:48 +0000 (00:39 +0000)]
clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx98.cpp: Appease ms targets with -fno-delayed-template-parsing.

llvm-svn: 267828

8 years agoUpdate test to use FileCheck
Sanjay Patel [Thu, 28 Apr 2016 00:29:27 +0000 (00:29 +0000)]
Update test to use FileCheck

Also, add some metadata to show what that currently looks like.

llvm-svn: 267827

8 years agoRemove Size from Undefined symbol.
Rui Ueyama [Thu, 28 Apr 2016 00:26:54 +0000 (00:26 +0000)]
Remove Size from Undefined symbol.

There seems to be no reason to keep st_size of undefined symbols.
This patch removes the member for it. This patch will change outputs
in cases that undefined symbols are copied to output, but I think
this is unimportant.

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

llvm-svn: 267826

8 years agoDriver: only produce CFI -fvisibility= error when compiling.
Peter Collingbourne [Thu, 28 Apr 2016 00:18:30 +0000 (00:18 +0000)]
Driver: only produce CFI -fvisibility= error when compiling.

The -fvisibility= flag only affects compile jobs, so there's no need to
error out because of it if we aren't compiling (e.g. if we are only linking).

llvm-svn: 267824

8 years ago[SystemZ] Support Swift Calling Convention
Bryan Chan [Thu, 28 Apr 2016 00:17:23 +0000 (00:17 +0000)]
[SystemZ] Support Swift Calling Convention

Summary:
Port rL265480, rL264754, rL265997 and rL266252 to SystemZ, in order to enable the Swift port on the architecture. SwiftSelf and SwiftError are assigned to R10 and R9, respectively, which are normally callee-saved registers. For more information, see:

RFC: Implementing the Swift calling convention in LLVM and Clang
https://groups.google.com/forum/#!topic/llvm-dev/epDd2w93kZ0

Reviewers: kbarton, manmanren, rjmccall, uweigand

Subscribers: llvm-commits

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

llvm-svn: 267823

8 years agoDo not lookup the symbol table twice for each --wrap.
Rui Ueyama [Thu, 28 Apr 2016 00:03:38 +0000 (00:03 +0000)]
Do not lookup the symbol table twice for each --wrap.

llvm-svn: 267822

8 years agoSort includes. NFC.
Rafael Espindola [Wed, 27 Apr 2016 23:54:04 +0000 (23:54 +0000)]
Sort includes. NFC.

llvm-svn: 267821

8 years agoLTO: Don't bother trying to mangle unnamed globals, as they can't be preserved with...
Peter Collingbourne [Wed, 27 Apr 2016 23:48:11 +0000 (23:48 +0000)]
LTO: Don't bother trying to mangle unnamed globals, as they can't be preserved with MustPreserveSymbols.

Summary: Should fix sanitizer-windows bot.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

llvm-svn: 267820

8 years agoFix bugs in llvm-objdump printing the last word for -section in non i386 and x86...
Kevin Enderby [Wed, 27 Apr 2016 23:43:00 +0000 (23:43 +0000)]
Fix bugs in llvm-objdump printing the last word for -section in non i386 and x86 files.
Two problems, 1) for the last 4 bytes it would print them as separate bytes not a word
and 2) it would print the same last byte for those bytes less than a word.

rdar://25938224

llvm-svn: 267819

8 years agoParse module information from DBI stream.
Zachary Turner [Wed, 27 Apr 2016 23:41:42 +0000 (23:41 +0000)]
Parse module information from DBI stream.

This gets more data out of the DBI strema of the PDB.  In
particular it extracts the metadata for the list of modules
(compilands) that this PDB contains info about, and adds support
for dumping these fields to llvm-pdbdump.

Differential Revision: http://reviews.llvm.org/D19570
Reviewed By: ruiu

llvm-svn: 267818

8 years ago[ImplicitNullChecks] Properly update the live-in of the block of the memory operation.
Quentin Colombet [Wed, 27 Apr 2016 23:26:40 +0000 (23:26 +0000)]
[ImplicitNullChecks] Properly update the live-in of the block of the memory operation.

We basically replace:
HoistBB:
cond_br NullBB, NotNullBB

NullBB:
  ...

NotNullBB:
  <reg> = load

into
HoistBB
<reg> = load_faulting_op NullBB
uncond_br NotNullBB

NullBB:
  ...

NotNullBB: ## <reg> is now live-in of NotNullBB
  ...

This partially fixes the machine verifier error for
test/CodeGen/X86/implicit-null-check.ll, but it still fails because
of the implicit CFG structure.

llvm-svn: 267817

8 years agomore buildbot failure fix to r267792
Rong Xu [Wed, 27 Apr 2016 23:23:53 +0000 (23:23 +0000)]
more buildbot failure fix to r267792

__llvm_prf_nm length is embedded in llvm_used. Relax llvm_used check.

llvm-svn: 267816

8 years ago[PGO] Promote indirect calls to conditional direct calls with value-profile
Rong Xu [Wed, 27 Apr 2016 23:20:27 +0000 (23:20 +0000)]
[PGO] Promote indirect calls to conditional direct calls with value-profile

This patch implements the transformation that promotes indirect calls to
conditional direct calls when the indirect-call value profile meta-data is
available.

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

llvm-svn: 267815

8 years ago[OpenMP] Code generation for target exit data directive
Samuel Antao [Wed, 27 Apr 2016 23:14:30 +0000 (23:14 +0000)]
[OpenMP] Code generation for target exit data directive

Summary:
This patch adds support for the target exit data directive code generation.

Given that, apart from the employed runtime call, target exit data requires the same code generation pattern as target enter data, the OpenMP codegen entry point was renamed and reused for both.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

llvm-svn: 267814

8 years ago[SimplifyCFG] propagate branch metadata when creating select
Sanjay Patel [Wed, 27 Apr 2016 23:14:12 +0000 (23:14 +0000)]
[SimplifyCFG] propagate branch metadata when creating select

There's no existing test for this path, and I don't know how to expose
it in a regression test, but I'm assuming there's some reason this
path exists.

llvm-svn: 267813

8 years ago[OpenMP] Code generation for target enter data directive
Samuel Antao [Wed, 27 Apr 2016 23:07:29 +0000 (23:07 +0000)]
[OpenMP] Code generation for target enter data directive

Summary: This patch adds support for the target enter data directive code generation.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

llvm-svn: 267812

8 years ago[OpenMP] Code generation for target data directive
Samuel Antao [Wed, 27 Apr 2016 22:58:19 +0000 (22:58 +0000)]
[OpenMP] Code generation for target data directive

Summary:
This patch adds support for the target data directive code generation.

Part of the already existent functionality related with data maps is moved to a new function so that it could be reused.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

llvm-svn: 267811

8 years ago[RuntimeDyld] Propagate another dropped error in RuntimeDyldELF.
Lang Hames [Wed, 27 Apr 2016 22:54:03 +0000 (22:54 +0000)]
[RuntimeDyld] Propagate another dropped error in RuntimeDyldELF.

This should fix the PPC64 bots.

llvm-svn: 267810

8 years ago[X86] Enable the post-RA-scheduler for clang's default 32-bit cpu.
Mitch Bodart [Wed, 27 Apr 2016 22:52:35 +0000 (22:52 +0000)]
[X86] Enable the post-RA-scheduler for clang's default 32-bit cpu.

For compilations with no explicit cpu specified, this exhibits
nice gains on Silvermont, with neutral performance on big cores.

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

llvm-svn: 267809

8 years ago[OpenMP] Map clause codegeneration.
Samuel Antao [Wed, 27 Apr 2016 22:40:57 +0000 (22:40 +0000)]
[OpenMP] Map clause codegeneration.

Summary:
Implement codegen for the map clause. All the new list items in 4.5 specification are supported.

Fix bug in the generation of array sections that was exposed by some of the map clause tests: for pointer types the offsets have to be calculated from the pointee not the pointer.

Reviewers: hfinkel, kkwli0, carlo.bertolli, arpith-jacob, ABataev

Subscribers: ABataev, cfe-commits, caomhin, fraggamuffin

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

llvm-svn: 267808

8 years agoFix a bug in llvm-objdump printing of 32-bit addresses for -section in non i386 and...
Kevin Enderby [Wed, 27 Apr 2016 22:36:18 +0000 (22:36 +0000)]
Fix a bug in llvm-objdump printing of 32-bit addresses for -section in non i386 and x86 files.

rdar://25896202

llvm-svn: 267807

8 years ago[X86][FastISel] Make sure we use the right register class when we select stores.
Quentin Colombet [Wed, 27 Apr 2016 22:33:42 +0000 (22:33 +0000)]
[X86][FastISel] Make sure we use the right register class when we select stores.

llvm-svn: 267806

8 years agoRemove unused LangOpts private variable in HeaderSearch.
Samuel Antao [Wed, 27 Apr 2016 22:28:32 +0000 (22:28 +0000)]
Remove unused LangOpts private variable in HeaderSearch.

Was causing warnings during the build.

llvm-svn: 267805

8 years agoMinor test simplification (per David Blaikie suggestion).
Paul Robinson [Wed, 27 Apr 2016 22:18:46 +0000 (22:18 +0000)]
Minor test simplification (per David Blaikie suggestion).

llvm-svn: 267804

8 years agoFix buildbot failure due to r267792
Rong Xu [Wed, 27 Apr 2016 22:06:35 +0000 (22:06 +0000)]
Fix buildbot failure due to r267792

Relax the test check as some targets do not have name compression.

llvm-svn: 267803

8 years ago[modules] When diagnosing a missing module import, suggest adding a #include if
Richard Smith [Wed, 27 Apr 2016 21:57:05 +0000 (21:57 +0000)]
[modules] When diagnosing a missing module import, suggest adding a #include if
the current language doesn't have an import syntax and we can figure out a
suitable file to include.

llvm-svn: 267802

8 years ago[ELF] -R is an alias for -rpath.
Davide Italiano [Wed, 27 Apr 2016 21:56:53 +0000 (21:56 +0000)]
[ELF] -R is an alias for -rpath.

perl-5 uses the former, so provide an alias. Found while linking
the whole set of FreeBSD ports with lld.

llvm-svn: 267801

8 years agoXFail TestIRInterpreter on Windows
Adrian McCarthy [Wed, 27 Apr 2016 21:53:19 +0000 (21:53 +0000)]
XFail TestIRInterpreter on Windows

There's an open bug with calling functions in the inferior.  And Windows doesn't have the POSIX function getpid().

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

llvm-svn: 267800

8 years ago[Hexagon] Merging nops in to previous packet rather than always creating a new one.
Colin LeMahieu [Wed, 27 Apr 2016 21:37:44 +0000 (21:37 +0000)]
[Hexagon] Merging nops in to previous packet rather than always creating a new one.

llvm-svn: 267798

8 years ago[X86] Fix the lowering of TLS calls.
Quentin Colombet [Wed, 27 Apr 2016 21:37:37 +0000 (21:37 +0000)]
[X86] Fix the lowering of TLS calls.

The callseq_end node must be glued with the TLS calls, otherwise,
the generic code will miss the uses of the returned value and will
mark it dead.
Moreover, TLSCall 64-bit pseudo must not set an implicit-use on RDI,
the pseudo uses the symbol address at this point not RDI and the
lowering will do the right thing.

llvm-svn: 267797

8 years ago[MCAssembler] Allow backend to finalize layout post-relaxation.
Colin LeMahieu [Wed, 27 Apr 2016 21:26:13 +0000 (21:26 +0000)]
[MCAssembler] Allow backend to finalize layout post-relaxation.

Differential revision: http://reviews.llvm.org/D19429

llvm-svn: 267796

8 years ago[MSan] [PowerPC] Dereference function descriptors when recording stack origins.
Marcin Koscielnicki [Wed, 27 Apr 2016 21:24:24 +0000 (21:24 +0000)]
[MSan] [PowerPC] Dereference function descriptors when recording stack origins.

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

llvm-svn: 267795

8 years ago[sanitizers] Get the proper symbol version when long double transition is involved.
Marcin Koscielnicki [Wed, 27 Apr 2016 21:24:21 +0000 (21:24 +0000)]
[sanitizers] Get the proper symbol version when long double transition is involved.

On linux, some architectures had an ABI transition from 64-bit long double
(ie. same as double) to 128-bit long double.  On those, glibc symbols
involving long doubles come in two versions, and we need to pass the
correct one to dlvsym when intercepting them.

A few more functions we intercept are also versioned (all printf, scanf,
strtold variants), but there's no need to fix these, as the REAL() versions
are never called.

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

llvm-svn: 267794

8 years ago[sanitizer] Add early call handling to strchr + strrchr interceptors
Derek Bruening [Wed, 27 Apr 2016 21:20:46 +0000 (21:20 +0000)]
[sanitizer] Add early call handling to strchr + strrchr interceptors

Summary:
The strchr and strrchr interceptors are sometimes invoked too early
for their REAL() counterparts to be initialized.  We have seen this in
hooks invoked from tcmalloc on the dlsym() used in initializing
interceptors.  A special check is added to use internal_ routines for
this situation.

Reviewers: vitalybuka, aizatsky, filcab

Subscribers: filcab, llvm-commits, eugenis, kcc, zhaoqin, aizatsky, kubabrecka

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

llvm-svn: 267793

8 years ago[PGO] Prohibit address recording if the function is both internal and COMDAT
Rong Xu [Wed, 27 Apr 2016 21:17:30 +0000 (21:17 +0000)]
[PGO] Prohibit address recording if the function is both internal and COMDAT

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

llvm-svn: 267792

8 years agoAMDGPU: Account for globals in AMDGPUPromoteAlloca pass
Matt Arsenault [Wed, 27 Apr 2016 21:05:08 +0000 (21:05 +0000)]
AMDGPU: Account for globals in AMDGPUPromoteAlloca pass

Patch by Bas Nieuwenhuizen

llvm-svn: 267791

8 years ago[RuntimeDyld] Add missing include - <string> is requried for std::to_string.
Lang Hames [Wed, 27 Apr 2016 20:54:49 +0000 (20:54 +0000)]
[RuntimeDyld] Add missing include - <string> is requried for std::to_string.

This should fix the compile error that showed up in build:
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/6754/

llvm-svn: 267790

8 years ago[RuntimeDyld] Propagate Errors from findPPC64TOCSection.
Lang Hames [Wed, 27 Apr 2016 20:51:58 +0000 (20:51 +0000)]
[RuntimeDyld] Propagate Errors from findPPC64TOCSection.

llvm-svn: 267789

8 years agoRevert unnecessary tblgen change.
Peter Collingbourne [Wed, 27 Apr 2016 20:49:44 +0000 (20:49 +0000)]
Revert unnecessary tblgen change.

llvm-svn: 267788

8 years agoWdocumentation fix
Simon Pilgrim [Wed, 27 Apr 2016 20:43:32 +0000 (20:43 +0000)]
Wdocumentation fix

llvm-svn: 267786