135964 Commits

Author SHA1 Message Date
Krzysztof Parzyszek
18fcd7fd21 [Hexagon] Insert CFI instructions before throwing calls
Normally, CFI instructions should be inserted after allocframe, but
if allocframe is in the same packet with a call, the CFI instructions
should be inserted before that packet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 19:13:46 +00:00
Zachary Turner
0c7a213a73 [pdb] Refactor library to more clearly separate reading/writing
Reviewed By: amccarth, ruiu
Differential Revision: https://reviews.llvm.org/D22693

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 19:12:28 +00:00
Zachary Turner
0c78d1d159 Get rid of IMsfStreamData class.
This was a pure virtual base class whose purpose was to abstract
away the notion of how you retrieve the layout of a discontiguous
stream of blocks in an Msf file.  This led to too many layers of
abstraction making it difficult to figure out what was going on
and extend things.  Ultimately, a stream's layout is decided by
its length and the array of block numbers that it lives on.  So
rather than have an abstract base class which can return this in
any number of ways, it's more straightforward to simply store them
as fields of a trivial struct, and also to give a more appropriate
name.

This patch does that.  It renames IMsfStreamData to MsfStreamLayout,
and deletes the 2 concrete implementations, DirectoryStreamData
and IndexedStreamData.  MsfStreamLayout is a trivial struct
with the necessary data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 19:11:09 +00:00
Matthias Braun
f79c57a412 MachineFunction: Return reference for getFrameInfo(); NFC
getFrameInfo() never returns nullptr so we should use a reference
instead of a pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 18:40:00 +00:00
Reid Kleckner
c39e246447 Fix dangling reference to temporary in use of ArrayRef
Fixes tests locally for me with MSVC 2015.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 18:17:01 +00:00
John Brawn
a0fb2b6393 Revert r276973 "Adjust Registry interface to not require plugins to export a registry"
Buildbot failures when building with clang -Werror. Reverting while I try to
figure this out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 17:17:22 +00:00
Ahmed Bougacha
e2c6755e74 [AArch64][GlobalISel] Select G_BR.
This is the first unsized instruction we support; move down the
'sized' check to binops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 17:15:15 +00:00
Ahmed Bougacha
e4fd36eb91 [MIRParser] Accept unsized generic instructions.
Since r276158, we require generic instructions to have a sized type.
G_BR doesn't; relax the restriction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277006 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 17:15:12 +00:00
Ahmed Bougacha
70d652907a [AArch64][GlobalISel] Select GPR G_SUB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 16:58:35 +00:00
Ahmed Bougacha
8686febe9e [AArch64][GlobalISel] Select GPR G_AND.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 16:58:31 +00:00
Ahmed Bougacha
e27b94c59f [GlobalISel] Remove types on selected insts instead of using LLT().
LLT() has a particular meaning: it's one invalid type. But we really
want selected instructions to have no type whatsoever.

Also verify that types don't linger after ISel, and enable the verifier
on the AArch64 select test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277001 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 16:58:27 +00:00
Ahmed Bougacha
d59b26e1ea [AArch64][GlobalISel] Remove 'alignment' from MIR tests. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 16:58:21 +00:00
Wei Ding
ee8c4ca1e1 AMDGPU : Add intrinsics for compare with the full wavefront result
Differential Revision: http://reviews.llvm.org/D22482

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276998 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 16:42:13 +00:00
Sjoerd Meijer
7b78e6e140 TargetInstrInfo: rename GetInstSizeInBytes to getInstSizeInBytes. NFC
Differential Revision: https://reviews.llvm.org/D22925


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276997 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 16:32:22 +00:00
Daniel Sanders
b27edd5bc8 [mips] Fix a warning that occurs on some gcc 4.9.2's but not all of them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276993 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 15:59:06 +00:00
Daniel Sanders
d1a7ed8d38 Revert r276982 and r276984: [mips][fastisel] Handle 0-4 arguments without SelectionDAG
It seems that the stack offset in callabi.ll varies between machines. I'll look
into it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 15:37:42 +00:00
Craig Topper
1314c16889 [X86] Remove CustomInserter for FMA3 instructions. Looks like since we got full commuting support for FMAs after this was added, the coalescer can now get this right on its own.
Differential Revision: https://reviews.llvm.org/D22799

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 15:28:56 +00:00
Daniel Sanders
e49e3346c0 [mips] Reword debug message as should have been done before committing r276982
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276984 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 15:13:23 +00:00
Daniel Sanders
5604769b28 [mips][fastisel] Handle 0-4 arguments without SelectionDAG.
Summary:
Implements fastLowerArguments() to avoid the need to fall back on
SelectionDAG for 0-4 argument functions that don't do tricky things like
passing double in a pair of i32's.

This allows us to move all except one test to -fast-isel-abort=3. The
remaining one has function prototypes of the form 'i32 (i32, double, double)'
which requires floats to be passed in GPR's.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276982 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 14:55:28 +00:00
Tom Stellard
04cc0adf58 AMDGPU/SI: Don't use reserved VGPRs for SGPR spilling
Summary:
We were using reserved VGPRs for SGPR spilling and this was causing
some programs with a workgroup size of 1024 to use more than 64
registers, which is illegal.

Reviewers: arsenm, mareko, nhaehnle

Subscribers: nhaehnle, arsenm, llvm-commits, kzhuravl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 14:30:43 +00:00
Simon Pilgrim
0e9859b9a8 Removed unused variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 13:42:57 +00:00
Simon Pilgrim
3fa868ef6d Fix signed/unsigned warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 13:29:56 +00:00
John Brawn
b1bee514fd Reapply r276856 "Adjust Registry interface to not require plugins to export a registry"
This version has two fixes compared to the original:
 * In Registry.h the template static members are instantiated before they are
   used, as clang gives an error if you do it the other way around.
 * The use of the Registry template in clang-tidy is updated in the same way as
   has been done everywhere else.

Original commit message:

Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.

This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 12:48:17 +00:00
Nicolai Haehnle
b18ca96c79 AMDGPU: add execfix flag to SI_ELSE
Summary:
SI_ELSE is lowered into two parts:

s_or_saveexec_b64 dst, src (at the start of the basic block)

s_xor_b64 exec, exec, dst (at the end of the basic block)

The idea is that dst contains the exec mask of the preceding IF block. It can
happen that SIWholeQuadMode decides to switch from WQM to Exact mode inside
the basic block that contains SI_ELSE, in which case it introduces an instruction

s_and_b64 exec, exec, s[...]

which masks out bits that can correspond to both the IF and the ELSE paths.
So the resulting sequence must be:

s_or_savexec_b64 dst, src

s_and_b64 exec, exec, s[...] <-- added by SIWholeQuadMode
s_and_b64 dst, dst, exec <-- added by SILowerControlFlow

s_xor_b64 exec, exec, dst

Whether to add the additional s_and_b64 dst, dst, exec is currently determined
via the ExecModified tracking. With this change, it is instead determined by
an additional flag on SI_ELSE which is set by SIWholeQuadMode.

Finally: It also occured to me that an alternative approach for the long run
is for SILowerControlFlow to unconditionally emit

s_or_saveexec_b64 dst, src

...

s_and_b64 dst, dst, exec
s_xor_b64 exec, exec, dst

and have a pass that detects and cleans up the "redundant AND with exec"
pattern where possible. This could be useful anyway, because we also add
instructions

s_and_b64 vcc, exec, vcc

before s_cbranch_scc (in moveToALU), and those are often redundant. I have
some pending changes to how KILL is lowered that could also benefit from
such a cleanup pass.

In any case, this current patch could help in the short term with the whole
ExecModified business.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, llvm-commits, kzhuravl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 11:39:24 +00:00
Vassil Vassilev
2b43353cb2 [modules] Add missing includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 10:26:33 +00:00
Daniel Jasper
edcbf6e2da Remove two tests added in r276957.
These loop from 0 to AEK_XSCALE, which is currently defined as 0x80000000, and
thus the tests loop over the entire int range, which is unreasonable
and also too slow in debug builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276969 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 09:54:35 +00:00
Sylvestre Ledru
0bab80e0f5 fix some typos in the doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 09:28:58 +00:00
Zijiao Ma
35df7fdf94 R276957 broke bot clang-ppc64be-linux-multistage,try to fix it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276966 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 07:29:45 +00:00
David Majnemer
fd8b386557 [ConstantFolding] Don't bail on folding if ConstantFoldConstantExpression fails
When folding an expression, we run ConstantFoldConstantExpression on
each operand of that expression.
However, ConstantFoldConstantExpression can fail and retur nullptr.

Previously, we would bail on further refining the expression.
Instead, use the original operand and see if we can refine a later
operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 06:39:48 +00:00
Zijiao Ma
b87ab2ee22 Add unittests to {ARM | AArch64}TargetParser.
Add unittest to {ARM | AArch64}TargetParser,and by the way correct problems as below:
1.Correct a incorrect indexing problem in AArch64TargetParser. The architecture enumeration
 is shared across ARM and AArch64 in original implementation.But In the code,I just used the
 index which was offset by the ARM, and this would index into the array incorrectly. To make
 AArch64 has its own arch enum,or we will do a lot of slowly iterating.
2.Correct a spelling error. The parameter of llvm::AArch64::getArchExtName.
3.Correct a writing mistake, in llvm::ARM::parseArchISA.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 06:11:18 +00:00
David Majnemer
556fadaada [CodeView] Don't crash on functions without subprograms
A function may have instructions annotated with debug info without
having a subprogram.

This fixes PR28747.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 05:03:22 +00:00
David Majnemer
22e3ed1aa0 Add EP_CGSCCOptimizerLate extension point to PassManagerBuilder
The EP_CGSCCOptimizerLate extension point allows adding CallGraphSCC
passes at the end of the main CallGraphSCC passes and before any
function simplification passes run by CGPassManager.

Patch by Gor Nishanov!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 03:28:43 +00:00
David Majnemer
20c394c170 [InstCombine] Handle failures from ConstantFoldConstantExpression
ConstantFoldConstantExpression returns null when folding fails.

This fixes PR28745.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 02:29:06 +00:00
Matt Arsenault
96ddf547a5 AMDGPU: Turn dead checks into asserts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276946 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 00:32:05 +00:00
Matt Arsenault
b5a809e37c AMDGPU: Remove analyzeImmediate
This no longer uses the more complicated classification
of constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 00:32:02 +00:00
Wei Mi
8d876fcdcd Fix the assertion error in collectLoopUniforms caused by empty Worklist before expanding.
Contributed-by: David Callahan

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 23:53:58 +00:00
Justin Lebar
6d9563a0bc Don't invoke getName() from Function::isIntrinsic().
Summary:
getName() involves a hashtable lookup, so is expensive given how
frequently isIntrinsic() is called.  (In particular, many users cast to
IntrinsicInstr or one of its subclasses before calling
getIntrinsicID().)

This has an incidental functional change: Before, isIntrinsic() would
return true for any function whose name started with "llvm.", even if it
wasn't properly an intrinsic.  The new behavior seems more correct to
me, because it's strange to say that isIntrinsic() is true, but
getIntrinsicId() returns "not an intrinsic".

Some callers want the old behavior -- they want to know whether the
caller is a recognized intrinsic, or might be one in some other version
of LLVM.  For them, we added Function::hasLLVMReservedName(), which
checks whether the name starts with "llvm.".

This change is good for a 1.5% e2e speedup compiling a large Eigen
benchmark.

Reviewers: bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 23:46:57 +00:00
Michael Zolotukhin
79e7020865 Add verifyAnalysis for LCSSA.
Summary:
LCSSAWrapperPass currently doesn't override verifyAnalysis method, so pass
manager doesn't verify LCSSA. This patch adds the method so that we start
verifying LCSSA between loop passes.

Reviewers: chandlerc, sanjoy, hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276941 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 23:35:53 +00:00
George Burgess IV
aa6ca74bfc [CFLAA] Add getModRefBehavior to CFLAnders.
This patch lets CFLAnders respond to mod-ref queries. It also includes
a small bugfix to CFLSteens.

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 23:07:07 +00:00
Justin Lebar
741862c996 [LSV] Use Instruction*s rather than Value*s where possible.
Summary:
Given the crash in D22878, this patch converts the load/store vectorizer
to use explicit Instruction*s wherever possible.  This is an overall
simplification and should be an improvement in safety, as we have fewer
naked cast<>s, and now where we use Value*, we really mean something
different from Instruction*.

This patch also gets rid of some cast<>s around Value*s returned by
Builder.  Given that Builder constant-folds everything, we can't assume
much about what we get out of it.

One downside of this patch is that we have to copy our chain before
calling propagateMetadata.  But I don't think this is a big deal, as our
chains are very small (usually 2 or 4 elems).

Reviewers: asbirlea

Subscribers: mzolotukhin, llvm-commits, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 23:06:00 +00:00
Justin Lebar
b3f897d0e3 [LVI] Use DenseMap::find_as in LazyValueInfo.
Summary:
This lets us avoid creating and destroying a CallbackVH every time we
check the cache.

This is good for a 2% e2e speedup when compiling one of the large Eigen
tests at -O3.

FTR, I tried making the ValueCache hashtable one-level -- i.e., mapping
a pair (Value*, BasicBlock*) to a lattice value, and that didn't seem to
provide any additional improvement.  Saving a word in LVILatticeVal by
merging the Tag and Val fields also didn't yield a speedup.

Reviewers: reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 22:33:36 +00:00
Vedant Kumar
e201775db6 [llvm-cov] Add a debug mode for source range highlighting (in html)
llvm-cov's `-dump' option now emits information which helps debug source
range highlighting in html mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 21:57:15 +00:00
Justin Lebar
d4f04da5fe [LSV] Don't assume that bitcast ops are Instructions.
Summary:
When we ask the builder to create a bitcast on a constant, we get back a
constant, not an instruction.

Reviewers: asbirlea

Subscribers: jholewinski, mzolotukhin, llvm-commits, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 21:45:48 +00:00
Krzysztof Parzyszek
ca740c1356 [Hexagon] Find speculative loop preheader in hardware loop generation
Before adding a new preheader block, check if there is a candidate block
where the loop setup could be placed speculatively. This will be off by
default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 21:20:54 +00:00
Michael Kuperstein
3e611f85b8 [X86] Factor out another piece of the SAD combine. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 20:59:51 +00:00
Krzysztof Parzyszek
47fb8653da [Hexagon] Add option to bisect spill slot optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 20:58:43 +00:00
Krzysztof Parzyszek
6d5ee09dd7 [Hexagon] Do not optimize volatile stack spill slots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 20:50:42 +00:00
Hans Wennborg
da34deb1c6 build_llvm_package.bat: try tests three times
Sometimes they're flaky on Windows, and starting the whole thing
over is painful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 20:38:01 +00:00
Matt Masten
549ec0895e test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 20:22:21 +00:00
Kyle Butt
efe4c058da Codegen: IfConversion: Factor out a function to count dup instrs.
Factor out countDuplicatedInstructions to Count duplicated instructions at the
beginning and end of a diamond pattern. This is in prep for adding support for
diamonds that need to be tail-merged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 20:19:33 +00:00