Commit Graph

15633 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
c76ad82140 Remove a bad PowerPC test.
This test case was way too strict, matching the entire assembly output.
Every non-trivial change to the ppc backend  or -O0 pipeline required
the test to be updated.

It should be replaced with a test of the specific vaarg feature.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151105 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 23:49:18 +00:00
Eric Christopher
ce7090360b Testcase for previous commit.
rdar://10493979

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151098 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 22:25:56 +00:00
Eric Christopher
35f225aa2c There's no need for a DW_AT_byte_size on a pointer type.
Part of rdar://10493979 where it reduces by about .5% (10k)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151097 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 22:25:53 +00:00
Nick Lewycky
a641c07828 Use the target-aware constant folder on expressions to improve the chance
they'll be simple enough to simulate, and to reduce the chance we'll encounter
equal but different simple pointer constants.

This removes the symptoms from PR11352 but is not a full fix. A proper fix would
either require a guarantee that two constant objects we simulate are folded
when equal, or a different way of handling equal pointers (ie., trying a
constantexpr icmp on them to see whether we know they're equal or non-equal or
unsure).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151093 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 22:08:06 +00:00
Evan Cheng
07043279f6 Proper support for a bastardized darwin-eabi hybird ABI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151083 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 20:46:00 +00:00
Benjamin Kramer
8294eb5599 InstCombine: Don't transform a signed icmp of two GEPs into a signed compare of the indices.
This transformation is not safe in some pathological cases (signed icmp of pointers should be an
extremely rare thing, but it's valid IR!). Add an explanatory comment.

Kudos to Duncan for pointing out this edge case (and not giving up explaining it until I finally got it).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151055 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 13:31:09 +00:00
NAKAMURA Takumi
bf8f50d944 test/CodeGen/X86/2012-02-20-MachineCPBug.ll: Fix on generic(non-x86) hosts to add -mattr=+sse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151053 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 11:56:42 +00:00
Nick Lewycky
0ef0557ab5 Check for the correct size in the invariant marker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151003 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 23:32:26 +00:00
Evan Cheng
01b623c8c2 Fix machine-cp by having it to check sub-register indicies. e.g.
ecx = mov eax
al  = mov ch
The second copy is not a nop because the sub-indices of ecx,ch is not the
same of that of eax/al.

Re-enabled machine-cp.
PR11940


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151002 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 23:28:17 +00:00
Benjamin Kramer
117314009e Test case for r150978.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150979 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 19:00:28 +00:00
Benjamin Kramer
9bb40853ee InstCombine: When comparing two GEPs that were derived from the same base pointer but use different types, expand the offset calculation and to the compare on the offset if profitable.
This came up in SmallVector code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150962 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 15:07:47 +00:00
Benjamin Kramer
d2348639e6 InstCombine: Make OptimizePointerDifference more aggressive.
- Ignore pointer casts.
- Also expand GEPs that aren't constantexprs when they have one use or only constant indices.

- We now compile "&foo[i] - &foo[j]" into "i - j".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150961 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 14:34:57 +00:00
Chris Lattner
b053fc1c92 fold comparisons of gep'd alloca points with null to false,
implementing PR12013.  We now compile the testcase to:

__Z4testv:                              ## @_Z4testv
## BB#0:                                ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit
	pushq	%rbx
	subq	$64, %rsp
	leaq	32(%rsp), %rbx
	movq	%rbx, (%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 16(%rsp)
	movl	$1, 32(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	(%rsp), %rdi
	callq	__Z1gRN4llvm11SmallVectorIiLj8EEE
	movq	(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	LBB0_2
## BB#1:
	callq	_free
LBB0_2:                                 ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit
	addq	$64, %rsp
	popq	%rbx
	ret

instead of:

__Z4testv:                              ## @_Z4testv
## BB#0:
	pushq	%rbx
	subq	$64, %rsp
	xorl	%eax, %eax
	leaq	(%rsp), %rbx
	addq	$32, %rbx
	movq	%rbx, (%rsp)
	movq	%rbx, 8(%rsp)
	leaq	64(%rsp), %rcx
	movq	%rcx, 16(%rsp)
	je	LBB0_2
## BB#1:
	movl	$1, 32(%rsp)
	movq	%rbx, %rax
LBB0_2:                                 ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit
	addq	$4, %rax
	movq	%rax, 8(%rsp)
	leaq	(%rsp), %rdi
	callq	__Z1gRN4llvm11SmallVectorIiLj8EEE
	movq	(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	LBB0_4
## BB#3:
	callq	_free
LBB0_4:                                 ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit
	addq	$64, %rsp
	popq	%rbx
	ret

This doesn't shrink clang noticably though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150944 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 00:42:49 +00:00
Craig Topper
28a713b20a Add vmfunc instruction to X86 assembler and disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150899 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 01:39:49 +00:00
Rafael Espindola
ef4c80e07b Don't skip debug instructions when looking for the insertion point of
the cast. If we do, we can end up with

   inst1
   ---------------  < Insertion point
   dbg inst
   new inst

instead of the desired

   inst1
   new inst
   ---------------  < Insertion point
   dbg inst

Another option would be for InsertNoopCastOfTo (or its callers) to move the
insertion point and we would end up with

   inst1
   dbg inst
   new inst
   ---------------  < Insertion point

but that complicates the callers. This fixes PR12018 (and firefox's build).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150884 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 17:22:58 +00:00
Craig Topper
9e3d0b3351 Add X86 assembler and disassembler support for AMD SVM instructions. Original patch by Kay Tiong Khoo. Few tweaks by me for code density and to reduce replication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150873 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 08:19:49 +00:00
Eli Friedman
2c3acb0e27 Fix a rather nasty regression from r150690: LHS != RHS does not imply LHS->stripPointerCasts() != RHS->stripPointerCasts().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150863 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 03:29:25 +00:00
Eric Christopher
50627097b7 Testcase for the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150852 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 00:05:45 +00:00
Dan Gohman
dbe266be35 Calls and invokes with the new clang.arc.no_objc_arc_exceptions
metadata may still unwind, but only in ways that the ARC
optimizer doesn't need to consider. This permits more
aggressive optimization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150829 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 18:59:53 +00:00
David Chisnall
ca5b752d18 It turns out that putting an 8-byte symbol in a 4-byte section makes Solaris ld sulk. GNU ld is perfectly happy with it, which is worrying for a whole other set of reasons...
Thanks to Anton, Duncan and Rafael for helping me track this down.
Pointy hat to Rafael for introducing the bug in the first place.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150811 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 16:05:50 +00:00
Nick Lewycky
c5e6f99981 Remove question.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150809 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 09:55:20 +00:00
Nick Lewycky
81266c5c93 Add support for invariant.start inside the static constructor evaluator. This is
useful to represent a variable that is const in the source but can't be constant
in the IR because of a non-trivial constructor. If globalopt evaluates the
constructor, and there was an invariant.start with no matching invariant.end
possible, it will mark the global constant afterwards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150794 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 06:59:21 +00:00
Chad Rosier
b8703fe265 [fast-isel] Add support for returning non-legal types with no sign- or zero-
entend flag.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150774 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 01:21:28 +00:00
Bill Wendling
5b0e7886f3 Use –mcpu=generic, so that the test will not fail when run on an Intel Atom
processor, due to the Atom scheduler producing an instruction sequence that is
different from that which is expected.
Patch by Michael Spencer!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150736 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 22:42:48 +00:00
Benjamin Kramer
1a7ea9dd04 Disable machine copy propagation for now. It's known to be buggy (PR11940) and introduces subtle miscompiles in many places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150703 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 17:29:50 +00:00
Benjamin Kramer
fd8779a94b InstSimplify: Ignore pointer casts when constant folding compares between pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150690 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 13:49:39 +00:00
Eli Bendersky
0f0c411079 Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed.
Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150664 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 06:28:33 +00:00
Eli Friedman
5e6162e756 loop-rotate shouldn't hoist alloca instructions out of a loop. Patch by Patrik Hägglund, with slightly modified test. Issue reported by Patrik Hägglund on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150642 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 00:41:10 +00:00
Bill Wendling
46b8b27057 Remove extraneous tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150636 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 23:44:05 +00:00
Bill Wendling
b183f5283a Add a test for generating Objective-C metadata from module flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150635 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 23:43:37 +00:00
Bill Wendling
39c4cd3180 Add a test for the Objective-C garbage collection metadata stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150626 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 22:44:10 +00:00
David Meyer
5f7692604d For ELF, also call fixSymbolsInTLSFixups() on expressions passed to EmitValue (literal values). Previously only called on expressions in instructions. New test cases added to tls.s, tls-i386.s. Resolves PR11981.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150582 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 15:09:06 +00:00
Pete Cooper
9989a63818 Stop custom lowering forr x86 DEC64m from happening if the load in the lowered sequence has more than 1 user
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150537 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 00:33:37 +00:00
Lang Hames
342c64c904 Tighten physical register invariants: Allocatable physical registers can
only be live in to a block if it is the function entry point or a landing pad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150494 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 18:51:53 +00:00
Nadav Rotem
8b7c3d0ee4 Fix PR12000. Some vector operations may use scalar operands with types
that are greater than the vector element type. For example BUILD_VECTOR
of type <1 x i1> with a constant i8 operand.
This patch fixes the assertion.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150477 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 13:06:32 +00:00
Bill Wendling
c54066aed3 Change error tests to coincide with message changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150467 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 09:29:21 +00:00
Kostya Serebryany
747c02c768 [asan] fix asan-vs-gvn.ll test (it did not actually check much before this change)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150441 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 00:02:35 +00:00
Andrew Trick
f6629ab847 Add simplifyLoopLatch to LoopRotate pass.
This folds a simple loop tail into a loop latch. It covers the common (in fortran) case of postincrement loops. It's a "free" way to expose this type of loop to downstream loop optimizations that bail out on non-canonical loops (getLoopLatch is a heavily used check).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150439 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 00:00:23 +00:00
Devang Patel
a2e0f6b643 Check against umin while converting fcmp into an icmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150425 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 23:05:18 +00:00
Dan Gohman
a3b08d68bd Just like in regular escape analysis, loads and stores through
(but not of) a block pointer do not cause the block pointer to
escape. This fixes rdar://10803830.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150424 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 22:57:02 +00:00
Kostya Serebryany
60ebb1947f ThreadSanitizer, a race detector. First LLVM commit.
Clang patch (flags) will follow shortly.
The run-time library will also follow, but not immediately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150423 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 22:50:51 +00:00
Nadav Rotem
0877fdf30b Fix a bug in DAGCombine for the optimization of BUILD_VECTOR. We cant generate a shuffle node from two vectors of different types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150383 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 12:42:26 +00:00
Craig Topper
3434b4354a Revert accidental commit of a pruned testcase from r150360.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150361 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 04:33:33 +00:00
Craig Topper
2dcd718c13 Update CanXFormVExtractWithShuffleIntoLoad to ensure bitcasts of loads only have one use. Matches DAGCombiner and prevents vector_shuffles from reaching isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150360 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 04:30:38 +00:00
Pete Cooper
ce3900849a Fixed bug when custom lowering DEC64m on x86.
If the DEC node had more than one user, it was doing this lowering but
leaving the original DEC node around and so decrementing twice.

Fixes PR11964.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150356 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 00:10:03 +00:00
Nadav Rotem
2ee746b87d This patch addresses the problem of poor code generation for the zext
v8i8 -> v8i32 on AVX machines. The codegen often scalarizes ANY_EXTEND nodes.
The DAGCombiner has two optimizations that can mitigate the problem. First,
if all of the operands of a BUILD_VECTOR node are extracted from an ZEXT/ANYEXT
nodes, then it is possible to create a new simplified BUILD_VECTOR which uses
UNDEFS/ZERO values to eliminate the scalar ZEXT/ANYEXT nodes.
Second, another dag combine optimization lowers BUILD_VECTOR into a shuffle
vector instruction.

In the case of zext v8i8->v8i32 on AVX, a value in an XMM register is to be
shuffled into a wide YMM register.

This patch modifes the second optimization and allows the creation of
shuffle vectors even when the newly generated vector and the original vector
from which we extract the values are of different types.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150340 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 15:05:31 +00:00
Anton Korobeynikov
d4a19b6a72 Add support for implicit TLS model used with MS VC runtime.
Patch by Kai Nacke!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 17:26:53 +00:00
Bill Wendling
d34cb1e09f [WIP] Initial code for module flags.
Module flags are key-value pairs associated with the module. They include a
'behavior' value, indicating how module flags react when mergine two
files. Normally, it's just the union of the two module flags. But if two module
flags have the same key, then the resulting flags are dictated by the behaviors.

Allowable behaviors are:

     Error
       Emits an error if two values disagree.

     Warning
       Emits a warning if two values disagree.

     Require
       Emits an error when the specified value is not present
       or doesn't have the specified value. It is an error for
       two (or more) llvm.module.flags with the same ID to have
       the Require behavior but different values. There may be
       multiple Require flags per ID.

     Override
       Uses the specified value if the two values disagree. It
       is an error for two (or more) llvm.module.flags with the
       same ID to have the Override behavior but different
       values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150300 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 11:38:06 +00:00
Hal Finkel
38a7f22445 Update BBVectorize to use aliasesUnknownInst.
This allows BBVectorize to check the "unknown instruction" list in the
alias sets. This is important to prevent instruction fusing from reordering
function calls. Resolves PR11920.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150250 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 15:52:40 +00:00
Duncan Sands
aa97bb54f0 Fix PR11948: the result type of an icmp may be a vector of boolean -
don't assume it is a boolean.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150247 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 14:31:24 +00:00