Commit Graph

115194 Commits

Author SHA1 Message Date
Colin LeMahieu
f41bfa16eb [Hexagon] Adding DuplexInst instruction format and duplex class defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231828 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 19:53:14 +00:00
Kit Barton
1f9ea3a230 Change the generation of the vmuluwm instruction to be based on the MUL opcode.
Phabricator review: http://reviews.llvm.org/D8185


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231827 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 19:49:38 +00:00
Sanjay Patel
a99cd39362 remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231826 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 19:42:57 +00:00
Colin LeMahieu
c183848463 [Hexagon] Adding nodes for vector insert/extract lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231825 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 19:40:03 +00:00
Colin LeMahieu
b2a2499a9e [Hexagon] Renaming HexagonJT to JT and adding CP for constantpool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231824 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 19:29:53 +00:00
Adrian Prantl
e753b17efe Change the datatype of DwarfExpression::Emit(Un)Signed to (u)int64_t
so it matches the one used by ByteStreamer::Emit(U|S)LEB128.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231823 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 19:23:37 +00:00
Benjamin Kramer
f0d37a472f NVPTX: move NVPTXAllocaHoisting into the cpp file
Also initialize without using static initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231822 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 19:20:52 +00:00
Adam Nemet
73dff35fac [LAA-memchecks] Comment improvement
I forgot to roll this into r231816.  It was requested by Hal in D8122.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231821 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 19:12:41 +00:00
Michael Zolotukhin
7212f8bb52 Enable loop-rotate before loop-vectorize by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231820 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 19:07:41 +00:00
Adam Nemet
86dbc2b6d3 [LAA-memchecks 3/3] Introduce pointer partitions for memchecks
This is the final patch that actually introduces the new parameter of
partition mapping to RuntimePointerCheck::needsChecking.

Another API (LAI::getInstructionsForAccess) is also exposed that helps
to map pointers to instructions because ultimately we partition
instructions.

The WIP version of the Loop Distribution pass in D6930 has been adapted
to use all this.  See for example, how
InstrPartitionContainer::computePartitionSetForPointers sets up the
partitions using the above API and then calls to LAI::addRuntimeCheck
with the pointer partitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231818 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 18:54:26 +00:00
Adam Nemet
c320ed14d2 [LAA-memchecks 2/3] Move number of memcheck threshold checking to LV
Now the analysis won't "fail" if the memchecks exceed the threshold.  It
is the transform pass' responsibility to perform the check.

This allows the transform pass to further analyze/eliminate the
memchecks.  E.g. in Loop distribution we only need to check pointers
that end up in different partitions.

Note that there is a slight change of functionality here.  The logic in
analyzeLoop is that if dependence checking fails due to non-constant
distance between the pointers, another attempt is made to prove safety
of the dependences purely using run-time checks.

Before this patch we could fail the loop due to exceeding the memcheck
threshold after the first step, now we only check the threshold in the
client after the full analysis.  There is no measurable compile-time
effect but I wanted to record this here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231817 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 18:54:23 +00:00
Adam Nemet
17c9aca856 [LAA-memchecks 1/3] Split out NumComparisons checks. NFC
The check for the number of memchecks will be moved to the client of
this analysis.  Besides allowing for transform-specific thresholds, this
also lets Loop Distribution post-process the memchecks; Loop
Distribution only needs memchecks between pointers of different
partitions.

The motivation for this first patch is to untangle the CanDoRT check
from the NumComparison check before moving the NumComparison part.
CanDoRT means that we couldn't determine the bounds for the pointer.
Note that NumComparison is set independent of this flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231816 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 18:54:19 +00:00
Sanjay Patel
9677d4f3f3 remove names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231813 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 18:41:22 +00:00
Sanjay Patel
3885990176 fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231812 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 18:37:05 +00:00
Benjamin Kramer
5b536e4af0 NVPTX: Remove copy of LLVMInitializeNVPTXAsmPrinter.
If anyone is using this for some strange reason,
LLVMInitializeNVPTXAsmPrinter does exactly the same thing and is what
other LLVM tools are calling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231810 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 18:19:24 +00:00
Benjamin Kramer
7b3db42f63 Hexagon: Remove unused InstrMapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231809 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 18:19:16 +00:00
Adam Nemet
8e7d56f6f7 [LoopAccesses 3/3] Print the dependences with -analyze
The dependences are now expose through the new getInterestingDependences
API so we can use that with -analyze too and fix the FIXME.

This lets us remove the test that relied on -debug to check the
dependences.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231807 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 17:40:43 +00:00
Adam Nemet
7063c7e084 [LoopAccesses 2/3] Allow querying of interesting dependences
Gather an array of interesting dependences rather than just failing
after the first unsafe one and regarding the loop unsafe.  Loop
Distribution needs to be able to collect all dependences in order to
isolate the dependence cycles into their own partition.

Since the dependence checking algorithm is quadratic in terms of
accesses sharing the same underlying pointer, I am applying a cut-off
threshold (MaxInterestingDependence).  Exceeding that, the logic reverts
back to the original approach deeming the loop unsafe upon encountering
the first unsafe dependence.

The main idea of the patch is to split isDepedent from directly
answering the question whether the dep is safe for vectorization to
return a dependence type which then gets mapped to old boolean result
using Dependence::isSafeForVectorization.

Tested that this was compile-time neutral on SpecINT2006 LTO bitcode
inputs.  No assembly change on the testsuite including external.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231806 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 17:40:37 +00:00
Adam Nemet
0ddb48c2f8 [LoopAccesses 1/3] Expose MemoryDepChecker to LAA users
LoopDistribution needs to query various results of the dependence
analysis.  This series will expose some more APIs and state of the
dependence checker.

This patch is a simple one to just expose the DepChecker instance.  The
set is compile-time neutral measured with LTO bitcode files of
SpecINT2006.  Also there is no assembly change on the testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231805 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 17:40:34 +00:00
Rafael Espindola
0f4df6dc6f Store an optional section start label in MCSection.
This makes code that uses section relative expressions (debug info) simpler and
less brittle.

This is still a bit awkward as the symbol is created late and has to be
stored in a mutable field.

I will move the symbol creation earlier in the next patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231802 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 16:58:10 +00:00
Sanjay Patel
f681b3f13f remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231801 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 16:42:24 +00:00
Igor Laevsky
68beb2a9ec Teach lowering to correctly handle invoke statepoint and gc results tied to them. Note that we still can not lower gc.relocates for invoke statepoints.
Also it extracts getCopyFromRegs helper function in SelectionDAGBuilder as we need to be able to customize type of the register exported from basic block during lowering of the gc.result.
(Resubmitting this change after not being able to reproduce buildbot failure)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231800 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 16:26:48 +00:00
Chad Rosier
e891f49ad5 [BranchFolding] Remove MMOs during tail merge to preserve dependencies.
When tail merging it may be necessary to remove MMOs from memory operations to
ensures later passes (e.g., MI sched) conservatively compute dependencies.
Currently, we only remove the MMO from the common tail if the MMO doesn't match
with the relative instruction in the non-common tail(s).

A more robust solution would be to add multiple MMOs from the duplicate MIs to
the new MI. Currently ScheduleDAGInstrs.cpp ignores all MMOs on instructions
with multiple MMOs, so this solution is equivalent for the time being.

No test case included as this is incredibly difficult to reproduce.

Patch was a collaborative effort between Ana Pazos and myself.
Phabricator: http://reviews.llvm.org/D7769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231799 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 16:22:52 +00:00
Tom Stellard
d472057ca2 R600/SI: Add _IDXEN and _BOTHEN variants for buffer_store
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 16:16:51 +00:00
Tom Stellard
29e7485cda R600/SI: Re-order MUBUF operands to match asm strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231797 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 16:16:49 +00:00
Tom Stellard
c2e1ba5d21 R600/SI: Move kill flag to second instruction when splitting SMRD
This fixes a machine verifier error in the salu-to-valu.ll, which
would have been exposed by a future commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231796 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 16:16:48 +00:00
Tom Stellard
92811fa2c7 R600/SI: Add 32-bit encoding of v_cndmask_b32
This was done by refactoring the v_cndmask_b32 tablegen definition
to use inherit from VOP2Inst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231795 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 16:16:44 +00:00
Sanjay Patel
137e1f3f28 [X86, AVX] replace vinsertf128 intrinsics with generic shuffles
We want to replace as much custom x86 shuffling via intrinsics
as possible because pushing the code down the generic shuffle
optimization path allows for better codegen and less complexity
in LLVM.

This is the sibling patch for the Clang half of this change:
http://reviews.llvm.org/D8088

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231794 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 16:08:36 +00:00
Benjamin Kramer
7aace59124 Hexagon: Remove pass that does nothing at all
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231791 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 15:06:38 +00:00
Rafael Espindola
71653f3324 Remove effectively dead code.
Switching back and forth between sections does nothing (other than producing
larger .s files).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231790 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 14:48:01 +00:00
Karthik Bhat
36b589fd8a Fix a memory corruption in Dependency Analysis.
This crash occurs due to memory corruption when trying to update dependency
direction based on Constraints.

This crash was observed during lnt regression of Polybench benchmark test case dynprog.

Review: http://reviews.llvm.org/D8059



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231788 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 14:32:02 +00:00
Rafael Espindola
57f42270e5 Don't repeat names and clang-format this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 13:56:44 +00:00
Aaron Ballman
93ca6e0d3b Removing dead code to silence warning C4060: switch statement contains no 'case' or 'default' labels; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231785 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 13:56:28 +00:00
Karthik Bhat
5f9683f54f Fix a crash in Dependency Analysis.
This crash in Dependency analysis is because we assume here that in case of UsefulGEP
both source and destination have the same number of operands which may not be true.
This incorrect assumption results in crash while populating Pairs. Fix the same.

This crash was observed during lnt regression for code such as-
  struct s{
    int A[10][10];
    int C[10][10][10]; 
  } S;
  void dep_constraint_crash_test(int k,int N)  {
     for( int i=0;i<N;i++)
       for( int j=0;j<N;j++)
         S.A[0][0] = S.C[0][0][k];
  }
Review: http://reviews.llvm.org/D8162



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 13:31:03 +00:00
Daniel Sanders
b02d16e0e7 The operand flag word used in ISD::INLINEASM is an i32 not a pointer. NFC.
Summary:
This is part of the work to support memory constraints that behave
differently to 'm'. The subsequent patches will expand on the existing
encoding (which is a 32-bit int) and as a result in some flag words will no
longer fit into an i16. This problem only affected the MSP430 target which
appears to have 16-bit pointers.

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231783 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 10:42:59 +00:00
Yaron Keren
1132d0cc5b Teach raw_ostream to accept SmallString.
Saves adding .str() call to any raw_ostream << SmallString usage
and a small step towards making .str() consistent in the ADTs by
removing one of the SmallString::str() use cases, discussion at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html

I'll update the Phabricator patch http://reviews.llvm.org/D6372
for review of the Twine SmallString support, it's more complex
than this one.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 07:33:23 +00:00
Owen Anderson
3a3665fd38 Fix a crash in InstCombine where we could try to truncate a switch comparison to zero width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231761 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 06:51:39 +00:00
Owen Anderson
bb6a88c25d Fix a stack overflow in the assembler when checking that GEPs must be over sized types.
We failed to use a marking set to properly handle recursive types, which caused use
to recurse infinitely and eventually overflow the stack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231760 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 06:34:57 +00:00
Owen Anderson
4935faa4ee Fix an issue in the verifier where we could try to read information out of a malformed statepoint intrinsic.
In this situation we would always have already flagged an error on the statepoint intrinsic,
but then we carry on to parse other, related GC intrinsics, and could end up crashing during that
verification when they try to access data from the malformed statepoint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231759 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 05:58:21 +00:00
Owen Anderson
645fd68c5c Fix an infinite loop in InstCombine when an instruction with no users and side effects can be constant folded.
ReplaceInstUsesWith needs to return nullptr when the input has no users,
because in that case it does not mutate the program.  Otherwise, we can
get stuck in an infinite loop of repeatedly attempting to constant fold
and instruction with no users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231755 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 05:13:47 +00:00
Rafael Espindola
cf08570476 Move variable into assert to fix -Asserts builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231753 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 04:28:09 +00:00
Rafael Espindola
774ad7aeb3 Remove incredibly confusing isBaseAddressKnownZero.
When referring to a symbol in a dwarf section on ELF we should use

.long foo

instead of

.long foo - .debug_something

because ELF is unaware of the content of the sections and therefore needs
relocations. This has nothing to do with optimizing a -0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 04:11:52 +00:00
Rafael Espindola
44292e80ac Use a better name for compile unit labels.
They mark the start of a compile unit, so name them .Lcu_*. Using
Section->getLabelBeginName() makes it looks like they mark the start of the
section.

While at it, switch to createTempSymbol to avoid collisions with labels
created in inline assembly. Not sure if a "don't crash" test is worth it.

With this getLabelBeginName is dead, delete it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231750 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 03:58:36 +00:00
Sanjay Patel
ec53c65238 removed function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231749 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 03:48:14 +00:00
Frederic Riss
d8b587de3b DwarfAccelTable: remove unneeded bucket terminators.
Last commit fixed the handling of hash collisions, but it introdcuced
unneeded bucket terminators in some places. The generated table was
correct, it can just be a tiny bit smaller. As the previous table was
correct, the test doesn't need updating. If we really wanted to test
this, I could add the section size to the dwarf dump and test for a
precise value there. IMO the correctness test is sufficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231748 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 03:47:55 +00:00
Sanjay Patel
9e894a9129 use range-based for loops; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231747 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 03:26:39 +00:00
Craig Topper
d4843f4c45 Improve and simplify EnforceSmallerThan for vector types.
Explicitly compare the size of the scalar types and the whole vector size rather than just comparing enum encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231746 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 03:25:07 +00:00
Craig Topper
541e68ea57 Remove extra indentation of entire function body. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 03:25:04 +00:00
Rafael Espindola
810c3f5ef9 Move label creation close to emission. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231744 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 03:11:11 +00:00
George Burgess IV
d8bd7ce2ca Added ConstantExpr support to CFLAA.
CFLAA didn't know how to properly handle ConstantExprs; it would silently
ignore them. This was a problem if the ConstantExpr is, say, a GEP of a global,
because CFLAA wouldn't realize that there's a global there. :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231743 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 02:58:15 +00:00