]> granicus.if.org Git - llvm/log
llvm
5 years ago[X86] Remove some dead code and combine some repeated code that's left.
Craig Topper [Thu, 15 Aug 2019 04:07:43 +0000 (04:07 +0000)]
[X86] Remove some dead code and combine some repeated code that's left.

If the width is 256 bits, then we must have AVX so the else here
was unnecessary. Once that's removed then the >= 256 bit code is
identical to the 128 bit code with a different VT so combine them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368956 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Expose TailCallKind via the LLVM C API"
Jonas Devlieghere [Thu, 15 Aug 2019 03:49:51 +0000 (03:49 +0000)]
Revert "Expose TailCallKind via the LLVM C API"

This is failing on several build bots. Reverting as discussed in
https://reviews.llvm.org/D66061.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368953 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r368918
Vitaly Buka [Thu, 15 Aug 2019 01:38:30 +0000 (01:38 +0000)]
gn build: Merge r368918

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368951 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[coroutine] Fixes "cannot move instruction since its users are not dominated by CoroB...
Gor Nishanov [Thu, 15 Aug 2019 00:48:51 +0000 (00:48 +0000)]
[coroutine] Fixes "cannot move instruction since its users are not dominated by CoroBegin" problem.

Summary:
Fixes https://bugs.llvm.org/show_bug.cgi?id=36578 and https://bugs.llvm.org/show_bug.cgi?id=36296.
Supersedes: https://reviews.llvm.org/D55966

One of the fundamental transformation that CoroSplit pass performs before splitting the coroutine is to find which values need to survive between suspend and resume and provide a slot for them in the coroutine frame to spill and restore the value as needed.

Coroutine frame becomes available once the storage for it was allocated and that point is marked in the pre-split coroutine with a llvm.coro.begin intrinsic.

FE normally puts all of the user-authored code that would be accessing those values after llvm.coro.begin, however, sometimes instructions accessing those values would end up prior to coro.begin. For example, writing out a value of the parameter into the alloca done by the FE or instructions that are added by the optimization passes such as SROA when it rewrites allocas.

Prior to this change, CoroSplit pass would try to move instructions that may end up accessing the values in the coroutine frame after CoroBegin. However it would run into problems (report_fatal_error) if some of the values would be used both in the allocation function (for example allocator is passed as a parameter to a coroutine) and in the use-authored body of the coroutine.

To handle this case and to simplify the instruction moving logic, this change removes all of the instruction moving. Instead, we only change the uses of the spilled values that are dominated by coro.begin and leave other instructions intact.

Before:

```
%var = alloca i32
%1 = getelementptr .. %var; ; will move this one after coro.begin
%f = call i8* @llvm.coro.begin(
```

After:

```
%var = alloca i32
%1 = getelementptr .. %var; stays put
%f = call i8* @llvm.coro.begin(
```
If we discover that there is a potential write into an alloca, prior to coro.begin we would copy its value from the alloca into the spill slot in the coroutine frame.

Before:

```
%var = alloca i32
store .. %var ; will move this one after coro.begin
%f = call i8* @llvm.coro.begin(
```

After:

```
%var = alloca i32
store .. %var ;stays put
%f = call i8* @llvm.coro.begin(
%tmp = load %var
store %tmp, %spill.slot.for.var
```

Note: This change does not handle array allocas as that is something that C++ FE does not produce, but, it can be added in the future if need arises

Reviewers: llvm-commits, modocache, ben-clayton, tks2103, rjmccall

Reviewed By: modocache

Subscribers: bartdesmet

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368949 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoExpose TailCallKind via the LLVM C API
Robert Widmann [Wed, 14 Aug 2019 23:54:35 +0000 (23:54 +0000)]
Expose TailCallKind via the LLVM C API

Summary: This exposes `CallInst`'s tail call kind via new `LLVMGetTailCallKind` and `LLVMSetTailCallKind` functions. The motivation for this is to be able to see `musttail` for languages that require mandatory tail calls for correctness. Today only the weaker `LLVMSetTail` is exposed and there is no way to set `GuaranteedTailCallOpt` via the C API.

Reviewers: CodaFi, jyknight, deadalnix, rnk

Reviewed By: CodaFi

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368945 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove LVALUE / RVALUE workarounds
JF Bastien [Wed, 14 Aug 2019 22:48:12 +0000 (22:48 +0000)]
Remove LVALUE / RVALUE workarounds

Summary: LLVM_HAS_RVALUE_REFERENCE_THIS and LLVM_LVALUE_FUNCTION shouldn't be needed anymore because the minimum compiler versions support them.

Subscribers: jkorous, dexonsmith, cfe-commits, llvm-commits, hans, thakis, chandlerc, rnk

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368939 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Try to fix "missing field 'RetInsts' initializer" warning
Johannes Doerfert [Wed, 14 Aug 2019 22:32:29 +0000 (22:32 +0000)]
[Attributor] Try to fix "missing field 'RetInsts' initializer" warning

http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/35674/steps/build_Lld/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368938 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Bugpoint redesign] Modified Functions pass to consider declarations
Diego Trevino Ferrer [Wed, 14 Aug 2019 22:22:37 +0000 (22:22 +0000)]
[Bugpoint redesign] Modified Functions pass to consider declarations

Summary: This modification was put in place so the `ReduceMetadata` pass doesn't have to consider debug functions

Reviewers: dblaikie

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368934 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[docs] Fix sphinx doc generation errors
Jordan Rupprecht [Wed, 14 Aug 2019 22:18:01 +0000 (22:18 +0000)]
[docs] Fix sphinx doc generation errors

Summary:
Errors fixed:
 - GettingStarted: Duplicate explicit target name: "cmake"
 - GlobalISel: Unexpected indentation
 - LoopTerminology: Explicit markup ends without a blank line; unexpected unindent
 - ORCv2: Definition list ends without a blank line; unexpected unindent
 - Misc: document isn't included in any toctree

Verified that a clean docs build (`rm -rf docs/ && ninja docs-llvm-html`) passes with no errors. Spot checked the individual pages to make sure they look OK.

Reviewers: thakis, dsanders

Reviewed By: dsanders

Subscribers: arphaman, llvm-commits, lhames, rovka, dsanders, reames

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368932 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor][NFC] Make debug output consistent
Johannes Doerfert [Wed, 14 Aug 2019 22:04:28 +0000 (22:04 +0000)]
[Attributor][NFC] Make debug output consistent

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368931 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SCEV] Rename getMaxBackedgeTakenCount to getConstantMaxBackedgeTakenCount [NFC]
Philip Reames [Wed, 14 Aug 2019 21:58:13 +0000 (21:58 +0000)]
[SCEV] Rename getMaxBackedgeTakenCount to getConstantMaxBackedgeTakenCount [NFC]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368930 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor][NFC] Try to eliminate warnings (debug build + fall through)
Johannes Doerfert [Wed, 14 Aug 2019 21:46:28 +0000 (21:46 +0000)]
[Attributor][NFC] Try to eliminate warnings (debug build + fall through)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368928 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor][NFC] Introduce statistics macros for new positions
Johannes Doerfert [Wed, 14 Aug 2019 21:46:25 +0000 (21:46 +0000)]
[Attributor][NFC] Introduce statistics macros for new positions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368927 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAGBuilder] Teach gather/scatter getUniformBase to look through vector...
Craig Topper [Wed, 14 Aug 2019 21:38:56 +0000 (21:38 +0000)]
[SelectionDAGBuilder] Teach gather/scatter getUniformBase to look through vector zeroinitializer indices in addition to scalar zeroes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368926 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor][NFC] Add merge/join/clamp operators to the IntegerState
Johannes Doerfert [Wed, 14 Aug 2019 21:35:20 +0000 (21:35 +0000)]
[Attributor][NFC] Add merge/join/clamp operators to the IntegerState

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368925 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Use the AANoNull attribute directly in AADereferenceable
Johannes Doerfert [Wed, 14 Aug 2019 21:31:32 +0000 (21:31 +0000)]
[Attributor] Use the AANoNull attribute directly in AADereferenceable

Summary:
Instead of constantly keeping track of the nonnull status with the
dereferenceable information we can simply query the nonnull attribute
whenever we need the information (debug + manifest).

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368924 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64][GlobalISel] Custom selection for s8 load acquire.
Amara Emerson [Wed, 14 Aug 2019 21:30:30 +0000 (21:30 +0000)]
[AArch64][GlobalISel] Custom selection for s8 load acquire.

Implement this single atomic load instruction so that we can compile stack
protector code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368923 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Use liveness during the creation of AAReturnedValues
Johannes Doerfert [Wed, 14 Aug 2019 21:29:37 +0000 (21:29 +0000)]
[Attributor] Use liveness during the creation of AAReturnedValues

Summary:
As one of the first attributes, and one of the complex ones,
AAReturnedValues was not using liveness but we filtered the result after
the fact. This change adds liveness usage during the creation. The
algorithm is also improved and shorter.

The new algorithm will collect returned values over time using the
generic facilities that work with liveness already, e.g.,
genericValueTraversal which does not look at dead PHI node predecessors.
A test to show how this leads to better results is included.

Note: Unresolved calls and resolved calls are now tracked explicitly.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368922 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Do not update or manifest dead attributes
Johannes Doerfert [Wed, 14 Aug 2019 21:25:08 +0000 (21:25 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368921 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Attributor] Use IRPosition consistently
Johannes Doerfert [Wed, 14 Aug 2019 21:18:01 +0000 (21:18 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368919 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Bugpoint redesign] Added Pass to Remove Global Variables
Diego Trevino Ferrer [Wed, 14 Aug 2019 21:01:19 +0000 (21:01 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368918 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Bugpoint redesign] Reduced scope of variables in Delta implementation
Diego Trevino Ferrer [Wed, 14 Aug 2019 20:34:12 +0000 (20:34 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368915 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[x86] add tests for fadd reduction; NFC
Sanjay Patel [Wed, 14 Aug 2019 20:21:30 +0000 (20:21 +0000)]
[x86] add tests for fadd reduction; NFC

More coverage for D66236.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368913 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse std::is_final directly
JF Bastien [Wed, 14 Aug 2019 20:13:49 +0000 (20:13 +0000)]
Use std::is_final directly

The workaround isn't needed anymore because all toolchains should support it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368910 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSwapByteOrder.h: don't check for unsupported GCC versions
JF Bastien [Wed, 14 Aug 2019 19:59:05 +0000 (19:59 +0000)]
SwapByteOrder.h: don't check for unsupported GCC versions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368909 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMathExtras.h: don't check for unsupported GCC versions
JF Bastien [Wed, 14 Aug 2019 19:57:21 +0000 (19:57 +0000)]
MathExtras.h: don't check for unsupported GCC versions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368908 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd support in CMake to statically link the C++ standard library.
Erich Keane [Wed, 14 Aug 2019 19:55:59 +0000 (19:55 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368907 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLP][NFC] Use pointers to address to ScalarToTreeEntry elements, instead of indexes.
Dinar Temirbulatov [Wed, 14 Aug 2019 19:46:50 +0000 (19:46 +0000)]
[SLP][NFC] Use pointers to address to ScalarToTreeEntry elements, instead of indexes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368906 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SDAG] move variable closer to use; NFC
Sanjay Patel [Wed, 14 Aug 2019 19:46:15 +0000 (19:46 +0000)]
[SDAG] move variable closer to use; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368905 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Un-break the bots"
JF Bastien [Wed, 14 Aug 2019 19:19:41 +0000 (19:19 +0000)]
Revert "Un-break the bots"

Looks like the problem was due to the cmake cache, Chris fixed in r368897.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368902 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Reduce number of registers in test
Matt Arsenault [Wed, 14 Aug 2019 19:09:48 +0000 (19:09 +0000)]
AMDGPU: Reduce number of registers in test

Once the failure this is testing is fixed, this would fail due to
using too many registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368901 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][NFC] Remove duplicate tests in build-vector-test.ll
Jinsong Ji [Wed, 14 Aug 2019 19:06:59 +0000 (19:06 +0000)]
[PowerPC][NFC] Remove duplicate tests in build-vector-test.ll

AllOnes has been split into build-vector-allones.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368900 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support][NFC] Fix error message for posix_spawn_file_actions_addopen failed call
Jan Korous [Wed, 14 Aug 2019 18:30:18 +0000 (18:30 +0000)]
[Support][NFC] Fix error message for posix_spawn_file_actions_addopen failed call

Seems like a copy-paste from couple lines above.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368899 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RLEV] Rewrite loop exit values for multiple exit loops w/o overall loop exit count
Philip Reames [Wed, 14 Aug 2019 18:27:57 +0000 (18:27 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368898 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CMake] Fix cache invalidation of LLVM_CXX_STD
Chris Bieneman [Wed, 14 Aug 2019 18:26:37 +0000 (18:26 +0000)]
[CMake] Fix cache invalidation of LLVM_CXX_STD

This cleans up fallout from https://reviews.llvm.org/D66195.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368897 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUn-break the bots
JF Bastien [Wed, 14 Aug 2019 18:17:06 +0000 (18:17 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368896 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoInferAddressSpaces: Move target intrinsic handling to TTI
Matt Arsenault [Wed, 14 Aug 2019 18:13:00 +0000 (18:13 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368895 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoInferAddressSpaces: Remove unnecessary check for ConstantInt
Matt Arsenault [Wed, 14 Aug 2019 18:01:42 +0000 (18:01 +0000)]
InferAddressSpaces: Remove unnecessary check for ConstantInt

The IR is invalid if this isn't a constant since immarg was added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368893 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMatch if / elseif properly
JF Bastien [Wed, 14 Aug 2019 18:01:11 +0000 (18:01 +0000)]
Match if / elseif properly

My last commit fumbled it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368892 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] Consider debug label scope has an extra lexical block file
Taewook Oh [Wed, 14 Aug 2019 17:58:45 +0000 (17:58 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368891 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove now useless C++1y flag
JF Bastien [Wed, 14 Aug 2019 17:57:20 +0000 (17:57 +0000)]
Remove now useless C++1y flag

As of D66195 we support C++14 by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368890 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDon't explicitly check for C++14
JF Bastien [Wed, 14 Aug 2019 17:48:36 +0000 (17:48 +0000)]
Don't explicitly check for C++14

MSVC is weird about __cplusplus. The check I added in D66195 confuses it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368889 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix cppcheck + MSVC analyzer uninitialized member variable warning. NFCI.
Simon Pilgrim [Wed, 14 Aug 2019 17:41:37 +0000 (17:41 +0000)]
Fix cppcheck + MSVC analyzer uninitialized member variable warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368888 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMove to C++14
JF Bastien [Wed, 14 Aug 2019 17:39:07 +0000 (17:39 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368887 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine][NFC] Tests for 'try to reuse constant from select in comparison'
Roman Lebedev [Wed, 14 Aug 2019 17:27:50 +0000 (17:27 +0000)]
[InstCombine][NFC] Tests for 'try to reuse constant from select in comparison'

https://rise4fun.com/Alive/THl

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368886 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLC] Dereferenceable annonation - handle valid null pointers
David Bolvansky [Wed, 14 Aug 2019 17:15:20 +0000 (17:15 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368884 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugLine] Improve path handling.
Jonas Devlieghere [Wed, 14 Aug 2019 17:00:10 +0000 (17:00 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368879 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix cppcheck + MSVC analyzer uninitialized member variable warning. NFCI.
Simon Pilgrim [Wed, 14 Aug 2019 16:55:34 +0000 (16:55 +0000)]
Fix cppcheck + MSVC analyzer uninitialized member variable warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368877 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[BuildLibCalls] Noalias annotation
David Bolvansky [Wed, 14 Aug 2019 16:50:06 +0000 (16:50 +0000)]
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368875 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoIgnore indirect branches from callbr.
Bill Wendling [Wed, 14 Aug 2019 16:44:07 +0000 (16:44 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368873 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Remove redundant case in the test. NFC
Simon Atanasyan [Wed, 14 Aug 2019 16:27:07 +0000 (16:27 +0000)]
[mips] Remove redundant case in the test. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368870 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Split long lines in the test case file. NFC
Simon Atanasyan [Wed, 14 Aug 2019 16:27:00 +0000 (16:27 +0000)]
[mips] Split long lines in the test case file. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368869 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Stop unrolling SIMD shifts since they are fixed in V8
Thomas Lively [Wed, 14 Aug 2019 16:24:37 +0000 (16:24 +0000)]
[WebAssembly] Stop unrolling SIMD shifts since they are fixed in V8

Summary:
Fixes PR42973. Tests don't change because simd-arith.ll tests behavior
on unimplemented-simd128, which does not include any temporary
workarounds such as the one removed in this revision.

Reviewers: aheejin

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368868 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix cppcheck + MSVC analyzer uninitialized member variable warning. NFCI.
Simon Pilgrim [Wed, 14 Aug 2019 16:03:37 +0000 (16:03 +0000)]
Fix cppcheck + MSVC analyzer uninitialized member variable warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368865 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Use PSADBW for v8i8 addition reductions.
Craig Topper [Wed, 14 Aug 2019 15:57:29 +0000 (15:57 +0000)]
[X86] Use PSADBW for v8i8 addition reductions.

Improves the 8 byte case from PR42674.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368864 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LangRef] Remove opening [ that was missing a closing ] from call/callbr/invoke syntax.
Craig Topper [Wed, 14 Aug 2019 15:10:37 +0000 (15:10 +0000)]
[LangRef] Remove opening [ that was missing a closing ] from call/callbr/invoke syntax.

It looks like this bracket was added when the addrspace was added.
before it. So I think it can jut be removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368861 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][AIX] Change assertion
Xiangling Liao [Wed, 14 Aug 2019 14:57:25 +0000 (14:57 +0000)]
[NFC][AIX] Change assertion

Address one left comment on https://reviews.llvm.org/D63547. A minor
change for assertion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368860 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][NFC] Add test for build all one vector with different types.
Jinsong Ji [Wed, 14 Aug 2019 14:53:05 +0000 (14:53 +0000)]
[PowerPC][NFC] Add test for build all one vector with different types.

build-vector-tests.ll is far too big, split such type tests for single
buildvector into new file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368859 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][CostModel] Adjust the costs of ZERO_EXTEND/SIGN_EXTEND with less than 128-bit...
Craig Topper [Wed, 14 Aug 2019 14:52:39 +0000 (14:52 +0000)]
[X86][CostModel] Adjust the costs of ZERO_EXTEND/SIGN_EXTEND with less than 128-bit inputs

Now that we legalize by widening, the element types here won't change. Previously these were modeled as the elements being widened and then the instruction might become an AND or SHL/ASHR pair. But now they'll become something like a ZERO_EXTEND_VECTOR_INREG/SIGN_EXTEND_VECTOR_INREG.

For AVX2, when the destination type is legal its clear the cost should be 1 since we have extend instructions that can produce 256 bit vectors from less than 128 bit vectors. I'm a little less sure about AVX1 costs, but I think the ones I changed were definitely too high, but they might still be too high.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368858 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add llvm_unreachable to a switch that covers all expected values.
Craig Topper [Wed, 14 Aug 2019 14:51:19 +0000 (14:51 +0000)]
[X86] Add llvm_unreachable to a switch that covers all expected values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368857 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][NFC] Consolidate duplicate XX3Form_SetZero and XX3Form_Zero.
Jinsong Ji [Wed, 14 Aug 2019 14:16:26 +0000 (14:16 +0000)]
[PowerPC][NFC] Consolidate duplicate XX3Form_SetZero and XX3Form_Zero.

Rename one to XX3Form_SameOp, remove the other one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368856 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AIX] Add call lowering for parameters that could pass onto FPRs
Jason Liu [Wed, 14 Aug 2019 14:13:11 +0000 (14:13 +0000)]
[AIX] Add call lowering for parameters that could pass onto FPRs

Summary:
This patch adds call lowering functionality to enable passing
parameters onto floating point registers when needed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368855 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "raw_ostream: add operator<< overload for std::error_code"
Pavel Labath [Wed, 14 Aug 2019 13:59:04 +0000 (13:59 +0000)]
Revert "raw_ostream: add operator<< overload for std::error_code"

This reverts commit r368849, because it breaks some bots (e.g.
llvm-clang-x86_64-win-fast).

It turns out this is not as NFC as we had hoped, because operator== will
consider two std::error_codes to be distinct even though they both hold
"success" values if they have different categories.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368854 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoraw_ostream: add operator<< overload for std::error_code
Pavel Labath [Wed, 14 Aug 2019 13:33:28 +0000 (13:33 +0000)]
raw_ostream: add operator<< overload for std::error_code

Summary:
The main motivation for this is unit tests, which contain a large macro
for pretty-printing std::error_code, and this macro is duplicated in
every file that needs to do this. However, the functionality may be
useful elsewhere too.

In this patch I have reimplemented the existing ASSERT_NO_ERROR macros
to reuse the new functionality, but I have kept the macro (as a
one-liner) as it is slightly more readable than ASSERT_EQ(...,
std::error_code()).

Reviewers: sammccall, ilya-biryukov

Subscribers: zturner, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368849 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SimplifyCFG] Add "safe abs" test from CMSIS DSP 'abs_with_clamp()'
Roman Lebedev [Wed, 14 Aug 2019 13:10:59 +0000 (13:10 +0000)]
[SimplifyCFG] Add "safe abs" test from CMSIS DSP 'abs_with_clamp()'

With -phi-node-folding-threshold=3
this branch would get flattened into select.

See https://reviews.llvm.org/D65148#1629010

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368847 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Pre-merge https://reviews.llvm.org/D66195
Nico Weber [Wed, 14 Aug 2019 12:38:43 +0000 (12:38 +0000)]
gn build: Pre-merge https://reviews.llvm.org/D66195

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368840 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add missing regular 512-bit vXi8 extract subvector cost model tests
Simon Pilgrim [Wed, 14 Aug 2019 12:36:23 +0000 (12:36 +0000)]
[X86] Add missing regular 512-bit vXi8 extract subvector cost model tests

These tests don't cover many cases where the subvectors don't start on aligned indices, but that can be added later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368839 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] MCP: collect and update DBG_VALUEs encountered in local block
Jeremy Morse [Wed, 14 Aug 2019 12:20:02 +0000 (12:20 +0000)]
[DebugInfo] MCP: collect and update DBG_VALUEs encountered in local block

MCP currently uses changeDebugValuesDefReg / collectDebugValues to find
debug users of a register, however those functions assume that all
DBG_VALUEs immediately follow the specified instruction, which isn't
necessarily true. This is going to become very often untrue when we turn
off CodeGenPrepare::placeDbgValues.

Instead of calling changeDebugValuesDefReg on an instruction to change its
debug users, in this patch we instead collect DBG_VALUEs of copies as we
iterate over insns, and update the debug users of copies that are made
dead. This isn't a non-functional change, because MCP will now update
DBG_VALUEs that aren't immediately after a copy, but refer to the same
register. I've hijacked the regression test for PR38773 to test for this
new behaviour, an entirely new test seemed overkill.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368835 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IR] Simplify removeDeadConstantUsers. NFC
Fangrui Song [Wed, 14 Aug 2019 11:38:45 +0000 (11:38 +0000)]
[IR] Simplify removeDeadConstantUsers. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368833 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix "not all control paths return a value" MSVC warnings. NFCI.
Simon Pilgrim [Wed, 14 Aug 2019 11:31:05 +0000 (11:31 +0000)]
Fix "not all control paths return a value" MSVC warnings. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368831 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix "not all control paths return a value" MSVC warning. NFCI.
Simon Pilgrim [Wed, 14 Aug 2019 11:29:56 +0000 (11:29 +0000)]
Fix "not all control paths return a value" MSVC warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368830 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix "not all control paths return a value" MSVC warnings. NFCI.
Simon Pilgrim [Wed, 14 Aug 2019 11:29:16 +0000 (11:29 +0000)]
Fix "not all control paths return a value" MSVC warnings. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368829 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRecommit r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"
George Rimar [Wed, 14 Aug 2019 11:10:11 +0000 (11:10 +0000)]
Recommit r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"

Changes: no changes. A fix for the clang code will be landed right on top.

Original commit message:

SectionRef::getName() returns std::error_code now.
Returning Expected<> instead has multiple benefits.

For example, it forces user to check the error returned.
Also Expected<> may keep a valuable string error message,
what is more useful than having a error code.
(Object\invalid.test was updated to show the new messages printed.)

This patch makes a change for all users to switch to Expected<> version.

Note: in a few places the error returned was ignored before my changes.
In such places I left them ignored. My intention was to convert the interface
used, and not to improve and/or the existent users in this patch.
(Though I think this is good idea for a follow-ups to revisit such places
and either remove consumeError calls or comment each of them to clarify why
it is OK to have them).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368826 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AsmPrinter] Delete redundant .type foo, @function when emitting an ifunc
Fangrui Song [Wed, 14 Aug 2019 10:30:27 +0000 (10:30 +0000)]
[AsmPrinter] Delete redundant .type foo, @function when emitting an ifunc

In MCAsmStreamer:

.type foo,@function   # <--- this is redundant
.type foo,@gnu_indirect_function

In MCELFStreamer, the latter STT_GNU_IFUNC overrides STT_FUNC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368823 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-size][test] Improve llvm-size testing
James Henderson [Wed, 14 Aug 2019 10:17:34 +0000 (10:17 +0000)]
[llvm-size][test] Improve llvm-size testing

This patch significantly improves the llvm-size testing. The changes
made are:

1) Change all tests to use yaml2obj instead of assembly or pre-canned
   inputs.
2) Move the tests out of the X86 directory, since they don't need to be
   there after 1).
3) Increased test coverage.
4) Added comments to explain purpose of tests.

I haven't attempted to add test coverage for all Mach-O related code, as
I am not familiar enough with that file format to be able to.

Reviewers: grimar, MaskRay

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368821 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Refactor getFlippedStrictnessPredicateAndConstant() out of canonicalize...
Roman Lebedev [Wed, 14 Aug 2019 09:57:20 +0000 (09:57 +0000)]
[InstCombine] Refactor getFlippedStrictnessPredicateAndConstant() out of canonicalizeCmpWithConstant(), NFCI

I'd like to use it elsewhere, hopefully without reinventing the wheel.
No functional change intended so far.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368820 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"
George Rimar [Wed, 14 Aug 2019 08:56:55 +0000 (08:56 +0000)]
Revert r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"

It broke clang BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/16455

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368813 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm/Object] - Convert SectionRef::getName() to return Expected<>
George Rimar [Wed, 14 Aug 2019 08:46:54 +0000 (08:46 +0000)]
[llvm/Object] - Convert SectionRef::getName() to return Expected<>

SectionRef::getName() returns std::error_code now.
Returning Expected<> instead has multiple benefits.

For example, it forces user to check the error returned.
Also Expected<> may keep a valuable string error message,
what is more useful than having a error code.
(Object\invalid.test was updated to show the new messages printed.)

This patch makes a change for all users to switch to Expected<> version.

Note: in a few places the error returned was ignored before my changes.
In such places I left them ignored. My intention was to convert the interface
used, and not to improve and/or the existent users in this patch.
(Though I think this is good idea for a follow-ups to revisit such places
and either remove consumeError calls or comment each of them to clarify why
it is OK to have them).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368812 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objdump] - Add a relocation-xindex-symbol.test test case.
George Rimar [Wed, 14 Aug 2019 08:33:26 +0000 (08:33 +0000)]
[llvm-objdump] - Add a relocation-xindex-symbol.test test case.

This rewrites the exitent test case to use YAML instead of the precompiled object
and moves it from test/Object to an appropriate llvm-objdump tests folder.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368811 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Intrinsics] Add a 'NoAlias' intrinsic property; annotate llvm.memcpy
David Bolvansky [Wed, 14 Aug 2019 08:33:07 +0000 (08:33 +0000)]
[Intrinsics] Add a 'NoAlias' intrinsic property; annotate llvm.memcpy

Reviewers: jdoerfert

Reviewed By: jdoerfert

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368810 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine][NFC] Autogenerate checks in adjust-for-minmax.ll
Roman Lebedev [Wed, 14 Aug 2019 08:12:20 +0000 (08:12 +0000)]
[InstCombine][NFC] Autogenerate checks in adjust-for-minmax.ll

Being affected by WIP patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368807 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LV] Fold-tail flag
Dorit Nuzman [Wed, 14 Aug 2019 05:22:20 +0000 (05:22 +0000)]
[LV] Fold-tail flag

This is the compiler-flag equivalent of the Predicate pragma
(https://reviews.llvm.org/D65197), to direct the vectorizer to fold the
remainder-loop into the main-loop using predication.

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

Reviewers: Ayal, hsaito, fhahn, SjoerdMeije

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368801 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert '[LICM] Make Loop ICM profile aware' and 'Fix pass dependency for LICM'
David L. Jones [Wed, 14 Aug 2019 04:50:33 +0000 (04:50 +0000)]
Revert '[LICM] Make Loop ICM profile aware' and 'Fix pass dependency for LICM'

This reverts r368526 (git commit 7e71aa24bc0788690fea7f0d7eab400c6a784deb)
This reverts r368542 (git commit cb5a90fd314a7914cf293797bb4fd7a6841052cf)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368800 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove minimum toolchain soft-error
JF Bastien [Wed, 14 Aug 2019 04:30:51 +0000 (04:30 +0000)]
Remove minimum toolchain soft-error

Summary:
Back in January I changed the minimum toolchain version required to build clang
and LLVM: D57264. Since then we've release LLVM 8, following
[our process](http://llvm.org/docs/DeveloperPolicy.html#toolchain)
it's therefore now a good time to remove the soft-error and officially deprecate
older toolchains. I tried this out last Tursday night to see if any bots
complained, and I saw no complaints. I also manually audited bots and didn't see
any bot that should break, but their toolchain information is unreliable and
some bots are offline.

Once this patch stick we'll move to C++14 as we've
[already agreed](http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html).

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368799 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCoroutines: adjust for SVN r358739
John McCall [Wed, 14 Aug 2019 03:54:25 +0000 (03:54 +0000)]
Coroutines: adjust for SVN r358739

CallSite has been removed in favour of CallBase.  Adjust the coroutine split to
account for that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368798 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDon't run a full verifier pass in coro-splitting's private pipeline.
John McCall [Wed, 14 Aug 2019 03:54:18 +0000 (03:54 +0000)]
Don't run a full verifier pass in coro-splitting's private pipeline.

Potentially addresses rdar://49022293.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368797 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove unreachable blocks before splitting a coroutine.
John McCall [Wed, 14 Aug 2019 03:54:13 +0000 (03:54 +0000)]
Remove unreachable blocks before splitting a coroutine.

The suspend-crossing algorithm is not correct in the presence of uses
that cannot be reached on some successor path from their defs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368796 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSupport swifterror in coroutine lowering.
John McCall [Wed, 14 Aug 2019 03:54:05 +0000 (03:54 +0000)]
Support swifterror in coroutine lowering.

The support for swifterror allocas should work in all lowerings.
The support for swifterror arguments only really works in a lowering
with prototypes where you can ensure that the prototype also has a
swifterror argument; I'm not really sure how it could possibly be
made to work in the switch lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368795 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUpdate for optimizer changes.
John McCall [Wed, 14 Aug 2019 03:53:58 +0000 (03:53 +0000)]
Update for optimizer changes.

rdar://37352868

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368794 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoIn coro.retcon lowering, don't explode if the optimizer messes around with the linkag...
John McCall [Wed, 14 Aug 2019 03:53:52 +0000 (03:53 +0000)]
In coro.retcon lowering, don't explode if the optimizer messes around with the linkage of the prototype or the exact types of the yielded values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368793 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix a use-after-free in the coro.alloca treatment.
John McCall [Wed, 14 Aug 2019 03:53:46 +0000 (03:53 +0000)]
Fix a use-after-free in the coro.alloca treatment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368792 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd intrinsics for doing frame-bound dynamic allocations within a coroutine.
John McCall [Wed, 14 Aug 2019 03:53:40 +0000 (03:53 +0000)]
Add intrinsics for doing frame-bound dynamic allocations within a coroutine.

These rely on having an allocator provided to the coroutine and thus,
for now, only work in retcon lowerings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368791 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGuard dumps in the coro intrinsic validation logic behind NDEBUG checks. dump() is...
John McCall [Wed, 14 Aug 2019 03:53:31 +0000 (03:53 +0000)]
Guard dumps in the coro intrinsic validation logic behind NDEBUG checks. dump() is not guaranteed to be defined in all builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368790 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGeneralize llvm.coro.suspend.retcon to allow an arbitrary number of arguments to...
John McCall [Wed, 14 Aug 2019 03:53:26 +0000 (03:53 +0000)]
Generalize llvm.coro.suspend.retcon to allow an arbitrary number of arguments to be passed back to the continuation function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368789 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoExtend coroutines to support a "returned continuation" lowering.
John McCall [Wed, 14 Aug 2019 03:53:17 +0000 (03:53 +0000)]
Extend coroutines to support a "returned continuation" lowering.

A quick contrast of this ABI with the currently-implemented ABI:

- Allocation is implicitly managed by the lowering passes, which is fine
  for frontends that are fine with assuming that allocation cannot fail.
  This assumption is necessary to implement dynamic allocas anyway.

- The lowering attempts to fit the coroutine frame into an opaque,
  statically-sized buffer before falling back on allocation; the same
  buffer must be provided to every resume point.  A buffer must be at
  least pointer-sized.

- The resume and destroy functions have been combined; the continuation
  function takes a parameter indicating whether it has succeeded.

- Conversely, every suspend point begins its own continuation function.

- The continuation function pointer is directly returned to the caller
  instead of being stored in the frame.  The continuation can therefore
  directly destroy the frame when exiting the coroutine instead of having
  to leave it in a defunct state.

- Other values can be returned directly to the caller instead of going
  through a promise allocation.  The frontend provides a "prototype"
  function declaration from which the type, calling convention, and
  attributes of the continuation functions are taken.

- On the caller side, the frontend can generate natural IR that directly
  uses the continuation functions as long as it prevents IPO with the
  coroutine until lowering has happened.  In combination with the point
  above, the frontend is almost totally in charge of the ABI of the
  coroutine.

- Unique-yield coroutines are given some special treatment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368788 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FileCheck] Document FILECHECK_OPTS in -help
Joel E. Denny [Wed, 14 Aug 2019 02:56:20 +0000 (02:56 +0000)]
[FileCheck] Document FILECHECK_OPTS in -help

Reviewed By: thopre

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368787 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FileCheck] Move -dump-input diagnostic to first line
Joel E. Denny [Wed, 14 Aug 2019 02:56:09 +0000 (02:56 +0000)]
[FileCheck] Move -dump-input diagnostic to first line

Without this patch, `-dump-input` prints a diagnostic at the end of
its marker range.  For example:

```
         1: Start.
check:1     ^~~~~~
         2: Bad.
next:2      X~~~
         3: Many lines
next:2      ~~~~~~~~~~
         4: of input.
next:2      ~~~~~~~~~
         5: End.
next:2      ~~~~ error: no match found
```

This patch moves it to the beginning like this:

```
         1: Start.
check:1     ^~~~~~
         2: Bad.
next:2      X~~~ error: no match found
         3: Many lines
next:2      ~~~~~~~~~~
         4: of input.
next:2      ~~~~~~~~~
         5: End.
next:2      ~~~~
```

The former somehow looks nicer because the diagnostic doesn't appear
to be somewhere within the marker range.  However, the latter is more
practical, especially when the marker range includes the remainder of
a very long dump.  First, in the case of an error, this patch enables
me to search the dump for `error:` and usually immediately land where
the detected error began.  Second, when trying to follow FileCheck's
logic, it's best to read top down, so this patch enables me to see
each diagnostic as soon as I encounter its marker.

Reviewed By: thopre

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368786 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalISel]: Fix lowering of G_Shuffle_vector where we pick up the wrong source...
Aditya Nandakumar [Wed, 14 Aug 2019 01:23:33 +0000 (01:23 +0000)]
[GlobalISel]: Fix lowering of G_Shuffle_vector where we pick up the wrong source index

https://reviews.llvm.org/D66182

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368781 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64][GlobalISel] RBS: Treat s128s like vectors when unmerging.
Amara Emerson [Tue, 13 Aug 2019 23:51:20 +0000 (23:51 +0000)]
[AArch64][GlobalISel] RBS: Treat s128s like vectors when unmerging.

The destinations should be FPRs (for now).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368775 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Remove incorrect usage of MONonTemporal.
Eli Friedman [Tue, 13 Aug 2019 23:12:14 +0000 (23:12 +0000)]
[AArch64] Remove incorrect usage of MONonTemporal.

This has no effect at the moment, but might matter if we try to
implement non-temporal loads in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368770 91177308-0d34-0410-b5e6-96231b3b80d8