platform/upstream/llvm.git
7 years ago[InstCombine] rename variables in foldICmpDivConstant(); NFC
Sanjay Patel [Fri, 26 Aug 2016 15:53:01 +0000 (15:53 +0000)]
[InstCombine] rename variables in foldICmpDivConstant(); NFC

Removing the redundant 'CmpRHSV' local variable exposes a bug in the caller
foldICmpShrConstant() - it was sending in the div constant instead of the
cmp constant. But I have not been able to expose this in a regression test
yet - the affected folds all appear to be handled before we ever reach this
code. I'll keep trying to find a case as I make changes to allow vector folds
in both functions.

llvm-svn: 279828

7 years agoAdd support for -fdiagnostics-absolute-paths: printing absolute paths in diagnostics
Hans Wennborg [Fri, 26 Aug 2016 15:45:36 +0000 (15:45 +0000)]
Add support for -fdiagnostics-absolute-paths: printing absolute paths in diagnostics

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

llvm-svn: 279827

7 years agoAdd space between access string and follow-up.
Michael Kruse [Fri, 26 Aug 2016 15:43:52 +0000 (15:43 +0000)]
Add space between access string and follow-up.

llvm-svn: 279826

7 years agoAdd "New access function" to update_check.py classifier.
Michael Kruse [Fri, 26 Aug 2016 15:43:43 +0000 (15:43 +0000)]
Add "New access function" to update_check.py classifier.

Lines with this prefix are printed by JSONImporter.

llvm-svn: 279825

7 years agoAvoid the use of large unsigned values in isl unit test
Tobias Grosser [Fri, 26 Aug 2016 15:42:38 +0000 (15:42 +0000)]
Avoid the use of large unsigned values in isl unit test

isl_val_int_from_ui takes an 'unsigned long' which has on 32-bit and LLP64
windows systems only 32 bit. Hence, make sure we do not use it with constants
that are larger than 32 bit.

Reported-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 279824

7 years ago[lib/LTO] Add an assertion to catch invalid opt levels.
Davide Italiano [Fri, 26 Aug 2016 15:22:59 +0000 (15:22 +0000)]
[lib/LTO] Add an assertion to catch invalid opt levels.

llvm-svn: 279823

7 years ago[AArch64] Avoid materializing constant 1 by using csinc, rather than csel.
Chad Rosier [Fri, 26 Aug 2016 14:01:55 +0000 (14:01 +0000)]
[AArch64] Avoid materializing constant 1 by using csinc, rather than csel.

This is similar to what was done in r261675, but for CSINC rather than CSINV.

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

llvm-svn: 279822

7 years ago[FIX] Access dimensions should correspond to number of dimensions of the accesses...
Roman Gareev [Fri, 26 Aug 2016 13:41:53 +0000 (13:41 +0000)]
[FIX] Access dimensions should correspond to number of dimensions of the accesses array.

llvm-svn: 279821

7 years agoHandle empty functions with debug info in load/store opt pass
Pablo Barrio [Fri, 26 Aug 2016 13:00:39 +0000 (13:00 +0000)]
Handle empty functions with debug info in load/store opt pass

Summary:
In fuctions that contained debug info but were empty otherwise,
the ARM load/store optimizer could abort. This was because
function MergeReturnIntoLDM handled the special case where a
Machine Basic BLock is empty by calling MBB.empty(). However, this
returns false in presence of debug info, although the function
should be considered empty in the eyes of the load/store optimizer.
This has been fixed by handling the case where searching through the
block finds only debug instructions.

Reviewers: rengolin, dexonsmith, llvm-commits, jmolloy

Subscribers: t.p.northover, aemerson, rengolin, samparker

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

llvm-svn: 279820

7 years ago[compiler-rt][XRay] Remove unnecessary assertion.
Dean Michael Berris [Fri, 26 Aug 2016 12:33:33 +0000 (12:33 +0000)]
[compiler-rt][XRay] Remove unnecessary assertion.

This assert only causes issues with signed/unsigned comparisons.

llvm-svn: 279819

7 years agoRevert " [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
Dean Michael Berris [Fri, 26 Aug 2016 12:31:02 +0000 (12:31 +0000)]
Revert "    [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"

This reverts commit 6659b10799b287ad815e49c4f1b01abc4369b03d.

llvm-svn: 279818

7 years agounittests: Make the expected value the first argument in EXPECT_EQ [NFC]
Tobias Grosser [Fri, 26 Aug 2016 12:25:08 +0000 (12:25 +0000)]
unittests: Make the expected value the first argument in EXPECT_EQ [NFC]

This improves the readability of failing test results, as gtest prints always
the first argument as the 'expected value'.

In the previous commit we already changed the tests for isl_valFromAPInt. In
this commit, the tests for IslValToAPInt follow.

Suggested-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 279817

7 years ago [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Dean Michael Berris [Fri, 26 Aug 2016 12:23:20 +0000 (12:23 +0000)]
[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration

    Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

    Reviewers: samsonov, beanz, pcc, rnk

    Subscribers: llvm-commits, kubabrecka, compnerd, dberris

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

llvm-svn: 279816

7 years agoImprove documentation and testing for isl_valFromAPInt
Tobias Grosser [Fri, 26 Aug 2016 12:01:07 +0000 (12:01 +0000)]
Improve documentation and testing for isl_valFromAPInt

The recent unit tests we gained made clear that the semantics of
isl_valFromAPInt are not clear, due to missing documentation. In this change we
document both the calling interface as well as the implementation of
isl_valFromAPInt.

We also make the implementation easier to read by removing integer wrappig in
abs() when passing in the minimal integer value for a given bitwidth. Even
though wrapping and subsequently interpreting the result as unsigned value gives
the correct result, this is far from obvious.  Instead, we explicitly add one
more bit to the input type to ensure that abs will never wrap. This change did
not uncover a bug in the old implementation, but was introduced to increase
readability.

We update the tests to add a test case for this special case and use this
opportunity to also test a number larger than 64 bit. Finally, we order the
arguments of the test cases to make sure the expected output is first. This
helps readability in case of failing test cases as gtest assumes the first value
to be the exected value.

Reviewed-by: Michael Kruse <llvm@meinersbur.de>
Differential Revision: https://reviews.llvm.org/D23917

llvm-svn: 279815

7 years ago[clang-tidy] Some tweaks on header guard checks.
Haojian Wu [Fri, 26 Aug 2016 11:15:38 +0000 (11:15 +0000)]
[clang-tidy] Some tweaks on header guard checks.

* Implement missing storeOption interfaces.
* Remove unnecessary parameter copy in isHeaderFileExtension.
* Fix doc style.

llvm-svn: 279814

7 years agoImprove documentation and testing of APIntFromVal
Tobias Grosser [Fri, 26 Aug 2016 10:43:28 +0000 (10:43 +0000)]
Improve documentation and testing of APIntFromVal

The recent unit tests we gained made clear that the semantics of APIntFromVal
are not clear, due to missing documentation. In this change we document both
the calling interface as well as the implementation of APIntFromVal. We also
make the implementation easier to read by removing the use of magic numbers.
Finally, we add tests to check the bitwidth of the created values as well as
the correct modeling of very large numbers.

Reviewed-by: Michael Kruse <llvm@meinersbur.de>
Differential Revision: https://reviews.llvm.org/D23910

llvm-svn: 279813

7 years agoSwitch linux and android CODE_OWNERS
Pavel Labath [Fri, 26 Aug 2016 10:06:13 +0000 (10:06 +0000)]
Switch linux and android CODE_OWNERS

Summary:
Oleksiy is no longer active in LLDB, I'd like to formally assume ownership of the linux and
android parts.

Reviewers: ovyalov, clayborg

Subscribers: tberghammer, danalbert, lldb-commits

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

llvm-svn: 279812

7 years ago[X86][SSE4A] The EXTRQ/INSERTQ bit extraction/insertion ops should be in the integer...
Simon Pilgrim [Fri, 26 Aug 2016 09:55:41 +0000 (09:55 +0000)]
[X86][SSE4A] The EXTRQ/INSERTQ bit extraction/insertion ops should be in the integer domain

llvm-svn: 279811

7 years agoImplement support for --build-id=uuid switch
Eugene Leviant [Fri, 26 Aug 2016 09:55:37 +0000 (09:55 +0000)]
Implement support for --build-id=uuid switch

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

llvm-svn: 279810

7 years ago[ELF] Added test case for PROVIDE and PROVIDE_HIDDEN within section
Eugene Leviant [Fri, 26 Aug 2016 09:48:32 +0000 (09:48 +0000)]
[ELF] Added test case for PROVIDE and PROVIDE_HIDDEN within section

llvm-svn: 279809

7 years agoAdd cmake option to choose whether to use the builtin demangler
Pavel Labath [Fri, 26 Aug 2016 09:47:58 +0000 (09:47 +0000)]
Add cmake option to choose whether to use the builtin demangler

Summary:
Previously the builting demangler was on for platforms that explicitly set a flag by modifying
Mangled.cpp (windows, freebsd). The Xcode build always used builtin demangler by passing a
compiler flag. This adds a cmake flag (defaulting to ON) to configure the demangling library used
at build time. The flag is only available on non-windows platforms as there the system demangler
is not present (in the form we're trying to use it, at least).
The impact of this change is:
- linux: switches to the builtin demangler
- freebsd, windows: NFC (I hope)
- netbsd: switches to the builtin demangler
- osx cmake build: switches to the builtin demangler (matching the XCode build)

The main motivation for this is the cross-platform case, where it should bring more consistency
by removing the dependency on the host demangler (which can be completely unrelated to the debug
target).

Reviewers: zturner, emaste, krytarowski

Subscribers: emaste, clayborg, lldb-commits

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

llvm-svn: 279808

7 years agoImplement getRandomBytes() function
Eugene Leviant [Fri, 26 Aug 2016 08:14:54 +0000 (08:14 +0000)]
Implement getRandomBytes() function

This function allows getting arbitrary sized block of random bytes.
Primary motivation is support for --build-id=uuid in lld.

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

llvm-svn: 279807

7 years ago[X86][SSE] Add CMPSS/CMPSD intrinsic scalar load folding support.
Craig Topper [Fri, 26 Aug 2016 07:08:00 +0000 (07:08 +0000)]
[X86][SSE] Add CMPSS/CMPSD intrinsic scalar load folding support.

llvm-svn: 279806

7 years ago[compiler-rt][XRay] Initial per-thread inmemory logging implementation
Dean Michael Berris [Fri, 26 Aug 2016 06:39:33 +0000 (06:39 +0000)]
[compiler-rt][XRay] Initial per-thread inmemory logging implementation

Depends on D21612 which implements the building blocks for the compiler-rt
implementation of the XRay runtime. We use a naive in-memory log of fixed-size
entries that get written out to a log file when the buffers are full, and when
the thread exits.

This implementation lays some foundations on to allowing for more complex XRay
records to be written to the log in subsequent changes. It also defines the format
that the function call accounting tool in D21987 will start building upon.

Once D21987 lands, we should be able to start defining more tests using that tool
once the function call accounting tool becomes part of the llvm distribution.

Reviewers: echristo, kcc, rnk, eugenis, majnemer, rSerge

Subscribers: sdardis, rSerge, dberris, tberghammer, danalbert, srhines, majnemer, llvm-commits, mehdi_amini

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

llvm-svn: 279805

7 years agoReplace subregister uses when processing tied operands
Matt Arsenault [Fri, 26 Aug 2016 06:31:32 +0000 (06:31 +0000)]
Replace subregister uses when processing tied operands

This was for some reason skipping operands that are subregisters
instead of keeping the same subregister index.

v_movreld_b32 expects src0 to be the subregister of the tied
super register use/def.

e.g.

v_movreld_b32 v0, v9, <imp-def, tied3> v[0:3], <imp-use, tied2> v[0:3]

was being replaced with

v[4:7] = copy v[0:3]
v_movreld_b32 v0, v9, <imp-def, tied3> v[4:7], <imp-use, tied2> v[4:7],

which really writes to v[0:3]

llvm-svn: 279804

7 years ago[clang-tidy] Added hh, hxx and hpp to header guard checks.
Mads Ravn [Fri, 26 Aug 2016 05:59:53 +0000 (05:59 +0000)]
[clang-tidy] Added hh, hxx and hpp to header guard checks.

Changed the extension check to include the option of ",h,hh,hpp,hxx" instead of just returning whether the file ended with ".h".

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

llvm-svn: 279803

7 years agoInclude tests only if COMPILER_RT_BUILD_XRAY is ON.
Dean Michael Berris [Fri, 26 Aug 2016 02:39:09 +0000 (02:39 +0000)]
Include tests only if COMPILER_RT_BUILD_XRAY is ON.

This should un-break users that have not re-generated their CMake
configs when they ran it when this was defaulted to OFF. Related to
r277975 post-commit review.

llvm-svn: 279802

7 years agoFix singlton -> singleton typo.
Eric Christopher [Fri, 26 Aug 2016 02:00:21 +0000 (02:00 +0000)]
Fix singlton -> singleton typo.

llvm-svn: 279801

7 years agoMake all the Function implementations different so the compiler won't share them.
Jim Ingham [Fri, 26 Aug 2016 01:27:50 +0000 (01:27 +0000)]
Make all the Function implementations different so the compiler won't share them.

Clang on ARM64 was making the three Function methods with identical bodies have
one implementation that was shared.  That threw off the count of breakpoints, since
we don't count as separate locations three functions with the same address.

I also cleaned up the test case while I was at it.

<rdar://problem/27001915>

llvm-svn: 279800

7 years agoSort list of driver-known file extensions. It was previously approximately
Richard Smith [Fri, 26 Aug 2016 00:41:59 +0000 (00:41 +0000)]
Sort list of driver-known file extensions. It was previously approximately
ordered by length then alphabetically; apply that order consistently.

llvm-svn: 279799

7 years agoAdditional update missed by r279793, should hopefully make the PPC sanitizer bots...
Richard Smith [Fri, 26 Aug 2016 00:30:03 +0000 (00:30 +0000)]
Additional update missed by r279793, should hopefully make the PPC sanitizer bots happy again.

llvm-svn: 279798

7 years agoFix the static_assert added in r279536.
Akira Hatanaka [Fri, 26 Aug 2016 00:22:12 +0000 (00:22 +0000)]
Fix the static_assert added in r279536.

The assertion doesn't always hold true as sizeof(SDNodeBits) isn't equal
to sizeof(uint16_t) for some targets. For example, sizeof(SDNodeBits)
evaluates to 1, not 2, for ARM's APCS targets.

llvm-svn: 279797

7 years ago[libFuzzer] simplify a test to make it pass on the bot
Kostya Serebryany [Fri, 26 Aug 2016 00:18:16 +0000 (00:18 +0000)]
[libFuzzer] simplify a test to make it pass on the bot

llvm-svn: 279796

7 years agoC++ Modules TS: add frontend support for building pcm files from module
Richard Smith [Fri, 26 Aug 2016 00:14:38 +0000 (00:14 +0000)]
C++ Modules TS: add frontend support for building pcm files from module
interface files. At the moment, all declarations (and no macros) are exported,
and 'export' declarations are not supported yet.

llvm-svn: 279794

7 years ago[sanitizer] enable random shuffling the memory chunks inside the allocator, under...
Kostya Serebryany [Fri, 26 Aug 2016 00:06:03 +0000 (00:06 +0000)]
[sanitizer] enable random shuffling the memory chunks inside the allocator, under a flag. Set this flag for the scudo allocator, add a test.

llvm-svn: 279793

7 years ago[libFuzzer] make sure we have symbols on fuzzer tests
Kostya Serebryany [Thu, 25 Aug 2016 23:30:02 +0000 (23:30 +0000)]
[libFuzzer] make sure we have symbols on fuzzer tests

llvm-svn: 279792

7 years ago[asan] remove unused kAsanHeapRightRedzoneMagic (NFC); part 2 (sorry)
Kostya Serebryany [Thu, 25 Aug 2016 22:51:26 +0000 (22:51 +0000)]
[asan] remove unused kAsanHeapRightRedzoneMagic (NFC); part 2 (sorry)

llvm-svn: 279790

7 years ago[asan] remove unused kAsanHeapRightRedzoneMagic (NFC)
Kostya Serebryany [Thu, 25 Aug 2016 22:49:35 +0000 (22:49 +0000)]
[asan] remove unused kAsanHeapRightRedzoneMagic (NFC)

llvm-svn: 279789

7 years agoRevert r274613 because it breaks the test suite with AVX512
Michael Kuperstein [Thu, 25 Aug 2016 22:48:11 +0000 (22:48 +0000)]
Revert r274613 because it breaks the test suite with AVX512

This reverts most of r274613 (AKA r274626) and its follow-ups (r276347, r277289),
due to miscompiles in the test suite. The FastISel change was left in, because
it apparently fixes an unrelated issue.

(Recommit of r279782 which was broken due to a bad merge.)

This fixes 4 out of the 5 test failures in PR29112.

llvm-svn: 279788

7 years ago[libFizzer] rename -print_new_cov_pcs=1 into -print_pcs=1 and make it more useful...
Kostya Serebryany [Thu, 25 Aug 2016 22:35:08 +0000 (22:35 +0000)]
[libFizzer] rename -print_new_cov_pcs=1 into -print_pcs=1 and make it more useful: print PCs only after the initial corpus has been read and symbolize them

llvm-svn: 279787

7 years agoWiden type of __offset_flags in RTTI on Mingw64
Reid Kleckner [Thu, 25 Aug 2016 22:16:30 +0000 (22:16 +0000)]
Widen type of __offset_flags in RTTI on Mingw64

Otherwise we can't handle secondary base classes at offsets greater than
2**24. This agrees with libstdc++abi.

We could extend this change to other LLP64 platforms, but then we would
want to update libc++abi and it would require additional review.

Fixes PR29116

llvm-svn: 279786

7 years agoRevert r279782 due to debug buildbot breakage.
Michael Kuperstein [Thu, 25 Aug 2016 22:14:45 +0000 (22:14 +0000)]
Revert r279782 due to debug buildbot breakage.

llvm-svn: 279785

7 years agoAdd a notification message in 'type lookup' when the current language doesn't yield...
Enrico Granata [Thu, 25 Aug 2016 22:11:01 +0000 (22:11 +0000)]
Add a notification message in 'type lookup' when the current language doesn't yield results and one has to go across multiple languages to scan for types

Fixes rdar://22422313

llvm-svn: 279784

7 years agoFix ArrayRef initializer_list Ctor Test
David Blaikie [Thu, 25 Aug 2016 22:09:13 +0000 (22:09 +0000)]
Fix ArrayRef initializer_list Ctor Test

The InitializerList test had undefined behavior by creating a dangling pointer to the temporary initializer list.  This patch removes the undefined behavior in the test by creating the initializer list directly.

Reviewers: mehdi_amini, dblaikie

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

llvm-svn: 279783

7 years agoRevert r274613 because it breaks the test suite with AVX512
Michael Kuperstein [Thu, 25 Aug 2016 21:55:41 +0000 (21:55 +0000)]
Revert r274613 because it breaks the test suite with AVX512

This reverts most of r274613 and its follow-ups (r276347, r277289), due to
miscompiles in the test suite. The FastISel change was left in, because it
apparently fixes an unrelated issue.

This fixes 4 out of the 5 test failures in PR29112.

llvm-svn: 279782

7 years ago[asan] fix windows bot
Kostya Serebryany [Thu, 25 Aug 2016 21:45:18 +0000 (21:45 +0000)]
[asan] fix windows bot

llvm-svn: 279781

7 years ago[sanitizer] add __sanitizer_symbolize_pc. https://github.com/google/sanitizers/issues/322
Kostya Serebryany [Thu, 25 Aug 2016 21:35:29 +0000 (21:35 +0000)]
[sanitizer] add __sanitizer_symbolize_pc. https://github.com/google/sanitizers/issues/322

llvm-svn: 279780

7 years ago[StreamExecutor] Add Platform and PlatformManager
Jason Henline [Thu, 25 Aug 2016 21:33:07 +0000 (21:33 +0000)]
[StreamExecutor] Add Platform and PlatformManager

Summary: Abstractions for a StreamExecutor platform

Reviewers: jlebar

Subscribers: jprice, parallel_libs-commits

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

llvm-svn: 279779

7 years ago[MemCpy] Add comments for r279769
Tim Shen [Thu, 25 Aug 2016 21:03:46 +0000 (21:03 +0000)]
[MemCpy] Add comments for r279769

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

llvm-svn: 279778

7 years agocmake: Install CheckAtomic.cmake (needed by lldb)
Chris Bieneman [Thu, 25 Aug 2016 20:53:00 +0000 (20:53 +0000)]
cmake: Install CheckAtomic.cmake (needed by lldb)

Summary:
Install CheckAtomic.cmake along with other LLVM modules, therefore making it possible for other projects to use it. This file is needed for LLDB to be built standalone, and installing it was suggested in https://reviews.llvm.org/D23881.

Patch by: MichaÅ‚ Górny

Reviewers: krytarowski, zturner, eugenis, jyknight, labath, beanz

Subscribers: beanz, llvm-commits

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

llvm-svn: 279777

7 years ago[CMake] Add support for exposing runtime targets
Chris Bieneman [Thu, 25 Aug 2016 20:49:51 +0000 (20:49 +0000)]
[CMake] Add support for exposing runtime targets

This patch adds support to the runtimes build for exposing sub-project targets through the high-level configuration. This will enable exposing the build, check and install targets for sub-project components (i.e. asan, check-asan, install-asan...).

This patch requires minor changes to the runtime projects to take advantage of it, and I'll phase those changes into Compiler-RT shortly.

llvm-svn: 279776

7 years agoFix test corresponding to change r279770
Hemant Kulkarni [Thu, 25 Aug 2016 20:43:49 +0000 (20:43 +0000)]
Fix test corresponding to change r279770

llvm-svn: 279775

7 years ago[MS] Win64 va_arg should expect large arguments to be passed indirectly
Reid Kleckner [Thu, 25 Aug 2016 20:42:26 +0000 (20:42 +0000)]
[MS] Win64 va_arg should expect large arguments to be passed indirectly

Fixes PR20569

llvm-svn: 279774

7 years agoARM: by default don't set the Thumb bit on MachO relocated values.
Tim Northover [Thu, 25 Aug 2016 20:41:30 +0000 (20:41 +0000)]
ARM: by default don't set the Thumb bit on MachO relocated values.

Its existence is largely historical, apparently we tried to make ARM object
files look maybe-almost-possibly runnable by putting our best guess at the
actual value into relocated locations. Of course, the real linker then comes
along and can completely change things.

But it should only be there for word-sized and movw/movt relocations. It can't
be encoded in branch relocations, and I've seen it mess up validity
calculations twice in the last couple of weeks so the default is clearly problematic.

llvm-svn: 279773

7 years agoFix clang-offload-bundler.c test on Windows
Reid Kleckner [Thu, 25 Aug 2016 20:40:23 +0000 (20:40 +0000)]
Fix clang-offload-bundler.c test on Windows

llvm-svn: 279772

7 years ago[sanitizer] change SizeClassAllocator64 to accept just one template parameter instead...
Kostya Serebryany [Thu, 25 Aug 2016 20:23:08 +0000 (20:23 +0000)]
[sanitizer] change SizeClassAllocator64 to accept just one template parameter instead of 5. First, this will make the mangled names shorter. Second, this will make adding more parameters simpler.

llvm-svn: 279771

7 years agollvm-objdump: ELF: Handle code and data mix in all scenarios
Hemant Kulkarni [Thu, 25 Aug 2016 19:41:08 +0000 (19:41 +0000)]
llvm-objdump: ELF: Handle code and data mix in all scenarios

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

llvm-svn: 279770

7 years ago[MemCpy] Check for alias in performMemCpyToMemSetOptzn, instead of the identity of...
Tim Shen [Thu, 25 Aug 2016 19:27:26 +0000 (19:27 +0000)]
[MemCpy] Check for alias in performMemCpyToMemSetOptzn, instead of the identity of two operands

Summary:
This fixes pr29105. The reason is that lifetime marks creates new
aliasing pointers the original ones, but before this patch aliases
were not checked in performMemCpyToMemSetOptzn.

Subscribers: llvm-commits

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

llvm-svn: 279769

7 years ago[lsan] one more test fix to please the Debian Sid bot (this time, confirmed on the...
Kostya Serebryany [Thu, 25 Aug 2016 19:08:10 +0000 (19:08 +0000)]
[lsan] one more test fix to please the Debian Sid bot (this time, confirmed on the proper machine). Apparently, newer glibc uses slightly more stack

llvm-svn: 279768

7 years agoReuse an SDLoc throughout a function. NFC.
Michael Kuperstein [Thu, 25 Aug 2016 18:50:56 +0000 (18:50 +0000)]
Reuse an SDLoc throughout a function. NFC.

llvm-svn: 279767

7 years agoRefactor to remove the assumption that we know the name of the module we're emitting...
Richard Smith [Thu, 25 Aug 2016 18:26:30 +0000 (18:26 +0000)]
Refactor to remove the assumption that we know the name of the module we're emitting at the point when we create a PCHGenerator (with the C++ modules TS, we find that out part way through parsing the input).

llvm-svn: 279766

7 years agoOmit column info for CodeView by default
Adrian McCarthy [Thu, 25 Aug 2016 18:24:35 +0000 (18:24 +0000)]
Omit column info for CodeView by default

Clang tracks only start columns, not start-end ranges. CodeView allows for that, but the VS debugger doesn't handle anything less than a complete range well--it either highlights the wrong part of a statement or truncates source lines in the assembly view. It's better to have no column information at all.

So by default, we'll omit the column information for CodeView targeting Windows.

Since the column info is still useful for sanitizers, I've promoted -gcolumn-info (and -gno-column-info) to a CoreOption and added a couple tests to make sure that works for clang-cl.

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

llvm-svn: 279765

7 years ago[MS] Pass non-trivially-copyable objects indirectly on Windows ARM
Reid Kleckner [Thu, 25 Aug 2016 18:23:28 +0000 (18:23 +0000)]
[MS] Pass non-trivially-copyable objects indirectly on Windows ARM

This isn't exactly what MSVC does, unfortunately. MSVC does not pass
objects with destructors but no copy constructors by address. More ARM
expertise is required to really understand what should be done here.

Fixes PR29136.

llvm-svn: 279764

7 years agoFollowon to r279744. Find the other exception types and make __throw_XXX routines...
Marshall Clow [Thu, 25 Aug 2016 17:47:09 +0000 (17:47 +0000)]
Followon to r279744. Find the other exception types and make __throw_XXX routines (and call them).  Remove the generic __libcpp_throw routine, since no one uses it anymore.

llvm-svn: 279763

7 years agoGlobalISel: add missing type to G_UADDE instructions
Tim Northover [Thu, 25 Aug 2016 17:37:44 +0000 (17:37 +0000)]
GlobalISel: add missing type to G_UADDE instructions

llvm-svn: 279762

7 years agoGlobalISel: mark overflow bit of overflow ops legal.
Tim Northover [Thu, 25 Aug 2016 17:37:41 +0000 (17:37 +0000)]
GlobalISel: mark overflow bit of overflow ops legal.

It's expected this will map to NZCV register class and be properly selectable.

llvm-svn: 279761

7 years agoGlobalISel: mark simple ops legal even on types < 32-bit.
Tim Northover [Thu, 25 Aug 2016 17:37:39 +0000 (17:37 +0000)]
GlobalISel: mark simple ops legal even on types < 32-bit.

The 32-bit variants of these operations don't depend on the bits not being
operated on, so they also naturally model operations narrower than the actual
register width.

llvm-svn: 279760

7 years agoGlobalISel: mark pointer constants as legal on AArch64.
Tim Northover [Thu, 25 Aug 2016 17:37:35 +0000 (17:37 +0000)]
GlobalISel: mark pointer constants as legal on AArch64.

llvm-svn: 279759

7 years agoGlobalISel: perform multi-step legalization
Tim Northover [Thu, 25 Aug 2016 17:37:32 +0000 (17:37 +0000)]
GlobalISel: perform multi-step legalization

llvm-svn: 279758

7 years agoGlobalISel: mark small extends as legal on AArch64
Tim Northover [Thu, 25 Aug 2016 17:37:25 +0000 (17:37 +0000)]
GlobalISel: mark small extends as legal on AArch64

llvm-svn: 279757

7 years agoHooking up a check-all target for the runtimes projects
Chris Bieneman [Thu, 25 Aug 2016 17:18:41 +0000 (17:18 +0000)]
Hooking up a check-all target for the runtimes projects

llvm-svn: 279756

7 years ago[X86] 512-bit VPAVG requires AVX512BW
Michael Kuperstein [Thu, 25 Aug 2016 17:17:46 +0000 (17:17 +0000)]
[X86] 512-bit VPAVG requires AVX512BW

Fix VPAVG detection to require AVX512BW, not AVX512F for 512-bit widths,
and change associated asserts to assert in the right direction...

This fixes PR29111.

llvm-svn: 279755

7 years ago[Sema][Comments] Add support for TypeAliasTemplate
Bruno Cardoso Lopes [Thu, 25 Aug 2016 17:09:33 +0000 (17:09 +0000)]
[Sema][Comments] Add support for TypeAliasTemplate

Emit proper diagnostics when -Wdocumentation is used with constructs such as:

  template<typename T>
  using fn = int(T aaa, int ccc);

Previously clang wouldn't recognize the function and complain with
'comment that is not attached to a function declaration'.

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

rdar://problem/27300695

llvm-svn: 279754

7 years agodfsan: Enable 48-bit VMA support on aarch64
Adhemerval Zanella [Thu, 25 Aug 2016 17:07:43 +0000 (17:07 +0000)]
dfsan: Enable 48-bit VMA support on aarch64

This patch adds 48-bits VMA support for msan on aarch64. As current
mappings for aarch64, 48-bit VMA also supports PIE executable.

Tested on 39 and 48-bit VMA kernels on aarch64.

llvm-svn: 279753

7 years agomsan: Enable 48-bit VMA support on aarch64
Adhemerval Zanella [Thu, 25 Aug 2016 17:05:56 +0000 (17:05 +0000)]
msan: Enable 48-bit VMA support on aarch64

This patch adds 48-bits VMA support for msan on aarch64. As current
mappings for aarch64, 48-bit VMA also supports PIE executable. The
48-bits segments only cover the usual PIE/default segments plus some
more segments (262144GB total, 0.39% total VMA). Memory avaliability
can be increase by adding multiple application segments like 39 and
42 mapping (some mappings were added on this patch as well).

Tested on 39 and 48-bit VMA kernels on aarch64.

llvm-svn: 279752

7 years ago[X86][SSE] INSERTPS is only combined on v4f32 types. NFCI.
Simon Pilgrim [Thu, 25 Aug 2016 17:02:00 +0000 (17:02 +0000)]
[X86][SSE] INSERTPS is only combined on v4f32 types. NFCI.

llvm-svn: 279751

7 years ago[Hexagon] Remove extraneous debug output from HexagonCopyToCombine.cpp
Ron Lieberman [Thu, 25 Aug 2016 16:46:09 +0000 (16:46 +0000)]
[Hexagon] Remove extraneous debug output from HexagonCopyToCombine.cpp
BB# ...

llvm-svn: 279750

7 years ago[UNROLL] Postpone ScalarEvolution::forgetLoop after TripCountSC is expanded
Wei Mi [Thu, 25 Aug 2016 16:17:18 +0000 (16:17 +0000)]
[UNROLL] Postpone ScalarEvolution::forgetLoop after TripCountSC is expanded
when unroll runtime iteration loop.

In llvm::UnrollRuntimeLoopRemainder, if the loop to be unrolled is the inner
loop inside a loop nest, the scalar evolution needs to be dropped for its
parent loop which is done by ScalarEvolution::forgetLoop. However, we can
postpone forgetLoop to the end of UnrollRuntimeLoopRemainder so TripCountSC
expansion can still reuse existing value.

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

llvm-svn: 279748

7 years ago[builtins] Make sure builtin compile tests respect CMAKE_C_COMPILER_TARGET
Francis Ricci [Thu, 25 Aug 2016 16:15:45 +0000 (16:15 +0000)]
[builtins] Make sure builtin compile tests respect CMAKE_C_COMPILER_TARGET

Summary:
Since we generate the compiler invocation on our own, we need to
manually add -target if CMAKE_C_COMPILER_TARGET has been specified.

Reviewers: compnerd, beanz

Subscribers: llvm-commits

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

llvm-svn: 279747

7 years agoRemove duplicate inline
Marshall Clow [Thu, 25 Aug 2016 15:56:55 +0000 (15:56 +0000)]
Remove duplicate inline

llvm-svn: 279746

7 years agoFix line endings
Simon Pilgrim [Thu, 25 Aug 2016 15:45:27 +0000 (15:45 +0000)]
Fix line endings

llvm-svn: 279745

7 years agoAdd an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type...
Marshall Clow [Thu, 25 Aug 2016 15:09:01 +0000 (15:09 +0000)]
Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled.  Reviewed as: https://reviews.llvm.org/D23855.

llvm-svn: 279744

7 years agoQuery llvm-config to get system libs required for linking.
Michael Kruse [Thu, 25 Aug 2016 14:58:29 +0000 (14:58 +0000)]
Query llvm-config to get system libs required for linking.

Remove the unused function get_system_libs. Instead, run
'llvm-config --system-libs' to determine which libraries are required in
addition LLVM's for linking an executable. At the moment these are the unittests
that link to gtest and transitively depend on these system libs.

llvm-svn: 279743

7 years agoAdd comment for querying --libdir. NFC.
Michael Kruse [Thu, 25 Aug 2016 14:43:04 +0000 (14:43 +0000)]
Add comment for querying --libdir. NFC.

llvm-svn: 279742

7 years agoFix offload bundler test to support Windows new lines.
Samuel Antao [Thu, 25 Aug 2016 14:35:20 +0000 (14:35 +0000)]
Fix offload bundler test to support Windows new lines.

llvm-svn: 279741

7 years agoDo not build unittests by default.
Michael Kruse [Thu, 25 Aug 2016 14:33:44 +0000 (14:33 +0000)]
Do not build unittests by default.

Only build them for check-polly and check-polly-unittests in out-of-tree builds.

In LLVM, this behaviour is controlled with LLVM_BUILD_TESTS. Polly out-of-tree
does not have such a flag.

llvm-svn: 279740

7 years ago[Hexagon] vector store print tracing.
Ron Lieberman [Thu, 25 Aug 2016 13:35:48 +0000 (13:35 +0000)]
[Hexagon] vector store print tracing.

Add vector store print tracing option for hexagon vector instructions.

https://reviews.llvm.org/D23870

llvm-svn: 279739

7 years agoAdd missing words to wanrning.
Michael Kruse [Thu, 25 Aug 2016 13:29:26 +0000 (13:29 +0000)]
Add missing words to wanrning.

llvm-svn: 279738

7 years agoAdd warning for FORCE_STATIC libraries when using BUILD_SHARED_LIBS.
Michael Kruse [Thu, 25 Aug 2016 13:21:53 +0000 (13:21 +0000)]
Add warning for FORCE_STATIC libraries when using BUILD_SHARED_LIBS.

We cannot built ISL as shared object because we build it with
-fvisibility=hidden; The created shared object would have no accessible symbols.

The reason it is built with -fvisibility=hidden is because opt/clang might load
other libraries that have ISL embedded and whose' symbols would conflict with
Polly's private ISL. This could happend with Draggonegg.

In the future we might instead statically link PollyISL into the Polly shared
object to avoid installing the static library.

Requested-by: Vedran Miletic <vedran@miletic.net>
See-also: llvm.org/PR27306
llvm-svn: 279737

7 years ago[X86][AVX] Improved AVX512F/AVX512VL SubVectorBroadcast tests
Simon Pilgrim [Thu, 25 Aug 2016 12:50:13 +0000 (12:50 +0000)]
[X86][AVX] Improved AVX512F/AVX512VL SubVectorBroadcast tests

llvm-svn: 279736

7 years ago[X86][AVX] Provide SubVectorBroadcast fallback if load fold fails (PR29133)
Simon Pilgrim [Thu, 25 Aug 2016 12:45:16 +0000 (12:45 +0000)]
[X86][AVX] Provide SubVectorBroadcast fallback if load fold fails (PR29133)

Fix for PR29133, matching the approach that was taken for AVX1 scalar broadcasts.

llvm-svn: 279735

7 years agoIntroduce unittests.
Michael Kruse [Thu, 25 Aug 2016 12:36:15 +0000 (12:36 +0000)]
Introduce unittests.

Add the infrastructure for unittests to Polly and two simple tests for
conversion between isl_val and APInt. In addition, a build target
check-polly-unittests is added to run only the unittests but not the regression
tests.

Clang's unittest mechanism served as as a blueprint which then was adapted to
Polly.

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

llvm-svn: 279734

7 years agoUse configure_lit_site_cfg instead of configure_file.
Michael Kruse [Thu, 25 Aug 2016 12:03:33 +0000 (12:03 +0000)]
Use configure_lit_site_cfg instead of configure_file.

configure_lit_site_cfg defines some more parameters that are used in
lit.site.cfg.in. configure_file would leave those empty. These additional
definitions seem to be unimportant for regression tests, but unittests do not
work without them.

In case of out-of-tree builds, define the additional parameters with default
values. These may not take all configuration parameters into account, as
configure_lit_site_cfg would.

llvm-svn: 279733

7 years agoGVN-hoist: fix hoistingFromAllPaths for loops (PR29034)
Sebastian Pop [Thu, 25 Aug 2016 11:55:47 +0000 (11:55 +0000)]
GVN-hoist: fix hoistingFromAllPaths for loops (PR29034)

It is invalid to hoist stores or loads if they are not executed on all paths
from the hoisting point to the exit of the function. In the testcase, there are
paths in the loop that do not execute the stores or the loads, and so hoisting
them within the loop is unsafe.

The problem is that the current implementation of hoistingFromAllPaths is
incomplete: it walks all blocks dominated by the hoisting point, and does not
return false when the loop contains a path on which the hoisted ld/st is
not executed.

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

llvm-svn: 279732

7 years agoRemove trailing WS [NFC]
Aditya Kumar [Thu, 25 Aug 2016 11:52:38 +0000 (11:52 +0000)]
Remove trailing WS [NFC]

llvm-svn: 279731

7 years agoAdd LLVM libdir to library search path in out-of-tree builds.
Michael Kruse [Thu, 25 Aug 2016 11:28:52 +0000 (11:28 +0000)]
Add LLVM libdir to library search path in out-of-tree builds.

This previously was not required because in an out-of-tree build Polly would
only build libraries (LLVMPolly, libPolly, libPollyISL, libPollyPPCG), but no
executables where the libraries would be linked to. This will change when adding
unittests in a follow-up commit.

llvm-svn: 279730

7 years agoRemoved trailing whitespace. NFC.
George Rimar [Thu, 25 Aug 2016 10:39:04 +0000 (10:39 +0000)]
Removed trailing whitespace. NFC.

llvm-svn: 279729

7 years agoAlso warn if llvm-lit is not available.
Michael Kruse [Thu, 25 Aug 2016 10:35:22 +0000 (10:35 +0000)]
Also warn if llvm-lit is not available.

The program 'llvm-lit', like 'not' and 'FileCheck' are necessary for running
check-polly. Warn of any of the three is not in LLVM_INSTALL_ROOT/bin directory.

llvm-svn: 279728

7 years agoclang-format: [JS] nested and tagged template strings.
Martin Probst [Thu, 25 Aug 2016 10:13:21 +0000 (10:13 +0000)]
clang-format: [JS] nested and tagged template strings.

JavaScript template strings can be nested arbitrarily:

    foo = `text ${es.map(e => { return `<${e}>`; })} text`;

This change lexes nested template strings using a stack of lexer states to
correctly switch back to template string lexing on closing braces.

Also, reuse the same stack for the token-stashed logic.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 279727

7 years ago[ELF] - Implemented --oformat binary option.
George Rimar [Thu, 25 Aug 2016 09:05:47 +0000 (09:05 +0000)]
[ELF] - Implemented --oformat binary option.

-oformat output-format
`-oformat' option can be used to specify the binary format for the output object file.

Patch implements binary format output type.

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

llvm-svn: 279726