platform/upstream/llvm.git
7 years agomath: Implement lgamma
Aaron Watry [Thu, 15 Sep 2016 00:17:31 +0000 (00:17 +0000)]
math: Implement lgamma

Just use lgamma_r and ignore the value returned in the second argument

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 281565

7 years agomath: Implement lgamma_r
Aaron Watry [Thu, 15 Sep 2016 00:17:28 +0000 (00:17 +0000)]
math: Implement lgamma_r

Ported from the amd-builtins branch, which is itself based on the
Sun Microsystems implementation.

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 281564

7 years agoAdd ADDR_SPACE parameter to _CLC_V_V_VP_VECTORIZE
Aaron Watry [Thu, 15 Sep 2016 00:17:22 +0000 (00:17 +0000)]
Add ADDR_SPACE parameter to _CLC_V_V_VP_VECTORIZE

This macro is currently unused, but I plan to use it shortly.

The previous form did casts of pointers without an address space, which
doesn't work so well for CL 1.x.

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 281563

7 years agoRevert r280944 - Added 'inline' attribute to basic_string's destructor
Eric Fiselier [Wed, 14 Sep 2016 23:52:01 +0000 (23:52 +0000)]
Revert r280944 - Added 'inline' attribute to basic_string's destructor

This patch causes a couple of issues:

1) It triggers http://llvm.org/PR30341. Although the bug is not truly a libc++
bug it breaks the LLVM build using libc++. Reverting this patch is only
a temporary workaround until Clang is fixed.

2) It adds yet another ABI incompatibility when libc++.so is compiled with GCC.
Specifically GCC doesn't ignore the _LIBCPP_INLINE_VISIBILITY on the out-of-line
definition when compiling the dylib. This causes the externally instantiated
~basic_string symbol to have hidden visibility.

This patch should be recommitted after addressing (1) and (2). (2) can be fixed
by adding _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY which is defined as
__attribute__((visibility("default"), always_inline)) as opposed to
_LIBCPP_INLINE_VISIBILITY which makes the symbol hidden.

llvm-svn: 281562

7 years ago[InstCombine] refactor eq/ne cases in foldICmpUsingKnownBits() ; NFCI
Sanjay Patel [Wed, 14 Sep 2016 23:38:56 +0000 (23:38 +0000)]
[InstCombine] refactor eq/ne cases in foldICmpUsingKnownBits() ; NFCI

The pattern matching and transforms are identical; the cmp predicate just changes.

llvm-svn: 281561

7 years ago[pdb] Fix unit test compilation.
Zachary Turner [Wed, 14 Sep 2016 23:17:08 +0000 (23:17 +0000)]
[pdb] Fix unit test compilation.

llvm-svn: 281560

7 years ago[InstCombine] add vector tests for foldICmpUsingKnownBits()
Sanjay Patel [Wed, 14 Sep 2016 23:15:11 +0000 (23:15 +0000)]
[InstCombine] add vector tests for foldICmpUsingKnownBits()

llvm-svn: 281559

7 years agoFix the Windows build after r281546
Reid Kleckner [Wed, 14 Sep 2016 23:07:05 +0000 (23:07 +0000)]
Fix the Windows build after r281546

llvm-svn: 281558

7 years agoRevert r281457 "Supports adding insertion around non-insertion replacements."
Artem Belevich [Wed, 14 Sep 2016 23:03:06 +0000 (23:03 +0000)]
Revert r281457 "Supports adding insertion around non-insertion replacements."

Commit was breaking our internal tests.

llvm-svn: 281557

7 years ago[pdb] Get rid of Data and RawData in CVType.
Zachary Turner [Wed, 14 Sep 2016 23:00:16 +0000 (23:00 +0000)]
[pdb] Get rid of Data and RawData in CVType.

The `CVType` had two redundant fields which were confusing and
error-prone to fill out.  By treating member records as a distinct
type from leaf records, we are able to simplify this quite a bit.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24432

llvm-svn: 281556

7 years ago[pdb] Write TPI hash values to the TPI stream.
Zachary Turner [Wed, 14 Sep 2016 23:00:02 +0000 (23:00 +0000)]
[pdb] Write TPI hash values to the TPI stream.

This completes being able to write all the interesting
values of a PDB TPI stream.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24370

llvm-svn: 281555

7 years ago[MC] Handle discardable COFF sections in assembly
Reid Kleckner [Wed, 14 Sep 2016 22:41:50 +0000 (22:41 +0000)]
[MC] Handle discardable COFF sections in assembly

Summary:
This fixes a dumpbin warning on objects produced by the MC assembler
when starting from text. All .debug$S sections are supposed to be marked
IMAGE_SCN_MEM_DISCARDABLE. The main, non-COMDAT .debug$S section had
this set, but any comdat ones were not being marked discardable because
there was no .section flag for it.

This change does two things:

- If the section name starts with .debug, implicitly mark the section as
  discardable. This means we do the same thing as gas on .s files with
  DWARF from GCC, which is important.

- Adds the 'D' flag to the .section directive on COFF to explicitly say
  a section is discardable. We only emit this flag if the section name
  does not start with .debug. This allows the user to explicitly tweak
  their section flags without worrying about magic section names.

The only thing you can't do in this scheme is to create a
non-discardable section with a name starting with ".debug", but
hopefully users don't need that.

Reviewers: majnemer, rafael

Subscribers: llvm-commits

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

llvm-svn: 281554

7 years ago[tsan] fix tsan build by adding a dummy __sanitizer_print_memory_profile
Kostya Serebryany [Wed, 14 Sep 2016 22:35:56 +0000 (22:35 +0000)]
[tsan] fix tsan build by adding a dummy __sanitizer_print_memory_profile

llvm-svn: 281553

7 years ago[clang-cl] Accept the joined equals version of -resource-dir=
Reid Kleckner [Wed, 14 Sep 2016 22:31:24 +0000 (22:31 +0000)]
[clang-cl] Accept the joined equals version of -resource-dir=

lib/Tooling injects this argument without regard for what driver syntax
is in use.

llvm-svn: 281550

7 years agoFix auto-upgrade of TBAA tags in Bitcode Reader
Mehdi Amini [Wed, 14 Sep 2016 22:29:59 +0000 (22:29 +0000)]
Fix auto-upgrade of TBAA tags in Bitcode Reader

If TBAA is on an intrinsic and it gets upgraded, it'll delete the call
instruction that we collected in a vector. Even if we were to use
WeakVH, it'll drop the TBAA and we'll hit the assert on the upgrade
path.

r263673 gave a shot to make sure the TBAA upgrade happens before
intrinsics upgrade, but failed to account for all cases.

Instead of collecting instructions in a vector, this patch makes it
just upgrade the TBAA on the fly, because metadata are always
already loaded at this point.

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

llvm-svn: 281549

7 years ago[asan] fix windows
Kostya Serebryany [Wed, 14 Sep 2016 22:13:20 +0000 (22:13 +0000)]
[asan] fix windows

llvm-svn: 281548

7 years ago[asan] add heap_profile=1 to asan to periodically print the heap profile. So far...
Kostya Serebryany [Wed, 14 Sep 2016 22:00:58 +0000 (22:00 +0000)]
[asan] add heap_profile=1 to asan to periodically print the heap profile. So far this is a very basic heap-profile functionality

llvm-svn: 281546

7 years agoMore cleanup in `frame diagnose,` eliminating a bunch of messy cases.
Sean Callanan [Wed, 14 Sep 2016 21:54:28 +0000 (21:54 +0000)]
More cleanup in `frame diagnose,` eliminating a bunch of messy cases.

llvm-svn: 281545

7 years ago[CUDA] Make __clang_cuda_cmath.h compatible with libc++.
Justin Lebar [Wed, 14 Sep 2016 21:50:14 +0000 (21:50 +0000)]
[CUDA] Make __clang_cuda_cmath.h compatible with libc++.

Summary:
We need to add a bunch more "using"s, which weren't necessary with
libstdc++.

Once this is in I can check in a test to the test-suite.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 281544

7 years ago[CUDA] Add test checking our ability to take a function pointer to a __global__ funct...
Justin Lebar [Wed, 14 Sep 2016 21:50:11 +0000 (21:50 +0000)]
[CUDA] Add test checking our ability to take a function pointer to a __global__ function on the host side.

Summary: This functionality is used by Thrust.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 281543

7 years agoFix indentation in codeview code
Reid Kleckner [Wed, 14 Sep 2016 21:49:21 +0000 (21:49 +0000)]
Fix indentation in codeview code

llvm-svn: 281542

7 years agoAdd some MS aliases for existing intrinsics
Albert Gutowski [Wed, 14 Sep 2016 21:19:43 +0000 (21:19 +0000)]
Add some MS aliases for existing intrinsics

Reviewers: thakis, compnerd, majnemer, rsmith, rnk

Subscribers: alexshap, cfe-commits

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

llvm-svn: 281540

7 years ago[LTO] Move tests from test/tools to test/LTO, as they're testing the API functionalit...
Mehdi Amini [Wed, 14 Sep 2016 21:07:32 +0000 (21:07 +0000)]
[LTO] Move tests from test/tools to test/LTO, as they're testing the API functionalities (NFC)

llvm-svn: 281539

7 years ago[LTO] Fix commons handling
Mehdi Amini [Wed, 14 Sep 2016 21:05:04 +0000 (21:05 +0000)]
[LTO] Fix commons handling

Previously the prevailing information was not honored, and commons
symbols could override a strong definition. This patch fixes it and
propose the following semantic for commons: the client should mark
as prevailing the commons that it expects the LTO implementation to
merge (i.e. take the maximum size and alignment).
It implies that commons are allowed to have multiple prevailing
definitions.

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

llvm-svn: 281538

7 years ago[ThinLTO] Add an option to llvm-lto to print some basic statistics for the index
Mehdi Amini [Wed, 14 Sep 2016 21:04:59 +0000 (21:04 +0000)]
[ThinLTO] Add an option to llvm-lto to print some basic statistics for the index

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

llvm-svn: 281537

7 years agoReplaced two instances of std::function with auto.
Sean Callanan [Wed, 14 Sep 2016 20:58:31 +0000 (20:58 +0000)]
Replaced two instances of std::function with auto.

Thanks to Zachary Turner for the suggestion.  It's distasteful that the actual
type of the lambda can't be spelled out, but it should be evident from the
definition of the lambda body.

llvm-svn: 281536

7 years agoFinish renaming remaining analyzeBranch functions
Matt Arsenault [Wed, 14 Sep 2016 20:43:16 +0000 (20:43 +0000)]
Finish renaming remaining analyzeBranch functions

llvm-svn: 281535

7 years agoCleaned up a little bit of redundant code in 'frame diagnose.`
Sean Callanan [Wed, 14 Sep 2016 20:29:57 +0000 (20:29 +0000)]
Cleaned up a little bit of redundant code in 'frame diagnose.`

llvm-svn: 281534

7 years ago[asan] Disable 64-bit allocator on android/aarch64.
Evgeniy Stepanov [Wed, 14 Sep 2016 20:25:51 +0000 (20:25 +0000)]
[asan] Disable 64-bit allocator on android/aarch64.

Makes the device strangely unstable, and fails one sanitizer_common test.

llvm-svn: 281533

7 years ago[Stackmap] Added callsite counts to emitted function information.
Sanjoy Das [Wed, 14 Sep 2016 20:22:03 +0000 (20:22 +0000)]
[Stackmap] Added callsite counts to emitted function information.

Summary:
It was previously not possible for tools to use solely the stackmap
information emitted to reconstruct the return addresses of callsites in
the map, which is necessary to use the information to walk a stack. This
patch adds per-function callsite counts when emitting the stackmap
section in order to resolve the problem. Note that this slightly alters
the stackmap format, so external tools parsing these maps will need to
be updated.

**Problem Details:**
Records only store their offset from the beginning of the function they
belong to. While these records and the functions are output in program
order, it is not possible to determine where the end of one function's
records are without the callsite count when processing the records to
compute return addresses.

Patch by Kavon Farvardin!

Reviewers: atrick, ributzka, sanjoy

Subscribers: nemanjai

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

llvm-svn: 281532

7 years ago[x86] regenerate checks
Sanjay Patel [Wed, 14 Sep 2016 20:21:28 +0000 (20:21 +0000)]
[x86] regenerate checks

llvm-svn: 281531

7 years agoRevert "Do not warn about format strings that are indexed string literals."
Stephen Hines [Wed, 14 Sep 2016 20:20:14 +0000 (20:20 +0000)]
Revert "Do not warn about format strings that are indexed string literals."

Summary: This reverts r281527 because I messed up the attribution.

Reviewers: srhines

Subscribers: cfe-commits

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

llvm-svn: 281530

7 years ago[x86] regenerate checks
Sanjay Patel [Wed, 14 Sep 2016 20:16:24 +0000 (20:16 +0000)]
[x86] regenerate checks

llvm-svn: 281529

7 years agoUse 'enum class' instead of 'enum' in NativeRegisterContextLinux_x86_x64.
Valentina Giusti [Wed, 14 Sep 2016 20:12:12 +0000 (20:12 +0000)]
Use 'enum class' instead of 'enum' in NativeRegisterContextLinux_x86_x64.

Reviewers: labath, clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 281528

7 years agoDo not warn about format strings that are indexed string literals.
Stephen Hines [Wed, 14 Sep 2016 20:05:20 +0000 (20:05 +0000)]
Do not warn about format strings that are indexed string literals.

Summary:
The warning for a format string not being a sting literal and therefore
being potentially insecure is overly strict for indecies into sting
literals. This fix checks if the index into the string literal is
precomputable. If thats the case it will check if the suffix of that
sting literal is a valid format string string literal. It will still
issue the aforementioned warning for out of range indecies into the
string literal.

Reviewers: rsmith

Subscribers: srhines, cfe-commits

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

llvm-svn: 281527

7 years agoRevert "[ARM] Promote small global constants to constant pools"
Evgeniy Stepanov [Wed, 14 Sep 2016 20:02:30 +0000 (20:02 +0000)]
Revert "[ARM] Promote small global constants to constant pools"

Breaks Android tests by introducing text relocations to ARM binaries.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/25362/steps/run%20asan%20lit%20tests%20%5Barm%2Fbullhead-userdebug%2FMTC20F%5D/logs/stdio

llvm-svn: 281526

7 years agoCorrect assert text in DeclGroup::getSingleDecl()
Kirill Bobyrev [Wed, 14 Sep 2016 19:59:26 +0000 (19:59 +0000)]
Correct assert text in DeclGroup::getSingleDecl()

Assert text for getSingleDecl() is inaccurate. Appears to have been copy pasted
from getDeclGroup().

Patch by Ben Taylor!

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 281525

7 years ago[SE] Add CUDA platform
Jason Henline [Wed, 14 Sep 2016 19:58:34 +0000 (19:58 +0000)]
[SE] Add CUDA platform

Summary:
Basic CUDA platform implementation and cmake infrastructure to control
whether it's used. A few important TODOs will be handled in later
patches:

* Log some error messages that can't easily be returned as Errors.
* Cache modules and kernels to prevent reloading them if someone tries to
  reload a kernel that's already loaded.
* Tolerate shared memory arguments for kernel launches.

Reviewers: jlebar

Subscribers: beanz, mgorny, jprice, jlebar, parallel_libs-commits

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

llvm-svn: 281524

7 years ago[x86] regenerate checks
Sanjay Patel [Wed, 14 Sep 2016 19:42:03 +0000 (19:42 +0000)]
[x86] regenerate checks

llvm-svn: 281523

7 years ago[compiler-rt] Set asan win 64-bits to use dynamic address for memory allocator
Etienne Bergeron [Wed, 14 Sep 2016 19:23:21 +0000 (19:23 +0000)]
[compiler-rt] Set asan win 64-bits to use dynamic address for memory allocator

Summary:
ASAN on Windows 64-bits should use a dynamic address instead of a fixed one.
The asan-allocator code to support dynamic address is already landed.
This patch is turning on the feature.

Reviewers: rnk

Subscribers: kubabrecka, dberris, llvm-commits, chrisha

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

llvm-svn: 281522

7 years agoHandle arbitrary expressions in DATA_SEGMENT_RELRO_END.
Rafael Espindola [Wed, 14 Sep 2016 19:14:01 +0000 (19:14 +0000)]
Handle arbitrary expressions in DATA_SEGMENT_RELRO_END.

llvm-svn: 281521

7 years agoAdd SB API's for writing breakpoints to & creating the from a file.
Jim Ingham [Wed, 14 Sep 2016 19:07:35 +0000 (19:07 +0000)]
Add SB API's for writing breakpoints to & creating the from a file.

Moved the guts of the code from CommandObjectBreakpoint to Target (should
have done it that way in the first place.)  Added an SBBreakpointList class
so there's a way to specify which breakpoints to serialize and to report the
deserialized breakpoints.

<rdar://problem/12611863>

llvm-svn: 281520

7 years agoFix some const-ness issues with BreakpointID & BreakpointIDList.
Jim Ingham [Wed, 14 Sep 2016 19:05:27 +0000 (19:05 +0000)]
Fix some const-ness issues with BreakpointID & BreakpointIDList.

llvm-svn: 281519

7 years ago[lib/LTO] Fix a typo. NFC.
Davide Italiano [Wed, 14 Sep 2016 18:48:43 +0000 (18:48 +0000)]
[lib/LTO] Fix a typo. NFC.

llvm-svn: 281517

7 years ago[analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py
Devin Coughlin [Wed, 14 Sep 2016 18:14:11 +0000 (18:14 +0000)]
[analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py

Remove the relative path hack in scan-build-py that converts a fully qualified
directory name and a fully qualified file path to a relative path before running
the analyzer on a file.

This hack is not needed: the bad interaction with SATestsBuild.py it was
intended to address is actually the same underlying problem that r280768 fixed.
Further, because the hack would always relativize paths, it caused
SATestBuild.py to be unable to properly line up issues when the build system
changed directory and then built a source file in a child directory but used a
fully-qualified path for the source file.

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

llvm-svn: 281516

7 years agoAdd an interesting test.
Rafael Espindola [Wed, 14 Sep 2016 18:06:02 +0000 (18:06 +0000)]
Add an interesting test.

llvm-svn: 281515

7 years agoRevert "AMDGPU: Use SOPK compare instructions"
Matt Arsenault [Wed, 14 Sep 2016 18:04:42 +0000 (18:04 +0000)]
Revert "AMDGPU: Use SOPK compare instructions"

Accidentally committed

llvm-svn: 281514

7 years agoAMDGPU: Use SOPK compare instructions
Matt Arsenault [Wed, 14 Sep 2016 18:03:53 +0000 (18:03 +0000)]
AMDGPU: Use SOPK compare instructions

llvm-svn: 281513

7 years ago[cmake] Make libgomp & libiomp5 alias install optional
Michal Gorny [Wed, 14 Sep 2016 17:46:27 +0000 (17:46 +0000)]
[cmake] Make libgomp & libiomp5 alias install optional

Introduce a new LIBOMP_INSTALL_VARIABLES cache variable that can be used
to disable creating libgomp and libiomp5 aliases on 'make install'.
Those aliases are undesired e.g. on Gentoo systems where libomp is used
purely by clang.

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

llvm-svn: 281512

7 years ago[Release notes] Mention readability-container-size-empty improvements.
Eugene Zelenko [Wed, 14 Sep 2016 17:41:51 +0000 (17:41 +0000)]
[Release notes] Mention readability-container-size-empty improvements.

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

llvm-svn: 281510

7 years agoConvert finite to builtin
Dehao Chen [Wed, 14 Sep 2016 17:34:14 +0000 (17:34 +0000)]
Convert finite to builtin

Summary: This patch converts finite/__finite to builtin functions so that it will be inlined by compiler.

Reviewers: hfinkel, davidxl, efriedma

Subscribers: efriedma, llvm-commits

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

llvm-svn: 281509

7 years agoVerifier: Mark orphaned DICompileUnits as a debug info failure.
Adrian Prantl [Wed, 14 Sep 2016 17:30:37 +0000 (17:30 +0000)]
Verifier: Mark orphaned DICompileUnits as a debug info failure.
This is a follow-up to r268778 that adds a couple of missing cases,
most notably orphaned compile units.

rdar://problem/28193346

llvm-svn: 281508

7 years agoUse Intel CPU flags to determine target supported features.
Valentina Giusti [Wed, 14 Sep 2016 17:27:48 +0000 (17:27 +0000)]
Use Intel CPU flags to determine target supported features.

Summary:
This patch uses the instruction CPUID to verify that FXSAVE, XSAVE, AVX
and MPX are supported by the target hardware. In case the HW supports XSAVE,
and at least one of the extended register sets, it further checks if the
target software has the kernel support for such features, by verifying that
their XSAVE part is correctly managed.

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

llvm-svn: 281507

7 years agoMake analyzeBranch family of instruction names consistent
Matt Arsenault [Wed, 14 Sep 2016 17:24:15 +0000 (17:24 +0000)]
Make analyzeBranch family of instruction names consistent

analyzeBranch was renamed to use lowercase first, rename
the related set to match.

llvm-svn: 281506

7 years agoAArch64: Use TTI branch functions in branch relaxation
Matt Arsenault [Wed, 14 Sep 2016 17:23:48 +0000 (17:23 +0000)]
AArch64: Use TTI branch functions in branch relaxation

The main change is to return the code size from
InsertBranch/RemoveBranch.

Patch mostly by Tim Northover

llvm-svn: 281505

7 years ago[x86] fix formatting; NFC
Sanjay Patel [Wed, 14 Sep 2016 17:23:18 +0000 (17:23 +0000)]
[x86] fix formatting; NFC

llvm-svn: 281504

7 years ago[compiler-rt] Avoid instrumenting sanitizer functions
Etienne Bergeron [Wed, 14 Sep 2016 17:18:37 +0000 (17:18 +0000)]
[compiler-rt] Avoid instrumenting sanitizer functions

Summary:
Function __asan_default_options is called by __asan_init before the
shadow memory got initialized. Instrumenting that function may lead
to flaky execution.

As the __asan_default_options is provided by users, we cannot expect
them to add the appropriate function atttributes to avoid
instrumentation.

Reviewers: kcc, rnk

Subscribers: dberris, chrisha, llvm-commits

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

llvm-svn: 281503

7 years ago[X86][SSE] Improve recognition of i64 sitofp conversions that can be performed as...
Simon Pilgrim [Wed, 14 Sep 2016 17:15:26 +0000 (17:15 +0000)]
[X86][SSE] Improve recognition of i64 sitofp conversions that can be performed as i32 (PR29078)

Until AVX512DQ we only support i64/vXi64 sitofp conversion as scalars.

This patch sees if the sign bit extends far enough that we can truncate to a i32 type and then perform sitofp without loss of precision.

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

llvm-svn: 281502

7 years ago[LoopInterchange] Typo. NFC.
Chad Rosier [Wed, 14 Sep 2016 17:12:30 +0000 (17:12 +0000)]
[LoopInterchange] Typo. NFC.

llvm-svn: 281501

7 years ago[LoopInterchange] Add CL option to override cost threshold.
Chad Rosier [Wed, 14 Sep 2016 17:07:13 +0000 (17:07 +0000)]
[LoopInterchange] Add CL option to override cost threshold.

Mostly useful for getting consistent lit testing.

llvm-svn: 281500

7 years ago[X86][SSE] Don't use PSHUFD directly - lower with generic shuffle
Simon Pilgrim [Wed, 14 Sep 2016 17:04:22 +0000 (17:04 +0000)]
[X86][SSE] Don't use PSHUFD directly - lower with generic shuffle

Remove the last user of the old getTargetShuffleNode helpers

llvm-svn: 281499

7 years agogetValueType().getScalarSizeInBits() -> getScalarValueSizeInBits(), round 2 ; NFCI
Sanjay Patel [Wed, 14 Sep 2016 16:54:10 +0000 (16:54 +0000)]
getValueType().getScalarSizeInBits() -> getScalarValueSizeInBits(), round 2 ; NFCI

llvm-svn: 281498

7 years ago[LoopInterchange] Cleanup debug whitespace. NFC.
Chad Rosier [Wed, 14 Sep 2016 16:43:19 +0000 (16:43 +0000)]
[LoopInterchange] Cleanup debug whitespace. NFC.

llvm-svn: 281497

7 years agoAdd a test showing we handle .tbss sections in linker scripts.
Rafael Espindola [Wed, 14 Sep 2016 16:40:33 +0000 (16:40 +0000)]
Add a test showing we handle .tbss sections in linker scripts.

llvm-svn: 281496

7 years agogetVectorElementType().getSizeInBits() -> getScalarSizeInBits() ; NFCI
Sanjay Patel [Wed, 14 Sep 2016 16:37:15 +0000 (16:37 +0000)]
getVectorElementType().getSizeInBits() -> getScalarSizeInBits() ; NFCI

llvm-svn: 281495

7 years ago[ELF] Do not adjust TLS symbol value when produce relocatable object
Simon Atanasyan [Wed, 14 Sep 2016 16:26:19 +0000 (16:26 +0000)]
[ELF] Do not adjust TLS symbol value when produce relocatable object

When the linker generates a relocatable object there is no TLS program
header and we should not adjust TLS symbols value.

llvm-svn: 281494

7 years agogetValueType().getSizeInBits() -> getValueSizeInBits() ; NFCI
Sanjay Patel [Wed, 14 Sep 2016 16:05:51 +0000 (16:05 +0000)]
getValueType().getSizeInBits() -> getValueSizeInBits() ; NFCI

llvm-svn: 281493

7 years agoFix typo in comment [NFC]
Etienne Bergeron [Wed, 14 Sep 2016 15:59:32 +0000 (15:59 +0000)]
Fix typo in comment [NFC]

llvm-svn: 281492

7 years agoAMDGPU: Support folding FrameIndex operands
Matt Arsenault [Wed, 14 Sep 2016 15:51:33 +0000 (15:51 +0000)]
AMDGPU: Support folding FrameIndex operands

This avoids test regressions in a future commit.

llvm-svn: 281491

7 years agogetValueType().getScalarSizeInBits() -> getScalarValueSizeInBits() ; NFCI
Sanjay Patel [Wed, 14 Sep 2016 15:43:44 +0000 (15:43 +0000)]
getValueType().getScalarSizeInBits() -> getScalarValueSizeInBits() ; NFCI

llvm-svn: 281490

7 years agogetScalarType().getSizeInBits() -> getScalarSizeInBits() ; NFCI
Sanjay Patel [Wed, 14 Sep 2016 15:21:00 +0000 (15:21 +0000)]
getScalarType().getSizeInBits() -> getScalarSizeInBits() ; NFCI

llvm-svn: 281489

7 years agoAMDGPU: Improve splitting 64-bit bit ops by constants
Matt Arsenault [Wed, 14 Sep 2016 15:19:03 +0000 (15:19 +0000)]
AMDGPU: Improve splitting 64-bit bit ops by constants

This addresses a TODO to handle operations besides and. This
also starts eliminating no-op operations with a constant that
can emerge later.

llvm-svn: 281488

7 years agoCodeGen: simplify the logic a slight bit
Saleem Abdulrasool [Wed, 14 Sep 2016 15:17:46 +0000 (15:17 +0000)]
CodeGen: simplify the logic a slight bit

Move the definition of `getTriple()` into the header.  It would just call
`getTarget().getTriple()`.  Inline the definition to allow the compiler to see
the same amount of the layout as previously.  Remove the more verbose
`getTarget().getTriple()` in favour of `getTriple()`.

llvm-svn: 281487

7 years ago[interception] Avoid duplicate declaration of isdigit in test
Jonas Hahnfeld [Wed, 14 Sep 2016 15:02:32 +0000 (15:02 +0000)]
[interception] Avoid duplicate declaration of isdigit in test

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

llvm-svn: 281486

7 years ago[LV] Process pointer IVs with PHINodes in collectLoopUniforms
Matthew Simpson [Wed, 14 Sep 2016 14:47:40 +0000 (14:47 +0000)]
[LV] Process pointer IVs with PHINodes in collectLoopUniforms

This patch moves the processing of pointer induction variables in
collectLoopUniforms from the consecutive pointer phase of the analysis to the
phi node phase. Previously, if a pointer induction variable was used by both a
scalarized non-memory instruction as well as a vectorized memory instruction,
we would incorrectly identify the pointer as uniform. Pointer induction
variables should be treated the same as other phi nodes. That is, they are
uniform if all users of the induction variable and induction variable update
are uniform.

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

llvm-svn: 281485

7 years ago[ARM] Promote small global constants to constant pools
James Molloy [Wed, 14 Sep 2016 14:47:27 +0000 (14:47 +0000)]
[ARM] Promote small global constants to constant pools

If a constant is unamed_addr and is only used within one function, we can save
on the code size and runtime cost of an indirection by changing the global's storage
to inside the constant pool. For example, instead of:

      ldr r0, .CPI0
      bl printf
      bx lr
    .CPI0: &format_string
    format_string: .asciz "hello, world!\n"

We can emit:

      adr r0, .CPI0
      bl printf
      bx lr
    .CPI0: .asciz "hello, world!\n"

This can cause significant code size savings when many small strings are used in one
function (4 bytes per string).

llvm-svn: 281484

7 years agoMCInstrDesc: this fixes an issue setting/getting member Flags, which
Sjoerd Meijer [Wed, 14 Sep 2016 14:32:17 +0000 (14:32 +0000)]
MCInstrDesc: this fixes an issue setting/getting member Flags, which
is an uint64_t. However, getter function getFlags returned an unsigned,
and in function hasProperty (1 << MCFlag) was used instead of (1ULL << MCFlag).

llvm-svn: 281483

7 years agoMove helper function higher in the file. NFC
Rafael Espindola [Wed, 14 Sep 2016 14:32:08 +0000 (14:32 +0000)]
Move helper function higher in the file. NFC

This just makes a followup patch easier to read.

llvm-svn: 281482

7 years ago[X86][SSE] Removed unused getTargetShuffleNode function
Simon Pilgrim [Wed, 14 Sep 2016 14:30:00 +0000 (14:30 +0000)]
[X86][SSE] Removed unused getTargetShuffleNode function

llvm-svn: 281481

7 years ago[X86] Added i128 lshr+shl -> mask combine test
Simon Pilgrim [Wed, 14 Sep 2016 14:29:16 +0000 (14:29 +0000)]
[X86] Added i128 lshr+shl -> mask combine test

llvm-svn: 281480

7 years agoFix code-gen crash on Power9 for insert_vector_elt with variable index (PR30189)
Nemanja Ivanovic [Wed, 14 Sep 2016 14:19:09 +0000 (14:19 +0000)]
Fix code-gen crash on Power9 for insert_vector_elt with variable index (PR30189)

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

In the initial implementation of this instruction, I forgot to account for
variable indices. This patch fixes PR30189 and should probably be merged into
3.9.1 (I'll open a bug according to the new instructions).

llvm-svn: 281479

7 years ago[InstCombine] Merged two test files and regenerated checks using update_test_checks...
Andrea Di Biagio [Wed, 14 Sep 2016 14:18:21 +0000 (14:18 +0000)]
[InstCombine] Merged two test files and regenerated checks using update_test_checks.py. NFC.

llvm-svn: 281478

7 years ago[libcxx] Add a TSan regression test for a data race in call_once
Kuba Brecka [Wed, 14 Sep 2016 14:15:42 +0000 (14:15 +0000)]
[libcxx] Add a TSan regression test for a data race in call_once

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

llvm-svn: 281477

7 years ago[libcxx] Fix a typo in test/libcxx/test/target_info.py that prevents running tests...
Kuba Brecka [Wed, 14 Sep 2016 14:13:50 +0000 (14:13 +0000)]
[libcxx] Fix a typo in test/libcxx/test/target_info.py that prevents running tests on Darwin with sanitizers

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

llvm-svn: 281476

7 years ago[libcxx] Enable building and testing of libcxx with ThreadSanitizer on OS X
Kuba Brecka [Wed, 14 Sep 2016 14:12:50 +0000 (14:12 +0000)]
[libcxx] Enable building and testing of libcxx with ThreadSanitizer on OS X

This patch enables building and testing libcxx under ThreadSanitizer on OS X. CMake builds that have -DLLVM_USE_SANITIZER=Thread will automatically build libcxx with -fsanitize=thread and testing via lit then runs under TSan.

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

llvm-svn: 281475

7 years ago[StackProtector] Use INITIALIZE_TM_PASS instead of INITIALIZE_PASS
Silviu Baranga [Wed, 14 Sep 2016 14:09:43 +0000 (14:09 +0000)]
[StackProtector] Use INITIALIZE_TM_PASS instead of INITIALIZE_PASS
in order to make sure that its TargetMachine constructor is
registered.

This allows us to run the PEI machine pass with MIR input
(see PR30324).

llvm-svn: 281474

7 years agoAdding missing directive for Power9.
Nemanja Ivanovic [Wed, 14 Sep 2016 14:09:39 +0000 (14:09 +0000)]
Adding missing directive for Power9.
There is currently no codegen for Power9 that depends on the directive
so this is NFC for now but will be important in the future. This was
missed in r268950 so I'm adding it now.

llvm-svn: 281473

7 years ago[asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR false positi...
Kuba Brecka [Wed, 14 Sep 2016 14:09:18 +0000 (14:09 +0000)]
[asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR false positive with LTO (compiler-rt part)

The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (https://github.com/google/sanitizers/issues/647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case.

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

llvm-svn: 281472

7 years ago[X86][SSE] Don't blend vector shifts with MOVSS/MOVSD directly, lower from generic...
Simon Pilgrim [Wed, 14 Sep 2016 14:08:18 +0000 (14:08 +0000)]
[X86][SSE] Don't blend vector shifts with MOVSS/MOVSD directly, lower from generic shuffle

Shuffle lowering will correctly lower to MOVSS/MOVSD/PBLEND, improving commutation opportunities

llvm-svn: 281471

7 years ago[asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR false positi...
Kuba Brecka [Wed, 14 Sep 2016 14:06:33 +0000 (14:06 +0000)]
[asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR false positive with LTO (llvm part)

The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (https://github.com/google/sanitizers/issues/647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case.

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

llvm-svn: 281470

7 years agoFix documentation of MemberExpr::getMemberDecl
Stephan Bergmann [Wed, 14 Sep 2016 14:03:50 +0000 (14:03 +0000)]
Fix documentation of MemberExpr::getMemberDecl

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

llvm-svn: 281469

7 years ago[OMPT] fix task frame information for gomp interface
Jonas Hahnfeld [Wed, 14 Sep 2016 13:59:39 +0000 (13:59 +0000)]
[OMPT] fix task frame information for gomp interface

Previous differencials D23305-D23310 changed task frame information management only for the kmp interface, but not for the whole gomp interface. This broke some testcases when building with gcc.
This patch fixes the broken task frame information for the gomp interface.

Patch by Joachim Protze!

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

llvm-svn: 281468

7 years ago[OMPT] save exit address to lwt if available
Jonas Hahnfeld [Wed, 14 Sep 2016 13:59:31 +0000 (13:59 +0000)]
[OMPT] save exit address to lwt if available

In case, the current team is a serialized team (lwt), the frame information should be written to this data structure.
Before, nested serialized teams would overwrite the same task information.

Patch by Joachim Protze!

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

llvm-svn: 281467

7 years ago[OMPT] fix __ompt_get_teaminfo to consult lwt entries of parent teams
Jonas Hahnfeld [Wed, 14 Sep 2016 13:59:24 +0000 (13:59 +0000)]
[OMPT] fix __ompt_get_teaminfo to consult lwt entries of parent teams

The comment already states, that this function should work similarly as __ompt_get_taskinfo.

The function only looked for lwt entries of the current team, but not when unrolling the parents. This fix aligns the implementation to __ompt_get_taskinfo.

The new test case creates a single theaded team (->lwt) and then a nested active team.
Before the innermost print_id(1) would deliver a different team then the outer print_id(0).

Patch by Joachim Protze!

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

llvm-svn: 281466

7 years ago[OMPT] Reset task exit frame when execution is finished
Jonas Hahnfeld [Wed, 14 Sep 2016 13:59:19 +0000 (13:59 +0000)]
[OMPT] Reset task exit frame when execution is finished

The exit address is set when execution of a task is started and should be reset as soon as the execution is finished.
Especially for the asm implementation of __kmp_invoke_microtask, resetting in this call would be painfull, so reset just after the invokation.

The testcase shows the effect of this patch:
Before, the implicit barriers at the end of an implicit task would see an exit address for the implicit task.

This barrier is a task scheduling point. Thus, any explicit task scheduled there would see an exit, but no reenter address for the implicit task.

Patch by Joachim Protze!

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

llvm-svn: 281465

7 years ago[OMPT] Align implementation of reenter frame address to latest (frozen) version of...
Jonas Hahnfeld [Wed, 14 Sep 2016 13:59:13 +0000 (13:59 +0000)]
[OMPT] Align implementation of reenter frame address to latest (frozen) version of OMPT spec

The latest OMPT spec changed the semantic of a tasks reenter frame to be the application frame, that will be entered, when the runtime frame drops.
Before it was the last frame in the runtime. This doesn't work for some gcc execution pathes or even clang generated code for :
Since there is no runtime frame between the executed task and the encountering task.

The test case compares exit and reenter addresses against addresses captured in application code

Patch by Joachim Protze!

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

llvm-svn: 281464

7 years ago[OMPT] extend ompt tests by checks for frame pointers
Jonas Hahnfeld [Wed, 14 Sep 2016 13:59:05 +0000 (13:59 +0000)]
[OMPT] extend ompt tests by checks for frame pointers

OMPT tests can check for right frame information of tasks:
 * parent_task_frame was directly printed as a pointer, but actually points to a struct ompt_frame {void*, void*}
 * NULL is printed in the beginning of execution and loaded to FileChecker variable [[NULL]]
 * implicit tasks now also print their frame information
 * macro to print frame address from application
 * print task info for barrier begin

Patch by Joachim Protze!

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

llvm-svn: 281463

7 years ago[tsan] Fix hanging gcd-apply and gcd-apply-race tests on macOS Sierra
Kuba Brecka [Wed, 14 Sep 2016 13:53:06 +0000 (13:53 +0000)]
[tsan] Fix hanging gcd-apply and gcd-apply-race tests on macOS Sierra

llvm-svn: 281462

7 years ago[cmake] Support overriding llvm-config query results
Michal Gorny [Wed, 14 Sep 2016 13:42:31 +0000 (13:42 +0000)]
[cmake] Support overriding llvm-config query results

Support overriding LLVM_* variables obtained from llvm-config when doing
stand-alone builds. The override of LLVM_MAIN_SRC_DIR is necessary to
provide LLVM sources when the initial directory used to build LLVM does
no longer exist when compiler-rt is built stand-alone. This is
especially the case when building the projects separately in temporary
directories with unpredictable names.

The code is based on existing CMakeLists.txt from clang. Alike clang, it
extends the override to all queried variables.

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

llvm-svn: 281461

7 years ago[clang-tidy] Add dependency on clangAnalysis to clangTidyMiscModule
Martin Bohme [Wed, 14 Sep 2016 13:33:11 +0000 (13:33 +0000)]
[clang-tidy] Add dependency on clangAnalysis to clangTidyMiscModule

Summary:
This is needed for the recently submitted misc-use-after-move check (rL281453).
For some reason, this still built under Linux, but it caused the PPC build bot
to fail.

Subscribers: beanz, cfe-commits, mgorny

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

llvm-svn: 281460