Sanjay Patel [Tue, 10 Mar 2015 16:42:24 +0000 (16:42 +0000)]
remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231801
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Laevsky [Tue, 10 Mar 2015 16:26:48 +0000 (16:26 +0000)]
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
Chad Rosier [Tue, 10 Mar 2015 16:22:52 +0000 (16:22 +0000)]
[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
Tom Stellard [Tue, 10 Mar 2015 16:16:51 +0000 (16:16 +0000)]
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
Tom Stellard [Tue, 10 Mar 2015 16:16:49 +0000 (16:16 +0000)]
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
Tom Stellard [Tue, 10 Mar 2015 16:16:48 +0000 (16:16 +0000)]
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
Tom Stellard [Tue, 10 Mar 2015 16:16:44 +0000 (16:16 +0000)]
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
Sanjay Patel [Tue, 10 Mar 2015 16:08:36 +0000 (16:08 +0000)]
[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
Benjamin Kramer [Tue, 10 Mar 2015 15:06:38 +0000 (15:06 +0000)]
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
Rafael Espindola [Tue, 10 Mar 2015 14:48:01 +0000 (14:48 +0000)]
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
Karthik Bhat [Tue, 10 Mar 2015 14:32:02 +0000 (14:32 +0000)]
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
Rafael Espindola [Tue, 10 Mar 2015 13:56:44 +0000 (13:56 +0000)]
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
Aaron Ballman [Tue, 10 Mar 2015 13:56:28 +0000 (13:56 +0000)]
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
Karthik Bhat [Tue, 10 Mar 2015 13:31:03 +0000 (13:31 +0000)]
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
Daniel Sanders [Tue, 10 Mar 2015 10:42:59 +0000 (10:42 +0000)]
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
Yaron Keren [Tue, 10 Mar 2015 07:33:23 +0000 (07:33 +0000)]
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
Owen Anderson [Tue, 10 Mar 2015 06:51:39 +0000 (06:51 +0000)]
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
Owen Anderson [Tue, 10 Mar 2015 06:34:57 +0000 (06:34 +0000)]
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
Owen Anderson [Tue, 10 Mar 2015 05:58:21 +0000 (05:58 +0000)]
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
Owen Anderson [Tue, 10 Mar 2015 05:13:47 +0000 (05:13 +0000)]
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
Rafael Espindola [Tue, 10 Mar 2015 04:28:09 +0000 (04:28 +0000)]
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
Rafael Espindola [Tue, 10 Mar 2015 04:11:52 +0000 (04:11 +0000)]
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
Rafael Espindola [Tue, 10 Mar 2015 03:58:36 +0000 (03:58 +0000)]
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
Sanjay Patel [Tue, 10 Mar 2015 03:48:14 +0000 (03:48 +0000)]
removed function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231749
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 10 Mar 2015 03:47:55 +0000 (03:47 +0000)]
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
Sanjay Patel [Tue, 10 Mar 2015 03:26:39 +0000 (03:26 +0000)]
use range-based for loops; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231747
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 10 Mar 2015 03:25:07 +0000 (03:25 +0000)]
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
Craig Topper [Tue, 10 Mar 2015 03:25:04 +0000 (03:25 +0000)]
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
Rafael Espindola [Tue, 10 Mar 2015 03:11:11 +0000 (03:11 +0000)]
Move label creation close to emission. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231744
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Tue, 10 Mar 2015 02:58:15 +0000 (02:58 +0000)]
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
George Burgess IV [Tue, 10 Mar 2015 02:40:06 +0000 (02:40 +0000)]
Added special handling for inttoptr in CFLAA.
We now treat pointers given to ptrtoint and pointers retrieved from
inttoptr as similar to arguments or globals (can alias anything, etc.)
This solves some of the problems we were having with giving incorrect
results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231741
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Tue, 10 Mar 2015 02:37:25 +0000 (02:37 +0000)]
DataLayout is mandatory, update the API to reflect it with references.
Summary:
Now that the DataLayout is a mandatory part of the module, let's start
cleaning the codebase. This patch is a first attempt at doing that.
This patch is not exactly NFC as for instance some places were passing
a nullptr instead of the DataLayout, possibly just because there was a
default value on the DataLayout argument to many functions in the API.
Even though it is not purely NFC, there is no change in the
validation.
I turned as many pointer to DataLayout to references, this helped
figuring out all the places where a nullptr could come up.
I had initially a local version of this patch broken into over 30
independant, commits but some later commit were cleaning the API and
touching part of the code modified in the previous commits, so it
seemed cleaner without the intermediate state.
Test Plan:
Reviewers: echristo
Subscribers: llvm-commits
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231740
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 10 Mar 2015 01:58:27 +0000 (01:58 +0000)]
[sanitizer] fix instrumentation with -mllvm -sanitizer-coverage-block-threshold=0 to actually do something useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231736
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 10 Mar 2015 01:11:53 +0000 (01:11 +0000)]
[sanitizer] decrease sanitizer-coverage-block-threshold from 1000 to 500 as another horrible workaround for PR17409
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231733
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 10 Mar 2015 00:46:31 +0000 (00:46 +0000)]
DwarfAccelTable: Fix handling of hash collisions.
It turns out accelerator tables where totally broken if they contained
entries with colliding hashes. The failure mode is pretty bad, as it not
only impacted the colliding entries, but would basically make all the
entries after the first hash collision pointing in the wrong place.
The testcase uses the symbol names that where found to collide during a
clang build.
From a performance point of view, the patch adds a sort and a linear
walk over each bucket contents. While it has a measurable impact on the
accelerator table emission, it's not showing up significantly in clang
profiles (and I'd argue that correctness is priceless :-)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231732
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Mar 2015 00:33:27 +0000 (00:33 +0000)]
Temporarily revert r231726 and r231724 as they're breaking the build.:
Author: Lang Hames <lhames@gmail.com>
Date: Mon Mar 9 23:51:09 2015 +0000
[Orc][MCJIT][RuntimeDyld] Add header that was accidentally left out of r231724.
Author: Lang Hames <lhames@gmail.com>
Date: Mon Mar 9 23:44:13 2015 +0000
[Orc][MCJIT][RuntimeDyld] Add symbol flags to symbols in RuntimeDyld. Thread the
new types through MCJIT and Orc.
In particular, add a 'weak' flag. When plumbed through RTDyldMemoryManager, this
will allow us to distinguish between weak and strong definitions and find the
right ones during symbol resolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231731
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Mar 2015 00:33:22 +0000 (00:33 +0000)]
Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231730
91177308-0d34-0410-b5e6-
96231b3b80d8
Ben Langmuir [Tue, 10 Mar 2015 00:04:29 +0000 (00:04 +0000)]
Don't treat .foo as two path components in path::iterators
We were treating '/.foo' as ['/', '.', 'foo'] instead of ['/', '.foo'],
which lead to insanity. Same for '..'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231727
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 9 Mar 2015 23:51:09 +0000 (23:51 +0000)]
[Orc][MCJIT][RuntimeDyld] Add header that was accidentally left out of r231724.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231726
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 9 Mar 2015 23:44:13 +0000 (23:44 +0000)]
[Orc][MCJIT][RuntimeDyld] Add symbol flags to symbols in RuntimeDyld. Thread the
new types through MCJIT and Orc.
In particular, add a 'weak' flag. When plumbed through RTDyldMemoryManager, this
will allow us to distinguish between weak and strong definitions and find the
right ones during symbol resolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231724
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 23:08:46 +0000 (23:08 +0000)]
[Hexagon] Removing unused patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231723
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 9 Mar 2015 23:08:44 +0000 (23:08 +0000)]
LLParser: gep: Simplify parsing error handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231722
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Mon, 9 Mar 2015 22:51:05 +0000 (22:51 +0000)]
[CodeGen] Replace the reused stores' chain for extractelt expansion.
This fixes a subtle issue that was introduced in r205153.
When reusing a store for the extractelement expansion (to load directly
from it, inserting of going through the stack), later stores to the
same location might have overwritten the data we were expecting to
extract from.
To fix that, we need to explicitly replace the chain going out of the
reused store, so that later stores also have an explicit dependency on
the generated element-extracting loads, and can't clobber them.
rdar://
20066785
Differential Revision: http://reviews.llvm.org/D8180
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231721
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Mon, 9 Mar 2015 22:46:02 +0000 (22:46 +0000)]
[X86] Add nounwind to vector-idiv.ll testcases. NFC.
In preparation for a patch where cfi directives get in the way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231720
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 9 Mar 2015 22:45:16 +0000 (22:45 +0000)]
Reland r229944: EH: Prune unreachable resume instructions during Dwarf EH preparation
Fix the double-deletion of AnalysisResolver when delegating through to
Dwarf EH preparation by creating one from scratch. Hopefully the new
pass manager simplifies this.
This reverts commit r229952.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231719
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Mar 2015 22:08:37 +0000 (22:08 +0000)]
Use a MapVector instead of an extra sort.
This also has the advantage of not depending on the brittle getLabelBeginName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231714
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 22:05:21 +0000 (22:05 +0000)]
[Hexagon] Use single tailcall pseudoinst and fix checking for label jumping versus tail calling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231713
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 21:48:13 +0000 (21:48 +0000)]
[Hexagon] Reapply r231699. Remove assumption that second operand is an immediate when checking if A2_tfrsi is combinable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231710
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 9 Mar 2015 21:43:43 +0000 (21:43 +0000)]
[SCEV] Unify getUnsignedRange and getSignedRange
Summary:
This removes some duplicated code, and also helps optimization: e.g. in
the test case added, `%idx ULT 128` in `@x` is not currently optimized
to `true` by `-indvars` but will be, after this change.
The only functional change in ths commit is that for add recurrences,
ScalarEvolution::getRange will be more aggressive -- computing the
unsigned (resp. signed) range for a SCEVAddRecExpr will now look at the
NSW (resp. NUW) bits and check for signed (resp. unsigned) overflow.
This can be a strict improvement in some cases (such as the attached
test case), and should be no worse in other cases.
Reviewers: atrick, nlewycky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8142
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231709
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 9 Mar 2015 21:43:39 +0000 (21:43 +0000)]
[SCEV] Add a `scalar-evolution-print-constant-ranges' option
Summary:
Unused in this commit, but will be used in a subsequent change (D8142)
by a FileCheck test.
Reviewers: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8143
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231708
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 21:19:02 +0000 (21:19 +0000)]
[Hexagon] Reverting r231699
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231703
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Mon, 9 Mar 2015 21:09:50 +0000 (21:09 +0000)]
DwarfAccelTable: fix obvious typo.
I have a test for that issue, but I didn't include it in the commit as it's
a 200KB file for a pretty minor issue. (The reason the file is so big is
that it needs > 1024 variables/functions to trigger and that with debug
information.
The issue/fix on the other side is totally trivial. If poeple want the test
commited, I can do that. It just didn't seem worth it to me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231701
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 20:33:12 +0000 (20:33 +0000)]
[Hexagon] Updating constant set to simpler versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231699
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 9 Mar 2015 20:23:14 +0000 (20:23 +0000)]
TableGen: Use 'enum : uint64_t' for feature flags to fix -Wmicrosoft
clang-cl would warn that this value is not representable in 'int':
enum { FeatureX = 1ULL << 31 };
All MS enums are 'ints' unless otherwise specified, so we have to use an
explicit type. The AMDGPU target just hit 32 features, triggering this
warning.
Now that we have C++11 strong enum types, we can also eliminate the
'const uint64_t' codepath from tablegen and just use 'enum : uint64_t'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231697
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 9 Mar 2015 20:20:16 +0000 (20:20 +0000)]
Remove the remaining uses of abs64 and nuke it.
std::abs works just fine and we're already using it in many places. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231696
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 20:11:02 +0000 (20:11 +0000)]
[Hexagon] Removing old halfword codegen instructions and updating const32/64 splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231695
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Mar 2015 20:09:58 +0000 (20:09 +0000)]
Don't prime the section map.
This was just creating unused labels for .text when the module had no
functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231694
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 19:57:18 +0000 (19:57 +0000)]
[Hexagon] Eliminating immediate condition set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231693
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 19:31:25 +0000 (19:31 +0000)]
[Hexagon] Removing TFR_condset_ir/TFR_condset_ri modeling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231689
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 18:57:33 +0000 (18:57 +0000)]
[Hexagon] Changing AddrFI back to ADDRri to address test issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231687
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 9 Mar 2015 18:54:58 +0000 (18:54 +0000)]
InstrProf: Use the proftext format for these coverage tests
This format's easier to understand and update by hand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231686
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 9 Mar 2015 18:54:49 +0000 (18:54 +0000)]
InstrProf: Allow hexadecimal function hashes in proftext format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231685
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 9 Mar 2015 18:49:54 +0000 (18:49 +0000)]
R600/SI: Move gds operand to the end of operand list
Also print it in the assembly string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231684
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 9 Mar 2015 18:49:45 +0000 (18:49 +0000)]
R600/SI: Refactor DS instruction defs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231683
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Mar 2015 18:48:29 +0000 (18:48 +0000)]
Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231682
91177308-0d34-0410-b5e6-
96231b3b80d8
Ed Schouten [Mon, 9 Mar 2015 18:40:45 +0000 (18:40 +0000)]
Add support for Nuxi CloudABI.
CloudABI is a POSIX-like runtime environment built around the concept of
capability-based security. More details:
https://github.com/NuxiNL/cloudlibc
CloudABI uses its own ELFOSABI number. This number has been allocated by
the maintainers of ELF a couple of days ago.
Reviewed by: echristo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231681
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 9 Mar 2015 18:35:18 +0000 (18:35 +0000)]
Drop the hacks used for partial C99 math libraries.
All supported platforms have half-way decent C99 support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231679
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 9 Mar 2015 18:34:05 +0000 (18:34 +0000)]
[Hexagon] Adding PackHL nodes and some missing modeling instructions and patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231678
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Mar 2015 18:29:12 +0000 (18:29 +0000)]
Print jump tables before exception tables.
In the case where just tables are part of the function section, this produces
more readable assembly by avoiding switching to the eh section and back
to .text.
This would also break with non unique section names, as trying to switch to
a unique section actually creates a new one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231677
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Mar 2015 18:11:42 +0000 (18:11 +0000)]
Don't repeat name in comment. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231676
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Mar 2015 17:58:49 +0000 (17:58 +0000)]
Remove dummy method implementations.
These are pure virtual in the base class, so the compiler checks that they
are implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231673
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Mon, 9 Mar 2015 16:28:10 +0000 (16:28 +0000)]
Add logical ops to Mips fast-isel
Summary:
Code is mostly copied from AArch64 port and modified where needed for Mips.
This handles the "non" legal cases of logical ops. Legal cases are handled by tablegen patterns.
Test Plan:
Make check test logopm.ll
All of test-suite passes at O0/O2 and mips32 r1/r2 with this new change.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: echristo, llvm-commits, aemerson, rfuhler
Differential Revision: http://reviews.llvm.org/D6599
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231665
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 9 Mar 2015 16:23:46 +0000 (16:23 +0000)]
Make helper functions static.
Found by -Wmissing-prototypes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231664
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 9 Mar 2015 16:03:45 +0000 (16:03 +0000)]
R600/SI: Fix DS definitions and add missing instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231663
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Mon, 9 Mar 2015 16:03:39 +0000 (16:03 +0000)]
R600/SI: Fix opcode for ds_read2_b64 and ds_read2st64_b64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231662
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 9 Mar 2015 15:50:58 +0000 (15:50 +0000)]
Move unreferenced passes into the cpp file
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231661
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 9 Mar 2015 15:50:47 +0000 (15:50 +0000)]
SymbolRewriter: Hide implementation details
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231660
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Mon, 9 Mar 2015 15:48:09 +0000 (15:48 +0000)]
R600/SI: Limit SGPRs to 80 on Tonga and Iceland
This is a candidate for stable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231659
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Mon, 9 Mar 2015 15:48:00 +0000 (15:48 +0000)]
R600/SI: Fix getNumSGPRsAllowed for VI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231658
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Mon, 9 Mar 2015 15:02:01 +0000 (15:02 +0000)]
Fix line ending in test CodeGen/X86/pr22774.ll. NFC.
Also, replaced line with 'target triple' with flag -mtriple on the RUN line.
Removed the data layout string as it is not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231654
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Mon, 9 Mar 2015 07:26:37 +0000 (07:26 +0000)]
Revert r231630 - Run LICM pass after loop unrolling pass.
As it broke llvm bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231635
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 9 Mar 2015 07:13:42 +0000 (07:13 +0000)]
Fix a bug in the LLParser where we failed to diagnose landingpads with non-constant clause operands.
Fixing this also exposed a related issue where the landingpad under construction was not
cleaned up when an error was raised, which would cause bad reference errors before the
error could actually be printed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231634
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Mon, 9 Mar 2015 06:14:28 +0000 (06:14 +0000)]
[AArch64] Enable partial & runtime unrolling on cortex-a57
For inner one of nested loops, it is more likely to be a hot loop,
and the runtime check can be promoted out from patch 0001, so the
overhead is less, we can try a doubled threshold to unroll more loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231632
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Mon, 9 Mar 2015 06:14:18 +0000 (06:14 +0000)]
Introduce runtime unrolling disable matadata and use it to mark the scalar loop from vectorization.
Runtime unrolling is an expensive optimization which can bring benefit
only if the loop is hot and iteration number is relatively large enough.
For some loops, we know they are not worth to be runtime unrolled.
The scalar loop from vectorization is one of the cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231631
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Mon, 9 Mar 2015 06:14:07 +0000 (06:14 +0000)]
Run LICM pass after loop unrolling pass.
Runtime unrollng will introduce a runtime check in loop prologue.
If the unrolled loop is a inner loop, then the proglogue will be inside
the outer loop. LICM pass can help to promote the runtime check out if
the checked value is loop invariant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231630
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Mon, 9 Mar 2015 03:20:25 +0000 (03:20 +0000)]
InstCombine: fix fold "fcmp x, undef" to account for NaN
Summary:
See the two test cases.
; Can fold fcmp with undef on one side by choosing NaN for the undef
; Can fold fcmp with undef on both side
; fcmp u_pred undef, undef -> true
; fcmp o_pred undef, undef -> false
; because whatever you choose for the first undef
; you can choose NaN for the other undef
Reviewers: hfinkel, chandlerc, majnemer
Reviewed By: majnemer
Subscribers: majnemer, llvm-commits
Differential Revision: http://reviews.llvm.org/D7617
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231626
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Mon, 9 Mar 2015 02:57:32 +0000 (02:57 +0000)]
DCE: isArrayMalloc() is not used neither in LLVM nor Clang
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231624
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 9 Mar 2015 01:57:13 +0000 (01:57 +0000)]
Simplify expressions involving boolean constants with clang-tidy
Patch by Richard (legalize at xmission dot com).
Differential Revision: http://reviews.llvm.org/D8154
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231617
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Sun, 8 Mar 2015 21:53:59 +0000 (21:53 +0000)]
Teach DataLayout to infer a plausible alignment for things even when nothing is specified by the user.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231613
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Sun, 8 Mar 2015 16:28:47 +0000 (16:28 +0000)]
[X86][AVX] Fix wrong lowering of VPERM2X128 nodes
There were cases where the backend computed a wrong permute mask for a VPERM2X128 node.
Example:
\code
define <8 x float> @foo(<8 x float> %a, <8 x float> %b) {
%shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 undef, i32 undef, i32 6, i32 7, i32 undef, i32 undef, i32 6, i32 7>
ret <8 x float> %shuffle
}
\code end
Before this patch, llc (with -mattr=+avx) emitted the following vperm2f128:
vperm2f128 $0, %ymm0, %ymm0, %ymm0 # ymm0 = ymm0[0,1,0,1]
With this patch, llc emits a vperm2f128 with a correct permute mask:
vperm2f128 $17, %ymm0, %ymm0, %ymm0 # ymm0 = ymm0[2,3,2,3]
Differential Revision: http://reviews.llvm.org/D8119
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231601
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 8 Mar 2015 16:07:39 +0000 (16:07 +0000)]
Make static variables const if possible. Makes them go into a read-only section.
Or fold them into a initializer list which has the same effect. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231598
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 7 Mar 2015 22:33:11 +0000 (22:33 +0000)]
[DAGCombiner] Add a shuffle mask commutation helper function. NFCI.
We have an increasing number of cases where we are creating commuted shuffle masks - all implementing nearly the same code.
This patch adds a static helper function - ShuffleVectorSDNode::commuteMask() and replaces a number of cases to use it.
Differential Revision: http://reviews.llvm.org/D8139
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231581
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 7 Mar 2015 21:47:46 +0000 (21:47 +0000)]
Fix the autoconf build
lib/ExecutionEngine/Targets has no Makefile, causing the autoconf build
to fail. Solve this by bringing the COFF implementation of RuntimeDyld
in line like the Mach-O and ELF implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231579
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 7 Mar 2015 21:15:40 +0000 (21:15 +0000)]
Make the assertion macros in Verifier and Linter truly variadic.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231577
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 7 Mar 2015 20:56:50 +0000 (20:56 +0000)]
Fix unused variable/function warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231576
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 7 Mar 2015 20:21:27 +0000 (20:21 +0000)]
ExecutionEngine: Preliminary support for dynamically loadable coff objects
Provide basic support for dynamically loadable coff objects. Only handles a subset of x64 currently.
Patch by Andy Ayers!
Differential Revision: http://reviews.llvm.org/D7793
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231574
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 7 Mar 2015 17:41:00 +0000 (17:41 +0000)]
Make constant arrays that are passed to functions as const.
In theory this allows the compiler to skip materializing the array on
the stack. In practice clang often fails to do that, but that's a
different story. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231571
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 7 Mar 2015 16:34:55 +0000 (16:34 +0000)]
Use SDValue bool check to tidyup some possible combines. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231569
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 7 Mar 2015 15:16:27 +0000 (15:16 +0000)]
Adding parenthesis around logical expressions to silence a -Wparentheses warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231567
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 7 Mar 2015 15:10:32 +0000 (15:10 +0000)]
Removing spurious semi-colons; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231566
91177308-0d34-0410-b5e6-
96231b3b80d8