Commit Graph

120084 Commits

Author SHA1 Message Date
Jingyue Wu
cab4b8c41b [NaryReassociate] remove redundant code
This check is already done by findClosestMatchingDominator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243065 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 23:13:37 +00:00
Alex Lorenz
832202c797 MIR Serialization: Serialize the '.cfi_offset' CFI instruction.
Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243062 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 23:09:07 +00:00
JF Bastien
4cd3b05c67 WebAssembly: test that valid -mcpu flags are accepted.
Summary: AArch64 has a similar test.

Subscribers: sunfish, aemerson, llvm-commits, jfb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243058 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 23:00:04 +00:00
Sanjay Patel
c3bac701a5 fix crash in machine trace metrics due to processing dbg_value instructions (PR24199)
The test in PR24199 ( https://llvm.org/bugs/show_bug.cgi?id=24199 ) crashes because machine
trace metrics was not ignoring dbg_value instructions when calculating data dependencies.

The machine-combiner pass asks machine trace metrics to calculate an instruction trace, 
does some reassociations, and calls MachineInstr::eraseFromParentAndMarkDBGValuesForRemoval()
along with MachineTraceMetrics::invalidate(). The dbg_value instructions have their operands
invalidated, but the instructions are not expected to be deleted.

On a subsequent loop iteration of the machine-combiner pass, machine trace metrics would be
called again and die while accessing the invalid debug instructions.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243057 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 22:56:53 +00:00
Philip Reames
e2d5247dee [RewriteStatepointsForGC] Rename PhiState to reflect that it's associated w/more than just PHIs
Today, Select instructions also have associated PhiStates.  In the near future, so will ExtractElement and SuffleVector.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243056 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 22:49:14 +00:00
Philip Reames
173e222715 [RewriteStatepointsForGC] Use idomatic mechanisms for debug tracing [NFC]
Deleting much of the code using trace-rewrite-statepoints and use idiomatic DEBUG statements instead.  This includes adding operator<< to a helper class.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243054 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 22:25:26 +00:00
David Gross
99d1c88279 [ARM] Register (existing) ARMLoadStoreOpt pass with LLVM pass manager.
Summary: Among other things, this allows -print-after-all/-print-before-all to dump IR around this pass.

Subscribers: aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243052 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 22:12:46 +00:00
Colin LeMahieu
5fb71b264d Moving tests in to X86 directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243049 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 21:55:26 +00:00
David Gross
e8f876d972 Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243046 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 21:46:09 +00:00
Philip Reames
6c5bfdf124 [RewriteStatepointsForGC] Simplify code around meet of PhiStates [NFC]
We don't need to pass in the map from BDV to PhiStates; we can instead handle that externally and let the MeetPhiStates helper class just meet PhiStates.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243045 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 21:41:27 +00:00
Colin LeMahieu
8782d64e37 Using an input object file instead of trying to generate an object file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243044 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 21:40:19 +00:00
Colin LeMahieu
a5c7608532 Specifying a test triple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243042 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 21:24:52 +00:00
Colin LeMahieu
ea8050283f [llvm-objdump] Add -D and --disassemble-all flags that attempt disassembly on all sections instead of just text sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243041 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 20:58:49 +00:00
Matt Wala
106d75d396 [Scalarizer] Fix potential for stale data in Scattered across invocations
Summary:
Scalarizer has two data structures that hold information about changes
to the function, Gathered and Scattered. These are cleared in finish()
at the end of runOnFunction() if finish() detects any changes to the
function.

However, finish() was checking for changes by only checking if
Gathered was non-empty. The function visitStore() only modifies
Scattered without touching Gathered. As a result, Scattered could have
ended up having stale data if Scalarizer only scalarized store
instructions. Since the data in Scattered is used during the execution
of the pass, this introduced dangling pointer errors.

The fix is to check whether both Scattered and Gathered are empty
before deciding what to do in finish(). This also fixes a problem
where the Function can be modified although the pass returns false.

Reviewers: rnk

Subscribers: rnk, srhines, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243040 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 20:53:46 +00:00
Duncan P. N. Exon Smith
31c063d405 X86: Use dyn_cast instead of isa+cast, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243034 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 19:27:07 +00:00
Weiming Zhao
8d5c72d513 This patch eanble register coalescing to coalesce the following:
%vreg2<def> = MOVi32imm 1; GPR32:%vreg2
  %W1<def> = COPY %vreg2; GPR32:%vreg2
into:
  %W1<def> = MOVi32imm 1
Patched by Lawrence Hu (lawrence@codeaurora.org)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243033 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 19:24:53 +00:00
Kostya Serebryany
6cbc095f13 [libFuzzer] dump long running units to disk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243031 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 18:37:22 +00:00
Igor Laevsky
899ad49863 NFC. Explicitly specify attributes in BasicAA/cs-cs.ll test.
This will simplify verifying correctness for a changes which modify attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243016 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 14:31:18 +00:00
Rafael Espindola
826e95913b Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243015 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 13:42:16 +00:00
Rafael Espindola
52f969b029 Use helper function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 12:51:44 +00:00
Rafael Espindola
a7616cd14c Add a version of getSymbol with an explicit symbol table. Use it. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243011 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 12:49:40 +00:00
Michael Kuperstein
e31d7f83c5 [X86] Allow load folding into PUSH instructions
Adds pushes to the folding tables.
This also required a fix to the TD definition, since the memory forms of 
the push instructions did not have the right mayLoad/mayStore flags.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243010 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 12:23:45 +00:00
Asaf Badouh
7463ffc5f1 [x86] change FP scalar builtin naming convention
Differential Revision: http://reviews.llvm.org/D11454

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243008 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 12:10:51 +00:00
Kuba Brecka
00a917ca7c [asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead of abusing '__asan_init'
We currently version `__asan_init` and when the ABI version doesn't match, the linker gives a `undefined reference to '__asan_init_v5'` message. From this, it might not be obvious that it's actually a version mismatch error. This patch makes the error message much clearer by changing the name of the undefined symbol to be `__asan_version_mismatch_check_xxx` (followed by the version string). We obviously don't want the initializer to be named like that, so it's a separate symbol that is used only for the purpose of version checking.

Reviewed at http://reviews.llvm.org/D11004



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 10:54:06 +00:00
Michael Kuperstein
dedb07fcbe [X86] Fix order of operands for ins and outs instructions when parsing intel syntax
Patch by: marina.yatsina@intel.com
Differential Revision: http://reviews.llvm.org/D11337

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 10:23:48 +00:00
Chandler Carruth
8de7149b0d [GMR] Add a late run of GlobalsModRef to the main pass pipeline behind
the general GMR-in-non-LTO flag.

Without this, we have the global information during the CGSCC pipeline
for GVN and such, but don't have it available during the late loop
optimizations such as the vectorizer. Moreover, after the CGSCC pipeline
has finished we have substantially more accurate and refined call graph
information, function annotations, etc, which will make GMR even more
powerful than it is early in the pipelien.

Note that we have to play silly games with preserving AliasAnalysis
(which is now trivially preserved) in order to let a module analysis
magically be preserved into the entire function pass pipeline.
Simultaneously we have to not make GMR an immutable pass in order to be
able to re-run it and collect fresh data on the final call graph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 09:34:01 +00:00
Rafael Espindola
2b11aef2f4 Support printing relocations in files with no section table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242998 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 09:11:05 +00:00
Rafael Espindola
7528c1963f Use typdef to simplify the code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242995 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 08:48:14 +00:00
Elena Demikhovsky
fb09d25df5 X86: Fixed assertion failure in 32-bit mode
The DAG Node "SCALAR_TO_VECTOR" may be created if the type of the scalar element is legal.
Added a check for the scalar type before creating this node.
Added a test that fails with assertion on the current version.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242994 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 08:25:23 +00:00
Yaron Keren
fe6b5aa191 Avoid using -Wl,-z,defs on Cygwin.
Prior to CMAKE 2.8.4 that was covered by the WIN32 conditional but
from 2.8.4 CMAKE no longer defined WIN32 when running under Cygwin
and it needs its own test.

Patch by Martell Malone!

http://reviews.llvm.org/D11347



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242993 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 08:06:12 +00:00
Chandler Carruth
0451957993 Revert r242990: "AVX-512: Implemented encoding , DAG lowering and ..."
This commit broke the build. Numerous build bots broken, and it was
blocking my progress so reverting.

It should be trivial to reproduce -- enable the BPF backend and it
should fail when running llvm-tblgen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242992 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 08:03:44 +00:00
Chandler Carruth
caabac7978 [GMR] Switch the function info we store for every function to be a much
more dense datastructure. We actually only have 3 bits of information
and an often-null pointer here. This fits very nicely into a
pointer-size value in the DenseMap from Function -> Info. Then we take
one more pointer hop to get to a secondary DenseMap from GlobalValue ->
ModRefInfo when we actually have precise info for particular globals.

This is more code than I would really like to do this packing, but it
ended up reasonably cleanly laid out. It should ensure we don't hit
scaling limitations with more widespread use of GMR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242991 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 07:50:52 +00:00
Igor Breger
cb8fe113a3 AVX-512: Implemented encoding , DAG lowering and intrinsics for Integer Truncate with/without saturation
Added tests for DAG lowering ,encoding and intrinsic

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242990 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 07:39:21 +00:00
Craig Topper
25544b1bce [ScalarEvolution] Change addRequired to addRequiredTransitive on two passes where ScalarEvolution stores long lived raw pointers to objects those passes own.
This prevents the pointers from dangling when those passes are freed.

http://reviews.llvm.org/D11236
Patch by Steve King.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242989 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 07:33:48 +00:00
Craig Topper
8f87a9998e Replace a 0 with nullptr. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242988 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 07:17:53 +00:00
Igor Breger
5ec4b5ac8a AVX : Fix ISA disabling in case AVX512VL , some instructions should be disabled only if AVX512BW and AVX512VL present.
Tests added.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242987 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 07:11:14 +00:00
Yaron Keren
c9cbb9371f Remove unnecessary in C++11 c_str() calls
While theoratically required in pre-C++11 to avoid re-allocation upon call,
C++11 guarantees that c_str() returns a pointer to the internal array so
pre-calling c_str() is no longer required.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242983 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 05:49:29 +00:00
Jingyue Wu
eb653bd9d1 [NVPTX] run LSR before straight-line optimizations
Summary:
Straight-line optimizations can simplify the loop body and make LSR's
cost analysis more precise. This significantly improves several Eigen3
CUDA benchmarks.

With this change, EigenContractionKernel runs up to 40% faster
(753ceee5f2/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h (cl-502)).
EigenConvolutionKernel2D runs up to 10% faster
(753ceee5f2/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h (cl-605)).

I have some difficulties writing small tests that benefit from this
reordering due to a seemingly issue with LSR (being discussed at
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-July/088244.html).

See the review thread for the compilation time impact of GVN. 

Reviewers: eliben, jholewinski

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242982 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 04:59:07 +00:00
Rafael Espindola
a95022a4f3 Refactor duplicated code and check for invalid symbol table size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242981 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 03:24:22 +00:00
Chandler Carruth
603a9adf39 [GMR] Further improve the FunctionInfo API inside of GlobalsModRef, NFC.
This takes the operation of merging a callee's information into the
current information and embeds it into the FunctionInfo type itself.
This is much cleaner as now we don't need to expose iteration of the
globals, etc.

Also, switched all the uses of a raw integer two maintain the mod/ref
info during the SCC walk into just directly manipulating it in the
FunctionInfo object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242976 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 00:12:32 +00:00
Chandler Carruth
d9a7d837de [GMR] Wrap all of the per-function information behind a more strongly
typed interface as a precursor to rewriting how it is stored.

This way we know that the access paths are controlled and it should be
easy to store these bits in a different way.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242974 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 23:56:31 +00:00
Frederic Riss
00d14ddf9d [dsymutil] Check archive members timestamps.
The debug map contains the timestamp of the object files in references.
We do not check these in the general case, but it's really useful if
you have archives where different versions of an object file have been
appended. This allows llvm-dsymutil to find the right one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242965 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 23:24:00 +00:00
Chandler Carruth
e2b5bcf781 [PM/AA] Cleanup comments, formatting, and organization of the AA
interface prior to making more substantial and invasive changes.

No functionality changed, and should hopefully keep subsequent patches
as clean and focused as possible in addition to making the comments and
such more clear.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242964 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 23:16:02 +00:00
Chandler Carruth
52ab0bc417 [PM/AA] Extract the ModRef enums from the AliasAnalysis class in
preparation for de-coupling the AA implementations.

In order to do this, they had to become fake-scoped using the
traditional LLVM pattern of a leading initialism. These can't be actual
scoped enumerations because they're bitfields and thus inherently we use
them as integers.

I've also renamed the behavior enums that are specific to reasoning
about the mod/ref behavior of functions when called. This makes it more
clear that they have a very narrow domain of applicability.

I think there is a significantly cleaner API for all of this, but
I don't want to try to do really substantive changes for now, I just
want to refactor the things away from analysis groups so I'm preserving
the exact original design and just cleaning up the names, style, and
lifting out of the class.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242963 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 23:15:57 +00:00
Chandler Carruth
90b20e96a1 [GMR] Continue my quest to remove linked datastructures from GMR, NFC.
This replaces the next-to-last std::map with a DenseMap. While DenseMap
doesn't yet make tons of sense (there are 32 bytes or so in the value
type), my next change will reduce the value type to a single pointer --
we only need a pointer and 3 bits, and that is exactly what we can have.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242956 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 22:32:34 +00:00
David Majnemer
1b072f2beb [ConstantFolding] Support folding loads from a GlobalAlias
The MSVC ABI requires that we generate an alias for the vtable which
means looking through a GlobalAlias which cannot be overridden improves
our ability to devirtualize.

Found while investigating PR20801.

Patch by Andrew Zhogin!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242955 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 22:29:30 +00:00
Anthony Pesch
186b8ca6dc Revert "Improve merging of stores from static constructors in GlobalOpt"
This reverts commit 0a9dee959a30b81b9e7df64c9a58ff9898c24024.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242954 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 22:26:54 +00:00
Anthony Pesch
63abd4b150 Revert "IPO: Avoid brace initialization of a map, some versions of libc++ don't like it"
This reverts commit fc2dad0c68f8d32273d3c2d790ed496961f829af.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242953 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 22:26:52 +00:00
Chandler Carruth
30b2dba663 [GMR] Make the collection of readers and writers of globals much more
efficient, NFC.

Previously, we built up vectors of function pointers to track readers
and writers. The primary problem here is that we would add the same
function to this vector every time we found an instruction that reads or
writes to the pointer. This could be a *lot* of redudant function
pointers. Instead of doing that, we can use a SmallPtrSet.

This does more than just reduce the size of the list of readers or
writers. We walk the entire lists of each and do a map lookup for each
one. By having sets, we will only do one map lookup per reader or writer
function.

But only one user of the pointer analyzer actually needs this
information, so we can also skip accumulating it (and doing a lot of
heap allocations) for all the other pointer analysis. This is
particularly useful because there are very many more pointers in some of
the other cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242950 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 22:10:05 +00:00
Rafael Espindola
3b12bb79e8 Force the gnu archive format to fix the test on darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242949 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 22:09:44 +00:00