platform/upstream/llvm.git
8 years agoDon't crash when trying to capture persistent variables in a block.
Sean Callanan [Fri, 26 Aug 2016 18:12:39 +0000 (18:12 +0000)]
Don't crash when trying to capture persistent variables in a block.

Reports an error instead.  We can fix this later to make persistent variables
work, but right now we hit an LLVM assertion if we get this wrong.

<rdar://problem/27770298>

llvm-svn: 279850

8 years ago[AArch64] Avoid materializing constant values when generating csel instructions.
Chad Rosier [Fri, 26 Aug 2016 18:05:50 +0000 (18:05 +0000)]
[AArch64] Avoid materializing constant values when generating csel instructions.

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

llvm-svn: 279849

8 years ago[AsmParser] Placate a -Wmisleading-indentantion warning (GCC7).
Davide Italiano [Fri, 26 Aug 2016 18:05:03 +0000 (18:05 +0000)]
[AsmParser] Placate a -Wmisleading-indentantion warning (GCC7).

llvm-svn: 279848

8 years ago[MC] Move .cv_loc management logic out of MCContext
Reid Kleckner [Fri, 26 Aug 2016 17:58:37 +0000 (17:58 +0000)]
[MC] Move .cv_loc management logic out of MCContext

MCContext already has many tasks, and separating CodeView out from it is
probably a good idea. The .cv_loc tracking was modelled on the DWARF
tracking which lived directly in MCContext.

Removes the inclusion of MCCodeView.h from MCContext.h, so now there are
only 10 build actions while I hack on CodeView support instead of 265.

llvm-svn: 279847

8 years ago[Clang-tidy] Fix some checks documentation style.
Eugene Zelenko [Fri, 26 Aug 2016 17:46:51 +0000 (17:46 +0000)]
[Clang-tidy] Fix some checks documentation style.

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

llvm-svn: 279846

8 years agoGlobalISel: mark G_FPEXT legal from float to double.
Tim Northover [Fri, 26 Aug 2016 17:46:22 +0000 (17:46 +0000)]
GlobalISel: mark G_FPEXT legal from float to double.

llvm-svn: 279845

8 years agoGlobalISel: mark G_FCMP legal on float & double.
Tim Northover [Fri, 26 Aug 2016 17:46:19 +0000 (17:46 +0000)]
GlobalISel: mark G_FCMP legal on float & double.

llvm-svn: 279844

8 years agoGlobalISel: simplify G_ICMP legalization regime.
Tim Northover [Fri, 26 Aug 2016 17:46:17 +0000 (17:46 +0000)]
GlobalISel: simplify G_ICMP legalization regime.

It's unclear how the old

    %res(32) = G_ICMP { s32, s32 } intpred(eq), %0, %1

is actually different from an s1 verison

    %res(1) = G_ICMP { s1, s32 } intpred(eq), %0, %1

so we'll remove it for now.

llvm-svn: 279843

8 years agoGlobalISel: legalize sdiv and srem operations.
Tim Northover [Fri, 26 Aug 2016 17:46:13 +0000 (17:46 +0000)]
GlobalISel: legalize sdiv and srem operations.

llvm-svn: 279842

8 years agoGlobalISel: legalize under-width divisions.
Tim Northover [Fri, 26 Aug 2016 17:46:06 +0000 (17:46 +0000)]
GlobalISel: legalize under-width divisions.

llvm-svn: 279841

8 years agoGlobalISel: mark selects legal
Tim Northover [Fri, 26 Aug 2016 17:46:03 +0000 (17:46 +0000)]
GlobalISel: mark selects legal

llvm-svn: 279840

8 years agoGlobalISel: mark float/int conversions legal
Tim Northover [Fri, 26 Aug 2016 17:45:58 +0000 (17:45 +0000)]
GlobalISel: mark float/int conversions legal

llvm-svn: 279839

8 years agoDon't diagnose non-modular includes when we are not compiling a module.
Manman Ren [Fri, 26 Aug 2016 17:16:46 +0000 (17:16 +0000)]
Don't diagnose non-modular includes when we are not compiling a module.

This is triggered when we are compiling an implementation of a module,
it has relative includes to a VFS-mapped module with umbrella headers.
Currently we will find the real path to headers under the umbrella directory,
but the umbrella directories are using virtual path.

rdar://27951255

Thanks Ben and Richard for reviewing the patch!
Differential Revision: http://reviews.llvm.org/D23858

llvm-svn: 279838

8 years ago[InstCombine] clean up foldICmpAndConstConst(); NFC
Sanjay Patel [Fri, 26 Aug 2016 17:15:22 +0000 (17:15 +0000)]
[InstCombine] clean up foldICmpAndConstConst(); NFC

1. Early exit to reduce indent
2. Fix comments and variable names to match
3. Reformat comments / clang-format code

llvm-svn: 279837

8 years agoMissed a semicolon in r279835
Krzysztof Parzyszek [Fri, 26 Aug 2016 16:50:57 +0000 (16:50 +0000)]
Missed a semicolon in r279835

llvm-svn: 279836

8 years agoAdd some more detailed debugging information in RegisterCoalescer
Krzysztof Parzyszek [Fri, 26 Aug 2016 16:46:14 +0000 (16:46 +0000)]
Add some more detailed debugging information in RegisterCoalescer

llvm-svn: 279835

8 years ago[InstCombine] add helper function for folding of icmp (and X, C2), C; NFC
Sanjay Patel [Fri, 26 Aug 2016 16:42:33 +0000 (16:42 +0000)]
[InstCombine] add helper function for folding of icmp (and X, C2), C; NFC

llvm-svn: 279834

8 years agolimit the number of instructions per block examined by dead store elimination
Bob Haarman [Fri, 26 Aug 2016 16:34:27 +0000 (16:34 +0000)]
limit the number of instructions per block examined by dead store elimination

Summary: Dead store elimination gets very expensive when large numbers of instructions need to be analyzed. This patch limits the number of instructions analyzed per store to the value of the memdep-block-scan-limit parameter (which defaults to 100). This resulted in no observed difference in performance of the generated code, and no change in the statistics for the dead store elimination pass, but improved compilation time on some files by more than an order of magnitude.

Reviewers: dexonsmith, bruno, george.burgess.iv, dberlin, reames, davidxl

Subscribers: davide, chandlerc, dberlin, davidxl, eraman, tejohnson, mbodart, llvm-commits

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

llvm-svn: 279833

8 years agoFileCheck: Minor cleanup of the class Pattern
Saleem Abdulrasool [Fri, 26 Aug 2016 16:18:40 +0000 (16:18 +0000)]
FileCheck: Minor cleanup of the class Pattern

1. Add the "explicit" specifier to the single-argument constructor of Pattern
2. Reorder the fields to remove excessive padding (8 bytes).

Patch by Alexander Shaposhnikov!

llvm-svn: 279832

8 years ago[InstCombine] rename variables in foldICmpAndConstant(); NFC
Sanjay Patel [Fri, 26 Aug 2016 16:14:06 +0000 (16:14 +0000)]
[InstCombine] rename variables in foldICmpAndConstant(); NFC

llvm-svn: 279831

8 years agotest commit
Bob Haarman [Fri, 26 Aug 2016 16:00:04 +0000 (16:00 +0000)]
test commit

llvm-svn: 279830

8 years ago[LoopUnroll] Use OptimizationRemarkEmitter directly not via the analysis pass
Adam Nemet [Fri, 26 Aug 2016 15:58:34 +0000 (15:58 +0000)]
[LoopUnroll] Use OptimizationRemarkEmitter directly not via the analysis pass

We can't mark ORE (a function pass) preserved as required by the loop
passes because that is how we ensure that the required passes like
LazyBFI are all available any time ORE is used.  See the new comments in
the patch.

Instead we use it directly just like the inliner does in D22694.

As expected there is some additional overhead after removing the caching
provided by analysis passes.  The worst case, I measured was
LNT/CINT2006_ref/401.bzip2 which regresses by 12%.  As before, this only
affects -Rpass-with-hotness and not default compilation.

llvm-svn: 279829

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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