platform/upstream/llvm.git
7 years agoNext set of additional error checks for invalid Mach-O files for bad LC_SYMTAB’s.
Kevin Enderby [Fri, 26 Aug 2016 19:34:07 +0000 (19:34 +0000)]
Next set of additional error checks for invalid Mach-O files for bad LC_SYMTAB’s.

This contains the missing checks for LC_SYMTAB load command fields.

llvm-svn: 279854

7 years agoSwift Calling Convetion: add support for AArch64.
Manman Ren [Fri, 26 Aug 2016 19:28:17 +0000 (19:28 +0000)]
Swift Calling Convetion: add support for AArch64.

It will just be the same as the regular calling convention.

rdar://28029509

llvm-svn: 279853

7 years agoAArch64: avoid assertion on illegal types in performFDivCombine.
Tim Northover [Fri, 26 Aug 2016 18:52:31 +0000 (18:52 +0000)]
AArch64: avoid assertion on illegal types in performFDivCombine.

In the code to detect fixed-point conversions and make use of AArch64's special
instructions, we weren't prepared for weird types. The fptosi direction got
fixed recently, but not the similar sitofp code.

llvm-svn: 279852

7 years ago[InstCombine] add helper function for icmp (and (sh X, Y), C2), C1 ; NFC
Sanjay Patel [Fri, 26 Aug 2016 18:28:46 +0000 (18:28 +0000)]
[InstCombine] add helper function for icmp (and (sh X, Y), C2), C1 ; NFC

Like other recent changes near here, the goal is to allow vector types for
all of these folds. Splitting things up makes it easier to incrementally
enhance the code and easier to read.

llvm-svn: 279851

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

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

llvm-svn: 279830

7 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

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