6 years agoRemove CloningDirector and associated code
Easwaran Raman [Fri, 8 Jan 2016 18:23:17 +0000 (18:23 +0000)]
Remove CloningDirector and associated code

With the removal of the old landing pad code in r249918, CloningDirector is not
 used anywhere else. NFCI.

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

6 years agoDo not ASSERTZEXT for i16 result of bitcast from f16 operand
Pirama Arumuga Nainar [Fri, 8 Jan 2016 17:46:05 +0000 (17:46 +0000)]
Do not ASSERTZEXT for i16 result of bitcast from f16 operand

During legalization if i16, do not ASSERTZEXT the result of FP_TO_FP16.
Directly return an FP_TO_FP16 node with return type as the
promote-to-type of i16.

This patch also removes extraneous length check.  This legalization
should be valid even if integer and float types are of different

This patch breaks a hard-float test for fp16 args.  The test is changed
to allow a vmov to zero-out the top bits, and also ensure that the
return value is in an FP register.

Reviewers: ab, jmolloy

Subscribers: srhines, llvm-commits

Differential Revision: http://reviews.llvm.org/D15438

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

6 years ago[WinEH] CatchHandler which don't have catch objects in StackColoring
David Majnemer [Fri, 8 Jan 2016 17:24:47 +0000 (17:24 +0000)]
[WinEH] CatchHandler which don't have catch objects in StackColoring

StackColoring rewrites the frame indicies of operations involving
allocas if it can find that the life time of two objects do not overlap.
MSVC EH needs to be kept aware of this if happens in the event that a
catch object has moved around.  However, we represent the non-existance
of a catch object with a sentinel frame index (INT_MAX).  This sentinel
also happens to be the EmptyKey of the SlotRemap DenseMap.  Testing for
whether or not we need to translate the frame index fails in this case
because we call the count method on the DenseMap with the EmptyKey,
leading to assertions.  Instead, check if it is our sentinel value
before trying to look into the DenseMap.

This fixes PR26073.

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

6 years ago[ThinLTO] Use new in-place symbol changes for exporting module
Teresa Johnson [Fri, 8 Jan 2016 17:06:29 +0000 (17:06 +0000)]
[ThinLTO] Use new in-place symbol changes for exporting module

Due to the new in-place ThinLTO symbol handling support added in
r257174, we now invoke renameModuleForThinLTO on the current
module from within the FunctionImport pass.

Additionally, renameModuleForThinLTO no longer needs to return the
Module as it is performing the renaming in place on the one provided.

This commit will be immediately preceeded by a companion clang patch to
remove its invocation of renameModuleForThinLTO.

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

6 years agoHow to close a review manually.
Paul Robinson [Fri, 8 Jan 2016 17:05:12 +0000 (17:05 +0000)]
How to close a review manually.

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

6 years ago[ThinLTO] Enable in-place symbol changes for exporting module
Teresa Johnson [Fri, 8 Jan 2016 15:00:00 +0000 (15:00 +0000)]
[ThinLTO] Enable in-place symbol changes for exporting module

Move ThinLTO global value processing functions out of ModuleLinker and
into a new ThinLTOGlobalProcessor class, which performs any necessary
linkage and naming changes on the given module in place.

As a result, renameModuleForThinLTO no longer needs to create a new
Module when performing any necessary local to global promotion on a
module that we are possibly exporting from during a ThinLTO backend

During function importing the ThinLTO processing is still invoked from
the ModuleLinker (via the new class), as it needs to perform renaming and
linkage changes on the source module, e.g. in order to get the correct
renaming during local to global promotion.

Reviewers: joker.eph

Subscribers: davidxl, llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D15696

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

6 years agoAMDGPU/SI: Emit global variable sizes when targeting HSA
Tom Stellard [Fri, 8 Jan 2016 14:50:28 +0000 (14:50 +0000)]
AMDGPU/SI: Emit global variable sizes when targeting HSA

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D15952

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

6 years agoAMDGPU: Emit functions sizes
Tom Stellard [Fri, 8 Jan 2016 14:50:23 +0000 (14:50 +0000)]
AMDGPU: Emit functions sizes

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D15951

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

6 years ago[ThinLTO] Delay metadata materializtion in function importer
Teresa Johnson [Fri, 8 Jan 2016 14:17:41 +0000 (14:17 +0000)]
[ThinLTO] Delay metadata materializtion in function importer

The function importer was still materializing metadata when modules were
loaded for function importing. We only want to materialize it when we
are going to invoke the metadata linking postpass. Materializing it
before function importing is not only unnecessary, but also causes
metadata referenced by imported functions to be mapped in early, and
then not connected to the rest of the module level metadata when it is
ultimately linked in.

Augmented the test case to specifically check for the metadata being
properly connected, which it wasn't before this fix.

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

6 years agoPrevent renaming of CR fields in AADB when a CR restore is present
Nemanja Ivanovic [Fri, 8 Jan 2016 13:09:54 +0000 (13:09 +0000)]
Prevent renaming of CR fields in AADB when a CR restore is present

This patch corresponds to review:

Moves to and from CR fields depend on shifts/masks that depend on the
target/source CR field. Thus, post-ra anti-dep breaking must not later
change that CR register assignment.

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

6 years agoInstCombineCompares.cpp: Fix a warning. [-Wbraced-scalar-init]
NAKAMURA Takumi [Fri, 8 Jan 2016 12:50:03 +0000 (12:50 +0000)]
InstCombineCompares.cpp: Fix a warning. [-Wbraced-scalar-init]

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

6 years agoRe-commit r257064, this time with a fixed assert
Silviu Baranga [Fri, 8 Jan 2016 11:11:04 +0000 (11:11 +0000)]
Re-commit r257064, this time with a fixed assert

In setInsertionPoint if the value is not a PHI, Instruction or
Argument it should be a Constant, not a ConstantExpr.

Original commit message:

[InstCombine] Look through PHIs, GEPs, IntToPtrs and PtrToInts to expose more constants when comparing GEPs

When comparing two GEP instructions which have the same base pointer
and one of them has a constant index, it is possible to only compare
indices, transforming it to a compare with a constant. This removes
one use for the GEP instruction with the constant index, can reduce
register pressure and can sometimes lead to removing the comparisson

InstCombine was already doing this when comparing two GEPs if the base
pointers were the same. However, in the case where we have complex
pointer arithmetic (GEPs applied to GEPs, PHIs of GEPs, conversions to
or from integers, etc) the value of the original base pointer will be
hidden to the optimizer and this transformation will be disabled.

This change detects when the two sides of the comparison can be
expressed as GEPs with the same base pointer, even if they don't
appear as such in the IR. The transformation will convert all the
pointer arithmetic to arithmetic done on indices and all the relevant
uses of GEPs to GEPs with a common base pointer. The GEP comparison
will be converted to a comparison done on indices.

Reviewers: majnemer, jmolloy

Subscribers: hfinkel, jevinskie, jmolloy, aadg, llvm-commits

Differential Revision: http://reviews.llvm.org/D15146

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

6 years ago[attrs] Split the late-revisit pattern for deducing norecurse in
Chandler Carruth [Fri, 8 Jan 2016 10:55:52 +0000 (10:55 +0000)]
[attrs] Split the late-revisit pattern for deducing norecurse in
a top-down manner into a true top-down or RPO pass over the call graph.

There are specific patterns of function attributes, notably the
norecurse attribute, which are most effectively propagated top-down
because all they us caller information.

Walk in RPO over the call graph SCCs takes the form of a module pass run
immediately after the CGSCC pass managers postorder walk of the SCCs,
trying again to deduce norerucrse for each singular SCC in the call

This removes a very legacy pass manager specific trick of using a lazy
revisit list traversed during finalization of the CGSCC pass. There is
no analogous finalization step in the new pass manager, and a lazy
revisit list is just trying to produce an RPO iteration of the call
graph. We can do that more directly if more expensively. It seems
unlikely that this will be the expensive part of any compilation though
as we never examine the function bodies here. Even in an LTO run over
a very large module, this should be a reasonable fast set of operations
over a reasonably small working set -- the function call graph itself.

In the future, if this really is a compile time performance issue, we
can look at building support for both post order and RPO traversals
directly into a pass manager that builds and maintains the PO list of

Differential Revision: http://reviews.llvm.org/D15785

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

6 years ago[LCG] Re-order the lazy node iterator below the node type to make some
Chandler Carruth [Fri, 8 Jan 2016 10:50:11 +0000 (10:50 +0000)]
[LCG] Re-order the lazy node iterator below the node type to make some
subsequent work I'm doing not have its delta obscured by boring code
motion. NFC.

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

6 years ago[WinEH] Update WinEHFuncInfo if StackColoring merges allocas
David Majnemer [Fri, 8 Jan 2016 08:03:55 +0000 (08:03 +0000)]
[WinEH] Update WinEHFuncInfo if StackColoring merges allocas

Windows EH keeping track of which frame index corresponds to a catchpad
in order to inform the runtime where the catch parameter should be
initialized.  LLVM's optimizations are able to prove that the memory
used by the catch parameter can be reused with another memory
optimization, changing it's frame index.

We need to keep WinEHFuncInfo up to date with respect to this or we will

This fixes PR26069.

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

6 years agoInstrProfTest.cpp: Fix a warning. [-Wsign-compare]
NAKAMURA Takumi [Fri, 8 Jan 2016 07:58:20 +0000 (07:58 +0000)]
InstrProfTest.cpp: Fix a warning. [-Wsign-compare]

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

6 years ago[TableGen] Use range-based for loops. Also fix one loop to not use some index name...
Craig Topper [Fri, 8 Jan 2016 07:06:32 +0000 (07:06 +0000)]
[TableGen] Use range-based for loops. Also fix one loop to not use some index name as an outer loop. NFC

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

6 years ago[TableGen] Combine variable declaration and initialization. Move a string into a...
Craig Topper [Fri, 8 Jan 2016 07:06:29 +0000 (07:06 +0000)]
[TableGen] Combine variable declaration and initialization. Move a string into a vector instead of copying. NFC

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

6 years agoAdd value site truncation unit test
Xinliang David Li [Fri, 8 Jan 2016 06:54:27 +0000 (06:54 +0000)]
Add value site truncation unit test

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

6 years ago[AVR] Added AVRSelectionDAGInfo header file
Dylan McKay [Fri, 8 Jan 2016 06:32:27 +0000 (06:32 +0000)]
[AVR] Added AVRSelectionDAGInfo header file

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

6 years ago[AVX-512] Remove superfluous spaces from some asm strings.
Craig Topper [Fri, 8 Jan 2016 06:09:20 +0000 (06:09 +0000)]
[AVX-512] Remove superfluous spaces from some asm strings.

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

6 years ago[X86] Don't print the aliased version of CVTSD2SI64rm. This appears to be a mistake...
Craig Topper [Fri, 8 Jan 2016 06:09:18 +0000 (06:09 +0000)]
[X86] Don't print the aliased version of CVTSD2SI64rm. This appears to be a mistake I made years ago.

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

6 years ago[X86] Use \t instead of space after mnemonics in a bunch InstAliases for consistency.
Craig Topper [Fri, 8 Jan 2016 06:09:13 +0000 (06:09 +0000)]
[X86] Use \t instead of space after mnemonics in a bunch InstAliases for consistency.

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

6 years ago[PGO] Ensure vp data in indexed profile always sorted
Xinliang David Li [Fri, 8 Jan 2016 05:45:21 +0000 (05:45 +0000)]
[PGO] Ensure vp data in indexed profile always sorted

Done in  InstrProfWriter to eliminate the need for client
code to do the sorting. The operation is done once and reused
many times so it is more efficient. Update unit test to remove
sorting. Also update expected output of affected tests.

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

6 years agoRemove extra whitespace. NFC.
Junmo Park [Fri, 8 Jan 2016 04:20:32 +0000 (04:20 +0000)]
Remove extra whitespace. NFC.

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

6 years ago[PGO] Fix a bug in InstProfWriter addRecord
Xinliang David Li [Fri, 8 Jan 2016 03:49:59 +0000 (03:49 +0000)]
[PGO] Fix a bug in InstProfWriter addRecord

For a new record with weight != 1, only edge profiling
counters are scaled, VP data is not properly scaled.

This patch refactors the code and fixes the problem.
Also added sort by count interface (for follow up patch).

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

6 years agoRemove static global GCNames from Function.cpp and move it to the Context
Mehdi Amini [Fri, 8 Jan 2016 02:28:20 +0000 (02:28 +0000)]
Remove static global GCNames from Function.cpp and move it to the Context

This remove the need for locking when deleting a function.

Differential Revision: http://reviews.llvm.org/D15988

From: Mehdi Amini <mehdi.amini@apple.com>

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

6 years agoAdd call sequence start and end for __tls_get_addr
Kyle Butt [Fri, 8 Jan 2016 02:06:19 +0000 (02:06 +0000)]
Add call sequence start and end for __tls_get_addr

This is a fix for bug http://llvm.org/bugs/show_bug.cgi?id=25839.

For a PIC TLS variable access in a function, prologue (mflr followed by std and
stdu) gets scheduled after a tls_get_addr call. tls_get_addr messed up LR but
no one saves/restores it.

Also added a test for save/restore clobbered registers during calling __tls_get_addr.

Patch by Tim Shen

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

6 years ago[Vectorization] Actually return from error case in isStridedPtr
Kyle Butt [Fri, 8 Jan 2016 01:55:13 +0000 (01:55 +0000)]
[Vectorization] Actually return from error case in isStridedPtr

The early return seems to be missed. This causes a radical and wrong loop
optimization on powerpc. It isn't reproducible on x86_64, because
"UseInterleaved" is false.

Patch by Tim Shen.

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

6 years ago[InstCombine] insert a new shuffle in a safe place (PR25999)
Sanjay Patel [Fri, 8 Jan 2016 01:39:16 +0000 (01:39 +0000)]
[InstCombine] insert a new shuffle in a safe place (PR25999)

Limit this transform to a basic block and guard against PHIs.
Hopefully, this fixes the remaining failures in PR25999:

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

6 years ago[WebAssembly] Minor code cleanups. NFC.
Dan Gohman [Fri, 8 Jan 2016 01:18:00 +0000 (01:18 +0000)]
[WebAssembly] Minor code cleanups. NFC.

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

6 years agoIntEqClasses: Let join() return the new leader
Matthias Braun [Fri, 8 Jan 2016 01:16:39 +0000 (01:16 +0000)]
IntEqClasses: Let join() return the new leader

The new leader is known anyway so we can return it for some micro
optimization in code where it is easy to pass along the result to the
next join().

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

6 years agoLiveInterval: A LiveRange is enough for ConnectedVNInfoEqClasses::Classify()
Matthias Braun [Fri, 8 Jan 2016 01:16:35 +0000 (01:16 +0000)]
LiveInterval: A LiveRange is enough for ConnectedVNInfoEqClasses::Classify()

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

6 years ago[WebAssembly] Minor code cleanups. NFC.
Dan Gohman [Fri, 8 Jan 2016 01:06:00 +0000 (01:06 +0000)]
[WebAssembly] Minor code cleanups. NFC.

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

6 years ago[WebAssembly] Remove an unused def : Pat.
Dan Gohman [Fri, 8 Jan 2016 00:50:33 +0000 (00:50 +0000)]
[WebAssembly] Remove an unused def : Pat.

WebAssemblyISelLowering.cpp does not wrap jump table nodes inside of
WebAssemblywrapper nodes, so this pattern is not currently used.

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

6 years ago[WebAssembly] Remove unused arguments, unused functions. NFC.
Dan Gohman [Fri, 8 Jan 2016 00:43:54 +0000 (00:43 +0000)]
[WebAssembly] Remove unused arguments, unused functions. NFC.

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

6 years ago[PGO] : Removing trailing space/define new macro/NFC
Xinliang David Li [Fri, 8 Jan 2016 00:38:53 +0000 (00:38 +0000)]
[PGO] : Removing trailing space/define new macro/NFC

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

6 years agoAdd some testing for thumb1 and thumb2 inline asm immediate constraints
Eric Christopher [Fri, 8 Jan 2016 00:34:44 +0000 (00:34 +0000)]
Add some testing for thumb1 and thumb2 inline asm immediate constraints
and fix a couple of bugs on inspection.

Also fixes PR26061.

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

6 years ago[llvm-symbolizer] Print out non-address lines verbatim.
Mike Aizatsky [Thu, 7 Jan 2016 23:57:41 +0000 (23:57 +0000)]
[llvm-symbolizer] Print out non-address lines verbatim.

Differential Revision: http://reviews.llvm.org/D15876

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

6 years ago[LiveDebugValues] Replace several lines of code with operator[].
Alexey Samsonov [Thu, 7 Jan 2016 23:38:45 +0000 (23:38 +0000)]
[LiveDebugValues] Replace several lines of code with operator[].

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

6 years agoInstructions to be redone only if from the same BB
Aditya Nandakumar [Thu, 7 Jan 2016 23:22:55 +0000 (23:22 +0000)]
Instructions to be redone only if from the same BB

While adding instructions(possible roots) to be redone, make sure they
are from the same basic block.

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

6 years agoWebAssembly: use .skip instead of .zero directive
JF Bastien [Thu, 7 Jan 2016 23:18:29 +0000 (23:18 +0000)]
WebAssembly: use .skip instead of .zero directive

.zero is confusing when used with two arguments. Documentation:

  This directive emits SIZE 0-valued bytes.  SIZE must be an absolute
  expression.  This directive is actually an alias for the '.skip'
  directive so in can take an optional second argument of the value to
  store in the bytes instead of zero.  Using '.zero' in this way would be
  confusing however.

Ref: https://sourceware.org/bugzilla/show_bug.cgi?id=18353

Hexagon and Sparc do the same, and it's all the same to WebAssembly so
let's pick the less confusing of the two.

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

6 years ago[PGO] Minor refactoring /NFC
Xinliang David Li [Thu, 7 Jan 2016 22:46:29 +0000 (22:46 +0000)]
[PGO] Minor refactoring /NFC

Move common defs into common header files.

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

6 years agoTemporarily revert r257105 "[Verifier] Check that debug values have proper size"
Keno Fischer [Thu, 7 Jan 2016 22:39:11 +0000 (22:39 +0000)]
Temporarily revert r257105 "[Verifier] Check that debug values have proper size"

Looks like there's a case where clang generates debug info that triggers
the new verifier check. Reverting while investigating.

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

6 years ago[Verifier] Check that debug values have proper size
Keno Fischer [Thu, 7 Jan 2016 22:18:37 +0000 (22:18 +0000)]
[Verifier] Check that debug values have proper size

Teach the Verifier to make sure that the storage size given to llvm.dbg.declare
or the value size given to llvm.dbg.value agree with what is declared in
DebugInfo. This is implicitly assumed in a number of passes (e.g. in SROA).
Additionally this catches a number of common mistakes, such as passing a
pointer when a value was intended or vice versa.

One complication comes from stack coloring which modifies the original IR when
it merges allocas in order to make sure that if AA falls back to the IR it gets
the correct result. However, given this new invariant, indiscriminately
replacing one alloca by a different (differently sized one) is no longer valid.
Fix this by just undefing out any use of the alloca in a dbg.declare in this

Additionally, I had to fix a number of test cases. Of particular note:
- I regenerated dbg-changes-codegen-branch-folding.ll from the given source as
  it was affected by the bug fixed in r256077
- two-cus-from-same-file.ll was changed to avoid having a variable-typed debug
  variable as that would depend on the target, even though this test is
  supposed to be generic
- I had to manually declared size/align for reference type. See also the
  discussion for D14275/r253186.
- fpstack-debuginstr-kill.ll required changing `double` to `long double`
- most others were just a question of adding OP_deref

Reviewers: aprantl
Differential Revision: http://reviews.llvm.org/D14276

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

6 years agoTurn off lldb debug tuning by default for FreeBSD
Dimitry Andric [Thu, 7 Jan 2016 22:09:12 +0000 (22:09 +0000)]
Turn off lldb debug tuning by default for FreeBSD

In rL242338, debugger tuning was introduced, and the tuning for FreeBSD
was set to lldb by default.  However, for the foreseeable future we
still need to default to gdb tuning, since lldb is not ready for all of
FreeBSD's architectures, and some system tools (like objcopy, etc) have
not yet been adapted to cope with the lldb tuned format, which has
.apple sections.

Therefore, let FreeBSD use gdb by default for now.

Reviewers: emaste, probinson

Subscribers: llvm-commits, emaste

Differential Revision: http://reviews.llvm.org/D15966

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

6 years ago[SCCP] Don't violate the lattice invariants
David Majnemer [Thu, 7 Jan 2016 21:36:16 +0000 (21:36 +0000)]
[SCCP] Don't violate the lattice invariants

We marked values which are 'undef' as constant instead of undefined
which violates SCCP's invariants.  If we can figure out that a
computation results in 'undef', leave it in the undefined state.

This fixes PR16052.

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

6 years agoWebAssembly: update expected failures, more assert got resolved.
JF Bastien [Thu, 7 Jan 2016 21:00:37 +0000 (21:00 +0000)]
WebAssembly: update expected failures, more assert got resolved.

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

6 years agoFix crash when printing instructions that have a metadata attached but no parent.
Mehdi Amini [Thu, 7 Jan 2016 20:14:30 +0000 (20:14 +0000)]
Fix crash when printing instructions that have a metadata attached but no parent.

Fix PR24852 (crash with -debug -instcombine)

Patch by Than McIntosh <thanm@google.com>

Add guards to the asm writer to prevent crashing
when dumping an instruction that has no basic

Differential Revision: http://reviews.llvm.org/D15798

From: Than McIntosh <thanm@google.com>

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

6 years agoWebAssembly: update expected failures, assert got resolved by r257084.
JF Bastien [Thu, 7 Jan 2016 20:07:21 +0000 (20:07 +0000)]
WebAssembly: update expected failures, assert got resolved by r257084.

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

6 years ago[PGO] Simplify coverage mapping lowering
Xinliang David Li [Thu, 7 Jan 2016 20:05:49 +0000 (20:05 +0000)]
[PGO] Simplify coverage mapping lowering

Coverage mapping data may reference names of functions
that are skipped by FE (e.g, unused inline functions). Since
those functions are skipped, normal instr-prof function lowering
pass won't put those names in the right section, so special
handling is needed to walk through coverage mapping structure
and recollect the references.

With this patch, only names that are skipped are processed. This
simplifies the lowering code and it no longer needs to make
assumptions coverage mapping data layout. It should also be
more efficient.

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

6 years agoRemove junk accidentally commited with r257087
David Majnemer [Thu, 7 Jan 2016 19:30:13 +0000 (19:30 +0000)]
Remove junk accidentally commited with r257087

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

6 years agoAdd test for r256912
David Majnemer [Thu, 7 Jan 2016 19:27:16 +0000 (19:27 +0000)]
Add test for r256912

I forgot to add this with the rest of r256912.

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

6 years ago[SCCP] Can't go from overdefined to constant
David Majnemer [Thu, 7 Jan 2016 19:25:39 +0000 (19:25 +0000)]
[SCCP] Can't go from overdefined to constant

The fix for PR23999 made us mark loads of null as producing the constant
undef which upsets the lattice.  Instead, keep the load as "undefined".
This fixes PR26044.

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

6 years ago[DominatorTree] Remove unnecessary map population. NFC.
Michael Liao [Thu, 7 Jan 2016 19:21:29 +0000 (19:21 +0000)]
[DominatorTree] Remove unnecessary map population. NFC.

- The reason of population these maps seems not valid any more.

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

6 years ago[WebAssembly] Support combining GEP and FrameIndex offsets in memory operand offset...
Derek Schuff [Thu, 7 Jan 2016 18:55:52 +0000 (18:55 +0000)]
[WebAssembly] Support combining GEP and FrameIndex offsets in memory operand offset field

Previously we only supported putting the FI into memory operand offset
fields if there was nothing there already. Now combine them.

Differential Revision: http://reviews.llvm.org/D15941

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

6 years ago[WebAssembly] Use the default private label prefixes.
Dan Gohman [Thu, 7 Jan 2016 18:49:53 +0000 (18:49 +0000)]
[WebAssembly] Use the default private label prefixes.

The MC assembler doesn't like using the empty string as a private label
prefix because then it treats all labels as private. This commit reverts
back to the default prefix, which is .L, which is common in ELF targets
and consistent with the LLVM name mangler.

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

6 years agoAMDGPU/SI: Fold operands with sub-registers
Nicolai Haehnle [Thu, 7 Jan 2016 17:10:29 +0000 (17:10 +0000)]
AMDGPU/SI: Fold operands with sub-registers

Multi-dword constant loads generated unnecessary moves from SGPRs into VGPRs,
increasing the code size and VGPR pressure. These moves are now folded away.

Note that this lack of operand folding was not a problem for VMEM loads,
because COPY nodes from VReg_Nnn to VGPR32 are eliminated by the register

Some tests are updated, note that the fsub.ll test explicitly checks that
the move is elided.

With the IR generated by current Mesa, the changes are obviously relatively

7063 shaders in 3531 tests
SGPRS: 351872 -> 352560 (0.20 %)
VGPRS: 199984 -> 200732 (0.37 %)
Code Size: 9876968 -> 9881112 (0.04 %) bytes
LDS: 91 -> 91 (0.00 %) blocks
Scratch: 1779712 -> 1767424 (-0.69 %) bytes per wave
Wait states: 295164 -> 295337 (0.06 %)

Totals from affected shaders:
SGPRS: 65784 -> 66472 (1.05 %)
VGPRS: 38064 -> 38812 (1.97 %)
Code Size: 1993828 -> 1997972 (0.21 %) bytes
LDS: 42 -> 42 (0.00 %) blocks
Scratch: 795648 -> 783360 (-1.54 %) bytes per wave
Wait states: 54026 -> 54199 (0.32 %)

Reviewers: tstellarAMD, arsenm, mareko

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D15875

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

6 years agoAMDGPU/SI: xnack_mask is always reserved on VI
Nicolai Haehnle [Thu, 7 Jan 2016 17:10:20 +0000 (17:10 +0000)]
AMDGPU/SI: xnack_mask is always reserved on VI

Somehow, I first interpreted the docs as saying space for xnack_mask is only
reserved when XNACK is enabled via SH_MEM_CONFIG. I felt uneasy about this and
went back to actually test what is happening, and it turns out that xnack_mask
is always reserved at least on Tonga and Carrizo, in the sense that flat_scr
is always fixed below the SGPRs that are used to implement xnack_mask, whether
or not they are actually used.

I confirmed this by writing a shader using inline assembly to tease out the
aliasing between flat_scratch and regular SGPRs. For example, on Tonga, where
we fix the number of SGPRs to 80, s[74:75] aliases flat_scratch (so
xnack_mask is s[76:77] and vcc is s[78:79]).

This patch changes both the calculation of the total number of SGPRs and the
various register reservations to account for this.

It ought to be possible to use the gap left by xnack_mask when the feature
isn't used, but this patch doesn't try to do that. (Note that the same applies
to vcc.)

Note that previously, even before my earlier change in r256794, the SGPRs that
alias to xnack_mask could end up being used as well when flat_scr was unused
and the total number of SGPRs happened to fall on the right alignment
(e.g. highest regular SGPR being used s29 and VCC used would lead to number
of SGPRs being 32, where s28 and s29 alias with xnack_mask). So if there
were some conflict due to such aliasing, we should have noticed that already.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D15898

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

6 years ago[avx512] Fix test avx512bw-intrinsics.ll
Michael Zuckerman [Thu, 7 Jan 2016 16:25:42 +0000 (16:25 +0000)]
[avx512] Fix test avx512bw-intrinsics.ll
Change the CHECK lablel into AVX512BW
And fix declare lable of llvm.x86.avx512.mask.psrav32_hi

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

6 years ago[AVX512] add PSLLW and PSLLV Intrinsic
Michael Zuckerman [Thu, 7 Jan 2016 16:02:51 +0000 (16:02 +0000)]
[AVX512] add PSLLW and PSLLV Intrinsic

Differential Revision: http://reviews.llvm.org/D15889

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

6 years agoRevert r257064. It caused failures in some sanitizer tests.
Silviu Baranga [Thu, 7 Jan 2016 15:46:43 +0000 (15:46 +0000)]
Revert r257064. It caused failures in some sanitizer tests.

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

6 years agoFix build after r257064: we should be returning false, not nullptr
Silviu Baranga [Thu, 7 Jan 2016 15:09:22 +0000 (15:09 +0000)]
Fix build after r257064: we should be returning false, not nullptr

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

6 years agoRevert r257055, it caused PR26064.
Nico Weber [Thu, 7 Jan 2016 15:01:46 +0000 (15:01 +0000)]
Revert r257055, it caused PR26064.

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

6 years ago[InstCombine] Look through PHIs, GEPs, IntToPtrs and PtrToInts to expose more constan...
Silviu Baranga [Thu, 7 Jan 2016 14:56:08 +0000 (14:56 +0000)]
[InstCombine] Look through PHIs, GEPs, IntToPtrs and PtrToInts to expose more constants when comparing GEPs

When comparing two GEP instructions which have the same base pointer
and one of them has a constant index, it is possible to only compare
indices, transforming it to a compare with a constant. This removes
one use for the GEP instruction with the constant index, can reduce
register pressure and can sometimes lead to removing the comparisson

InstCombine was already doing this when comparing two GEPs if the
base pointers were the same. However, in the case where we have
complex pointer arithmetic (GEPs applied to GEPs, PHIs of GEPs,
conversions to or from integers, etc) the value of the original
base pointer will be hidden to the optimizer and this transformation
will be disabled.

This change detects when the two sides of the comparison can be
expressed as GEPs with the same base pointer, even if they don't
appear as such in the IR. The transformation will convert all the
pointer arithmetic to arithmetic done on indices and all the
relevant uses of GEPs to GEPs with a common base pointer. The
GEP comparison will be converted to a comparison done on indices.

Reviewers: majnemer, jmolloy

Subscribers: hfinkel, jevinskie, jmolloy, aadg, llvm-commits

Differential Revision: http://reviews.llvm.org/D15146

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

6 years ago[AVX512] add PSRAV Intrinsic
Michael Zuckerman [Thu, 7 Jan 2016 14:42:20 +0000 (14:42 +0000)]
[AVX512] add PSRAV Intrinsic

Differential Revision: http://reviews.llvm.org/D15856

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

6 years agoAdded support for macro emission in dwarf (supporting DWARF version 4).
Amjad Aboud [Thu, 7 Jan 2016 14:28:20 +0000 (14:28 +0000)]
Added support for macro emission in dwarf (supporting DWARF version 4).

Differential Revision: http://reviews.llvm.org/D15495

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

6 years ago[GlobalsAA] Partially back out r248576
James Molloy [Thu, 7 Jan 2016 13:33:28 +0000 (13:33 +0000)]
[GlobalsAA] Partially back out r248576

See PR25822 for a more full summary, but we were conflating the concepts of "capture" and "escape". We were proving nocapture and using that proof to infer noescape, which is not true. Escaped-ness is a function-local property - as soon as a value is used in a call argument it escapes. Capturedness is a related but distinct property. It implies a *temporally limited* escape. Consider:

  static int a;
  int b;
  int g(int * nocapture arg);
  int f() {
    a = 2;  // Even though a escapes to g, it is not captured so can be treated as non-escaping here.
    g(&a);  // But here it must be treated as escaping.
    g(&b);  // Now that g(&a) has returned we know it was not captured so we can treat it as non-escaping again.

The original commit did not sufficiently understand this nuance and so caused PR25822 and PR26046.

r248576 included both a performance improvement (which has been backed out) and a related conformance fix (which has been kept along with its testcase).

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

6 years ago[AVX512] add PSHUFHW and PSHUFLW Intrinsic
Michael Zuckerman [Thu, 7 Jan 2016 12:35:43 +0000 (12:35 +0000)]
[AVX512] add PSHUFHW and PSHUFLW Intrinsic

Differential Revision: http://reviews.llvm.org/D15925

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

6 years ago[X86][AVX] Match broadcast loads through a bitcast
Simon Pilgrim [Thu, 7 Jan 2016 11:34:27 +0000 (11:34 +0000)]
[X86][AVX] Match broadcast loads through a bitcast

AVX1 v8i32/v4i64 shuffles are bitcasted to v8f32/v4f64, this patch peeks through bitcasts to check for a load node to allow broadcasts to occur.

Follow up to D15310

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

6 years agoAdded AVRTargetObjectFile class and AVR.h
Dylan McKay [Thu, 7 Jan 2016 10:53:15 +0000 (10:53 +0000)]
Added AVRTargetObjectFile class and AVR.h

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

6 years agoMark arm as the 32bit variant of aarch64 in Triple
Tamas Berghammer [Thu, 7 Jan 2016 10:41:12 +0000 (10:41 +0000)]
Mark arm as the 32bit variant of aarch64 in Triple

Change Triple::get32BitArchVariant to return arm/armeb as the 32bit
variant of aarch64/aarch64_be and do the same change for the oppoiste
direction in Triple::get64BitArchVariant.

Differential revision: http://reviews.llvm.org/D15529

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

6 years agoRemove extra whitespace. NFC.
Junmo Park [Thu, 7 Jan 2016 10:26:32 +0000 (10:26 +0000)]
Remove extra whitespace. NFC.

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

6 years ago[X86][SSE} Add INSERTPS as a target shuffle
Simon Pilgrim [Thu, 7 Jan 2016 10:24:19 +0000 (10:24 +0000)]
[X86][SSE} Add INSERTPS as a target shuffle

Follow up to D15378, added INSERTPS to the list of decodable target shuffles and enabled XFormVExtractWithShuffleIntoLoad to handle target shuffles with SentinelZero and tested this with INSERTPS.

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

6 years ago[AVX512] add PSHUFD Intrinsic
Michael Zuckerman [Thu, 7 Jan 2016 09:24:12 +0000 (09:24 +0000)]
[AVX512] add PSHUFD Intrinsic

Differential Revision: http://reviews.llvm.org/D15934

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

6 years agoARM: support TLS accesses on Darwin platforms
Tim Northover [Thu, 7 Jan 2016 09:03:03 +0000 (09:03 +0000)]
ARM: support TLS accesses on Darwin platforms

Darwin TLS accesses most closely resemble ELF's general-dynamic situation,
since they have to be able to handle all possible situations. The descriptors
and so on are obviously slightly different though.

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

6 years agoModernize to range-based loop
Michael Liao [Thu, 7 Jan 2016 07:58:25 +0000 (07:58 +0000)]
Modernize to range-based loop

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

6 years ago[SystemZ] Add hasSideEffects flag on Serialize instruction.
Jonas Paulsson [Thu, 7 Jan 2016 07:20:55 +0000 (07:20 +0000)]
[SystemZ] Add hasSideEffects flag on Serialize instruction.

Serialize will perform a hardware serialization operation, and is
acting as a memory barrier. Therefore it must have the hasSideEffects
flag set so it will be treated as a global memory object.

Reviewed by Ulrich Weigand

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

6 years ago[X86] Remove superfluous mayLoad flag. The pattern already implies it.
Craig Topper [Thu, 7 Jan 2016 06:42:10 +0000 (06:42 +0000)]
[X86] Remove superfluous mayLoad flag. The pattern already implies it.

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

6 years ago[X86] Had hasSideEffects=0 to VBROADCASTI128.
Craig Topper [Thu, 7 Jan 2016 06:37:55 +0000 (06:37 +0000)]
[X86] Had hasSideEffects=0 to VBROADCASTI128.

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

6 years ago[X86] Add OpSize32 to MOVSX32_NOREX instructions to match their other versions.
Craig Topper [Thu, 7 Jan 2016 06:37:52 +0000 (06:37 +0000)]
[X86] Add OpSize32 to MOVSX32_NOREX instructions to match their other versions.

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

6 years ago[X86] Add hasSideEffects=0 and mayLoad=1 to MOVZX64* instructions. While there remove...
Craig Topper [Thu, 7 Jan 2016 05:57:39 +0000 (05:57 +0000)]
[X86] Add hasSideEffects=0 and mayLoad=1 to MOVZX64* instructions. While there remove a superfluous _Q from the instruction names.

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

6 years agollvm/test/CodeGen/X86/statepoint-vector.ll REQUIRES asserts due to a debug option.
NAKAMURA Takumi [Thu, 7 Jan 2016 05:40:37 +0000 (05:40 +0000)]
llvm/test/CodeGen/X86/statepoint-vector.ll REQUIRES asserts due to a debug option.

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

6 years ago[X86] STOSQ without a rep prefix doesn't read or write RCX.
Craig Topper [Thu, 7 Jan 2016 05:18:49 +0000 (05:18 +0000)]
[X86] STOSQ without a rep prefix doesn't read or write RCX.

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

6 years agoUndo spurious change made in r256965
David Majnemer [Thu, 7 Jan 2016 04:31:35 +0000 (04:31 +0000)]
Undo spurious change made in r256965

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

6 years agoOne more attempt at stablizing a test on all platforms.
Philip Reames [Thu, 7 Jan 2016 04:20:52 +0000 (04:20 +0000)]
One more attempt at stablizing a test on all platforms.

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

6 years ago[Statepoints] Add test cases around vectors and stablize test
Philip Reames [Thu, 7 Jan 2016 04:15:31 +0000 (04:15 +0000)]
[Statepoints] Add test cases around vectors and stablize test

Unlike my comment in 257022 said, it turns out we do handle constant vectors in the statepoint lowering, but only because SelectionDAG doesn't actually produce constants for them.  Add a couple of tests which show this working.

Also, add a triple to the same test file to hopefully fix a failing bot.

It turns out we do han

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

6 years ago[AArch64 MachineCombine] Enhance/Add support for general reassociation to reduce...
Haicheng Wu [Thu, 7 Jan 2016 04:01:02 +0000 (04:01 +0000)]
[AArch64 MachineCombine] Enhance/Add support for general reassociation to reduce the critical path

Allow fadd/fmul to be reassociated in aarch64.

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

6 years ago[Statepoints] Initial support for relocating vectors of pointers
Philip Reames [Thu, 7 Jan 2016 03:32:11 +0000 (03:32 +0000)]
[Statepoints] Initial support for relocating vectors of pointers

Currently, we try to split vectors of pointers back into their component pointer elements during rewrite-statepoints-for-gc. This is less than ideal since presumably the vectorizer chose to vectorize for a reason. :) It's also been a source of bugs - in particular, the relocation logic as currently implemented was recently discovered to be wrong.

The alternate approach is to allow gc.relocates of vector-of-pointer type and update the backend to handle them. That's what this patch tries to do. This won't actually enable vector-of-pointers in practice - there are some RS4GC changes needed - but the lowering is standalone and testable so it makes sense to separate.

Note that there are some known cases around vector constants which this patch does not handle. Once this is in, I'll send another patch with individual fixes and test cases.

Differential Revision: http://reviews.llvm.org/D15632

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

6 years ago[WebAssembly] Add -m:e to the target triple.
Dan Gohman [Thu, 7 Jan 2016 03:19:23 +0000 (03:19 +0000)]
[WebAssembly] Add -m:e to the target triple.

This enables ELF-style name mangling, which primarily means using ".L" for
private symbols.

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

6 years ago[Linker] Also treat a DIImportedEntity scope DISubprogram as needed.
Ahmed Bougacha [Thu, 7 Jan 2016 03:14:59 +0000 (03:14 +0000)]
[Linker] Also treat a DIImportedEntity scope DISubprogram as needed.

Follow-up to r257000: DIImportedEntity can reach a DISubprogram via
its entity, but also via its scope. Handle the latter case as well.


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

6 years ago[RS4GC] Add an option to suppress vector splitting
Philip Reames [Thu, 7 Jan 2016 02:20:11 +0000 (02:20 +0000)]
[RS4GC] Add an option to suppress vector splitting

At the moment, this is essentially a diangostic option so that I can start collecting failing test cases, but we will eventually migrate to removing the vector splitting code entirely.

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

6 years ago[libFuzzer] add a position hint to the dictionary-based mutator
Kostya Serebryany [Thu, 7 Jan 2016 01:49:35 +0000 (01:49 +0000)]
[libFuzzer] add a position hint to the dictionary-based mutator

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

6 years ago[ShrinkWrapping] Give up on irreducible CFGs.
Quentin Colombet [Thu, 7 Jan 2016 01:23:49 +0000 (01:23 +0000)]
[ShrinkWrapping] Give up on irreducible CFGs.
We need to know whether or not a given basic block is in a loop for the analysis
to be correct.
Loop information may be incomplete on irreducible CFGs, therefore we may
generate incorrect code if we use it in those situations.

This fixes PR25988.

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

6 years agotools/llvm-config: improve shared library support
Andrew Wilkins [Thu, 7 Jan 2016 00:18:56 +0000 (00:18 +0000)]
tools/llvm-config: improve shared library support

r252532 added support for reporting the monolithic library
when LLVM_BUILD_LLVM_DYLIB is used. This would only be done
if the individual components were not found, and the dynamic
library is found.

This diff extends this as follows:
 - If LLVM_LINK_LLVM_DYLIB is set, then prefer the shared
   library, even if all component libraries exist.
 - Two flags, --link-shared and --link-static are introduced
   to provide explicit guidance. If --link-shared is passed
   and the shared library does not exist, an error results.

Additionally, changed the expected shared library names from
(e.g.) LLVM-3.8.0 to LLVM-3.8. The former exists only in an
installation (and then only in CMake builds I think?), and not
in the build tree; this breaks usage of llvm-config during
builds, e.g. by llvm-go.

Reviewers: DiamondLovesYou, beanz

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15033

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

6 years agoAlways treat DISubprogram reached by DIImportedEntity as needed.
Teresa Johnson [Thu, 7 Jan 2016 00:06:27 +0000 (00:06 +0000)]
Always treat DISubprogram reached by DIImportedEntity as needed.

It is illegal to have a null entity in a DIImportedEntity, so
we must link in a DISubprogram metadata node referenced by one,
even if the associated function is not linked in or inlined anywhere.

Fixes PR26037.

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

6 years agoFix PR26051: Memcpy optimization should introduce a call to memcpy before the store...
Mehdi Amini [Wed, 6 Jan 2016 23:50:22 +0000 (23:50 +0000)]
Fix PR26051: Memcpy optimization should introduce a call to memcpy before the store destination position

This is a conservative fix, I expect Amaury to relax this.
Follow-up for r256923

From: Mehdi Amini <mehdi.amini@apple.com>

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

6 years agorangify; NFCI
Sanjay Patel [Wed, 6 Jan 2016 23:45:05 +0000 (23:45 +0000)]
rangify; NFCI

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

6 years ago[X86] Determine if target shuffle can contain zero elements
Simon Pilgrim [Wed, 6 Jan 2016 23:24:40 +0000 (23:24 +0000)]
[X86] Determine if target shuffle can contain zero elements

getTargetShuffleMask may return shuffle masks with SM_SentinelZero (-2) values (currently just for PSHUFB but VPERM2X128 as well with this patch). Although some calling functions can make use of this (mainly for shuffle combining), others can not and their inclusion makes shuffle mask comparisons more difficult.

This patch adds a flag to getTargetShuffleMask to indicate if the calling function can't handle SM_SentinelZero; getTargetShuffleMask will then return false if it occurs to make handling much easier.

I've tidied up some uses of getTargetShuffleMask to better indicate what is going on - more could be done but at present I don't have test cases to demonstrate it.

Some upcoming patches will make use of this to both support more uses where SM_SentinelZero is not permitted (e.g. combineShuffleToAddSub), and also will allow us to add INSERTPS support to getTargetShuffleMask as part of better zero handling discussed in D14261.

Differential Revision: http://reviews.llvm.org/D15378

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

6 years ago[Bitcode] Remove superflous compatibility tests
Vedant Kumar [Wed, 6 Jan 2016 23:22:38 +0000 (23:22 +0000)]
[Bitcode] Remove superflous compatibility tests

With r256990, bogner introduced comprehensive tests for constant arrays
and vectors. We no longer need the existing ones because they are

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