Commit Graph

324698 Commits

Author SHA1 Message Date
Johannes Doerfert 9a1a1f96d9 [Attributor] Do not update or manifest dead attributes
Summary:
If the associated context instruction is assumed dead we do not need to
update or manifest the state.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 368921
2019-08-14 21:25:08 +00:00
Raphael Isemann 66214b581c Revert "[lldb] Reinstate original guard variable check"
It seems this breaks the following tests:
    lldb-Suite :: expression_command/call-function/TestCallUserDefinedFunction.py
    lldb-Suite :: expression_command/rdar42038760/TestScalarURem.py

Let's revert this patch and wait until we find an actual issue that could be
fixed by also doing the guard variable check on Windows.

llvm-svn: 368920
2019-08-14 21:21:14 +00:00
Johannes Doerfert 710ebb03ed [Attributor] Use IRPosition consistently
Summary:
The next attempt to clean up the Attributor interface before we grow it
further.

Before, we used a combination of two values (associated + anchor) and an
argument number (or -1) to determine a location. This was very fragile.
The new system uses exclusively IR positions and we restrict the
generation of IR positions to special constructor methods that verify
internal constraints we have. This will catch misuse early.

The auto-conversion, e.g., in getAAFor, is now performed through the
SubsumingPositionIterator. This iterator takes an IR position and allows
to visit all IR positions that "subsume" the given one, e.g., function
attributes "subsume" argument attributes of that function. For a
detailed breakdown see the class comment of SubsumingPositionIterator.

This patch also introduces the IRPosition::getAttrs() to extract IR
attributes at a certain position. The method knows how to look up in
different positions that are equivalent, e.g., the argument position for
call site arguments. We also introduce three new positions kinds such
that we have all IR positions where attributes can be placed and one for
"floating" values.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 368919
2019-08-14 21:18:01 +00:00
Diego Trevino Ferrer d1ffcd0745 [Bugpoint redesign] Added Pass to Remove Global Variables
Summary:
This pass tries to remove Global Variables, as well as their derived uses. For example if a variable `@x` is used by `%call1` and `%call2`, both these uses and the definition of `@x` are deleted. Moreover if `%call1` or `%call2` are used elsewhere those uses are also deleted, and so on recursively.

I'm still uncertain if this pass should remove derived uses, I'm open to suggestions.

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 368918
2019-08-14 21:01:19 +00:00
Stanislav Mekhanoshin c17705b7fb [AMDGPU] Do not assume a default GCN target
Differential Revision: https://reviews.llvm.org/D66246

llvm-svn: 368917
2019-08-14 20:55:15 +00:00
Marshall Clow 2e80d01fa7 Fix thread comparison by making sure we never pass our special 'not a thread' value to the underlying implementation. Fixes PR#42918.
llvm-svn: 368916
2019-08-14 20:54:56 +00:00
Diego Trevino Ferrer 376f642252 [Bugpoint redesign] Reduced scope of variables in Delta implementation
Summary: This diff also changed the check in `Delta.cpp` to verify interesting-ness, so it exits when the input isn't interesting

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368915
2019-08-14 20:34:12 +00:00
Louis Dionne 3f274d4a55 [libc++] Mark <chrono> test as unsupported on AppleClang 9
llvm-svn: 368914
2019-08-14 20:27:56 +00:00
Sanjay Patel a8ba919c01 [x86] add tests for fadd reduction; NFC
More coverage for D66236.

llvm-svn: 368913
2019-08-14 20:21:30 +00:00
Diego Astiazaran 6169a73088 [clang-doc] Add missing check in tests
Path is now checked when comparing two Infos in the unit tests.

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

llvm-svn: 368912
2019-08-14 20:19:33 +00:00
Louis Dionne b4aebff4f1 [libc++] Mark std::tuple CTAD test as failing on AppleClang 9
Like CTAD for std::unordered_set, AppleClang 9's support for CTAD is
insufficient. I suspect the corresponding LLVM Clang is broken too,
but we don't seem to have testers using that Clang.

llvm-svn: 368911
2019-08-14 20:17:18 +00:00
JF Bastien 9953c74fb6 Use std::is_final directly
The workaround isn't needed anymore because all toolchains should support it.

llvm-svn: 368910
2019-08-14 20:13:49 +00:00
JF Bastien ee6f3dd14d SwapByteOrder.h: don't check for unsupported GCC versions
llvm-svn: 368909
2019-08-14 19:59:05 +00:00
JF Bastien 6ff2a1c878 MathExtras.h: don't check for unsupported GCC versions
llvm-svn: 368908
2019-08-14 19:57:21 +00:00
Erich Keane 0e85f18ded Add support in CMake to statically link the C++ standard library.
It is sometimes useful to have the C++ standard library linked into the
assembly when compiling clang, particularly when distributing a compiler
onto systems that don't have a copy of stdlibc++ or libc++ installed.

This functionality should work with either GCC or Clang as the host
compiler, though statically linking libc++ (as may be required for
licensing purposes) is only possible if the host compiler is Clang with
a copy of libc++ available.

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

llvm-svn: 368907
2019-08-14 19:55:59 +00:00
Dinar Temirbulatov da0435a690 [SLP][NFC] Use pointers to address to ScalarToTreeEntry elements, instead of indexes.
llvm-svn: 368906
2019-08-14 19:46:50 +00:00
Sanjay Patel ecccf29e6c [SDAG] move variable closer to use; NFC
llvm-svn: 368905
2019-08-14 19:46:15 +00:00
Jordan Rupprecht 4ee1376dc6 [lldb][NFC] Remove unused function
llvm-svn: 368904
2019-08-14 19:31:56 +00:00
Alexey Bataev f8be476f0c [OPENMP]Support for non-rectangular loops.
Added basic support for non-rectangular loops. It requires an additional
analysis of min/max boundaries for non-rectangular loops. Since only
linear dependency is allowed, we can do this analysis.

llvm-svn: 368903
2019-08-14 19:30:06 +00:00
JF Bastien c264992853 Revert "Un-break the bots"
Looks like the problem was due to the cmake cache, Chris fixed in r368897.

llvm-svn: 368902
2019-08-14 19:19:41 +00:00
Matt Arsenault 0b864bb043 AMDGPU: Reduce number of registers in test
Once the failure this is testing is fixed, this would fail due to
using too many registers.

llvm-svn: 368901
2019-08-14 19:09:48 +00:00
Jinsong Ji 37cd0dd26a [PowerPC][NFC] Remove duplicate tests in build-vector-test.ll
AllOnes has been split into build-vector-allones.ll.

llvm-svn: 368900
2019-08-14 19:06:59 +00:00
Jan Korous 14230f9926 [Support][NFC] Fix error message for posix_spawn_file_actions_addopen failed call
Seems like a copy-paste from couple lines above.

llvm-svn: 368899
2019-08-14 18:30:18 +00:00
Philip Reames 6cca3ad43e [RLEV] Rewrite loop exit values for multiple exit loops w/o overall loop exit count
We already supported rewriting loop exit values for multiple exit loops, but if any of the loop exits were not computable, we gave up on all loop exit values. This patch generalizes the existing code to handle individual computable loop exits where possible.

As discussed in the review, this is a starting point for figuring out a better API.  The code is a bit ugly, but getting it in lets us test as we go.  

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

llvm-svn: 368898
2019-08-14 18:27:57 +00:00
Chris Bieneman a8e070366a [CMake] Fix cache invalidation of LLVM_CXX_STD
This cleans up fallout from https://reviews.llvm.org/D66195.

llvm-svn: 368897
2019-08-14 18:26:37 +00:00
JF Bastien ef56c7cdf0 Un-break the bots
Some bots can't find is_final despite it being in C++14. Leave the code as it was for now, fix it later when the bots are happy.

llvm-svn: 368896
2019-08-14 18:17:06 +00:00
Matt Arsenault dbc1f207fa InferAddressSpaces: Move target intrinsic handling to TTI
I'm planning on handling intrinsics that will benefit from checking
the address space enums. Don't bother moving the address collection
for now, since those won't need th enums.

llvm-svn: 368895
2019-08-14 18:13:00 +00:00
Matt Arsenault 0eac2a2963 InferAddressSpaces: Remove unnecessary check for ConstantInt
The IR is invalid if this isn't a constant since immarg was added.

llvm-svn: 368893
2019-08-14 18:01:42 +00:00
JF Bastien 3f9d044686 Match if / elseif properly
My last commit fumbled it.

llvm-svn: 368892
2019-08-14 18:01:11 +00:00
Taewook Oh df7022825c [DebugInfo] Consider debug label scope has an extra lexical block file
Summary: There are places where a case that debug label scope has an extra lexical block file is not considered properly. The modified test won't pass without this patch.

Reviewers: aprantl, HsiangKai

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 368891
2019-08-14 17:58:45 +00:00
JF Bastien 12f5a2807e Remove now useless C++1y flag
As of D66195 we support C++14 by default.

llvm-svn: 368890
2019-08-14 17:57:20 +00:00
JF Bastien f6db75c39b Don't explicitly check for C++14
MSVC is weird about __cplusplus. The check I added in D66195 confuses it.

llvm-svn: 368889
2019-08-14 17:48:36 +00:00
Simon Pilgrim 40f88d5f62 Fix cppcheck + MSVC analyzer uninitialized member variable warning. NFCI.
llvm-svn: 368888
2019-08-14 17:41:37 +00:00
JF Bastien b13c8ca9eb Move to C++14
Summary:
I just bumped the minimum compiler versions to support C++14 in D66188.

Following [our process](http://llvm.org/docs/DeveloperPolicy.html#toolchain) and [our previous agreement](http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html), I'm now officially bumping the C++ version to 14 and updating the documentation.

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, chandlerc, thakis, EricWF, jyknight, lhames, JDevlieghere

Tags: #llvm

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

llvm-svn: 368887
2019-08-14 17:39:07 +00:00
Roman Lebedev 04ddff4cbc [InstCombine][NFC] Tests for 'try to reuse constant from select in comparison'
https://rise4fun.com/Alive/THl

llvm-svn: 368886
2019-08-14 17:27:50 +00:00
Zoe Carver a5f5aad568 This commit removes std::shared_ptr::make_shared and std::shared_ptr::allocate_shared as they are not part of the standard. This commit also adds the helper function "__create_with_cntrl_block" which std::allocate_shared and std::make_shared have been updated to use.
llvm-svn: 368885
2019-08-14 17:19:25 +00:00
David Bolvansky f94460d4b6 [SLC] Dereferenceable annonation - handle valid null pointers
Reviewers: jdoerfert, reames

Reviewed By: jdoerfert

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368884
2019-08-14 17:15:20 +00:00
Kristof Umann 92541e359e [CFG] Introduce CFGElementRef, a wrapper that knows it's position in a CFGBlock
Previously, collecting CFGElements in a set was practially impossible, because
both CFGBlock::operator[] and both the iterators returned it by value. One
workaround would be to collect the iterators instead, but they don't really
capture the concept of an element, and elements from different iterator types are incomparable.

This patch introduces CFGElementRef, a wrapper around a (CFGBlock, Index) pair,
and a variety of new iterators and iterator ranges to solve this problem.

I guess you could say that this patch took a couple iterations to get right :^)

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

llvm-svn: 368883
2019-08-14 17:05:55 +00:00
Louis Dionne 619172a818 [libc++] Enable <chrono> ""d and ""y literals for AppleClang 10 and up
AppleClang supports those literals starting in version 10.0.1.

llvm-svn: 368882
2019-08-14 17:04:31 +00:00
Puyan Lotfi 740f69b91b [NFC][clang] Moving argument handling: Driver::BuildActions -> handleArguments
This patch simply moves code that already exists into a new function.
Specifically I think it will make the BuildActions code for building a clang
job pipeline easier to read and work with.

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

llvm-svn: 368881
2019-08-14 17:02:21 +00:00
Louis Dionne 3555af7120 [libc++] Do not define _LIBCPP_CLANG_VER for non-LLVM Clang
In r292833, we started defining _LIBCPP_CLANG_VER to 0 for Apple Clang.
The result is that AppleClang is detected as being a very old version
of LLVM Clang (version 0), which is obviously incorrect.

I believe this was added so that we don't have to check whether
_LIBCPP_CLANG_VER is defined prior to comparing it with a number
(which can trigger a warning). This commit also fixes the two
places that use the macro correspondingly.

llvm-svn: 368880
2019-08-14 17:01:08 +00:00
Jonas Devlieghere c0a9b1edca [DebugLine] Improve path handling.
After switching over LLDB's line table parser to libDebugInfo, we
noticed two regressions on the Windows bot. The problem is that when
obtaining a file from the line table prologue, we append paths without
specifying a path style. This leads to incorrect results on Windows for
debug info containing Posix paths:

  0x0000000000201000: /tmp\b.c, is_start_of_statement = TRUE

This patch is an attempt to fix that by guessing the path style whenever
possible.

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

llvm-svn: 368879
2019-08-14 17:00:10 +00:00
Erik Pilkington aa3855694f [Sema][ObjC] Fix a -Wformat false positive with localizedStringForKey
Only honour format_arg attributes on -[NSBundle localizedStringForKey] when its
argument has a format specifier in it, otherwise its likely to just be a key to
fetch localized strings.

Fixes rdar://23622446

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

llvm-svn: 368878
2019-08-14 16:57:11 +00:00
Simon Pilgrim 4ae5efbe66 Fix cppcheck + MSVC analyzer uninitialized member variable warning. NFCI.
llvm-svn: 368877
2019-08-14 16:55:34 +00:00
David Bolvansky 8f5c1c0148 [NFC] Updated tests after r368875
llvm-svn: 368876
2019-08-14 16:50:34 +00:00
David Bolvansky 0e0fbae1a4 [BuildLibCalls] Noalias annotation
Summary: I think this is better solution than annotating callsites in IC/SLC.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: MaskRay, llvm-commits

Tags: #llvm

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

llvm-svn: 368875
2019-08-14 16:50:06 +00:00
Chris Bieneman a80a3a2b23 Document clang-cpp in the release notes for clang
This patch adds a line in the release notes about the new clang-cpp library and the CMake option to force clang to link against it.

llvm-svn: 368874
2019-08-14 16:49:52 +00:00
Bill Wendling cc2bebe039 Ignore indirect branches from callbr.
Summary:
We can't speculate around indirect branches: indirectbr and invoke. The
callbr instruction needs to be included here.

Reviewers: nickdesaulniers, manojgupta, chandlerc

Reviewed By: chandlerc

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368873
2019-08-14 16:44:07 +00:00
Aaron Smith 8664998046 Add missing NativeProcessFactory for lldb-server on Windows
llvm-svn: 368872
2019-08-14 16:39:41 +00:00
Gabor Horvath bfe0c37601 [LifetimeAnalysis] Fix false negatives of statement local lifetime analysis for some STL implementation
Differential Revision: https://reviews.llvm.org/D66152

llvm-svn: 368871
2019-08-14 16:34:56 +00:00