Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

LLVM 4.0 #166

Merged
merged 8,010 commits into from
Mar 15, 2017
Merged

LLVM 4.0 #166

merged 8,010 commits into from
Mar 15, 2017

Conversation

kripken
Copy link
Member

@kripken kripken commented Jan 25, 2017

This builds upon @dylanmckay's excellent work in merging in LLVM 4.0. I added a few fixes for the test suite. At this point everything seems to pass, so I think this is ready for merge (as usual, with tagging before and after), except for

  • Review. Speaking of which, is there a good git way to see just the "non-merged" changes? I.e., not all the LLVM commits we merged in, but merge conflict resolutions etc.?
  • Would be good if someone does testing on their projects, if not, can happen on incoming
  • Need to verify the merged LLVM commit is exactly the one Rust needs. @brson?

Will open parallel emscripten and clang PRs in a second.

rotateright and others added 30 commits January 8, 2017 15:53
I noticed this problem as part of the ongoing attempt to canonicalize min/max ops in IR.

The debug output shows nodes like this:

t4: i32 = xor t2, Constant:i32<-1>
    t21: i8 = setcc t4, Constant:i32<0>, setlt:ch
  t14: i32 = select t21, t4, Constant:i32<-1>

And because the select is holding onto the t4 (xor) node while EmitTest creates a new 
x86-specific xor node, the lowering results in:

  t4: i32 = xor t2, Constant:i32<-1>
  t25: i32,i32 = X86ISD::XOR t2, Constant:i32<-1>
t28: i32,glue = X86ISD::CMOV Constant:i32<-1>, t4, Constant:i8<15>, t25:1

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291392 91177308-0d34-0410-b5e6-96231b3b80d8
Silences a warning from gcc:6.  NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291394 91177308-0d34-0410-b5e6-96231b3b80d8
Running a Debug build of objdump -objc-meta-data with a large Mach-O file is
currently unnecessarily slow.

With some local test input, this change reduces the run time from 75-85s down
to 15-20s.

The two changes are:
  Assert on pointer equality not array equality
  Replace vector<pair<address, symbol>> with DenseMap<address, symbol>

Additionally, use a std::unique_ptr rather than handling the memory manually.

Patch by Dave Lee!

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

handlers, make abandonPendingResults public API.

This should make installing asynchronous result handlers thread safe.

The abandonPendingResults method is made public so that clients can disconnect
from a remote even if they have asynchronous handlers awaing results from that
remote. The asynchronous handlers will all receive "abandoned result" errors as
their argument.



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

This is preparation for improving a case with avx512dq.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291401 91177308-0d34-0410-b5e6-96231b3b80d8
…select of zeroes/ones when handling sign extends of i1 without VLX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291402 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
By using stripPointerCasts we can get to the root
value and then walk down the bitcast graph

Reviewers: reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291405 91177308-0d34-0410-b5e6-96231b3b80d8
…ws for empty string

This is used in LDC for custom boolean commandline options, setArgStr
is called with an empty string before using AddLiteralOption.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291406 91177308-0d34-0410-b5e6-96231b3b80d8
This patch moves convertToUnixPathSeparator from LLD to LLVM.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291414 91177308-0d34-0410-b5e6-96231b3b80d8
… vselects of all ones and all zeros.

Previously we emitted a VPTERNLOG and a separate masked move.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291415 91177308-0d34-0410-b5e6-96231b3b80d8
…moves. A future patch will conver it back to BLENDM if its beneficial to register allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291419 91177308-0d34-0410-b5e6-96231b3b80d8
not excluding ourselves when checking if any equivalent stores
exist.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291421 91177308-0d34-0410-b5e6-96231b3b80d8
computeInterleaveCount() is not defined/used and is therefore removed.

Review: Davide Italiano

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

This fixes use-after-free bugs that will arise with any interesting use
of SCEV.

I've added a dedicated test that works diligently to trigger these kinds
of bugs in the new pass manager and also checks for them explicitly as
well as triggering ASan failures when things go squirly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291426 91177308-0d34-0410-b5e6-96231b3b80d8
This patch doesn't create thunk for branch operation when following conditions are met:
- Architecture is AArch64
- Relocation target is in the same object file
- Relocation target is close enough to be encoded in immediate offset

In such case we branch directly to the target instead of branching to thunk

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291431 91177308-0d34-0410-b5e6-96231b3b80d8
MSVC does not like to reinterpret_cast to a uint64_t. Use a different cast
instead.

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

Summary:
Originally

 i64 = umax t8, Constant:i64<4>

was expanded into

 i32,i32 = umax Constant:i32<0>, Constant:i32<0>
 i32,i32 = umax t7, Constant:i32<4>

Now instead the two produced umax:es return i32 instead of i32, i32.

Thanks to Jan Vesely for help with the test case.

Patch by mikael.holmen at ericsson.com

Reviewers: bogner, jvesely, tstellarAMD, arsenm

Subscribers: test, wdng, RKSimon, arsenm, nhaehnle, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291441 91177308-0d34-0410-b5e6-96231b3b80d8
const value op iterator is missing from User.h class.

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



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

Use the existing AVX2 v8i16 vector shift lowering for v16i16 on AVX512 targets (AVX512BW will have already have lowered with vpsravw).

Cost model updates to follow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291445 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291447 91177308-0d34-0410-b5e6-96231b3b80d8
…+truncate pattern.

Use the existing AVX2 v8i16 vector shift lowering for v16i8 (extending to v16i32) on AVX512 targets and v32i8 (extending to v32i16) on AVX512BW targets.

Cost model updates to follow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291451 91177308-0d34-0410-b5e6-96231b3b80d8
prazek and others added 18 commits January 14, 2017 10:03
------------------------------------------------------------------------
r292242 | bwilson | 2017-01-17 11:18:57 -0800 (Tue, 17 Jan 2017) | 5 lines

Revert r291640 change to fold X86 comparison with atomic_load_add.

Even with the fix from r291630, this still causes problems. I get
widespread assertion failures in the Swift runtime's WeakRefCount::increment()
function. I sent a reduced testcase in reply to the commit.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@292243 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r292255 | mgorny | 2017-01-17 13:04:19 -0800 (Tue, 17 Jan 2017) | 12 lines

[cmake] Update SOVERSION for the new versioning scheme

Update SOVERSION to use just the major version number rather than
major+minor, to match the new versioning scheme where only major is used
to indicate API/ABI version.

Since two-digit SOVERSIONs were introduced post 3.9 branching, this
change does not risk any SOVERSION collisions. In the past,
two-component X.Y SOVERSIONs were shortly used but those will not
interfere with the new ones since the new versions start at 4.

Differential Revision: https://reviews.llvm.org/D28730
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@292270 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r291968 | dannyb | 2017-01-13 14:40:01 -0800 (Fri, 13 Jan 2017) | 23 lines

NewGVN: Move leaders around properly to ensure we have a canonical dominating leader. Fixes PR 31613.

Summary:
This is a testcase where phi node cycling happens, and because we do
not order the leaders by domination or anything similar, the leader
keeps changing.

Using std::set for the members is too expensive, and we actually don't
need them sorted all the time, only at leader changes.

We could keep both a set and a vector, and keep them mostly sorted and
resort as necessary, or use a set and a fibheap, but all of this seems
premature.

After running some statistics, we are able to avoid the vast majority
of sorting by keeping a "next leader" field.  Most congruence classes only have
leader changes once or twice during GVN.

Reviewers: davide

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D28594
------------------------------------------------------------------------

------------------------------------------------------------------------
r291979 | dannyb | 2017-01-13 15:54:10 -0800 (Fri, 13 Jan 2017) | 1 line

NewGVN: Fix PR31613 test regex naming
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@292307 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r292133 | hfinkel | 2017-01-16 07:22:01 -0800 (Mon, 16 Jan 2017) | 10 lines

Fix use-after-free bug in AffectedValueCallbackVH::allUsesReplacedWith

When transferring affected values in the cache from an old value, identified by
the value of the current callback, to the specified new value we might need to
insert a new entry into the DenseMap which constitutes the cache. Doing so
might delete the current callback object. Move the copying logic into a new
function, a member of the assumption cache itself, so that we don't run into UB
should the callback handle itself be removed mid-copy.

Differential Revision: https://reviews.llvm.org/D28749
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@292312 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r291966 | majnemer | 2017-01-13 14:24:27 -0800 (Fri, 13 Jan 2017) | 6 lines

[LoopStrengthReduce] Don't bother rewriting PHIs in catchswitch blocks

The catchswitch instruction cannot be split, don't bother trying to
rewrite it.

This fixes PR31627.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@292340 91177308-0d34-0410-b5e6-96231b3b80d8
Dead code elimination would remove a bunch of math calls.
Invariant intrinsics are now suffixed with types.
… with side effects) if it has a param with the 'returned' attribute
@dschuff
Copy link
Member

dschuff commented Jan 31, 2017

LGTM!
on a somewhat related note, when was the last time we updated libc++ (to get the new library goodness to go along with this new compiler goodness)?

@dschuff
Copy link
Member

dschuff commented Jan 31, 2017

oh, wrt review. There's not a really good way to review just what we care about; i.e. changes to our diff from upstream. There is a thing called interdiff, which is for viewing diffs-of-diffs, which is sometimes useful. Also you can look directly at a diff if you limit it just to files which are not upstream (which covers a lot of things for fastcomp). git diff will accept a list of files on the command line to do this. It seems like I recall having a script to gather that for PNaCl, let me try to find it.

@kripken
Copy link
Member Author

kripken commented Jan 31, 2017

Ok, thanks. I reviewed the best diffs I could get. Everything seems to be in order.

Looks like we are just waiting on rust, to know the precise changeset to merge in: rust-lang/rust#37609 (comment) Otherwise we are all ready here.

About libc++, last update we did is Date: Mon May 9 23:39:55 2016 +0200 based on the changelog (f8e0b7dc838dea8b713944b5c9469be837826999 in emscripten).

@kripken
Copy link
Member Author

kripken commented Mar 15, 2017

Rust still isn't quite ready here, but meanwhile it would be good to merge this and the adjoining PRs, since the clang upgrade fixes some issues that projects have hit.

Any concerns with merging these in?

@dschuff
Copy link
Member

dschuff commented Mar 15, 2017

LGTM!

@kripken kripken merged commit 11b1147 into incoming Mar 15, 2017
@kripken kripken deleted the next-merge branch March 15, 2017 23:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.