Commit Graph

98556 Commits

Author SHA1 Message Date
Andrew Trick
edf1070ca7 Convert liveness tracking to work on a sub-register level instead of just register units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197253 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 18:36:56 +00:00
Chad Rosier
513a00db78 [AArch64] Simplify the Neon Scalar3Same patterns for floating-point reciprocal
step, floating-point reciprocal square root step, floating-point absolute
difference, and integer/floating-point compare instructions.  Also, move the
scalar general arithmetic operation patterns closer to similar code.  No
functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197250 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 17:56:44 +00:00
Rafael Espindola
48c2927021 Assume defaults to produce smaller datalayout strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197249 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 17:56:11 +00:00
Rafael Espindola
7b3aa0356d Fix pr18235.
The cpp backend is not a reasonable fallback for a missing target. It is a
very special backend, so it is reasonable to use it only if explicitly
requested.

While at it, simplify the interface a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197241 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 16:05:32 +00:00
Richard Sandiford
584940e3c6 [SystemZ] Optimize X [!=]= Y in cases where X - Y or Y - X is also computed
In those cases it's better to compare the result of the subtraction
against zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197239 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 15:50:30 +00:00
Richard Sandiford
5f65b24e4d [SystemZ] Make more use of TMHH
This originally came about after noticing that InstCombine turns
some of the TMHH (icmp (and...), ...) tests into plain comparisons.
Since there is no instruction to compare with a 64-bit immediate,
TMHH is generally better than an ordered comparison for the cases
that it can handle.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197238 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 15:46:55 +00:00
Iain Sandoe
8adb31eb3e test commit.
Amend a comment.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197237 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 15:46:48 +00:00
Richard Sandiford
193bf3171f [SystemZ] Extend integer absolute selection
This patch makes more use of LPGFR and LNGFR.  It builds on top of
the LTGFR selection from r197234.  Most of the tests are motivated
by what InstCombine would produce.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197236 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 15:35:00 +00:00
Richard Sandiford
467a3f9b3f [SystemZ] Add a structure to represent a selected comparison
...in an attempt to rein back the increasingly complex selection code.
A knock-on effect is that ICmpType is exposed from the outset, which
slightly simplifies adjustSubwordCmp.

The code is no piece of art even after this change, but at least it should
be slightly better.  No behavioral change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197235 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 15:28:45 +00:00
Richard Sandiford
204537e25e [SystemZ] Make more use of LTGFR
InstCombine turns (sext (trunc)) into (ashr (shl)), then converts any
comparison of the ashr against zero into a comparison of the shl against zero.
This makes sense in itself, but we want to undo it for z, since the sign-
extension instruction has a CC-setting form.

I've included tests for both the original and InstCombined variants,
but the former already worked.  The patch fixes the latter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197234 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 15:07:39 +00:00
Benjamin Kramer
fd2b2bd6b3 X86: When lowering shl_parts, don't emit shift amounts larger than the bit width.
While it's safe for the X86-specific shift nodes, dag combining will
kill generic nodes. Insert an AND to make it safe, isel will nuke it
as x86's shift instructions have an implicit AND.

Fixes PR16108, which contains a contraption to hit this case in between
constant folders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197228 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 13:40:24 +00:00
Joerg Sonnenberger
aca2998f14 Enabling thumb2 mode used to force support for armv6t2. Replace this
with a temporary assertion and adjust the various test cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197224 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 11:16:00 +00:00
Matheus Almeida
b90ed644fc [mips] Add checks for alignment and maximum displacements for most of the
branch instructions for mips and micromips instruction sets thus avoiding
the situation of generating branches to undesired locations if offsets
cannot be encoded.

This patch also checks if a fixup cannot be applied and returns a fatal error
if that's the case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197223 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 11:11:02 +00:00
Renato Golin
09b3900206 Add ARM to release instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197220 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 09:39:36 +00:00
Chandler Carruth
a7e2ef7e6e [inliner] Fix PR18206 by preventing inlining functions that call setjmp
through an invoke instruction.

The original patch for this was written by Mark Seaborn, but I've
reworked his test case into the existing returns_twice test case and
implemented the fix by the prior refactoring to actually run the cost
analysis over invoke instructions, and then here fixing our detection of
the returns_twice attribute to work for both calls and invokes. We never
noticed because we never saw an invoke. =[

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197216 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 08:00:01 +00:00
Chandler Carruth
0bdc7cd5de [inliner] Completely change (and fix) how the inline cost analysis
handles terminator instructions.

The inline cost analysis inheritted some pretty rough handling of
terminator insts from the original cost analysis, and then made it much,
much worse by factoring all of the important analyses into a separate
instruction visitor. That instruction visitor never visited the
terminator.

This works fine for things like conditional branches, but for many other
things we simply computed The Wrong Value. First example are
unconditional branches, which should be free but were counted as full
cost. This is most significant for conditional branches where the
condition simplifies and folds during inlining. We paid a 1 instruction
tax on every branch in a straight line specialized path. =[

Oh, we also claimed that the unreachable instruction had cost.

But it gets worse. Let's consider invoke. We never applied the call
penalty. We never accounted for the cost of the arguments. Nope. Worse
still, we didn't handle the *correctness* constraints of not inlining
recursive invokes, or exception throwing returns_twice functions. Oops.
See PR18206. Sadly, PR18206 requires yet another fix, but this
refactoring is at least a huge step in that direction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197215 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 07:59:56 +00:00
David Blaikie
2d39ad82bc Revert "DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers"
This reverts commit r197210.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197211 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 06:43:32 +00:00
David Blaikie
bc6b250c74 DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers
This commit does not complete the type units feature - there are issues
around fission support (skeletal type units, pubtypes/pubnames) and
hashing of some types including those containing references to types in
other type units.

Originally committed as r197073 and reverted in r197079.
Recommitted as r197197 to reproduce the failure and reverted as r197199

Turns out there was unstable ordering in the type unit dumping code.
Fixed by using MapVector in DWARFContext to store the debug_types
comdat sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197210 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 06:27:38 +00:00
Kai Nacke
da44c36d64 Change stack probing code for MingW.
Since gcc 4.6 the compiler uses ___chkstk_ms which has the same semantics as the
MS CRT function __chkstk. This simplifies the prologue generation a bit.

Reviewed by Rafael Espíndola. 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197205 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 05:37:05 +00:00
Rui Ueyama
e93ec87db1 Object/COFF: ExportAddressTableEntry is a union of two RVAs.
The previous definition was wrong. See Microsoft PE/COFF specification
section 5.3.2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197204 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 05:19:17 +00:00
David Blaikie
8290d175ff Revert "DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers"
This reverts commit r197197.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197199 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 01:24:54 +00:00
Yuchen Wu
a2639798a8 llvm-cov: Added -b option for branch probabilities.
This option tells llvm-cov to print out branch probabilities when
a basic block contains multiple branches. It also prints out some
function summary info including the number of times the function enters,
the percent of time it returns, and how many blocks were executed.

Also updated tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197198 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 01:15:07 +00:00
David Blaikie
f4597a0cd4 DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers
This commit does not complete the type units feature - there are issues
around fission support (skeletal type units, pubtypes/pubnames) and
hashing of some types including those containing references to types in
other type units.

Originally committed as r197073 and reverted in r197079.

This commit originally got jumbled up with another build-breaking commit
and I can't find the failures I thought this caused anymore.
Recommitting to hopefully get some clean buildbot results to work from.
I have a sneaking suspicion there's unstable output in the comdat group
output of MCStreamer...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197197 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13 01:06:41 +00:00
Mark Seaborn
363c1ec574 Fix spelling in comment in test: "themselve" -> "themselves"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197180 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 21:26:30 +00:00
Hal Finkel
1e3d96622a Fix a use-after-free error in GlobalOpt CleanupConstantGlobalUsers
GlobalOpt's CleanupConstantGlobalUsers function uses a worklist array to manage
constant users to be visited. The pointers in this array need to be weak
handles because when we delete a constant array, we may also be holding a
pointer to one of its elements (or an element of one of its elements if we're
dealing with an array of arrays) in the worklist.

Fixes PR17347.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197178 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 20:45:24 +00:00
Hal Finkel
8cd46c06f2 Initialize the barrier pass llvm::initializeIPO
The barrier pass is a temporary hack, and should go away soon. Nevertheless, if
we don't initialize it, then opt will not understand -barrier, and this will
break bugpoint (because when it dumps the passes from the default pass manager
-barrier will be there).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197177 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 20:45:08 +00:00
Yuchen Wu
0dbb28f076 Removed llvm-cov.test from Other folder.
More comprehensive llvm-cov tests were added to tools/llvm-cov.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197175 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 20:29:54 +00:00
Rafael Espindola
1cf81e6244 Simplify the datalayout string of ARM and AArch64.
No functionality change.

Reviewed by Tim Northover.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197172 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 17:43:37 +00:00
Rafael Espindola
d870fe2abb Simplify the SystemZ datalayout string.
Reviewed by Richard Sandiford.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197170 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 17:30:07 +00:00
Rafael Espindola
2053a06bd5 Use "a" instead of "a0" in DataLayout.
It means exactly the same and is just a bit shorter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197169 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 17:21:51 +00:00
Rafael Espindola
35e19348d9 Fix Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197168 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 16:17:40 +00:00
Rafael Espindola
e60ffe35a2 Convert the other getHostByName implementations to StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197166 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 16:10:48 +00:00
Rafael Espindola
11b11d77ee Switch to the new MingW ABI.
GCC 4.7 changed the MingW ABI. On the LLVM side it means that sret functions
don't pop the stack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197163 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 16:06:58 +00:00
Chad Rosier
410ca67ab2 [AArch64] Removed unnecessary copy patterns with v1fx types.
- Copy patterns with float/double types are enough.
- Fix typos in test case names that were using v1fx.
- There is no ACLE intrinsic that uses v1f32 type.  And there is no conflict of
  neon and non-neon ovelapped operations with this type, so there is no need to
  support operations with this type.
- Remove v1f32 from FPR32 register and disallow v1f32 as a legal type for
  operations.

Patch by Ana Pazos!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197159 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 15:46:29 +00:00
Rafael Espindola
9191be9523 Return a StringRef from getHostCPUName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197158 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 15:45:32 +00:00
Chandler Carruth
8a513abbc8 [cleanup] Remove trailing whitespace before I start changing this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197149 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 11:59:26 +00:00
Tim Northover
8b28f53eae PowerPC: add Linux triple to TLS tests
The tests were failing on OS X.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197146 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 11:51:23 +00:00
Andrea Di Biagio
a29b054e7a Added new X86 patterns to select SSE scalar fp arithmetic instructions from
a vector packed single/double fp operation followed by a vector insert.

The effect is that the backend coverts the packed fp instruction
followed by a vectro insert into a SSE or AVX scalar fp instruction.

For example, given the following code:
   __m128 foo(__m128 A, __m128 B) {
     __m128 C = A + B;
     return (__m128) {c[0], a[1], a[2], a[3]};
   }

 previously we generated:
   addps %xmm0, %xmm1
   movss %xmm1, %xmm0
 
 we now generate:
   addss %xmm1, %xmm0



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197145 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 11:50:47 +00:00
Richard Barton
b4605d4d4b Remove some dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197144 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 11:18:08 +00:00
Gabor Greif
e5f6931ffd typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197136 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 08:00:34 +00:00
Hao Liu
60a21f2238 [AArch64]Fix the problem that AArch64 backend fails to select scalar_to_vector of vector types having more than one element.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197135 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 07:36:26 +00:00
Alp Toker
7f8ef1ecc4 Swap around EXPECT_EQ() arguments orders for more natural gtest Failure messages
Somewhat counterintuitively the first arg in gtest is treated as the
expectation.

No change to the tests themselves.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197124 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 03:31:20 +00:00
Alp Toker
22e0e0c1de Add missing escape characters to the new Regex::escape() function
The old AddFixedStringToRegEx() it was based on got away with this for the
longest time, but the problem became easy to spot after the cleanup in r197096.

Also add a quick unit test to cover regex escaping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197121 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 02:51:58 +00:00
Reed Kotler
dcdc5736ad Check for null pointer before dereferencing. A careless typo on my part.
I don't know why this did not show up earlier. This code has been
around for ages. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197119 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 02:41:11 +00:00
Kevin Qin
24802f3f82 Fix Incorrect CHECK message [0-31]+ in test case.
In regular expression, [0-31]+ equals to [0-3]+, not the number from
0 to 31. So change it to [0-9]+.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197113 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 02:19:13 +00:00
Yi Jiang
41a3007571 Resubmit r196544: Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, x) ―> __exp10(x)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197109 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 01:55:04 +00:00
Yi Jiang
7c2b072d69 Add TargetLibraryInfo in LTO passes builder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197105 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 01:37:39 +00:00
Hal Finkel
31d3e9fe13 Remove unused multiclass from PPCInstrInfo.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197100 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 00:23:29 +00:00
Hal Finkel
f0c1388dd1 Improve instruction scheduling for the PPC POWER7
Aside from a few minor latency corrections, the major change here is a new
hazard recognizer which focuses on better dispatch-group formation on the
POWER7. As with the PPC970's hazard recognizer, the most important thing it
does is avoid load-after-store hazards within the same dispatch group. It uses
the POWER7's special dispatch-group-terminating nop instruction (instead of
inserting multiple regular nop instructions). This new hazard recognizer makes
use of the scheduling dependency graph itself, built using AA information, to
robustly detect the possibility of load-after-store hazards.

significant test-suite performance changes (the error bars are 99.5% confidence
intervals based on 5 test-suite runs both with and without the change --
speedups are negative):

speedups:

MultiSource/Benchmarks/FreeBench/pcompress2/pcompress2
	-0.55171% +/- 0.333168%

MultiSource/Benchmarks/TSVC/CrossingThresholds-dbl/CrossingThresholds-dbl
	-17.5576% +/- 14.598%

MultiSource/Benchmarks/TSVC/Reductions-dbl/Reductions-dbl
	-29.5708% +/- 7.09058%

MultiSource/Benchmarks/TSVC/Reductions-flt/Reductions-flt
	-34.9471% +/- 11.4391%

SingleSource/Benchmarks/BenchmarkGame/puzzle
	-25.1347% +/- 11.0104%

SingleSource/Benchmarks/Misc/flops-8
	-17.7297% +/- 9.79061%

SingleSource/Benchmarks/Shootout-C++/ary3
	-35.5018% +/- 23.9458%

SingleSource/Regression/C/uint64_to_float
	-56.3165% +/- 25.4234%

SingleSource/UnitTests/Vectorizer/gcc-loops
	-18.5309% +/- 6.8496%

regressions:

MultiSource/Benchmarks/ASCI_Purple/SMG2000/smg2000
	18.351% +/- 12.156%

SingleSource/Benchmarks/Shootout-C++/methcall
	27.3086% +/- 14.4733%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197099 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 00:19:11 +00:00
Hal Finkel
f15758b1d3 Add isBarrier to SDep
SDep had is* functions for the other kinds of order dependencies (isMustAlias,
isWeak, isArtificial, etc.), but not for barrier. Upcoming commits in the
PowerPC backend will make use of this function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197098 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 00:19:07 +00:00