platform/upstream/llvm.git
4 years ago[clangd] Collect macros in the preamble region of the main file
Haojian Wu [Tue, 24 Sep 2019 11:14:06 +0000 (11:14 +0000)]
[clangd] Collect macros in the preamble region of the main file

Summary:
- store all macro references in the ParsedAST;
- unify the two variants of CollectMainFileMacros;

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 372725

4 years ago[lldb][NFC] Use llvm::StringRef in formatters::NSStringSummaryProvider
Raphael Isemann [Tue, 24 Sep 2019 11:00:37 +0000 (11:00 +0000)]
[lldb][NFC] Use llvm::StringRef in formatters::NSStringSummaryProvider

llvm-svn: 372724

4 years ago[ModuloSchedule] KernelRewriter::rewrite - silence static analyzer dyn_cast<> null...
Simon Pilgrim [Tue, 24 Sep 2019 10:58:42 +0000 (10:58 +0000)]
[ModuloSchedule] KernelRewriter::rewrite - silence static analyzer dyn_cast<> null dereference warning. NFCI.

Assert that we've found the start of the MI schedule list.

llvm-svn: 372723

4 years ago[ARM] Split large widening MVE loads
David Green [Tue, 24 Sep 2019 10:53:09 +0000 (10:53 +0000)]
[ARM] Split large widening MVE loads

Similar to rL372717, we can force the splitting of extends of vector loads in
MVE, in order to use the better widening loads as opposed to going through
expensive extends. This adds a combine to early-on detect extends of loads and
split the load in two, from where normal legalisation will kick in and we get a
series of widening loads.

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

llvm-svn: 372721

4 years agolowerObjCCall - silence static analyzer dyn_cast<CallInst> null dereference warnings...
Simon Pilgrim [Tue, 24 Sep 2019 10:46:30 +0000 (10:46 +0000)]
lowerObjCCall - silence static analyzer dyn_cast<CallInst> null dereference warnings. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<CallInst> directly and if not assert will fire for us.

llvm-svn: 372720

4 years ago[ARM] MVE sext and widen/narrow tests from larger types. NFC
David Green [Tue, 24 Sep 2019 10:39:58 +0000 (10:39 +0000)]
[ARM] MVE sext and widen/narrow tests from larger types. NFC

llvm-svn: 372719

4 years ago[ARM] Split large truncating MVE stores
David Green [Tue, 24 Sep 2019 10:10:41 +0000 (10:10 +0000)]
[ARM] Split large truncating MVE stores

MVE does not have a simple sign extend instruction that can move elements
across lanes. We currently often end up moving each lane into and out of a GPR,
in order to get elements into the correct places. When we have a store of a
trunc (or a extend of a load), we can instead just split the store/load in two,
using the narrowing/widening load/store instructions from each half of the
vector.

This does that for stores. It happens very early in a store combine, so as to
easily detect the truncates. (It would be possible to do this later, but that
would involve looking through a buildvector of extract elements. Not impossible
but this way seemed simpler).

By enabling store combines we also get a vmovdrr combine for free, helping some
other tests.

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

llvm-svn: 372717

4 years ago[lldb] Decouple importing the std C++ module from the way the program is compiled
Raphael Isemann [Tue, 24 Sep 2019 10:08:18 +0000 (10:08 +0000)]
[lldb] Decouple importing the std C++ module from the way the program is compiled

Summary:
At the moment, when trying to import the `std` module in LLDB, we look at the imported modules used in the compiled program
and try to infer the Clang configuration we need from the DWARF module-import. That was the initial idea but turned out to
cause a few problems or inconveniences:

* It requires that users compile their programs with C++ modules. Given how experimental C++ modules are makes this feature inaccessible
for many users. Also it means that people can't just get the benefits of this feature for free when we activate it by default
(and we can't just close all the associated bug reports).
* Relying on DWARF's imported module tags (that are only emitted by default on macOS) means this can only be used when using DWARF (and with -glldb on Linux).
* We essentially hardcoded the C standard library paths on some platforms (Linux) or just couldn't support this feature on other platforms (macOS).

This patch drops the whole idea of looking at the imported module DWARF tags and instead just uses the support files of the compilation unit.
If we look at the support files and see file paths that indicate where the C standard library and libc++ are, we can just create the module
configuration this information. This fixes all the problems above which means we can enable all the tests now on Linux, macOS and with other debug information
than what we currently had. The only debug information specific code is now the iteration over external type module when -gmodules is used (as `std` and also the
`Darwin` module are their own external type module with their own files).

The meat of this patch is the CppModuleConfiguration which looks at the file paths from the compilation unit and then figures out the include paths
based on those paths. It's quite conservative in that it only enables modules if we find a single C library and single libc++ library. It's still missing some
test mode where we try to compile an expression before we actually activate the config for the user (which probably also needs some caching mechanism),
but for now it works and makes the feature usable.

Reviewers: aprantl, shafik, jdoerfert

Reviewed By: aprantl

Subscribers: mgorny, abidh, JDevlieghere, lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

llvm-svn: 372716

4 years ago[clang-tidy][test] Add -fexceptions to bugprone-infinite-loop.test
Fangrui Song [Tue, 24 Sep 2019 09:55:35 +0000 (09:55 +0000)]
[clang-tidy][test] Add -fexceptions to bugprone-infinite-loop.test

This fixes llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast.

-fexceptions is disabled by default on XCore and PS4.

llvm-svn: 372715

4 years ago[modularize] Fix compilation warning after r372681
Mikael Holmen [Tue, 24 Sep 2019 09:44:55 +0000 (09:44 +0000)]
[modularize] Fix compilation warning after r372681

In r372681 lang_cxx_11 and lang_cxx_14 were added to LanguageIDs
but they were not handled in the switch in VisitLinkageSpecDecl in
Modularize.cpp so at clang 8 complained with

/data/repo/master/clang-tools-extra/modularize/Modularize.cpp:583:13: error: enumeration values 'lang_cxx_11' and 'lang_cxx_14' not handled in switch [-Werror,-Wswitch]
    switch (D->getLanguage()) {
            ^
1 error generated.

With this patch we now treat lang_cxx, lang_cxx_11 and lang_cxx_14 the
same way in the switch in VisitLinkageSpecDecl.

llvm-svn: 372714

4 years agogn build: Merge r372712
GN Sync Bot [Tue, 24 Sep 2019 09:43:29 +0000 (09:43 +0000)]
gn build: Merge r372712

llvm-svn: 372713

4 years ago [llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.
Seiya Nuta [Tue, 24 Sep 2019 09:38:23 +0000 (09:38 +0000)]
 [llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.

Summary:
This patch splits the command-line parsing into two phases:

First, parse cross-platform options and leave ELF-specific options unparsed.

Second, in the ELF implementation, parse ELF-specific options and construct ELFCopyConfig.

Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich, MaskRay

Reviewed By: alexshap, jhenderson, jakehehrlich, MaskRay

Subscribers: mgorny, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits

Tags: #llvm

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

llvm-svn: 372712

4 years ago[clang-tidy] Add bugprone-infinite-loop.rst from D64736 to fix buildbot
Fangrui Song [Tue, 24 Sep 2019 09:32:00 +0000 (09:32 +0000)]
[clang-tidy] Add bugprone-infinite-loop.rst from D64736 to fix buildbot

llvm-svn: 372711

4 years agoMCRegisterInfo: Merge getLLVMRegNum and getLLVMRegNumFromEH
Pavel Labath [Tue, 24 Sep 2019 09:31:02 +0000 (09:31 +0000)]
MCRegisterInfo: Merge getLLVMRegNum and getLLVMRegNumFromEH

Summary:
The functions different in two ways:
- getLLVMRegNum could return both "eh" and "other" dwarf register
  numbers, while getLLVMRegNumFromEH only returned the "eh" number.
- getLLVMRegNum asserted if the register was not found, while the second
  function returned -1.

The second distinction was pretty important, but it was very hard to
infer that from the function name. Aditionally, for the use case of
dumping dwarf expressions, we needed a function which can work with both
kinds of number, but does not assert.

This patch solves both of these issues by merging the two functions into
one, returning an Optional<unsigned> value. While the same thing could
be achieved by adding an "IsEH" argument to the (renamed)
getLLVMRegNumFromEH function, it seemed better to avoid the confusion of
two functions and put the choice of asserting into the hands of the
caller -- if he checks the Optional value, he can safely process
"untrusted" input, and if he blindly dereferences the Optional, he gets
the assertion.

I've updated all call sites to the new API, choosing between the two
options according to the function they were calling originally, except
that I've updated the usage in DWARFExpression.cpp to use the "safe"
method instead, and added a test case which would have previously
triggered an assertion failure when processing (incorrect?) dwarf
expressions.

Reviewers: dsanders, arsenm, JDevlieghere

Subscribers: wdng, aprantl, javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 372710

4 years ago[NFC] Update test after r372708
David Bolvansky [Tue, 24 Sep 2019 09:24:48 +0000 (09:24 +0000)]
[NFC] Update test after r372708

llvm-svn: 372709

4 years ago[Diagnostics] Do not diagnose unsigned shifts in boolean context (-Wint-in-bool-context)
David Bolvansky [Tue, 24 Sep 2019 09:14:33 +0000 (09:14 +0000)]
[Diagnostics] Do not diagnose unsigned shifts in boolean context (-Wint-in-bool-context)

I was looking at old GCC's patch. Current "trunk" version avoids warning for unsigned case, GCC warns only for signed shifts.

llvm-svn: 372708

4 years agogn build: Merge r372706
GN Sync Bot [Tue, 24 Sep 2019 09:11:31 +0000 (09:11 +0000)]
gn build: Merge r372706

llvm-svn: 372707

4 years ago[clang-tidy] Add missing InfiniteLoopCheck.h, InfiniteLoopCheck.cpp and test from...
Fangrui Song [Tue, 24 Sep 2019 09:06:31 +0000 (09:06 +0000)]
[clang-tidy] Add missing InfiniteLoopCheck.h, InfiniteLoopCheck.cpp and test from D64736

llvm-svn: 372706

4 years ago[ASTImporter] 4th attempt to fix Windows buildbot test errors
Gabor Marton [Tue, 24 Sep 2019 09:00:46 +0000 (09:00 +0000)]
[ASTImporter] 4th attempt to fix Windows buildbot test errors

llvm-svn: 372705

4 years agoRevert rL372693 : [clang-tidy] New bugprone-infinite-loop check for detecting obvious...
Simon Pilgrim [Tue, 24 Sep 2019 08:56:44 +0000 (08:56 +0000)]
Revert rL372693 : [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

Finding infinite loops is well-known to be impossible (halting problem).
However, it is possible to detect some obvious infinite loops, for example,
if the loop condition is not changed. Detecting such loops is beneficial
since the tests will hang on programs containing infinite loops so
testing-time detection may be costly in large systems. Obvious cases are
where the programmer forgets to increment/decrement the counter or
increments/decrements the wrong variable.

Differential Revision: https://reviews.llvm.org/D64736
-------
Broke some buildbots "No SOURCES given to target: obj.clangTidyBugproneModule"

llvm-svn: 372704

4 years ago[Debuginfo] dbg.value points to undef value after Induction Variable Simplification.
Alexey Lapshin [Tue, 24 Sep 2019 08:47:03 +0000 (08:47 +0000)]
[Debuginfo] dbg.value points to undef value after Induction Variable Simplification.

Induction Variable Simplification pass does not update dbg.value intrinsic.

Before:

%add = add nuw nsw i32 %ArgIndex.06, 1
call void @llvm.dbg.value(metadata i32 %add, metadata !17, metadata !DIExpression())

After:

%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
call void @llvm.dbg.value(metadata i64 undef, metadata !17, metadata !DIExpression())

There should be:

%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
call void @llvm.dbg.value(metadata i64 %indvars.iv.next, metadata !17, metadata !DIExpression())

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

llvm-svn: 372703

4 years ago[lldb][NFC] Relax completion tests for log command to make them pass on Linux
Raphael Isemann [Tue, 24 Sep 2019 08:41:10 +0000 (08:41 +0000)]
[lldb][NFC] Relax completion tests for log command to make them pass on Linux

The log channels change depending on platform, so listing them breaks on
some platforms. Let's just check that the 'lldb' and 'dwarf' channels are
there which are independent of platform.

llvm-svn: 372701

4 years ago[LLDB] Avoid warnings about redefining posix mode defines on MinGW
Martin Storsjo [Tue, 24 Sep 2019 08:39:12 +0000 (08:39 +0000)]
[LLDB] Avoid warnings about redefining posix mode defines on MinGW

Since these defines were added in LLVM SVN r189364 in 2013,
mingw-w64 got defines for S_I?GRP, S_IRWXG, S_I?OTH and S_IRWXO
in 2015.

Also change the existing defined(_MSC_VER) into ifndef S_IRUSR, for
consistency.

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

llvm-svn: 372700

4 years ago[LLDB] [Windows] Add missing ifdefs to fix building for non-x86 architectures
Martin Storsjo [Tue, 24 Sep 2019 08:39:06 +0000 (08:39 +0000)]
[LLDB] [Windows] Add missing ifdefs to fix building for non-x86 architectures

While debugging on those architectures might not be supported yet,
the generic code should still be buildable. This file accesses x86
specific fields in the CONTEXT struct.

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

llvm-svn: 372699

4 years agosanitizer_common: fix freebsd build error
Dmitry Vyukov [Tue, 24 Sep 2019 08:27:51 +0000 (08:27 +0000)]
sanitizer_common: fix freebsd build error

Variable flags is not used. Remove it.

Suggested-by: randall77 (Keith Randall)
Review: https://reviews.llvm.org/D67928
llvm-svn: 372698

4 years ago[lldb] Fix log output and UtilityTests/LogChannelTest.List
Raphael Isemann [Tue, 24 Sep 2019 08:20:05 +0000 (08:20 +0000)]
[lldb] Fix log output and UtilityTests/LogChannelTest.List

I refactored this code in 372691 and it seems I didn't fully
replicate the original log output, so that test was failing.

llvm-svn: 372696

4 years ago[LV] Forced vectorization with runtime checks and OptForSize
Sjoerd Meijer [Tue, 24 Sep 2019 08:03:34 +0000 (08:03 +0000)]
[LV] Forced vectorization with runtime checks and OptForSize

When vectorisation is forced with a pragma, we optimise for min size, and we
need to emit runtime memory checks, then allow this code growth and don't run
in an assert like we currently do.

This is the result of D65197 and D66803, and was a use-case not really
considered before. If this now happens, we emit an optimisation remark warning
about the code-size expansion, which can be avoided by not forcing
vectorisation or possibly source-code modifications.

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

llvm-svn: 372694

4 years ago[clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops
Adam Balogh [Tue, 24 Sep 2019 07:43:26 +0000 (07:43 +0000)]
[clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

Finding infinite loops is well-known to be impossible (halting problem).
However, it is possible to detect some obvious infinite loops, for example,
if the loop condition is not changed. Detecting such loops is beneficial
since the tests will hang on programs containing infinite loops so
testing-time detection may be costly in large systems. Obvious cases are
where the programmer forgets to increment/decrement the counter or
increments/decrements the wrong variable.

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

llvm-svn: 372693

4 years ago[lldb] Remove redundant argument lists in CompletionRequest
Raphael Isemann [Tue, 24 Sep 2019 07:22:44 +0000 (07:22 +0000)]
[lldb] Remove redundant argument lists in CompletionRequest

We currently have two lists in the CompletionRequest that we
inherited from the old API: The complete list of arguments ignoring
where the user requested completion and the list of arguments that
stops at the cursor. Having two lists of arguments is confusing
and can lead to subtle errors, so let's remove the complete list
until we actually need it.

llvm-svn: 372692

4 years ago[lldb] Add completion support for log enable/disable/list
Raphael Isemann [Tue, 24 Sep 2019 07:18:09 +0000 (07:18 +0000)]
[lldb] Add completion support for log enable/disable/list

Reviewers: #lldb, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 372691

4 years agoIgnore generated @import statements in the expression evaluator
Raphael Isemann [Tue, 24 Sep 2019 06:58:39 +0000 (06:58 +0000)]
Ignore generated @import statements in the expression evaluator

Summary:
The ClangModulesDeclVendor is currently interpreting all injected `@import` statements in our expression
wrapper as modules that the user has explicitly requested to be persistently loaded. As we inject
`@import` statements with our std module prototype, the ClangModulesDeclVendor will start compiling
and loading unrelated C++ modules because it thinks the user has requested that it should load them. As
the ClangModulesDeclVendor is lacking the setup to compile these modules (e.g. it lacks the include paths),
it will then actually just fail to compile them and cause the whole expression evaluation to fail. This causes
these tests to fail on systems that enable the ClangModulesDeclVendor (such as macOS).

This patch fixes this by preventing the ClangModulesDeclVendor from interpreting `@import` statements
in the wrapper source code. This is done by check if the import happens in the fake source file containing
our wrapper code (which implies it was generated by LLDB).

This patch doesn't reenable the tests as there is more work needed to get the tests running on macOS (D67760)

Reviewers: aprantl, shafik, jingham

Subscribers: lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

llvm-svn: 372690

4 years ago[clang-format] NFC clang-format the clang-format unit tests
Paul Hoad [Tue, 24 Sep 2019 06:35:37 +0000 (06:35 +0000)]
[clang-format] NFC clang-format the clang-format unit tests

Summary:
It is annoying that the clang-format tests aren't themselves clang-formatted, if you use a format on save option in VS or vim this file gets massively changed then you have to `git difftool` all the other changes back out, which is risky.

I know people don't like mass clang-format changes but sometimes it becomes unmanageable to not. There are no other changes here other than just the reformat.

clang-format tests all pass.

```
[==========] 691 tests from 21 test cases ran. (55990 ms total)
[  PASSED  ] 691 tests.
```

Reviewers: klimek, owenpan, timwoj

Reviewed By: owenpan

Subscribers: cfe-commits

Tags: #clang-tools-extra, #clang

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

llvm-svn: 372689

4 years ago[ASTImporter] 3rd attempt to fix Windows buildbot test errors
Gabor Marton [Tue, 24 Sep 2019 05:50:02 +0000 (05:50 +0000)]
[ASTImporter] 3rd attempt to fix Windows buildbot test errors

llvm-svn: 372688

4 years agoRevert "[static analyzer] Define __clang_analyzer__ macro in driver"
Jan Korous [Tue, 24 Sep 2019 03:21:22 +0000 (03:21 +0000)]
Revert "[static analyzer] Define __clang_analyzer__ macro in driver"

This reverts commit fbd13570b0d5f92ef2cf6bcfe7cc2f6178500187.

llvm-svn: 372687

4 years agoRevert "[lit] Add -D__clang_analyzer__ to clang_analyze_cc1"
Jan Korous [Tue, 24 Sep 2019 03:20:59 +0000 (03:20 +0000)]
Revert "[lit] Add -D__clang_analyzer__ to clang_analyze_cc1"

This reverts commit 4185460f758b98ea5b898c04c179704756ca8f53.

llvm-svn: 372686

4 years agoRevert "[static analyzer][test] Test directly that driver sets D__clang_analyzer__"
Jan Korous [Tue, 24 Sep 2019 03:19:20 +0000 (03:19 +0000)]
Revert "[static analyzer][test] Test directly that driver sets D__clang_analyzer__"

This reverts commit c7541903d72765a38808e9973572a8d50c9d94fb.

llvm-svn: 372685

4 years agoFix int to bool errors exposed due to r372612.
Rumeet Dhindsa [Tue, 24 Sep 2019 02:59:02 +0000 (02:59 +0000)]
Fix int to bool errors exposed due to r372612.

Differential Revision: https://reviews.llvm.org/D67937
M    lib/builtins/fp_add_impl.inc
M    lib/builtins/fp_lib.h
M    lib/builtins/fp_trunc_impl.inc

llvm-svn: 372684

4 years ago[static analyzer][test] Test directly that driver sets D__clang_analyzer__
Jan Korous [Tue, 24 Sep 2019 02:06:59 +0000 (02:06 +0000)]
[static analyzer][test] Test directly that driver sets D__clang_analyzer__

Follow-up to fbd13570b0d

llvm-svn: 372683

4 years ago[lit] Add -D__clang_analyzer__ to clang_analyze_cc1
Jan Korous [Tue, 24 Sep 2019 01:59:20 +0000 (01:59 +0000)]
[lit] Add -D__clang_analyzer__ to clang_analyze_cc1

Fixup after fbd13570b0d

llvm-svn: 372682

4 years agoSupport for DWARF-5 C++ language tags.
Adrian Prantl [Tue, 24 Sep 2019 00:38:49 +0000 (00:38 +0000)]
Support for DWARF-5 C++ language tags.

This patch provides support for DW_LANG_C_plus_plus_11,
DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend.

Patch by Sourabh Singh Tomar!
Differential Revision: https://reviews.llvm.org/D67613

Reapplies r372663 after adapting a failing test in the LLDB testsuite.

llvm-svn: 372681

4 years ago[static analyzer] Remove --analyze-auto
Jan Korous [Tue, 24 Sep 2019 00:37:25 +0000 (00:37 +0000)]
[static analyzer] Remove --analyze-auto

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

llvm-svn: 372680

4 years ago[static analyzer] Define __clang_analyzer__ macro in driver
Jan Korous [Tue, 24 Sep 2019 00:33:47 +0000 (00:33 +0000)]
[static analyzer] Define __clang_analyzer__ macro in driver

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

llvm-svn: 372679

4 years ago[InstCombine] Fold a shifty implementation of clamp-to-allones.
Huihui Zhang [Tue, 24 Sep 2019 00:30:09 +0000 (00:30 +0000)]
[InstCombine] Fold a shifty implementation of clamp-to-allones.

Summary:
Fold
or(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X)
into
X s> Y ? -1 : X

https://rise4fun.com/Alive/d8Ab

clamp255 is a common operator in image processing, can be implemented
in a shifty way "(255 - X) >> 31 | X & 255". Fold shift into select
enables more optimization, e.g., vmin generation for ARM target.

Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon

Reviewed By: lebedev.ri

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372678

4 years agoAdapt test to upstream clang compiler changes.
Adrian Prantl [Tue, 24 Sep 2019 00:27:13 +0000 (00:27 +0000)]
Adapt test to upstream clang compiler changes.

Clang now emits the correct C++ language version in DWARF.

llvm-svn: 372677

4 years ago[InstCombine] Fold a shifty implementation of clamp-to-zero.
Huihui Zhang [Tue, 24 Sep 2019 00:15:03 +0000 (00:15 +0000)]
[InstCombine] Fold a shifty implementation of clamp-to-zero.

Summary:
Fold
and(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X)
into
X s> Y ? X : 0

https://rise4fun.com/Alive/lFH

Fold shift into select enables more optimization,
e.g., vmax generation for ARM target.

Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon

Reviewed By: lebedev.ri

Subscribers: xbolva00, andreadb, craig.topper, RKSimon, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372676

4 years ago[GlobalISel][IRTranslator] Fix switch table lowering to use signed LE not unsigned.
Amara Emerson [Tue, 24 Sep 2019 00:09:23 +0000 (00:09 +0000)]
[GlobalISel][IRTranslator] Fix switch table lowering to use signed LE not unsigned.

We were miscompiling switch value comparisons with the wrong signedness, which
shows up when we have things like switch case values with i1 types, which end up
being legalized incorrectly.

Fixes PR43383

llvm-svn: 372675

4 years ago[llvm-cov] NFC: Specify a specific C++ standard in the test.
Artem Dergachev [Tue, 24 Sep 2019 00:01:51 +0000 (00:01 +0000)]
[llvm-cov] NFC: Specify a specific C++ standard in the test.

Makes life easier for downstream users with customized default standard.

llvm-svn: 372674

4 years ago[MemorySSA] Update Phi insertion.
Alina Sbirlea [Mon, 23 Sep 2019 23:50:16 +0000 (23:50 +0000)]
[MemorySSA] Update Phi insertion.

Summary:
MemoryPhis may be needed following a Def insertion inthe IDF of all the
new accesses added (phis + potentially a def). Ensure this also  occurs when
only the new MemoryPhis are the defining accesses.

Note: The need for computing IDF here is because of new Phis added with
edges incoming from unreachable code, Phis that had previously been
simplified. The preferred solution is to not reintroduce such Phis.
This patch is the needed fix while working on the preferred solution.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

llvm-svn: 372673

4 years agoRevert "Support for DWARF-5 C++ language tags."
Jonas Devlieghere [Mon, 23 Sep 2019 23:49:36 +0000 (23:49 +0000)]
Revert "Support for DWARF-5 C++ language tags."

This reverts commit bf9c8ffb54943c6d77398adbedddf05ef9724007.

llvm-svn: 372672

4 years ago[NFC][InstCombine] Add tests for shifty implementation of clamping.
Huihui Zhang [Mon, 23 Sep 2019 23:48:32 +0000 (23:48 +0000)]
[NFC][InstCombine] Add tests for shifty implementation of clamping.

Summary:
Clamp negative to zero and clamp positive to allOnes are common
operation in image saturation.

Add tests for shifty implementation of clamping, as prepare work for
folding:

and(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X) --> X s> 0 ? X : 0;

or(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X) --> X s> Y ? allOnes : X.

Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 372671

4 years ago[Make] Add support for building NeXT-style frameworks
Jonas Devlieghere [Mon, 23 Sep 2019 22:31:16 +0000 (22:31 +0000)]
[Make] Add support for building NeXT-style frameworks

This patch extends the Makefile.rules to build NeXT-style frameworks. It
also fixes a bug in the clean logic that would accidentally delete the
.mm source file instead of the .o object file.

Thanks a lot to Adrian who was instrumental is getting this to work!

llvm-svn: 372669

4 years ago[NFCI] Return PathSensitiveBugReport where appropriate
Alex Langford [Mon, 23 Sep 2019 22:24:47 +0000 (22:24 +0000)]
[NFCI] Return PathSensitiveBugReport where appropriate

Some compilers have trouble converting unique_ptr<PathSensitiveBugReport> to
unique_ptr<BugReport> causing some functions to fail to compile.
Changing the return type of the functions that fail to compile does not
appear to have any issues.
I ran into this issue building with clang 3.8 on Ubuntu 16.04.

llvm-svn: 372668

4 years agoHotColdSplitting: invalidate the AssumptionCache on split
Saleem Abdulrasool [Mon, 23 Sep 2019 22:23:01 +0000 (22:23 +0000)]
HotColdSplitting: invalidate the AssumptionCache on split

When a cold path is outlined, the value tracking in the assumption cache may be
invalidated due to the code motion.  We would previously trip an assertion in
subsequent passes (but required the passes to happen in a single run as the
assumption cache is shared across the passes).  Invalidating the cache ensures
that we get the correct information when needed with the legacy pass manager as
well.

llvm-svn: 372667

4 years ago[llvm-lipo] Add support for archives
Alexander Shaposhnikov [Mon, 23 Sep 2019 22:22:55 +0000 (22:22 +0000)]
[llvm-lipo] Add support for archives

Add support for creating universal binaries which
can contain an archive.

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

Test plan: make check-all

llvm-svn: 372666

4 years ago[SampleFDO] Treat names in profile as not cold only when profile symbol list
Wei Mi [Mon, 23 Sep 2019 22:11:35 +0000 (22:11 +0000)]
[SampleFDO] Treat names in profile as not cold only when profile symbol list
is available

In rL372232, we treated names showing up in profile as not cold when
profile-sample-accurate is enabled. This caused 70k size regression in
Chrome/Android. The patch put a guard and only enable the change when
profile symbol list is available, i.e., keep the old behavior when profile
symbol list is not available.

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

llvm-svn: 372665

4 years ago[Diagnostics] Warn for enum constants in bool context (-Wint-in-bool-context; GCC...
David Bolvansky [Mon, 23 Sep 2019 22:09:49 +0000 (22:09 +0000)]
[Diagnostics] Warn for enum constants in bool context (-Wint-in-bool-context; GCC compatibility)

Extracted from D63082.

llvm-svn: 372664

4 years agoSupport for DWARF-5 C++ language tags.
Adrian Prantl [Mon, 23 Sep 2019 22:01:49 +0000 (22:01 +0000)]
Support for DWARF-5 C++ language tags.

This patch provides support for DW_LANG_C_plus_plus_11,
DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend.

Patch by Sourabh Singh Tomar!
Differential Revision: https://reviews.llvm.org/D67613

llvm-svn: 372663

4 years agoFix uninitialized variable warning. NFCI.
Simon Pilgrim [Mon, 23 Sep 2019 21:32:38 +0000 (21:32 +0000)]
Fix uninitialized variable warning. NFCI.

llvm-svn: 372662

4 years ago[X86] Reduce the number of unique check prefixes in memset-nonzero.ll. NFC
Craig Topper [Mon, 23 Sep 2019 21:29:28 +0000 (21:29 +0000)]
[X86] Reduce the number of unique check prefixes in memset-nonzero.ll. NFC

The avx512 with prefer-256-bit generates the same code as AVX2 so
just reuse that prefix.

llvm-svn: 372661

4 years ago[lld][WebAssembly] Preserve symbol flags in --relocatable output
Sam Clegg [Mon, 23 Sep 2019 21:28:29 +0000 (21:28 +0000)]
[lld][WebAssembly] Preserve symbol flags in --relocatable output

Fixes https://github.com/emscripten-core/emscripten/issues/8879

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

llvm-svn: 372660

4 years ago[LLDB] [Windows] Map COFF ARM machine ids to the right triple architectures
Martin Storsjo [Mon, 23 Sep 2019 20:43:22 +0000 (20:43 +0000)]
[LLDB] [Windows] Map COFF ARM machine ids to the right triple architectures

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

llvm-svn: 372658

4 years ago[LLDB] [PECOFF] Recognize arm64 executables
Martin Storsjo [Mon, 23 Sep 2019 20:43:16 +0000 (20:43 +0000)]
[LLDB] [PECOFF] Recognize arm64 executables

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

llvm-svn: 372657

4 years ago[LLDB] Rework a MinGW build fix from D65691
Martin Storsjo [Mon, 23 Sep 2019 20:43:11 +0000 (20:43 +0000)]
[LLDB] Rework a MinGW build fix from D65691

That change didn't contain any explanation for this bit. There shouldn't
be any need for a check for MinGW ifdefs here, as long as the include
uses lowercase windows.h (as is used consistently elsewhere in
the llvm projects).

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

llvm-svn: 372656

4 years ago[WebAssembly] vNxM.load_splat instructions
Thomas Lively [Mon, 23 Sep 2019 20:42:12 +0000 (20:42 +0000)]
[WebAssembly] vNxM.load_splat instructions

Summary:
Adds the new load_splat instructions as specified at
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#load-and-splat.

DAGISel does not allow matching multiple copies of the same load in a
single pattern, so we use a new node in WebAssemblyISD to wrap loads
that should be splatted.

Depends on D67783.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 372655

4 years ago[InstCombine] foldOrOfICmps(): Acquire SimplifyQuery with set CxtI
Roman Lebedev [Mon, 23 Sep 2019 20:40:47 +0000 (20:40 +0000)]
[InstCombine] foldOrOfICmps(): Acquire SimplifyQuery with set CxtI

Extracted from https://reviews.llvm.org/D67849#inline-610377

llvm-svn: 372654

4 years ago[InstCombine] foldAndOfICmps(): Acquire SimplifyQuery with set CxtI
Roman Lebedev [Mon, 23 Sep 2019 20:40:40 +0000 (20:40 +0000)]
[InstCombine] foldAndOfICmps(): Acquire SimplifyQuery with set CxtI

Extracted from https://reviews.llvm.org/D67849#inline-610377

llvm-svn: 372653

4 years agoFile::SetDescriptor() should require options
Jonas Devlieghere [Mon, 23 Sep 2019 20:36:46 +0000 (20:36 +0000)]
File::SetDescriptor() should require options

lvm_private::File::GetStream() can fail if m_options == 0

It's not clear from the header a File created with a descriptor will be
not be usable by many parts of LLDB unless SetOptions is also called,
but it is.

This is because those parts of LLDB rely on GetStream() to use the
file, and that in turn relies on calling fdopen on the descriptor. When
calling fdopen, GetStream relies on m_options to determine the access
mode. If m_options has never been set, GetStream() will fail.

This patch adds options as a required argument to File::SetDescriptor
and the corresponding constructor.

Patch by: Lawrence D'Anna

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

llvm-svn: 372652

4 years ago[mips] Support elf32btsmipn32_fbsd / elf32ltsmipn32_fbsd emulations
Simon Atanasyan [Mon, 23 Sep 2019 20:32:43 +0000 (20:32 +0000)]
[mips] Support elf32btsmipn32_fbsd / elf32ltsmipn32_fbsd emulations

Patch by Kyle Evans.

llvm-svn: 372651

4 years ago[mips] Add tests to check MIPS FreeBSD emulations. NFC
Simon Atanasyan [Mon, 23 Sep 2019 20:32:33 +0000 (20:32 +0000)]
[mips] Add tests to check MIPS FreeBSD emulations. NFC

llvm-svn: 372650

4 years ago[mips] Reformat test case to simplify addition new tests. NFC
Simon Atanasyan [Mon, 23 Sep 2019 20:32:27 +0000 (20:32 +0000)]
[mips] Reformat test case to simplify addition new tests. NFC

llvm-svn: 372649

4 years ago[WebAssembly] Remove unused memory instructions and patterns
Thomas Lively [Mon, 23 Sep 2019 20:04:59 +0000 (20:04 +0000)]
[WebAssembly] Remove unused memory instructions and patterns

Summary:
Removes duplicated SIMD loads and store instructions and removes
patterns involving GlobalAddresses that were not used in any tests.

Reviewers: aheejin, sunfish

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 372648

4 years ago[InstCombine] Annotate strndup calls with dereferenceable_or_null
David Bolvansky [Mon, 23 Sep 2019 19:55:45 +0000 (19:55 +0000)]
[InstCombine] Annotate strndup calls with dereferenceable_or_null

"Implementations are free to malloc() a buffer containing either (size + 1) bytes or (strnlen(s, size) + 1) bytes. Applications should not assume that strndup() will allocate (size + 1) bytes when strlen(s) is smaller than size."

llvm-svn: 372647

4 years ago[ASTImporter] 2nd attempt to fix Windows buildbot test errors
Gabor Marton [Mon, 23 Sep 2019 19:49:45 +0000 (19:49 +0000)]
[ASTImporter] 2nd attempt to fix Windows buildbot test errors

llvm-svn: 372646

4 years ago[X86] Use TargetConstant for condition code on X86ISD::SETCC/CMOV/BRCOND nodes.
Craig Topper [Mon, 23 Sep 2019 19:48:20 +0000 (19:48 +0000)]
[X86] Use TargetConstant for condition code on X86ISD::SETCC/CMOV/BRCOND nodes.

This removes the need for ConvertToTarget opcodes in the isel table.
It's also consistent with the recent changes to use TargetConstant
for intrinsic nodes that always take immediates.

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

llvm-svn: 372645

4 years ago[Host] File::GetWaitableHandle() should call fileno()
Jonas Devlieghere [Mon, 23 Sep 2019 19:34:26 +0000 (19:34 +0000)]
[Host] File::GetWaitableHandle() should call fileno()

If the file has m_stream, it may not have a m_descriptor.
GetWaitableHandle() should call GetDescriptor(), which will call
fileno(), so it will get waitable descriptor whenever one is available.

Patch by: Lawrence D'Anna

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

llvm-svn: 372644

4 years ago[ABISysV] Fix regression for Simulator and MacABI
Jonas Devlieghere [Mon, 23 Sep 2019 19:06:00 +0000 (19:06 +0000)]
[ABISysV] Fix regression for Simulator and MacABI

The ABISysV ABI was refactored in r364216 to support the Windows ABI for
x86_64. In particular it changed ABISysV_x86_64::CreateInstance to
switch on the OS type. This breaks debugging MacABI apps as well as apps
in the simulator. This adds back the necessary cases.

We have a test on Github that exercises this code path and which I'd
like to upstream once the remaining MacABI parts become available in
clang.

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

llvm-svn: 372642

4 years ago[TableGen] Emit OperandType enums for RegisterOperands/RegisterClasses
Aditya Nandakumar [Mon, 23 Sep 2019 18:51:00 +0000 (18:51 +0000)]
[TableGen] Emit OperandType enums for RegisterOperands/RegisterClasses

https://reviews.llvm.org/D66773

The OpTypes::OperandType was creating an enum for all records that
inherit from Operand, but in reality there are operands for instructions
that inherit from other types too. In particular, RegisterOperand and
RegisterClass. This commit adds those types to the list of operand types
that are tracked by the OperandType enum.

Patch by: nlguillemot

llvm-svn: 372641

4 years ago[Sema] Fix the atomic expr rebuilding order.
Michael Liao [Mon, 23 Sep 2019 18:48:06 +0000 (18:48 +0000)]
[Sema] Fix the atomic expr rebuilding order.

Summary:
- Rearrange the atomic expr order to the API order when rebuilding
  atomic expr during template instantiation.

Reviewers: erichkeane

Subscribers: jfb, cfe-commits

Tags: #clang

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

llvm-svn: 372640

4 years ago[IR] Add getExtendedType() to IntegerType and Type (dispatching to IntegerType or...
Roman Lebedev [Mon, 23 Sep 2019 18:21:33 +0000 (18:21 +0000)]
[IR] Add getExtendedType() to IntegerType and Type (dispatching to IntegerType or VectorType)

llvm-svn: 372638

4 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): improve comment
Roman Lebedev [Mon, 23 Sep 2019 18:21:14 +0000 (18:21 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): improve comment

llvm-svn: 372637

4 years ago[SLC] Convert some strndup calls to strdup calls
David Bolvansky [Mon, 23 Sep 2019 18:20:01 +0000 (18:20 +0000)]
[SLC] Convert some strndup calls to strdup calls

Summary:
Motivation:
- If we can fold it to strdup, we should (strndup does more things than strdup).
- Annotation mechanism. (Works for strdup well).

strdup and strndup are part of C 20 (currently posix fns), so we should optimize them.

Reviewers: efriedma, jdoerfert

Reviewed By: jdoerfert

Subscribers: lebedev.ri, llvm-commits

Tags: #llvm

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

llvm-svn: 372636

4 years ago[OPENMP]Use standard parsing for 'match' clause, NFC.
Alexey Bataev [Mon, 23 Sep 2019 18:13:31 +0000 (18:13 +0000)]
[OPENMP]Use standard parsing for 'match' clause, NFC.

Reused standard clauses parsing scheme for parsing/matching 'match'
clause in 'declare variant' directive.

llvm-svn: 372635

4 years ago[lldb-suite] TestCallOverriddenMethod.py is now passing on Windows
Stella Stamenova [Mon, 23 Sep 2019 17:51:27 +0000 (17:51 +0000)]
[lldb-suite] TestCallOverriddenMethod.py is now passing on Windows

The test is now passing, so remove the expected failure. No other tests associated with the bug are passing, though, so only remove expected failure from this one test

llvm-svn: 372634

4 years ago[ASTImporter] Attempt to fix Windows buildbot test errors
Gabor Marton [Mon, 23 Sep 2019 17:29:08 +0000 (17:29 +0000)]
[ASTImporter] Attempt to fix Windows buildbot test errors

llvm-svn: 372633

4 years ago[libc++] Mark CTAD tests as not failing on AppleClang 10.0.1
Louis Dionne [Mon, 23 Sep 2019 17:22:13 +0000 (17:22 +0000)]
[libc++] Mark CTAD tests as not failing on AppleClang 10.0.1

They do fail on AppleClang 10.0.0, but not AppleClang 10.0.1

llvm-svn: 372632

4 years agoNFC: Fix a poorly-written test
Erik Pilkington [Mon, 23 Sep 2019 17:16:55 +0000 (17:16 +0000)]
NFC: Fix a poorly-written test

The author of r364954 foolishly forgot that == binds tighter than ?:

llvm-svn: 372631

4 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. c/d/e with mask (PR42563)
Roman Lebedev [Mon, 23 Sep 2019 17:04:28 +0000 (17:04 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. c/d/e with mask (PR42563)

Summary:
If we have a pattern `(x & (-1 >> maskNbits)) << shiftNbits`,
we already know (have a fold) that will drop the `& (-1 >> maskNbits)`
mask iff `(shiftNbits-maskNbits) s>= 0` (i.e. `shiftNbits u>= maskNbits`).

So even if `(shiftNbits-maskNbits) s< 0`, we can still
fold, we will just need to apply a **constant** mask afterwards:
```
Name: c, normal+mask
  %t0 = lshr i32 -1, C1
  %t1 = and i32 %t0, %x
  %r = shl i32 %t1, C2
=>
  %n0 = shl i32 %x, C2
  %n1 = i32 ((-(C2-C1))+32)
  %n2 = zext i32 %n1 to i64
  %n3 = lshr i64 -1, %n2
  %n4 = trunc i64 %n3 to i32
  %r = and i32 %n0, %n4
```
https://rise4fun.com/Alive/gslRa

Naturally, old `%masked` will have to be one-use.
This is not valid for pattern f - where "masking" is done via `ashr`.

https://bugs.llvm.org/show_bug.cgi?id=42563

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372630

4 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. a/b with mask (PR42563)
Roman Lebedev [Mon, 23 Sep 2019 17:04:14 +0000 (17:04 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. a/b with mask (PR42563)

Summary:
And this is **finally** the interesting part of that fold!

If we have a pattern `(x & (~(-1 << maskNbits))) << shiftNbits`,
we already know (have a fold) that will drop the `& (~(-1 << maskNbits))`
mask iff `(maskNbits+shiftNbits) u>= bitwidth(x)`.
But that is actually ignorant, there's more general fold here:

In this pattern, `(maskNbits+shiftNbits)` actually correlates
with the number of low bits that will remain in the final value.
So even if `(maskNbits+shiftNbits) u< bitwidth(x)`, we can still
fold, we will just need to apply a **constant** mask afterwards:
```
Name: a, normal+mask
  %onebit = shl i32 -1, C1
  %mask = xor i32 %onebit, -1
  %masked = and i32 %mask, %x
  %r = shl i32 %masked, C2
=>
  %n0 = shl i32 %x, C2
  %n1 = add i32 C1, C2
  %n2 = zext i32 %n1 to i64
  %n3 = shl i64 -1, %n2
  %n4 = xor i64 %n3, -1
  %n5 = trunc i64 %n4 to i32
  %r = and i32 %n0, %n5
```
https://rise4fun.com/Alive/F5R

Naturally, old `%masked` will have to be one-use.
Similar fold exists for patterns c,d,e, will post patch later.

https://bugs.llvm.org/show_bug.cgi?id=42563

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372629

4 years ago[BreakFalseDeps] ignore function with minsize attribute
Sanjay Patel [Mon, 23 Sep 2019 17:01:01 +0000 (17:01 +0000)]
[BreakFalseDeps] ignore function with minsize attribute

This came up in the x86-specific:
https://bugs.llvm.org/show_bug.cgi?id=43239
...but it is a general problem for the BreakFalseDeps pass.
Dependencies may be broken by adding some other instruction,
so that should be avoided if the overall goal is to minimize size.

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

llvm-svn: 372628

4 years ago[Clang-doc] NFC: Fixed link to llvm bugs in documentation
Shaurya Gupta [Mon, 23 Sep 2019 16:55:13 +0000 (16:55 +0000)]
[Clang-doc] NFC: Fixed link to llvm bugs in documentation

llvm-svn: 372627

4 years ago[SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAdd...
Alexey Bataev [Mon, 23 Sep 2019 16:25:03 +0000 (16:25 +0000)]
[SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!")

Summary:
Initially SLP vectorizer replaced all going-to-be-vectorized
instructions with Undef values. It may break ScalarEvaluation and may
cause a crash.
Reworked SLP vectorizer so that it does not replace vectorized
instructions by UndefValue anymore. Instead vectorized instructions are
marked for deletion inside if BoUpSLP class and deleted upon class
destruction.

Reviewers: mzolotukhin, mkuper, hfinkel, RKSimon, davide, spatel

Subscribers: RKSimon, Gerolf, anemet, hans, majnemer, llvm-commits, sanjoy

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

llvm-svn: 372626

4 years ago[InstCombine] foldUnsignedUnderflowCheck(): s/Subtracted/ZeroCmpOp/
Roman Lebedev [Mon, 23 Sep 2019 16:04:32 +0000 (16:04 +0000)]
[InstCombine] foldUnsignedUnderflowCheck(): s/Subtracted/ZeroCmpOp/

llvm-svn: 372625

4 years ago Fix __is_fundamental to accept nullptr_t
Zoe Carver [Mon, 23 Sep 2019 16:02:46 +0000 (16:02 +0000)]
Fix __is_fundamental to accept nullptr_t

    Summary: This patch updates the __is_fundamental builtin type trait to return true for nullptr_t.

    Reviewers: rsmith, EricWF, efriedma, craig.topper, erichkeane

    Subscribers: cfe-commits

    Tags: #clang

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

llvm-svn: 372624

4 years ago[OPENMP]Fix PR43355: DO not emit target calls if only -fopenmp-targets
Alexey Bataev [Mon, 23 Sep 2019 15:53:51 +0000 (15:53 +0000)]
[OPENMP]Fix PR43355: DO not emit target calls if only -fopenmp-targets
is not provided.

We should not emit any target-dependent code if only -fopenmp flag is
used and device targets are not provided to prevent compiler crash.

llvm-svn: 372623

4 years ago[AMDGPU][MC] Corrected handling of relocatable expressions
Dmitry Preobrazhensky [Mon, 23 Sep 2019 15:41:51 +0000 (15:41 +0000)]
[AMDGPU][MC] Corrected handling of relocatable expressions

See bug 43359: https://bugs.llvm.org//show_bug.cgi?id=43359

Reviewers: rampitec

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

llvm-svn: 372622

4 years ago Fix __is_signed builtin
Zoe Carver [Mon, 23 Sep 2019 15:41:20 +0000 (15:41 +0000)]
Fix __is_signed builtin

    Summary: This patch fixes the __is_signed builtin type trait to work with floating point types and enums. Now, the builtin will return true if it is passed a floating point type and false for an enum type.

    Reviewers: EricWF, rsmith, erichkeane, craig.topper, efriedma

    Subscribers: cfe-commits

    Tags: #clang

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

llvm-svn: 372621

4 years ago[libc++] Mark iostreams test as XFAIL on older macOSes
Louis Dionne [Mon, 23 Sep 2019 15:40:47 +0000 (15:40 +0000)]
[libc++] Mark iostreams test as XFAIL on older macOSes

llvm-svn: 372620

4 years agoHexagonLoopIdiomRecognition - silence static analyzer dyn_cast<> null dereference...
Simon Pilgrim [Mon, 23 Sep 2019 15:36:24 +0000 (15:36 +0000)]
HexagonLoopIdiomRecognition - silence static analyzer dyn_cast<> null dereference warnings. NFCI.

llvm-svn: 372619

4 years ago[TextAPI] Add New Supported Platforms
Cyndy Ishida [Mon, 23 Sep 2019 15:28:02 +0000 (15:28 +0000)]
[TextAPI] Add New Supported Platforms

Summary: This patch introduces simulators, as well was the restriced zippered and macCatalyst to supported platforms

Reviewers: ributzka, steven_wu

Reviewed By: ributzka

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 372618

4 years ago[clangd] Simplify the callside of URI::resolve, NFC.
Haojian Wu [Mon, 23 Sep 2019 14:39:37 +0000 (14:39 +0000)]
[clangd] Simplify the callside of URI::resolve, NFC.

Summary:
- Add a overrloded URI::resolve, which accepts a string URI;
- also fixed some callside that don't check the error;

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

llvm-svn: 372617