platform/upstream/llvm.git
8 years agollvm/test/Transforms/CorrelatedValuePropagation/alloca.ll REQUIRES +Asserts.
NAKAMURA Takumi [Thu, 15 Sep 2016 09:45:31 +0000 (09:45 +0000)]
llvm/test/Transforms/CorrelatedValuePropagation/alloca.ll REQUIRES +Asserts.

llvm-svn: 281598

8 years agoGlobalISel: cache pointer sizes in LLT
Tim Northover [Thu, 15 Sep 2016 09:20:34 +0000 (09:20 +0000)]
GlobalISel: cache pointer sizes in LLT

Otherwise everything that needs to work out what size they are has to keep a
DataLayout handy, which is a bit silly and very annoying.

llvm-svn: 281597

8 years ago[ARM] ARM-specific attributes should be accepted for big-endian
Oliver Stannard [Thu, 15 Sep 2016 08:55:41 +0000 (08:55 +0000)]
[ARM] ARM-specific attributes should be accepted for big-endian

The ARM-specific C attributes (currently just interrupt) need to check
for both the big- and little-endian versions of the triples, so that
they are accepted for both big and little endian targets.

TargetWindows and TargetMicrosoftCXXABI also only use the little-endian
triples, but this is correct as windows is not supported on big-endian
ARM targets (and this is asserted in lib/Basic/Targets.cpp).

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

llvm-svn: 281596

8 years agoAdd support for DW_AT_ranges_base attribute
Tamas Berghammer [Thu, 15 Sep 2016 08:53:33 +0000 (08:53 +0000)]
Add support for DW_AT_ranges_base attribute

It is a new attribute emitted by clang as a GNU extension and will
be part of Dwarf5. The purpose of the attribute is to specify a compile
unit level base value for all DW_AT_ranges to reduce the number of
relocations have to be done by the linker.

Fixes (at least partially): https://llvm.org/pr28826

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

llvm-svn: 281595

8 years agoTry to fix windows build after rL281569
Tamas Berghammer [Thu, 15 Sep 2016 08:47:59 +0000 (08:47 +0000)]
Try to fix windows build after rL281569

llvm-svn: 281594

8 years ago[asan] Reify ErrorInvalidPointerPair
Filipe Cabecinhas [Thu, 15 Sep 2016 08:10:56 +0000 (08:10 +0000)]
[asan] Reify ErrorInvalidPointerPair

Summary: Continue work on PR30351

Reviewers: vitalybuka, kcc, eugenis

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 281593

8 years ago[asan] Reify ErrorODRViolation
Filipe Cabecinhas [Thu, 15 Sep 2016 08:10:52 +0000 (08:10 +0000)]
[asan] Reify ErrorODRViolation

Summary: Continue work on PR30351

Reviewers: vitalybuka, kcc, eugenis

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 281592

8 years ago[asan] Reify ErrorBadParamsToAnnotateContiguousContainer
Filipe Cabecinhas [Thu, 15 Sep 2016 08:10:48 +0000 (08:10 +0000)]
[asan] Reify ErrorBadParamsToAnnotateContiguousContainer

Summary: Continue work on PR30351

Reviewers: vitalybuka, kcc, eugenis

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 281591

8 years ago[llvm-cov] Move some layout logic to the right spot (NFC)
Vedant Kumar [Thu, 15 Sep 2016 06:49:13 +0000 (06:49 +0000)]
[llvm-cov] Move some layout logic to the right spot (NFC)

llvm-svn: 281590

8 years ago[llvm-cov] Hide instantiation views for unexecuted functions
Vedant Kumar [Thu, 15 Sep 2016 06:44:51 +0000 (06:44 +0000)]
[llvm-cov] Hide instantiation views for unexecuted functions

Copying in the full text of the function doesn't help at all when we
already know that it's never executed. Just say that it's unexecuted --
the relevant source text has already been printed.

llvm-svn: 281589

8 years ago[llvm-cov] Don't create 'jump to ...' links in nested views
Vedant Kumar [Thu, 15 Sep 2016 06:44:48 +0000 (06:44 +0000)]
[llvm-cov] Don't create 'jump to ...' links in nested views

Doing so is pointless, since the whole view is usually visible in a
small amount of space.

llvm-svn: 281588

8 years agoUpdate clang unittests for rL281586.
Wei Mi [Thu, 15 Sep 2016 06:31:30 +0000 (06:31 +0000)]
Update clang unittests for rL281586.

The change in rL281586 is in llvm component and tests updated here are
in clang component, so I have to commit them consecutively.

llvm-svn: 281587

8 years agoAdd some shortcuts in LazyValueInfo to reduce compile time of Correlated Value Propag...
Wei Mi [Thu, 15 Sep 2016 06:28:34 +0000 (06:28 +0000)]
Add some shortcuts in LazyValueInfo to reduce compile time of Correlated Value Propagation.

The patch is to partially fix PR10584. Correlated Value Propagation queries LVI
to check non-null for pointer params of each callsite. If we know the def of
param is an alloca instruction, we know it is non-null and can return early from
LVI. Similarly, CVP queries LVI to check whether pointer for each mem access is
constant. If the def of the pointer is an alloca instruction, we know it is not
a constant pointer. These shortcuts can reduce the cost of CVP significantly.

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

llvm-svn: 281586

8 years ago[CMake] Fixing lit for runtimes directory
Jonas Hahnfeld [Thu, 15 Sep 2016 06:14:13 +0000 (06:14 +0000)]
[CMake] Fixing lit for runtimes directory

Copy variable LLVM_BUILD_MAIN_SRC_DIR from LLVMConfig.cmake to
LLVM_MAIN_SRC_DIR as it is named for in-tree builds. This ensures that
add_lit_target() can reliably find llvm-lit which is not necessarily
in the PATH.

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

llvm-svn: 281585

8 years ago[libFuzzer] disable test that requires debug info -- it fails on the bot
Kostya Serebryany [Thu, 15 Sep 2016 05:46:58 +0000 (05:46 +0000)]
[libFuzzer] disable test that requires debug info -- it fails on the bot

llvm-svn: 281584

8 years ago[libFuzzer] move the AFL driver build rule test into the uninstrumented dir
Kostya Serebryany [Thu, 15 Sep 2016 05:17:39 +0000 (05:17 +0000)]
[libFuzzer] move the AFL driver build rule test into the uninstrumented dir

llvm-svn: 281583

8 years agoBuiltins.def: Explicitly undef finitef, to appease mingw. It defines finitef as alias...
NAKAMURA Takumi [Thu, 15 Sep 2016 05:11:43 +0000 (05:11 +0000)]
Builtins.def: Explicitly undef finitef, to appease mingw. It defines finitef as alias of _finitef.

llvm-svn: 281582

8 years ago[llvm-cov] Make a method name more accurate (NFC)
Vedant Kumar [Thu, 15 Sep 2016 04:45:59 +0000 (04:45 +0000)]
[llvm-cov] Make a method name more accurate (NFC)

llvm-svn: 281581

8 years ago[libFuzzer] fix print_pcs test
Kostya Serebryany [Thu, 15 Sep 2016 04:43:06 +0000 (04:43 +0000)]
[libFuzzer] fix print_pcs test

llvm-svn: 281580

8 years ago[llvm-cov] Don't print a verbose title when looking at one file
Vedant Kumar [Thu, 15 Sep 2016 04:41:39 +0000 (04:41 +0000)]
[llvm-cov] Don't print a verbose title when looking at one file

Having the same title, timestamp, etc. occur repeatedly creates an
unnecessary distraction when paging through a report.

llvm-svn: 281579

8 years ago[llvm-cov] Fix tests that aren't checking anything (NFC)
Vedant Kumar [Thu, 15 Sep 2016 04:41:37 +0000 (04:41 +0000)]
[llvm-cov] Fix tests that aren't checking anything (NFC)

E.g the 'showProjectSummary' test contains some checks which can't fail
because they match themselves...

llvm-svn: 281578

8 years ago[libFuzzer] implement print_pcs with trace-pc-guard. Change the trace-pc-guard heuris...
Kostya Serebryany [Thu, 15 Sep 2016 04:36:45 +0000 (04:36 +0000)]
[libFuzzer] implement print_pcs with trace-pc-guard. Change the trace-pc-guard heuristic for 8-bit counters to look more like in AFL (not that it's provable better, but the existin test preferes this heuristic)

llvm-svn: 281577

8 years ago[sanitizer] Fix darwin Go tsan build by unifying r281567 and r281553.
Ahmed Bougacha [Thu, 15 Sep 2016 04:28:20 +0000 (04:28 +0000)]
[sanitizer] Fix darwin Go tsan build by unifying r281567 and r281553.

Avoid redefining the weak stub when building gotsan.cc

llvm-svn: 281576

8 years agoAdd a C++ unittest to test the fix for PR30213.
Wei Mi [Thu, 15 Sep 2016 04:06:44 +0000 (04:06 +0000)]
Add a C++ unittest to test the fix for PR30213.

The test exercises the branch in scev expansion when the value in ValueOffsetPair
is a ptr and the offset is not divisible by the elem type size of value.

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

llvm-svn: 281575

8 years ago[sanitizer] one more attempt to fix things with __sanitizer_print_memory_profile
Kostya Serebryany [Thu, 15 Sep 2016 02:11:07 +0000 (02:11 +0000)]
[sanitizer] one more attempt to fix things with  __sanitizer_print_memory_profile

llvm-svn: 281574

8 years ago[doc] [CUDA] Add sections about STL support and differences between nvcc and clang...
Justin Lebar [Thu, 15 Sep 2016 02:04:32 +0000 (02:04 +0000)]
[doc] [CUDA] Add sections about STL support and differences between nvcc and clang to CompileCudaWithLLVM.rst.

llvm-svn: 281573

8 years ago[LangRef] Add a clarifying example for undef
Sanjoy Das [Thu, 15 Sep 2016 01:56:58 +0000 (01:56 +0000)]
[LangRef] Add a clarifying example for undef

llvm-svn: 281570

8 years agoMake the keys enumerations for options and resolvers enum classes.
Jim Ingham [Thu, 15 Sep 2016 01:47:22 +0000 (01:47 +0000)]
Make the keys enumerations for options and resolvers enum classes.

This keeps them from conflicting with other symbols names, so it's
worth their being less convenient to use for indexing.

llvm-svn: 281569

8 years ago[libFuzzer] add 8-bit counters to trace-pc-guard handler
Kostya Serebryany [Thu, 15 Sep 2016 01:30:18 +0000 (01:30 +0000)]
[libFuzzer] add 8-bit counters to trace-pc-guard handler

llvm-svn: 281568

8 years agoDefine the weak symbol added by r281546 on mac.
Ahmed Bougacha [Thu, 15 Sep 2016 01:04:32 +0000 (01:04 +0000)]
Define the weak symbol added by r281546 on mac.

'weak' doesn't behave like it does on linux.

llvm-svn: 281567

8 years agomath: Implement tgamma
Aaron Watry [Thu, 15 Sep 2016 00:17:34 +0000 (00:17 +0000)]
math: Implement tgamma

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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

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

llvm-svn: 281548

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

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

llvm-svn: 281531

8 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

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

llvm-svn: 281529

8 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

8 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

8 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

8 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

8 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

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

llvm-svn: 281523

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

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

llvm-svn: 281501

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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