Commit Graph

40250 Commits

Author SHA1 Message Date
Dan Gohman 7a066723d0 Make SCEVCallbackVH::allUsesReplacedWith update the old SCEVUnknown
object, as it may still be referenced by SCEVs not cleaned up by the
use list traversal.

Also, in ScalarEvolution::forgetValue, only check for a SCEVUnknown
object for the original value, not for any value in the use list,
because other SCEVUnknown values aren't necessary obsolete at that
point.

llvm-svn: 109570
2010-07-28 01:09:07 +00:00
Dan Gohman 8aeb0fb5ca Make SCEVCallbackVH::allUsesReplacedWith unconditionally delete
the old value.

llvm-svn: 109567
2010-07-28 00:28:25 +00:00
Nate Begeman 53afc8f06a Implement a vectorized algorithm for <16 x i8> << <16 x i8>
This is about 4x faster and smaller than the existing scalarization.

llvm-svn: 109566
2010-07-28 00:21:48 +00:00
Owen Anderson aac5a72139 Rearrange several datastructures in LazyValueInfo to improve compile time.
This is still not perfect, but better than it was before.

llvm-svn: 109563
2010-07-27 23:58:11 +00:00
Gabor Greif 0630a71742 reintroduce original (asserting) semantics of CallSite(Instruction *II)
add instead a CallSite(Value* V) constructor that is consistent with ImmutableCallSize
and use that one in client code

llvm-svn: 109553
2010-07-27 22:53:28 +00:00
Nate Begeman 269a6da023 ~40% faster vector shl <4 x i32> on SSE 4.1 Larger improvements for smaller types coming in future patches.
For:

define <2 x i64> @shl(<4 x i32> %r, <4 x i32> %a) nounwind readnone ssp {
entry:
  %shl = shl <4 x i32> %r, %a                     ; <<4 x i32>> [#uses=1]
  %tmp2 = bitcast <4 x i32> %shl to <2 x i64>     ; <<2 x i64>> [#uses=1]
  ret <2 x i64> %tmp2
}

We get:

_shl:                                   ## @shl
	pslld	$23, %xmm1
	paddd	LCPI0_0, %xmm1
	cvttps2dq	%xmm1, %xmm1
	pmulld	%xmm1, %xmm0
	ret

Instead of:

_shl:                                   ## @shl
	pshufd	$3, %xmm0, %xmm2
	movd	%xmm2, %eax
	pshufd	$3, %xmm1, %xmm2
	movd	%xmm2, %ecx
	shll	%cl, %eax
	movd	%eax, %xmm2
	pshufd	$1, %xmm0, %xmm3
	movd	%xmm3, %eax
	pshufd	$1, %xmm1, %xmm3
	movd	%xmm3, %ecx
	shll	%cl, %eax
	movd	%eax, %xmm3
	punpckldq	%xmm2, %xmm3
	movd	%xmm0, %eax
	movd	%xmm1, %ecx
	shll	%cl, %eax
	movd	%eax, %xmm2
	movhlps	%xmm0, %xmm0
	movd	%xmm0, %eax
	movhlps	%xmm1, %xmm1
	movd	%xmm1, %ecx
	shll	%cl, %eax
	movd	%eax, %xmm0
	punpckldq	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	punpckldq	%xmm3, %xmm0
	ret

llvm-svn: 109549
2010-07-27 22:37:06 +00:00
Gabor Greif ef1ca24b91 recommit simplification (originally r109504, backed out in r109508) now that problem in CallSiteBase is fixed
llvm-svn: 109547
2010-07-27 22:02:00 +00:00
Devang Patel 84a74779a1 It is FE's responsibility to emit proper directory name.
llvm-svn: 109538
2010-07-27 20:51:15 +00:00
Jim Grosbach 7383cf06ba Grammar
llvm-svn: 109525
2010-07-27 18:36:27 +00:00
Nate Begeman 317b969ac5 Fix a crash in the dag combiner caused by ConstantFoldBIT_CONVERTofBUILD_VECTOR calling itself
recursively and returning a SCALAR_TO_VECTOR node, but assuming the input was always a BUILD_VECTOR.

llvm-svn: 109519
2010-07-27 18:02:18 +00:00
Jim Grosbach 2ff0e64bc3 80 column
llvm-svn: 109513
2010-07-27 17:38:47 +00:00
Jim Grosbach 7639967e6c fix typo
llvm-svn: 109511
2010-07-27 17:14:29 +00:00
Gabor Greif f159085414 recommit simplification (r109502, backed out r109509); seems to innocent
llvm-svn: 109510
2010-07-27 16:44:23 +00:00
Gabor Greif 5f91b7cf3e back out this too to restore the bots
llvm-svn: 109509
2010-07-27 15:56:07 +00:00
Gabor Greif ed1d92cb9a back out r109504, breaks the bots
llvm-svn: 109508
2010-07-27 15:18:11 +00:00
Gabor Greif 7b0a5fd2a5 simplify: CallSite::get --> CallSite constructor
llvm-svn: 109506
2010-07-27 15:02:37 +00:00
Gabor Greif 195a609c37 simplify
llvm-svn: 109504
2010-07-27 14:38:38 +00:00
Gabor Greif d59498bc97 use ImmutableCallSite for const-corrgoodness
llvm-svn: 109503
2010-07-27 14:15:29 +00:00
Gabor Greif 7527b2ed5c simplify
llvm-svn: 109502
2010-07-27 13:31:22 +00:00
Mikhail Glushenkov ee68696c5f Fix silent failure with no input files.
llvm-svn: 109500
2010-07-27 11:19:40 +00:00
Mikhail Glushenkov d359cf2e44 Return -1 only on failure to execute a program.
Also fix some comments.

llvm-svn: 109499
2010-07-27 11:19:36 +00:00
Tobias Grosser fc763867d5 RegionInfo: Add getMaxRegionExit()
getMaxRegionExit returns the exit of the maximal refined region starting
at a specific basic block.

llvm-svn: 109496
2010-07-27 08:39:43 +00:00
Duncan Sands fd5c8329cf After updating value handles for RAUW, check that no weak or tracking handles
are still on the list.  This might happen if a CallbackVH created some new value
handles for the old value when doing RAUW.  Barf if it occurs, since it is almost
certainly a mistake.

llvm-svn: 109495
2010-07-27 06:53:14 +00:00
Michael J. Spencer f8270bdb2d Make MC use Windows COFF on Windows and add tests.
llvm-svn: 109494
2010-07-27 06:46:15 +00:00
Tobias Grosser 1bec81a888 Add function to query RegionInfo about loops.
* contains(Loop), * getOutermostLoop()
* Improve getNameStr() to return a sensible name, if basic blocks are not named.

llvm-svn: 109490
2010-07-27 04:17:13 +00:00
Jakob Stoklund Olesen 96a890a7f8 The isLoadFromStackSlot and isStoreToStackSlot have no way of reporting
subregister operands like this:

%reg1040:sub_32bit<def> = MOV32rm <fi#-2>, 1, %reg0, 0, %reg0, %reg1040<imp-def>; mem:LD4[FixedStack-2](align=8)

Make them return false when subreg operands are present. VirtRegRewriter is
making bad assumptions otherwise.

This fixes PR7713.

llvm-svn: 109489
2010-07-27 04:17:01 +00:00
Jakob Stoklund Olesen c3c05ed02e Add assertions that expose the PR7713 miscompilation: Accessing a stack slot
with a too-big register class.

llvm-svn: 109488
2010-07-27 04:16:58 +00:00
Bill Wendling 0ff1ef650b It's better to have the arrays, which would trigger the creation of stack
protectors, to be near the stack protectors on the stack. Accomplish this by
tagging the stack object with a predicate that indicates that it would trigger
this. In the prolog-epilog inserter, assign these objects to the stack after the
stack protector but before the other objects.

llvm-svn: 109481
2010-07-27 01:55:19 +00:00
Jakob Stoklund Olesen c698417e52 Add SplitEditor to SplitKit. This class will be used to edit live intervals and
rewrite instructions for live range splitting.

Still work in progress.

llvm-svn: 109469
2010-07-26 23:44:11 +00:00
Dan Gohman c2af77f510 Fix a use-after-free.
llvm-svn: 109468
2010-07-26 23:40:24 +00:00
Bill Wendling fa60b0ee51 Using llvm.eh.catch.all.value instead of .llvm.eh.catch.all.value.
llvm-svn: 109462
2010-07-26 22:36:52 +00:00
Eli Friedman f902befe8e And a bit more non-ASCII stuff.
llvm-svn: 109458
2010-07-26 22:28:18 +00:00
Anton Korobeynikov 1e0d76bfd1 Drop some non-ascii stuff
llvm-svn: 109456
2010-07-26 22:23:07 +00:00
Bob Wilson f23a06c2e4 Don't call __register_frame from the JIT on systems that use setjmp/longjmp
exception handling.  Also fix an extra underscore typo in one instance of
"__ARM_EABI__".  Radar 8236264.

llvm-svn: 109451
2010-07-26 21:58:00 +00:00
Evan Cheng d4218b8793 On x86, f32 / f64 nodes share the same registers as 128-bit vector values.
llvm-svn: 109450
2010-07-26 21:50:05 +00:00
Evan Cheng e6d6c5dd11 The "excess register pressure" returned by HighRegPressure() is not accurate enough to factor into scheduling priority. Eliminate it and add early exits to speed up scheduling.
llvm-svn: 109449
2010-07-26 21:49:07 +00:00
Anton Korobeynikov b61a6f2742 Add a note
llvm-svn: 109448
2010-07-26 21:48:35 +00:00
Bruno Cardoso Lopes 36c2ea6c7a Temporary hack to let codegen assert or generate poor code in case
we are using AVX and no AVX version of the desired intruction is present,
this is better for incremental dev (without fallbacks it's easier to spot
what's missing). Not sure this is the best hack thought (we can also disable
all HasSSE* predicates by dinamically marking them 'false' if AVX is present)

llvm-svn: 109434
2010-07-26 21:01:18 +00:00
Owen Anderson aa7f66ba67 Add an initial implementation of LazyValueInfo updating for JumpThreading. Disabled for now.
llvm-svn: 109424
2010-07-26 18:48:03 +00:00
Anton Korobeynikov 6bcea068db Currently EH lowering code expects typeinfo to be global only.
This assumption is not satisfied due to global mergeing.
Workaround the issue by temporary disablinge mergeing of const globals.
Also, ignore LLVM "special" globals. This fixes PR7716

llvm-svn: 109423
2010-07-26 18:45:39 +00:00
Evan Cheng 23b05d1cf5 ARM fastisel isn't ready.
llvm-svn: 109421
2010-07-26 18:32:55 +00:00
Dan Gohman cd83870faf Fix SCEVExpander::visitAddRecExpr so that it remembers the induction variable
it inserted rather than using LoopInfo::getCanonicalInductionVariable to
rediscover it, since that doesn't work on non-canonical loops. This fixes
infinite recurrsion on such loops; PR7562.

llvm-svn: 109419
2010-07-26 18:28:14 +00:00
Dan Gohman 2810bacafb Handle Values with no value in getCopyFromRegs.
llvm-svn: 109415
2010-07-26 18:15:41 +00:00
Dan Gohman 0141c13b22 Remove LCSSA's bogus dependence on LoopSimplify and LoopSimplify's bogus
dependence on DominanceFrontier. Instead, add an explicit DominanceFrontier
pass in StandardPasses.h to ensure that it gets scheduled at the right
time.

Declare that loop unrolling preserves ScalarEvolution, and shuffle some
getAnalysisUsages.

This eliminates one LoopSimplify and one LCCSA run in the standard
compile opts sequence.

llvm-svn: 109413
2010-07-26 18:11:16 +00:00
Dan Gohman a7908ae369 Preserve ScalarEvolution in the loop unroller.
llvm-svn: 109412
2010-07-26 18:02:06 +00:00
Dan Gohman accaca5604 Fix (at least) quadratic worst-case complexity in DominanceFrontier::splitBlock:
don't visit all blocks in the function, and don't iterate over the split blocks'
predecessor lists for each block visited.

Also, remove the special-case test for the entry block. Splitting the entry
block isn't common enough to make this worthwhile.

This fixes a major compile-time bottleneck which is exposed now that
LoopSimplify isn't being redundantly run both before and after
DominanceFrontier.

llvm-svn: 109408
2010-07-26 17:55:15 +00:00
Dan Gohman 30005444fe Avoid copying and recopying a std::set.
llvm-svn: 109405
2010-07-26 17:45:33 +00:00
Dan Gohman 2307c4bb76 Exit a search loop when the search goal is found.
llvm-svn: 109404
2010-07-26 17:41:45 +00:00
Dan Gohman 45af0ad182 Fix formatting.
llvm-svn: 109403
2010-07-26 17:39:33 +00:00
Dan Gohman f9da3c3b88 A block dominates itself, by definition.
llvm-svn: 109402
2010-07-26 17:38:15 +00:00