Commit Graph

15792 Commits

Author SHA1 Message Date
Andrew Trick
f9492288bb LSR: fix IVUsers isSimplifiedLoopNest to perform a full domtree walk
instead of skipping the current loop.

My prior fix was incomplete because of an overzealous compile-time optimization:
Better fix for: <rdar://problem/11049788> Segmentation fault: 11 in LoopStrengthReduce

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153131 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20 21:24:40 +00:00
Chad Rosier
36a273a76c [avx] Move the vextractf128 patterns closer to the vextractf128 def. Remove
whitespace from test case.  No functional change intended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153103 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20 18:24:55 +00:00
Kevin Enderby
9f2e160f7a Fix assembling ARM vst2 instructions with double-spaced registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153099 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20 17:41:51 +00:00
Jim Grosbach
07cdd80ccc ARM non-scattered MachO relocations for movw/movt.
Needed when building -mdynamic-no-pic code.

rdar://10459256

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153097 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20 17:25:45 +00:00
Chad Rosier
1fc999ec47 Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153095 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20 17:20:46 +00:00
Chad Rosier
33e528d44d [avx] Adjust the VINSERTF128rm pattern to allow for unaligned loads.
This results in things such as

	vmovups	16(%rdi), %xmm0
	vinsertf128	$1, %xmm0, %ymm0, %ymm0

to be combined to

    vinsertf128	$1, 16(%rdi), %ymm0, %ymm0

rdar://11076953



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153092 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20 17:08:51 +00:00
Silviu Baranga
5c062ad926 The ARM instructions that have an unpredictable behavior when the pc register operand is given now fail with soft fail. Modified the regression tests to reflect this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153089 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20 15:54:56 +00:00
Bill Wendling
21e42d0ea5 It's possible to have a constant expression who's size is quite big (e.g.,
i128). In that case, we may not be able to print out the MCExpr as an
expression. For instance, we could have an MCExpr like this:

    0xBEEF0000BEEF0000 | (0xBEEF0000BEEF0000 << 64)

The MCExpr printer handles sizes up to 64-bits, but this expression would
require 128-bits. In this situation, try to evaluate the constant expression and
emit that as the value into 64-bit chunks.
<rdar://problem/11070338>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153081 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20 08:56:43 +00:00
Anton Korobeynikov
2d7ea04e28 Perform mul combine when multiplying wiht negative constants.
Patch by Weiming Zhao!
This fixes PR12212


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153049 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-19 19:19:50 +00:00
NAKAMURA Takumi
5587a8e094 llvm/test/DebugInfo: Move two tests to DebugInfo/X86. They are X86-dependent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153038 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-19 16:16:03 +00:00
Preston Gurd
3e99b715d1 This patch adds X86 instruction itineraries for non-pseudo opcodes in
X86InstrCompiler.td.
 
It also adds –mcpu-generic to the legalize-shift-64.ll test so the test
will pass if run on an Intel Atom CPU, which would otherwise
produce an instruction schedule which differs from that which the test expects.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153033 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-19 14:10:12 +00:00
Nick Lewycky
f201a06662 Factor out the multiply analysis code in ComputeMaskedBits and apply it to the
overflow checking multiply intrinsic as well.

Add a test for this, updating the test from grep to FileCheck.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153028 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-18 23:28:48 +00:00
Jim Grosbach
ae151ed87d MC asm parser macro argument count was wrong when empty.
evaluated to '1' when the argument list was empty (should be '0').

rdar://11057257

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152967 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-17 00:11:42 +00:00
Jim Grosbach
be7cf2b377 ARM ldm/stm register lists can be out of order.
It's not a good style idea, as the registers will be laid down in memory in
numerical order, not the order they're in the list, but it's legal. vldm/vstm
are stricter.

rdar://11064740

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152943 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16 20:48:38 +00:00
Bill Wendling
0ccae0b1f6 Revert r152907.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152935 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16 18:20:54 +00:00
Bill Wendling
ff030fd300 The alignment of the pointer part of the store instruction may have an
alignment. If that's the case, then we want to make sure that we don't increase
the alignment of the store instruction. Because if we increase it to be "more
aligned" than the pointer, code-gen may use instructions which require a greater
alignment than the pointer guarantees.
<rdar://problem/11043589>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152907 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16 07:40:08 +00:00
Chandler Carruth
b2442fc760 Rip out support for 'llvm.noinline'. This thing has a strange history...
It was added in 2007 as the first cut at supporting no-inline
attributes, but we didn't have function attributes of any form at the
time. However, it was added without any mention in the LangRef or other
documentation.

Later on, in 2008, Devang added function notes for 'inline=never' and
then turned them into proper function attributes. From that point
onward, as far as I can tell, the world moved on, and no one has touched
'llvm.noinline' in any meaningful way since.

It's time has now come. We have had better mechanisms for doing this for
a long time, all the frontends I'm aware of use them, and this is just
holding back progress. Given that it was never a documented feature of
the IR, I've provided no auto-upgrade support. If people know of real,
in-the-wild bitcode that relies on this, yell at me and I'll add it, but
I *seriously* doubt anyone cares.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152904 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16 06:10:15 +00:00
Andrew Trick
75ae20366f LSR fix: Add isSimplifiedLoopNest to IVUsers analysis.
Only record IVUsers that are dominated by simplified loop
headers. Otherwise SCEVExpander will crash while looking for a
preheader.

I previously tried to work around this in LSR itself, but that was
insufficient. This way, LSR can continue to run if some uses are not
in simple loops, as long as we don't attempt to analyze those users.

Fixes <rdar://problem/11049788> Segmentation fault: 11 in LoopStrengthReduce

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152892 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16 03:16:56 +00:00
Eli Friedman
e9f15c8a56 In InstCombiner::visitOr, make sure we reverse the operand swap used for checking for or-of-xor operations after those checks; a later check expects that any constant will be in Op1. PR12234.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152884 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16 00:52:42 +00:00
Jim Grosbach
213d2e7dc3 ARM optional operand on MRC/MCR assembly instructions.
rdar://11058464

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152883 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16 00:45:58 +00:00
Jim Grosbach
9426ac7b57 ARM vmrs system registers mvfr0 and mvfr1 handling.
rdar://11058464

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152881 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16 00:27:18 +00:00
Eric Christopher
75df9f23fa Do the right thing on NULL uint64 fields.
Patch by Clemens Hammacher!

Fixes PR12243

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152880 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16 00:21:54 +00:00
Eric Christopher
2125d5a7e5 For types with a parent of the compile unit make sure and emit
the DECL information.

rdar://10855921

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152876 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 23:55:40 +00:00
Chad Rosier
0ac754f6f4 [fast-isel] Address Eli's comments for r152847. Specifically, add a test case
and still allow immediate encoding, just not with cmn.
rdar://11038907


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152869 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 22:54:20 +00:00
Jim Grosbach
b84ad4aa7d ARM case-insensitive checking for APSR_nzcv.
rdar://11056591

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152846 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 21:34:14 +00:00
Matt Beaumont-Gay
cb18ca29e2 line endings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152832 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 20:24:29 +00:00
Lang Hames
45b5f88938 Use vmov.f32 to materialize f32 consts on ARM. This relaxes constraints on
register allocation by allowing all 32 D-registers to be used. Patch by Cameron
Zwarich.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152824 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 18:49:02 +00:00
Kristof Beyls
8a6bcc3722 Fix VCVT decoding (between floating-point and fixed-point, Floating-point). Patch by Richard Barton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152814 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 17:50:29 +00:00
Rafael Espindola
2453dff96a Short term fix for pr12270 before we change dominates to handle unreachable
code.
While here, reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152803 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 15:52:59 +00:00
Nadav Rotem
6431ff96be When optimizing certain BUILD_VECTOR nodes into other BUILD_VECTOR nodes, add the new node into the work list because there is a potential for further optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152784 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 08:49:06 +00:00
Eric Christopher
8d101c31d2 Revert the removal of DW_AT_MIPS_linkage_name when we aren't putting
out the DW_AT_name. Older gdbs unfortunately still use it to
disambiguate member functions in templated classes (gdb.cp/templates.exp).

rdar://11043421 (which is now deferred for a bit)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152782 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 08:19:33 +00:00
Chad Rosier
38ca0d78a2 [avx] Add patterns for VINSERTF128rm.
This results in things such as

	vmovaps	-96(%rbx), %xmm1
	vinsertf128	$1, %xmm1, %ymm0, %ymm0

to be combined to
         
	vinsertf128	$1, -96(%rbx), %ymm0, %ymm0

rdar://10643481

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152762 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 00:45:30 +00:00
Aaron Ballman
7e2fa3142a Fixed a transform crash when setting a negative size value for memset. Fixes PR12202.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152756 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15 00:05:31 +00:00
Chandler Carruth
274d377ea6 Extend the inline cost calculation to account for bonuses due to
correlated pairs of pointer arguments at the callsite. This is designed
to recognize the common C++ idiom of begin/end pointer pairs when the
end pointer is a constant offset from the begin pointer. With the
C-based idiom of a pointer and size, the inline cost saw the constant
size calculation, and this provides the same level of information for
begin/end pairs.

In order to propagate this information we have to search for candidate
operations on a pair of pointer function arguments (or derived from
them) which would be simplified if the pointers had a known constant
offset. Then the callsite analysis looks for such pointer pairs in the
argument list, and applies the appropriate bonus.

This helps LLVM detect that half of bounds-checked STL algorithms
(such as hash_combine_range, and some hybrid sort implementations)
disappear when inlined with a constant size input. However, it's not
a complete fix due the inaccuracy of our cost metric for constants in
general. I'm looking into that next.

Benchmarks showed no significant code size change, and very minor
performance changes. However, specific code such as hashing is showing
significantly cleaner inlining decisions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152752 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-14 23:19:53 +00:00
Dan Gohman
8b11fdd8bb When an invoke is marked with metadata indicating its unwind edge
should be ignored by ARC optimization, don't insert new ARC runtime
calls in the unwind destination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152748 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-14 23:05:06 +00:00
Eric Christopher
fc7e9ef239 Remove the DW_AT_MIPS_linkage name attribute when we don't need it
output (we're emitting a specification already and the information
isn't changing).

Saves 1% on the debug information for a build of llvm.

Fixes rdar://11043421

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152697 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-14 02:59:17 +00:00
Evan Cheng
84387ea5f5 DAG combine incorrectly optimize (i32 vextract (v4i16 load $addr), c) to
(i16 load $addr+c*sizeof(i16)) and replace uses of (i32 vextract) with the
i16 load. It should issue an extload instead: (i32 extload $addr+c*sizeof(i16)).

rdar://11035895


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152675 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 22:00:52 +00:00
Kevin Enderby
0f5ab7c5f3 Change the X86 assembler to not require a segment register on string
instruction's destination operand like it does for the source operand.
Also fix a typo in the comment for X86AsmParser::isSrcOp().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152654 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 19:47:55 +00:00
Chris Lattner
5161de6ebb enhance jump threading to preserve TBAA information when PRE'ing loads,
fixing rdar://11039258, an issue that came up when inspecting clang's 
bootstrapped codegen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152635 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 18:07:41 +00:00
Dan Gohman
f1ce79f3c3 Teach globalopt how to evaluate an invoke with a non-void return type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152634 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 18:01:37 +00:00
Duncan Sands
bd0fe56425 Generalize the "trunc(ptrtoint(x)) - trunc(ptrtoint(y)) ->
trunc(ptrtoint(x-y))" optimization introduced by Chandler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152626 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 14:07:05 +00:00
Eli Friedman
5b8f0ddc7e Fix regression from r151466: an we can't replace uses of an instruction reachable from the entry block with uses of an instruction not reachable from the entry block. PR12231.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152595 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 01:06:07 +00:00
Kevin Enderby
8b15278964 Change the second line of the test added for r152414 to use CHECK-NEXT.
Suggestion by Bill Wendling!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152582 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-12 21:38:09 +00:00
Kevin Enderby
84faf65912 Added a missing error check for X86 assembly with mismatched base and index
registers not both being 64-bit or both being 32-bit registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152580 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-12 21:32:09 +00:00
Kostya Serebryany
1778513fa5 [asan] move x86-specific test to a separate X86 directory with a custom lit.local.cfg file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-12 18:49:11 +00:00
Chandler Carruth
6c0b3ac8ea When inlining a function and adding its inner call sites to the
candidate set for subsequent inlining, try to simplify the arguments to
the inner call site now that inlining has been performed.

The goal here is to propagate and fold constants through deeply nested
call chains. Without doing this, we loose the inliner bonus that should
be applied because the arguments don't match the exact pattern the cost
estimator uses.

Reviewed on IRC by Benjamin Kramer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152556 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-12 11:19:33 +00:00
Chandler Carruth
fc72ae613a Teach instsimplify how to constant fold pointer differences.
Typically instcombine has handled this, but pointer differences show up
in several contexts where we would like to get constant folding, and
cannot afford to run instcombine. Specifically, I'm working on improving
the constant folding of arguments used in inline cost analysis with
instsimplify.

Doing this in instsimplify implies some algorithm changes. We have to
handle multiple layers of all-constant GEPs because instsimplify cannot
fold them into a single GEP the way instcombine can. Also, we're only
interested in all-constant GEPs. The result is that this doesn't really
replace the instcombine logic, it's just complimentary and focused on
constant folding.

Reviewed on IRC by Benjamin Kramer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152555 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-12 11:19:31 +00:00
Chandler Carruth
747cccf0dc FileCheck-ize this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152554 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-12 11:19:28 +00:00
Andrew Trick
644f191d31 Move llc + target triple tests into X86
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152502 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-10 19:03:51 +00:00
Benjamin Kramer
30a73022bb Don't try to filecheck bitcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152498 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-10 18:07:46 +00:00