platform/upstream/llvm.git
8 years agoRemove skipIfHostPlatform and skipUnlessHostPlatform decorators.
Zachary Turner [Tue, 9 Feb 2016 00:36:27 +0000 (00:36 +0000)]
Remove skipIfHostPlatform and skipUnlessHostPlatform decorators.

llvm-svn: 260177

8 years agoRemove the skipUnlessArch decorator.
Zachary Turner [Tue, 9 Feb 2016 00:36:22 +0000 (00:36 +0000)]
Remove the skipUnlessArch decorator.

Convert everything over to using skipIf.

llvm-svn: 260176

8 years ago[asan] Fix build on Windows and PowerPC.
Evgeniy Stepanov [Tue, 9 Feb 2016 00:28:57 +0000 (00:28 +0000)]
[asan] Fix build on Windows and PowerPC.

llvm-svn: 260175

8 years agoThis patch is to fix PR26529 caused by r259736.
Wei Mi [Tue, 9 Feb 2016 00:07:08 +0000 (00:07 +0000)]
This patch is to fix PR26529 caused by r259736.

IndVarSimplify assumes scAddRecExpr to be expanded in literal form instead of
canonical form by calling disableCanonicalMode after it creates SCEVExpander.
When CanonicalMode is disabled, SCEVExpander::expand should always return PHI
node for scAddRecExpr. r259736 broke the assumption.

The fix is to let SCEVExpander::expand skip the reuse Value logic if
CanonicalMode is false.

In addition, Besides IndVarSimplify, LSR pass also calls disableCanonicalMode
before doing rewrite. We can remove the original check of LSRMode in reuse
Value logic and use CanonicalMode instead.

llvm-svn: 260174

8 years ago[llvm-nm] Remove excessive parenthesis, noticed by David Blaikie.
Davide Italiano [Mon, 8 Feb 2016 23:50:23 +0000 (23:50 +0000)]
[llvm-nm] Remove excessive parenthesis, noticed by David Blaikie.

llvm-svn: 260173

8 years agoRevert r260012 due to __gnu_cxx::hash_map breakage
Eric Fiselier [Mon, 8 Feb 2016 23:47:13 +0000 (23:47 +0000)]
Revert r260012 due to __gnu_cxx::hash_map breakage

llvm-svn: 260172

8 years ago[PGO] Revert r260146 as it breaks Darwin platforms.
Rong Xu [Mon, 8 Feb 2016 23:11:16 +0000 (23:11 +0000)]
[PGO] Revert r260146 as it breaks Darwin platforms.
r260146 | xur | 2016-02-08 13:07:46 -0800 (Mon, 08 Feb 2016) | 13 lines
[PGO] Differentiate Clang instrumentation and IR level instrumentation profiles

llvm-svn: 260170

8 years agoFactor out UnrollAnalyzer to Analysis, and add unit tests for it.
Michael Zolotukhin [Mon, 8 Feb 2016 23:03:59 +0000 (23:03 +0000)]
Factor out UnrollAnalyzer to Analysis, and add unit tests for it.

Summary:
Unrolling Analyzer is already pretty complicated, and it becomes harder and harder to exercise it with usual IR tests, as with them we can only check the final decision: whether the loop is unrolled or not. This change factors this framework out from LoopUnrollPass to analyses, which allows to use unit tests.
The change itself is supposed to be NFC, except adding a couple of tests.

I plan to add more tests as I add new functionality and find/fix bugs.

Reviewers: chandlerc, hfinkel, sanjoy

Subscribers: zzheng, sanjoy, llvm-commits

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

llvm-svn: 260169

8 years ago[X86][SSE1] Add MOVLHPS/MOVHLPS lowering and memory folding support
Simon Pilgrim [Mon, 8 Feb 2016 23:03:46 +0000 (23:03 +0000)]
[X86][SSE1] Add MOVLHPS/MOVHLPS lowering and memory folding support

As discussed on PR26491, this patch adds support for lowering v4f32 shuffles to the MOVLHPS/MOVHLPS instructions. It also adds support for memory folding with their MOVLPS/MOVHPS load equivalents.

This first patch only really helps SSE1 targets as SSE2+ targets will widen the shuffle mask and use v2f64 equivalents (although they still combine to MOVLHPS/MOVHLPS for v2f64 splats). This will have to be addressed in a future patch, most likely when we add support for binary target shuffle combines.

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

llvm-svn: 260168

8 years ago[asan] Fix Windows build.
Evgeniy Stepanov [Mon, 8 Feb 2016 23:01:06 +0000 (23:01 +0000)]
[asan] Fix Windows build.

llvm-svn: 260167

8 years ago[llvm-nm] Yet another attempt of simplifying code.
Davide Italiano [Mon, 8 Feb 2016 22:58:26 +0000 (22:58 +0000)]
[llvm-nm] Yet another attempt of simplifying code.

llvm-svn: 260166

8 years ago[asan] Remove leftover debug print statement.
Evgeniy Stepanov [Mon, 8 Feb 2016 22:54:46 +0000 (22:54 +0000)]
[asan] Remove leftover debug print statement.

llvm-svn: 260165

8 years ago[regalloc][WinEH] Do not mark intervals as not spillable if they contain a regmask
Andrew Kaylor [Mon, 8 Feb 2016 22:52:51 +0000 (22:52 +0000)]
[regalloc][WinEH] Do not mark intervals as not spillable if they contain a regmask

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

llvm-svn: 260164

8 years ago[asan] Implement SEGV read vs write detection for ARM and AArch64.
Evgeniy Stepanov [Mon, 8 Feb 2016 22:50:25 +0000 (22:50 +0000)]
[asan] Implement SEGV read vs write detection for ARM and AArch64.

llvm-svn: 260163

8 years agollvm-cov: Fix reading gcov data that does not have function names
Justin Bogner [Mon, 8 Feb 2016 22:49:40 +0000 (22:49 +0000)]
llvm-cov: Fix reading gcov data that does not have function names

In order for recent gcov versions to read the coverage data, you have
to use UseCfgChecksum=true and FunctionNamesInData=false options for
coverage profiling pass. This is because gcov is expecting the
function section in .gcda to be exactly 3 words in size, containing
ident and two checksums.

While llvm-cov is compatible with UseCfgChecksum=true, it always
expects a function name in .gcda function sections (it's not
compatible with FunctionNamesInData=false). Thus it's currently
impossible to generate one set of coverage files that works with both
gcov and llvm-cov.

This change fixes the reading of coverage information to only read the
function name if it's present.

Patch by Arseny Kapoulkine. Thanks!

llvm-svn: 260162

8 years ago[PGO] Cover more cases of implicitly generated C++ methods
Xinliang David Li [Mon, 8 Feb 2016 22:41:37 +0000 (22:41 +0000)]
[PGO] Cover more cases of implicitly generated C++ methods

llvm-svn: 260161

8 years agoThis patch adds doxygen comments for all the intrinsincs in the header file pmmintrin...
Ekaterina Romanova [Mon, 8 Feb 2016 22:35:09 +0000 (22:35 +0000)]
This patch adds doxygen comments for all the intrinsincs in the header file pmmintrin.h. The doxygen comments are automatically generated based on Sony's intrinsics document.

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

llvm-svn: 260160

8 years agoMake ParentMap work with explicit specializations of function templates.
Nico Weber [Mon, 8 Feb 2016 22:23:09 +0000 (22:23 +0000)]
Make ParentMap work with explicit specializations of function templates.

For an explicit specialization, we first build a FunctionDecl, and then
we call SubstDecl() on it to build a second FunctionDecl, which has the
first FunctionDecl as canonical decl.

The address of an explicit specialization of function template used to be the
canonical decl of the FunctionDecl.  This is different from all the other
DeduceTemplateArguments() calls in SemaOverload, and since the canonical decl
isn't visited by ParentMap while the redecl is, it also made ParentMap assert
when computing the parent of a address-of-explicit-specialization-fun-template.

To fix, remove the getCanonicalDecl() call.  No behavior difference for clang,
but it fixes an assert in ParentMap (which is e.g. used by libTooling).

llvm-svn: 260159

8 years ago[Concepts] Remove the IsConcept bit and associated member functions from VarDecl
Nathan Wilson [Mon, 8 Feb 2016 22:02:50 +0000 (22:02 +0000)]
[Concepts] Remove the IsConcept bit and associated member functions from VarDecl
because the information is now stored in TemplateDecl.

llvm-svn: 260155

8 years agocmake: Use "set" instead of "option" for LLVM_ENABLE_LTO
Justin Bogner [Mon, 8 Feb 2016 21:55:19 +0000 (21:55 +0000)]
cmake: Use "set" instead of "option" for LLVM_ENABLE_LTO

Apparently option is for bools and cmake-gui will display this
strangely with option.

Pointed out by edward-san - thanks!

llvm-svn: 260154

8 years agoMove includes inside guards. NFC.
Pete Cooper [Mon, 8 Feb 2016 21:50:45 +0000 (21:50 +0000)]
Move includes inside guards.  NFC.

These includes were before the #ifndef/#define guards.  Moving them to
where they should be.

llvm-svn: 260153

8 years ago[WebAssembly] Update the br_if instructions' operand orders to match the spec.
Dan Gohman [Mon, 8 Feb 2016 21:50:13 +0000 (21:50 +0000)]
[WebAssembly] Update the br_if instructions' operand orders to match the spec.

llvm-svn: 260152

8 years agorangify; NFC
Sanjay Patel [Mon, 8 Feb 2016 21:32:43 +0000 (21:32 +0000)]
rangify; NFC

llvm-svn: 260151

8 years ago[PGO] Update InstrProfData.inc to sync with llvm
Rong Xu [Mon, 8 Feb 2016 21:18:18 +0000 (21:18 +0000)]
[PGO] Update InstrProfData.inc to sync with llvm

Sync InstrProfData.inc with the one in llvm.

llvm-svn: 260148

8 years agoFix typo in asan_flags.
George Burgess IV [Mon, 8 Feb 2016 21:10:00 +0000 (21:10 +0000)]
Fix typo in asan_flags.

Patch by Michael Stapelberg.

llvm-svn: 260147

8 years ago[PGO] Differentiate Clang instrumentation and IR level instrumentation profiles
Rong Xu [Mon, 8 Feb 2016 21:07:46 +0000 (21:07 +0000)]
[PGO] Differentiate Clang instrumentation and IR level instrumentation profiles

This patch uses one bit in profile version to differentiate Clang
instrumentation and IR level instrumentation profiles.

PGOInstrumenation generates a COMDAT variable __llvm_profile_raw_version so
that the compiler runtime can set the right profile kind.
PGOInstrumenation now checks this bit to make sure it's an IR level
instrumentation profile.

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

llvm-svn: 260146

8 years ago[x86] convert masked store of one element to scalar store
Sanjay Patel [Mon, 8 Feb 2016 21:05:08 +0000 (21:05 +0000)]
[x86] convert masked store of one element to scalar store

Another opportunity to reduce masked stores: in D16691, we decided not to attempt the 'one mask element is set'
transform in InstCombine, but this should be a win for any AVX machine.

Code comments note that this transform could be extended for other targets / cases.

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

llvm-svn: 260145

8 years agocmake: Accept "thin" or "full" as arguments to -DLLVM_ENABLE_LTO
Justin Bogner [Mon, 8 Feb 2016 21:01:24 +0000 (21:01 +0000)]
cmake: Accept "thin" or "full" as arguments to -DLLVM_ENABLE_LTO

Mehdi suggested in a review of r259766 that it's also useful to easily
set the type of LTO. Augment the cmake variable to support that.

llvm-svn: 260143

8 years ago[PGO] Simpflify test and increase coverage
Xinliang David Li [Mon, 8 Feb 2016 20:46:26 +0000 (20:46 +0000)]
[PGO] Simpflify test and increase coverage

llvm-svn: 260142

8 years agoFix build bot failure
Xinliang David Li [Mon, 8 Feb 2016 20:08:21 +0000 (20:08 +0000)]
Fix build bot failure

llvm-svn: 260138

8 years agoAMDGPU/SI: Implement a work-around for smrd corrupting vccz bit
Tom Stellard [Mon, 8 Feb 2016 19:49:20 +0000 (19:49 +0000)]
AMDGPU/SI: Implement a work-around for smrd corrupting vccz bit

Summary:
We will hit this once we have enabled uniform branches.  The
smrd-vccz-bug.ll test will be added with the uniform branch commit.

Reviewers: mareko, arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 260137

8 years agoAdd triple to h-registers-3.ll to make bots happy after r260133
Hans Wennborg [Mon, 8 Feb 2016 19:45:24 +0000 (19:45 +0000)]
Add triple to h-registers-3.ll to make bots happy after r260133

llvm-svn: 260136

8 years agoA number of improvements to decorator conditionals.
Zachary Turner [Mon, 8 Feb 2016 19:35:18 +0000 (19:35 +0000)]
A number of improvements to decorator conditionals.

* Change the `not_in` function to be called `no_match`.  This makes
  it clear that keyword arguments can be more than just lists.
* Change the name of `_check_list_or_lambda` to
  `_match_decorator_property`.  Again clarifying that decorator params
  are not always lists.
* Always use a regex match when matching strings.  This allows automatic
  support for regex matching on all decorator properties.  Also support
  compiled regex values.
* Fix a bug in the compiler check used by _decorateTest.  The two
  arguments were reversed, the condition was always wrong.
* Change one test that uses skipUnlessArch to use skipIf, to
  demonstrate that skipIf can now handle more scenarios.

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

llvm-svn: 260135

8 years agoRemove expectedFailureWindows decorator.
Zachary Turner [Mon, 8 Feb 2016 19:34:59 +0000 (19:34 +0000)]
Remove expectedFailureWindows decorator.

expectedFailureWindows is equivalent to using the general
expectedFailureAll decorator with oslist="windows".  Additionally,
by moving towards these common decorators we can solve the issue
of having to support decorators that can be called with or without
arguments.  Once all decorators are always called with arguments,
and this is enforced by design (because you can't specify the condition
you're decorating for without passing an argument) the implementation
of the decorators can become much simpler

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

llvm-svn: 260134

8 years ago[X86] Don't zero/sign-extend i1, i8, or i16 return values to 32 bits (PR22532)
Hans Wennborg [Mon, 8 Feb 2016 19:34:30 +0000 (19:34 +0000)]
[X86] Don't zero/sign-extend i1, i8, or i16 return values to 32 bits (PR22532)

This matches GCC and MSVC's behaviour, and saves on code size.

We were already not extending i1 return values on x86_64 after r127766. This
takes that patch further by applying it to x86 target as well, and also for i8
and i16.

The ABI docs have been unclear about the required behaviour here. The new i386
psABI [1] clearly states (Table 2.4, page 14) that i1, i8, and i16 return
vales do not need to be extended beyond 8 bits. The x86_64 ABI doc is being
updated to say the same [2].

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

 [1]. https://01.org/sites/default/files/file_attach/intel386-psabi-1.0.pdf
 [2]. https://groups.google.com/d/msg/x86-64-abi/E8O33onbnGQ/_RFWw_ixDQAJ

llvm-svn: 260133

8 years ago[asan] fix the Windows build (MSVC says: cannot specify explicit initializer for...
Kostya Serebryany [Mon, 8 Feb 2016 19:33:36 +0000 (19:33 +0000)]
[asan] fix the Windows build (MSVC says: cannot specify explicit initializer for arrays)

llvm-svn: 260132

8 years agoAArch64: match correct order in subtraction pattern.
Tim Northover [Mon, 8 Feb 2016 19:33:18 +0000 (19:33 +0000)]
AArch64: match correct order in subtraction pattern.

The accumulator in multiply-and-subtract instructions is actually subtracted
*from* so these patterns were computing the wrong value.

llvm-svn: 260131

8 years agofix typos; NFC
Sanjay Patel [Mon, 8 Feb 2016 19:27:33 +0000 (19:27 +0000)]
fix typos; NFC

llvm-svn: 260130

8 years ago[Coverage] Fix crash when handling certain macro expansions
Vedant Kumar [Mon, 8 Feb 2016 19:25:45 +0000 (19:25 +0000)]
[Coverage] Fix crash when handling certain macro expansions

When handling 'if' statements, we crash if the condition and the consequent
branch are spanned by a single macro expansion.

The crash occurs because of a sanity 'reset' in popRegions(): if an expansion
exactly spans an entire region, we set MostRecentLocation to the start of the
expansion (its 'include location'). This ensures we don't handleFileExit()
ourselves out of the expansion before we're done processing all of the regions
within it. This is tested in test/CoverageMapping/macro-expressions.c.

This causes a problem when an expansion spans both the condition and the
consequent branch of an 'if' statement. MostRecentLocation is updated to the
start of the 'if' statement in popRegions(), so the file for the expansion
isn't exited by the time we're done handling the statement. We then crash with
'fatal: File exit not handled before popRegions'.

The fix for this is to detect these kinds of expansions, and conservatively
update MostRecentLocation to the end of expansion region containing the
conditional. I've added tests to make sure we don't have the same problem with
other kinds of statements.

rdar://problem/23630316

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

llvm-svn: 260129

8 years ago[asan] re-commit r259961, this time making the test Linux-Only
Kostya Serebryany [Mon, 8 Feb 2016 19:21:08 +0000 (19:21 +0000)]
[asan] re-commit r259961, this time making the test Linux-Only

llvm-svn: 260128

8 years agoSimplify test cases
Xinliang David Li [Mon, 8 Feb 2016 19:14:14 +0000 (19:14 +0000)]
Simplify test cases

llvm-svn: 260126

8 years agoSimplify this unittest.
Adrian Prantl [Mon, 8 Feb 2016 19:13:15 +0000 (19:13 +0000)]
Simplify this unittest.

Thanks to dblaikie for the suggestion!

llvm-svn: 260125

8 years agoRemove dead code.
Richard Smith [Mon, 8 Feb 2016 19:10:14 +0000 (19:10 +0000)]
Remove dead code.

llvm-svn: 260124

8 years agoAMDGPU: Remove bfi and bfm intrinsics
Matt Arsenault [Mon, 8 Feb 2016 19:06:01 +0000 (19:06 +0000)]
AMDGPU: Remove bfi and bfm intrinsics

Nothing is using them.

llvm-svn: 260123

8 years ago[ThinLTO] Remove imported available externally defs from comdats.
Teresa Johnson [Mon, 8 Feb 2016 18:47:20 +0000 (18:47 +0000)]
[ThinLTO] Remove imported available externally defs from comdats.

Summary:
Available externally definitions are considered declarations for the
linker and eventually dropped. As such they are not allowed to be
in comdats. Remove any such imported functions from comdats.

Reviewers: rafael

Subscribers: davidxl, llvm-commits, joker.eph

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

llvm-svn: 260122

8 years agoFix windows build bot failure
Xinliang David Li [Mon, 8 Feb 2016 18:27:04 +0000 (18:27 +0000)]
Fix windows build bot failure

llvm-svn: 260120

8 years ago[PGO] Enable compression in pgo instrumentation
Xinliang David Li [Mon, 8 Feb 2016 18:14:02 +0000 (18:14 +0000)]
[PGO] Enable compression in pgo instrumentation

This reduces sizes of instrumented object files, final binaries,
process images, and raw profile data.

The format of the indexed profile data remain the same.

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

llvm-svn: 260118

8 years ago[PGO] Enable compression in pgo instrumentation
Xinliang David Li [Mon, 8 Feb 2016 18:13:49 +0000 (18:13 +0000)]
[PGO] Enable compression in pgo instrumentation

This reduces sizes of instrumented object files, final binaries,
process images, and raw profile data.

The format of the indexed profile data remain the same.

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

llvm-svn: 260117

8 years agoFix missing space (NFC)
Rong Xu [Mon, 8 Feb 2016 18:12:41 +0000 (18:12 +0000)]
Fix missing space (NFC)

Fixed the inconsistently placed : (missing space) introduced in in r259811.

llvm-svn: 260116

8 years agoClean up a test; get rid of hard-wired char/wchar_t code for template fns that take...
Marshall Clow [Mon, 8 Feb 2016 17:38:23 +0000 (17:38 +0000)]
Clean up a test; get rid of hard-wired char/wchar_t code for template fns that take any char type. Prep work for PR#26503

llvm-svn: 260115

8 years agomath: Add frexp ported from amd-builtins
Aaron Watry [Mon, 8 Feb 2016 17:07:21 +0000 (17:07 +0000)]
math: Add frexp ported from amd-builtins

The float implementation is almost a direct port from the amd-builtins,
but instead of just having a scalar and float4 implementation, it has
a scalar and arbitrary width vector implementation.

The double scalar is also a direct port from AMD's builtin release.

The double vector implementation copies the logic in the float vector
implementation using the values from the double scalar version.

Both have been tested in piglit using tests sent to that project's
mailing list.

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 260114

8 years agoUse llvm::TempDIScope instead of manually deleting a temporary MDNode.
Adrian Prantl [Mon, 8 Feb 2016 17:03:28 +0000 (17:03 +0000)]
Use llvm::TempDIScope instead of manually deleting a temporary MDNode.

llvm-svn: 260113

8 years ago[SCEV][LAA] Re-commit r260085 and r260086, this time with a fix for the memory
Silviu Baranga [Mon, 8 Feb 2016 17:02:45 +0000 (17:02 +0000)]
[SCEV][LAA] Re-commit r260085 and r260086, this time with a fix for the memory
sanitizer issue. The PredicatedScalarEvolution's copy constructor
wasn't copying the Generation value, and was leaving it un-initialized.

Original commit message:

[SCEV][LAA] Add no wrap SCEV predicates and use use them to improve strided pointer detection

Summary:
This change adds no wrap SCEV predicates with:
  - support for runtime checking
  - support for expression rewriting:
      (sext ({x,+,y}) -> {sext(x),+,sext(y)}
      (zext ({x,+,y}) -> {zext(x),+,sext(y)}

Note that we are sign extending the increment of the SCEV, even for
the zext case. This is needed to cover the fairly common case where y would
be a (small) negative integer. In order to do this, this change adds two new
flags: nusw and nssw that are applicable to AddRecExprs and permit the
transformations above.

We also change isStridedPtr in LAA to be able to make use of
these predicates. With this feature we should now always be able to
work around overflow issues in the dependence analysis.

Reviewers: mzolotukhin, sanjoy, anemet

Subscribers: mzolotukhin, sanjoy, llvm-commits, rengolin, jmolloy, hfinkel

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

llvm-svn: 260112

8 years agoAdd a unit test for r259973.
Adrian Prantl [Mon, 8 Feb 2016 17:02:34 +0000 (17:02 +0000)]
Add a unit test for r259973.

llvm-svn: 260111

8 years ago[JumpThreading] Change a return of ComputeValueKnownInPredecessors()
Haicheng Wu [Mon, 8 Feb 2016 17:00:39 +0000 (17:00 +0000)]
[JumpThreading] Change a return of ComputeValueKnownInPredecessors()

Change a return statement of ComputeValueKnownInPredecessors() to be the same as
the rest return statements of the function. Otherwise, it might return true with
an empty Result when the current basic block has no predecessors and trigger the
first assert of JumpThreading::ProcessThreadableEdges().

llvm-svn: 260110

8 years agoSelectionDAG: Lower some range metadata to AssertZext
Matt Arsenault [Mon, 8 Feb 2016 16:28:19 +0000 (16:28 +0000)]
SelectionDAG: Lower some range metadata to AssertZext

If a range has a lower bound of 0, add an AssertZext from the
nearest floor power of two.

This allows operations with some workitem intrinsics with known
maximum ranges to use fast 24-bit multiplies.

llvm-svn: 260109

8 years ago[clang-tidy] Some improvements in 'misc-definitions-in-headers' check.
Haojian Wu [Mon, 8 Feb 2016 16:05:39 +0000 (16:05 +0000)]
[clang-tidy] Some improvements in 'misc-definitions-in-headers' check.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260108

8 years ago[clang-tidy] Fix assertion failure on `at` function in modernize-loop-convert.
Haojian Wu [Mon, 8 Feb 2016 15:59:42 +0000 (15:59 +0000)]
[clang-tidy] Fix assertion failure on `at` function in modernize-loop-convert.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260107

8 years agoRe-apply for the 2nd-time r259977 - [OpenMP] Reorganize code to allow specialized...
Samuel Antao [Mon, 8 Feb 2016 15:59:20 +0000 (15:59 +0000)]
Re-apply for the 2nd-time r259977 - [OpenMP] Reorganize code to allow specialized code generation for different devices.

This was reverted by r260036, but was not the cause of the problem in the buildbot.

llvm-svn: 260106

8 years ago[clang-tidy] Correct IncorrectRoundings namespace.
Haojian Wu [Mon, 8 Feb 2016 15:54:30 +0000 (15:54 +0000)]
[clang-tidy] Correct IncorrectRoundings namespace.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260105

8 years agoMove static functions returning UDTs outside of the extern "C" block. Silences an...
Aaron Ballman [Mon, 8 Feb 2016 15:52:13 +0000 (15:52 +0000)]
Move static functions returning UDTs outside of the extern "C" block. Silences an MSVC warning, and reduces the number of exported symbols.

llvm-svn: 260104

8 years agoFix the alignment of PT_PHDR.
Rafael Espindola [Mon, 8 Feb 2016 15:33:53 +0000 (15:33 +0000)]
Fix the alignment of PT_PHDR.

We were claiming it was aligned to 8 bytes even on 32 bit files, which
is not the case.

llvm-svn: 260102

8 years ago[AVX512][PROLQ][PROLD] Change imm8 to int
Michael Zuckerman [Mon, 8 Feb 2016 15:13:32 +0000 (15:13 +0000)]
[AVX512][PROLQ][PROLD] Change imm8 to int

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

llvm-svn: 260101

8 years ago[clang-tidy] Reshuffled paragraphs a bit, added contents.
Alexander Kornienko [Mon, 8 Feb 2016 15:09:39 +0000 (15:09 +0000)]
[clang-tidy] Reshuffled paragraphs a bit, added contents.

llvm-svn: 260100

8 years ago[clang-tidy] Fix an error in .rst
Alexander Kornienko [Mon, 8 Feb 2016 15:09:34 +0000 (15:09 +0000)]
[clang-tidy] Fix an error in .rst

llvm-svn: 260099

8 years ago[clang-tidy] Update documentation
Alexander Kornienko [Mon, 8 Feb 2016 15:09:28 +0000 (15:09 +0000)]
[clang-tidy] Update documentation

Summary: We have 2 scripts add_new_check.py and rename_check.py to bootstrap a new check creation. There is also clang-query to aid with the matcher creation. These were not mentioned in the current document, add them so it's available to the masses.

Reviewers: alexfh

Patch by Deniz Türkoglu!

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

llvm-svn: 260098

8 years agoReverting r260096; it causes build bot failures:
Aaron Ballman [Mon, 8 Feb 2016 14:37:56 +0000 (14:37 +0000)]
Reverting r260096; it causes build bot failures:

http://bb.pgr.jp/builders/cmake-clang-tools-x86_64-linux/builds/23351
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/492

llvm-svn: 260097

8 years agoExpand the simplify boolean expression check to handle implicit conversion of integra...
Aaron Ballman [Mon, 8 Feb 2016 14:25:25 +0000 (14:25 +0000)]
Expand the simplify boolean expression check to handle implicit conversion of integral types to bool and improve the handling of implicit conversion of member pointers to bool.

Implicit conversion of member pointers are replaced with explicit comparisons to nullptr.

Implicit conversions of integral types are replaced with explicit comparisons to 0.

Patch by Richard Thomson.

llvm-svn: 260096

8 years ago[SLP] Fix placement of debug statement (NFC)
Igor Breger [Mon, 8 Feb 2016 14:11:39 +0000 (14:11 +0000)]
[SLP] Fix placement of debug statement (NFC)

By Ayal Zaks (ayal.zaks@intel.com)

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

llvm-svn: 260094

8 years agoclang/test/OpenMP/parallel_private_codegen.cpp: Fix an expression.
NAKAMURA Takumi [Mon, 8 Feb 2016 14:04:28 +0000 (14:04 +0000)]
clang/test/OpenMP/parallel_private_codegen.cpp: Fix an expression.

  call x86_thiscallcc void @_ZN2SSC1ERi(

It matched to:

  <call> x86_this<callcc void @_ZN2SSC1ERi(>

llvm-svn: 260093

8 years ago[OPENMP] Fix test incompatibility with arm buildbots
Alexey Bataev [Mon, 8 Feb 2016 13:47:46 +0000 (13:47 +0000)]
[OPENMP] Fix test incompatibility with arm buildbots

llvm-svn: 260092

8 years ago[OPENMP] Fixed test incompat with MSVC
Alexey Bataev [Mon, 8 Feb 2016 13:02:00 +0000 (13:02 +0000)]
[OPENMP] Fixed test incompat with MSVC

llvm-svn: 260091

8 years ago[asan] XFAIL local_alias.cc testcase on android in order to fix sanitizer-x86_64...
Maxim Ostapenko [Mon, 8 Feb 2016 12:58:05 +0000 (12:58 +0000)]
[asan] XFAIL local_alias.cc testcase on android in order to fix sanitizer-x86_64-linux buildbot.

llvm-svn: 260090

8 years agoAVX512: Change builtin function name for scalar intrinsics. Add "mask" to function...
Igor Breger [Mon, 8 Feb 2016 12:38:03 +0000 (12:38 +0000)]
AVX512: Change builtin function name for scalar intrinsics. Add "mask" to function name to reflect the function behavior.

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

llvm-svn: 260089

8 years agoAVX512: Change builtin function name for scalar intrinsics. Add "mask" to function...
Igor Breger [Mon, 8 Feb 2016 12:36:48 +0000 (12:36 +0000)]
AVX512: Change builtin function name for scalar intrinsics. Add "mask" to function name to reflect the function behavior.

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

llvm-svn: 260088

8 years agoRevert r260086 and r260085. They have broken the memory
Silviu Baranga [Mon, 8 Feb 2016 11:56:15 +0000 (11:56 +0000)]
Revert r260086 and r260085. They have broken the memory
sanitizer bots.

llvm-svn: 260087

8 years ago[LoopVersioning] Don't assert when there are no memchecks
Silviu Baranga [Mon, 8 Feb 2016 11:15:29 +0000 (11:15 +0000)]
[LoopVersioning] Don't assert when there are no memchecks

We shouldn't assert when there are no memchecks, since we
can have SCEV checks. There is already an assert covering
the case where there are no SCEV checks or memchecks.

This also changes the LAA pointer wrapping versioning test
to use the loop versioning pass (this was how I managed to
trigger the assert in the loop versioning pass).

llvm-svn: 260086

8 years ago[SCEV][LAA] Add no wrap SCEV predicates and use use them to improve strided pointer...
Silviu Baranga [Mon, 8 Feb 2016 10:45:50 +0000 (10:45 +0000)]
[SCEV][LAA] Add no wrap SCEV predicates and use use them to improve strided pointer detection

Summary:
This change adds no wrap SCEV predicates with:
  - support for runtime checking
  - support for expression rewriting:
      (sext ({x,+,y}) -> {sext(x),+,sext(y)}
      (zext ({x,+,y}) -> {zext(x),+,sext(y)}

Note that we are sign extending the increment of the SCEV, even for
the zext case. This is needed to cover the fairly common case where y would
be a (small) negative integer. In order to do this, this change adds two new
flags: nusw and nssw that are applicable to AddRecExprs and permit the
transformations above.

We also change isStridedPtr in LAA to be able to make use of
these predicates. With this feature we should now always be able to
work around overflow issues in the dependence analysis.

Reviewers: mzolotukhin, sanjoy, anemet

Subscribers: mzolotukhin, sanjoy, llvm-commits, rengolin, jmolloy, hfinkel

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

llvm-svn: 260085

8 years ago[clang-tidy] Move incorrect-roundings to upstream.
Haojian Wu [Mon, 8 Feb 2016 10:16:13 +0000 (10:16 +0000)]
[clang-tidy] Move incorrect-roundings to upstream.

Summary: This is originally implemented by Jacques Pienaar.

Reviewers: alexfh

Subscribers: cfe-commits, jpienaar

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

llvm-svn: 260084

8 years ago[ELF][MIPS] Support R_MIPS_COPY relocation
Simon Atanasyan [Mon, 8 Feb 2016 10:05:13 +0000 (10:05 +0000)]
[ELF][MIPS] Support R_MIPS_COPY relocation

Generate R_MIPS_COPY relocation for 'static' relocations against object
symbols defined in a shared libraries.

llvm-svn: 260083

8 years agoShow real error message in -data-evaluate-expression
Eugene Leviant [Mon, 8 Feb 2016 10:04:51 +0000 (10:04 +0000)]
Show real error message in -data-evaluate-expression

llvm-svn: 260082

8 years agoRevert "Enable test_lldbmi_settings_set_target_run_args_before on linux"
Pavel Labath [Mon, 8 Feb 2016 09:58:27 +0000 (09:58 +0000)]
Revert "Enable test_lldbmi_settings_set_target_run_args_before on linux"

Test is still flaky.

llvm-svn: 260081

8 years agoclang-format: Fix weird alignment when not aligning after brackets.
Daniel Jasper [Mon, 8 Feb 2016 09:52:54 +0000 (09:52 +0000)]
clang-format: Fix weird alignment when not aligning after brackets.

Before:
  bbbbbbbbbbbb(aaaaaaaaaaaaaaaaaaaaaaaa, //
      ccccccc(aaaaaaaaaaaaaaaaa, //
           b));

After:
  bbbbbbbbbbbb(aaaaaaaaaaaaaaaaaaaaaaaa, //
      ccccccc(aaaaaaaaaaaaaaaaa, //
        b));

This fixes llvm.org/PR24905.

llvm-svn: 260080

8 years ago[asan] XFAIL local alias related tests on Mips due to https://llvm.org/bugs/show_bug...
Maxim Ostapenko [Mon, 8 Feb 2016 09:50:57 +0000 (09:50 +0000)]
[asan] XFAIL local alias related tests on Mips due to https://llvm.org/bugs/show_bug.cgi?id=26525.

llvm-svn: 260079

8 years agoHave lldb-server log the timestamp in its log messages
Pavel Labath [Mon, 8 Feb 2016 09:35:53 +0000 (09:35 +0000)]
Have lldb-server log the timestamp in its log messages

llvm-svn: 260078

8 years ago[OPENMP 4.5] Ccapture/codegen of private non-static data members.
Alexey Bataev [Mon, 8 Feb 2016 09:29:13 +0000 (09:29 +0000)]
[OPENMP 4.5] Ccapture/codegen of private non-static data members.
OpenMP 4.5 introduces privatization of non-static data members of current class in non-static member functions.
To correctly handle such kind of privatization a new (pseudo)declaration VarDecl-based node is added. It allows to reuse an existing code for capturing variables in Lambdas/Block/Captured blocks of code for correct privatization and codegen.

llvm-svn: 260077

8 years ago[asan] Introduce new approach for ODR violation detection based on odr indicator...
Maxim Ostapenko [Mon, 8 Feb 2016 08:39:59 +0000 (08:39 +0000)]
[asan] Introduce new approach for ODR violation detection based on odr indicator symbols.

This is a compiler-rt part of this http://reviews.llvm.org/D15642 patch. Here,
we add a new approach for ODR violation detection.
Instead of using __asan_region_is_poisoned(g->beg, g->size_with_redzone) on
global address (that would return false now due to using private alias), we can
use new globally visible indicator symbol to perform the check.

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

llvm-svn: 260076

8 years ago[asan] Introduce new hidden -asan-use-private-alias option.
Maxim Ostapenko [Mon, 8 Feb 2016 08:30:57 +0000 (08:30 +0000)]
[asan] Introduce new hidden -asan-use-private-alias option.

As discussed in https://github.com/google/sanitizers/issues/398, with current
implementation of poisoning globals we can have some CHECK failures or false
positives in case of mixing instrumented and non-instrumented code due to ASan
poisons innocent globals from non-sanitized binary/library. We can use private
aliases to avoid such errors. In addition, to preserve ODR violation detection,
we introduce new __odr_asan_gen_XXX symbol for each instrumented global that
indicates if this global was already registered. To detect ODR violation in
runtime, we should only check the value of indicator and report an error if it
isn't equal to zero.

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

llvm-svn: 260075

8 years ago[Concepts] Implement a portion of Concepts TS[dcl.spec.concept]p1 by
Nathan Wilson [Mon, 8 Feb 2016 05:34:00 +0000 (05:34 +0000)]
[Concepts] Implement a portion of Concepts TS[dcl.spec.concept]p1 by
diagnosing when 'concept' is specified on a function or template
specialization.

Since a concept can only be applied to a function or variable template,
the concept bit is stored in TemplateDecl as a PointerIntPair.

Reviewers: rsmith, faisalv, aaron.ballman, hubert.reinterpretcast

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

llvm-svn: 260074

8 years agoELF: Simplify getFdeEncoding.
Rui Ueyama [Mon, 8 Feb 2016 05:18:44 +0000 (05:18 +0000)]
ELF: Simplify getFdeEncoding.

I found that the handling of 'L' character in an augmentation string is
wrong because 'L' means that the next byte is the length field. I could
have fixed that by just skipping the next byte, but I decided to take a
different approach.

Teaching the linker about all the types of CIE internal records just to
skip them is silly. And the code doing that is not actually executed now
(that's why the bug did not cause any issue.) It is because the 'R' field,
which we want to read, is always at beginning of the CIE. So I reduced
the code dramatically by assuming that that's always the case. I want to
see how it works in the wild. If it doesn't work, we can roll this back
(with a fix for 'L').

http://reviews.llvm.org/D16939

llvm-svn: 260073

8 years ago[LLDB][MIPS] Fix TestExpressionInSyscall.py for MIPS
Bhushan D. Attarde [Mon, 8 Feb 2016 04:35:51 +0000 (04:35 +0000)]
[LLDB][MIPS] Fix TestExpressionInSyscall.py for MIPS

    SUMMARY:
    This patch fixes TestExpressionInSyscall.py and solves bug 23659 for MIPS.
    Corrected indentation at couple of places.

    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D16916

llvm-svn: 260072

8 years agobuild: silence warnings in in-tree build
Saleem Abdulrasool [Mon, 8 Feb 2016 03:50:18 +0000 (03:50 +0000)]
build: silence warnings in in-tree build

Avoid the developer warnings from cmake when configuring libc++ as part of the
LLVM layout.  Setup the custom macro paths earlier to re-use the detection logic
prior to setting the project properties.

llvm-svn: 260071

8 years ago[WebAssembly] Add another optimization idea to README.txt.
Dan Gohman [Mon, 8 Feb 2016 03:42:36 +0000 (03:42 +0000)]
[WebAssembly] Add another optimization idea to README.txt.

llvm-svn: 260070

8 years ago[X86] Change FeatureIFMA string to 'avx512ifma'. Matches gcc and fixes PR26461.
Craig Topper [Mon, 8 Feb 2016 01:23:15 +0000 (01:23 +0000)]
[X86] Change FeatureIFMA string to 'avx512ifma'. Matches gcc and fixes PR26461.

llvm-svn: 260069

8 years ago[Support] Use hexdigit. NFC
Craig Topper [Mon, 8 Feb 2016 01:03:01 +0000 (01:03 +0000)]
[Support] Use hexdigit. NFC

llvm-svn: 260068

8 years ago[Support] Fix the examples and assertion for format_hex_no_prefix to take into accoun...
Craig Topper [Mon, 8 Feb 2016 01:02:55 +0000 (01:02 +0000)]
[Support] Fix the examples and assertion for format_hex_no_prefix to take into account that there are no prefix characters to include in Width.

llvm-svn: 260067

8 years ago[analyzer] Avoid crash when attempting to evaluate binary operation on LazyCompoundVal.
Devin Coughlin [Mon, 8 Feb 2016 00:28:24 +0000 (00:28 +0000)]
[analyzer] Avoid crash when attempting to evaluate binary operation on LazyCompoundVal.

Instead, return UnknownValue if either operand is a nonloc::LazyCompoundVal. This is a
spot fix for PR 24951.

rdar://problem/23682244

llvm-svn: 260066

8 years ago[clang-tidy] Reformatted docs + minor updates
Alexander Kornienko [Mon, 8 Feb 2016 00:19:29 +0000 (00:19 +0000)]
[clang-tidy] Reformatted docs + minor updates

llvm-svn: 260065

8 years agoDisable llvm/test/tools/llvm-profdata/value-prof.proftext on win32 for now. Investiga...
NAKAMURA Takumi [Sun, 7 Feb 2016 23:03:38 +0000 (23:03 +0000)]
Disable llvm/test/tools/llvm-profdata/value-prof.proftext on win32 for now. Investigating.

llvm-svn: 260064

8 years ago[X86][SSE] Resolve target shuffle inputs to sentinels to permit more combines
Simon Pilgrim [Sun, 7 Feb 2016 22:51:06 +0000 (22:51 +0000)]
[X86][SSE] Resolve target shuffle inputs to sentinels to permit more combines

The combineX86ShufflesRecursively only supports unary shuffles, but was missing the opportunity to combine binary shuffles with a zero / undef second input.

This patch resolves target shuffle inputs, converting the shuffle mask elements to SM_SentinelUndef/SM_SentinelZero where possible. It then resolves the updated mask to check if we have created a faux unary shuffle.

Additionally, we now attempt to recursively call combineX86ShufflesRecursively for all input operands (we used to just recurse for unary integer shuffles and unary unpacks) - it safely returns early if its not a target shuffle.

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

llvm-svn: 260063