Commit Graph

125967 Commits

Author SHA1 Message Date
Sanjay Patel
005a83c748 variable names start with an upper case letter; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 22:05:03 +00:00
Sanjay Patel
47436fa2d1 [DAGCombiner] don't dereference an operand that doesn't exist (PR26070)
The bug was introduced with changes for x86-64 fp128:
http://reviews.llvm.org/rL254653

I don't know why an x86 change is here, so I'll follow up in:
http://reviews.llvm.org/D15134

Should fix:
https://llvm.org/bugs/show_bug.cgi?id=26070



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 19:53:24 +00:00
Haicheng Wu
1d3fb4f736 [JumpThreading] Split select that has constant conditions coming from the PHI node
Look for PHI/Select in the same BB of the form

bb:
  %p = phi [false, %bb1], [true, %bb2], [false, %bb3], [true, %bb4], ...
  %s = select p, trueval, falseval

And expand the select into a branch structure. This later enables
jump-threading over bb in this pass.

Using the similar approach of SimplifyCFG::FoldCondBranchOnPHI(), unfold
select if the associated PHI has at least one constant.  If the unfolded
select is not jump-threaded, it will be folded again in the later
optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 19:39:39 +00:00
Matthias Braun
3bd93089a9 LiveInterval: Adapt commen to the LI->LR change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 19:25:31 +00:00
Xinliang David Li
b195813e9e Minor fix -- use the right version enum/NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 19:21:32 +00:00
Tim Shen
d6cee943e5 Test commit access - add a blank line in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 19:20:23 +00:00
Justin Bogner
fbbc16fa87 LoopInfo: Simplify ownership of Loop objects
It's strange that LoopInfo mostly owns the Loop objects, but that it
defers deleting them to the loop pass manager. Instead, change the
oddly named "updateUnloop" to "markAsRemoved" and have it queue the
Loop object for deletion. We can't delete the Loop immediately when we
remove it, since we need its pointer identity still, so we'll mark the
object as "invalid" so that clients can see what's going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 19:08:53 +00:00
Weiming Zhao
432ca7460b RBIT Instruction only available for ARMv6t2 and above.
Summary:
r255334 matches bit-reverse pattern in InstCombine and generates calls to Instrinsic::bitreverse.

RBIT instruction is only available for ARMv6t2 and above. This patch has the intrinsic expanded during legalization for ARMv4 and ARMv5.

Patch by Z. Zheng <zhaoshiz@codeaurora.org>

Reviewers: apazos, jmolloy, weimingz

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257188 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 18:43:41 +00:00
Weiming Zhao
ad748b70b5 Disable shrink-wrap for Thumb1
Summary: In ARMConstantIslandPass, which runs after Shrink Wrap pass, long jumps will be fixed up as BL (tBfar) which depends on spilling LR in epilogue.  However, shrink-wrap may remove the LR, which causes issues when the function returns.

Reviewers: qcolombet, rengolin

Subscribers: aemerson, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 18:37:43 +00:00
Easwaran Raman
da92e11909 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
2016-01-08 18:23:17 +00:00
Pirama Arumuga Nainar
0de8d7820f Do not ASSERTZEXT for i16 result of bitcast from f16 operand
Summary:
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
lengths.

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
2016-01-08 17:46:05 +00:00
David Majnemer
dc706797f9 [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
2016-01-08 17:24:47 +00:00
Teresa Johnson
44f8ddb3bb [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
2016-01-08 17:06:29 +00:00
Paul Robinson
604ad96a35 How to close a review manually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 17:05:12 +00:00
Teresa Johnson
73ef481b52 [ThinLTO] Enable in-place symbol changes for exporting module
Summary:
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
compilation.

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
2016-01-08 15:00:00 +00:00
Tom Stellard
d7ef3dae86 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
2016-01-08 14:50:28 +00:00
Tom Stellard
54fa7b1f76 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
2016-01-08 14:50:23 +00:00
Teresa Johnson
1b3af3b517 [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
2016-01-08 14:17:41 +00:00
Nemanja Ivanovic
2a613d664f Prevent renaming of CR fields in AADB when a CR restore is present
This patch corresponds to review:
http://reviews.llvm.org/D15930

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
2016-01-08 13:09:54 +00:00
NAKAMURA Takumi
b999767c2e 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
2016-01-08 12:50:03 +00:00
Silviu Baranga
2bb04c9abe 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

Summary:
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
entirely.

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
2016-01-08 11:11:04 +00:00
Chandler Carruth
e96fb9ab15 [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
graph.

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
SCCs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 10:55:52 +00:00
Chandler Carruth
84a9919b57 [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
2016-01-08 10:50:11 +00:00
David Majnemer
204e31b7ab [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
miscompile/assert.

This fixes PR26069.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 08:03:55 +00:00
NAKAMURA Takumi
7203e500c0 InstrProfTest.cpp: Fix a warning. [-Wsign-compare]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 07:58:20 +00:00
Craig Topper
616141238d [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
2016-01-08 07:06:32 +00:00
Craig Topper
d028f0c94b [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
2016-01-08 07:06:29 +00:00
Xinliang David Li
5dcdd411ac Add value site truncation unit test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 06:54:27 +00:00
Dylan McKay
9baf25537d [AVR] Added AVRSelectionDAGInfo header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 06:32:27 +00:00
Craig Topper
5c6c8e2bb9 [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
2016-01-08 06:09:20 +00:00
Craig Topper
bf82c317d8 [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
2016-01-08 06:09:18 +00:00
Craig Topper
d7a8d29a31 [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
2016-01-08 06:09:13 +00:00
Xinliang David Li
36838feb74 [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
2016-01-08 05:45:21 +00:00
Junmo Park
a94cb08fda Remove extra whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 04:20:32 +00:00
Xinliang David Li
4f87d1237a [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
2016-01-08 03:49:59 +00:00
Mehdi Amini
3569d3c5eb 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
2016-01-08 02:28:20 +00:00
Kyle Butt
e51b530b12 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
2016-01-08 02:06:19 +00:00
Kyle Butt
505bc50701 [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
2016-01-08 01:55:13 +00:00
Sanjay Patel
810605370d [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:
https://llvm.org/bugs/show_bug.cgi?id=25999



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257133 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 01:39:16 +00:00
Dan Gohman
ad86ed61f2 [WebAssembly] Minor code cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 01:18:00 +00:00
Matthias Braun
aaf3afccff 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
2016-01-08 01:16:39 +00:00
Matthias Braun
dcaeedf3f4 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
2016-01-08 01:16:35 +00:00
Dan Gohman
2c2e12150f [WebAssembly] Minor code cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 01:06:00 +00:00
Dan Gohman
1087a1818f [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
2016-01-08 00:50:33 +00:00
Dan Gohman
0b9379b950 [WebAssembly] Remove unused arguments, unused functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257125 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 00:43:54 +00:00
Xinliang David Li
8105d80b25 [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
2016-01-08 00:38:53 +00:00
Eric Christopher
d0fdbdba37 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
2016-01-08 00:34:44 +00:00
Mike Aizatsky
ba07fc7f19 [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
2016-01-07 23:57:41 +00:00
Alexey Samsonov
a1505f1072 [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
2016-01-07 23:38:45 +00:00
Aditya Nandakumar
3d7142aab4 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
2016-01-07 23:22:55 +00:00