Commit Graph

55007 Commits

Author SHA1 Message Date
Duncan Sands
be1ce0a867 Add utility method for determining whether a function argument
has the 'nest' attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91109 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 08:36:17 +00:00
Evan Cheng
50d070561e Tests for 91103 and 91104.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91105 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 06:02:21 +00:00
Evan Cheng
656e51454a Add support to 3-addressify 16-bit instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91104 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 06:01:48 +00:00
Evan Cheng
ac94863a1c Coalesce insert_subreg undef, x first to avoid phase ordering issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 06:01:00 +00:00
Bill Wendling
64bdde2093 Address comments on last patch:
- Loosen the restrictions when checking of it branches to a landing pad.
- Make the loop more efficient by checking the '.insert' return value.
- Do cheaper checks first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 03:14:18 +00:00
Bill Wendling
4bde1ab82d A machine basic block may end in an unconditional branch, however it may have
more than one successor. Normally, these extra successors are dead. However,
some of them may branch to exception handling landing pads. If we remove those
successors, then the landing pads could go away if all predecessors to it are
removed. Before, it was checking if the direct successor was the landing
pad. But it could be the result of jumping through multiple basic blocks to get
to it. If we were to only check for the existence of an EH_LABEL in the basic
block and not remove successors if it's in there, then it could stop actually
dead basic blocks from being removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:49:14 +00:00
Jim Grosbach
5278eb802f Rough first pass at compare_and_swap atomic builtins for ARM mode. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:42:04 +00:00
Anders Carlsson
da920fa4f9 Add qualifiers for calls to member functions in dependent bases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:04:42 +00:00
Devang Patel
edb4563cea If VariableDIe is not created (may be because global was optimzed away) then do not try to use the variable die.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 23:25:41 +00:00
Eric Christopher
072f6fe196 Add a test for the fix in revision 91009.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91062 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 21:11:40 +00:00
Evan Cheng
6fd78ec8a2 It's not safe to coalesce a move where src and dst registers have different subregister indices. e.g.:
%reg16404:1<def> = MOV8rr %reg16412:2<kill>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 20:59:45 +00:00
Douglas Gregor
e4a70cd19c Remove a broken, unused header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 19:52:22 +00:00
Devang Patel
c366f83d89 Refactor code that finds context for a given die.
Create global variable DIEs after creating subprogram DIEs. This allows function level static variable's to find their context at the time of DIE creation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 19:14:49 +00:00
Jim Grosbach
cbd77d2cb1 Add instruction encoding for DMB/DSB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 18:35:32 +00:00
Devang Patel
16ced733f3 Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 18:05:33 +00:00
Jakob Stoklund Olesen
cf97036675 Also attempt trivial coalescing for live intervals that end in a copy.
The coalescer is supposed to clean these up, but when setting up parameters
for a function call, there may be copies to physregs. If the defining
instruction has been LICM'ed far away, the coalescer won't touch it.

The register allocation hint does not always work - when the register
allocator is backtracking, it clears the hints.

This patch is more conservative than r90502, and does not break
483.xalancbmk/i686. It still breaks the PowerPC bootstrap, so it is disabled
by default, and can be enabled with the -trivial-coalesce-ends option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 17:48:32 +00:00
Torok Edwin
f05e45eb37 Comparing std::string with NULL is a bad idea, so just check whether its empty.
This code was crashing always with oprofile enabled, since it tried to create a StringRef
out of NULL, which run strlen on NULL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 10:01:47 +00:00
Eric Christopher
3472ae1e7b Make sure the immediate dominator isn't NULL through iterations
of the loop. We could get to this condition via indirect
branches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:25:41 +00:00
Chris Lattner
16f244e982 Fix PR5744, a case where we were getting the pointer size instead of the
value size.  This only manifested when memdep inprecisely returns clobber,
which is do to a caching issue in the PR5744 testcase.  We can 'efficiently
emulate' this by using '-no-aa'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91004 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:11:45 +00:00
Jim Grosbach
3728e96a6c Add memory barrier intrinsic support for ARM. Moving towards adding the atomic operations intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91003 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:11:09 +00:00
Chris Lattner
b6760b4a1e allow this to build when the #if 0's are enabled. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90999 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:04:46 +00:00
Dan Gohman
f68d0c1bbe Dereference loopHeader after checking for null rather than before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 22:55:01 +00:00
Evan Cheng
ce72f3fbdf Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90988 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 22:24:42 +00:00
Evan Cheng
c363094e04 Optimize splat of a scalar load into a shuffle of a vector load when it's legal. e.g.
vector_shuffle (scalar_to_vector (i32 load (ptr + 4))), undef, <0, 0, 0, 0>
=>
vector_shuffle (v4i32 load ptr), undef, <1, 1, 1, 1>

iff ptr is 16-byte aligned (or can be made into 16-byte aligned).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 21:00:30 +00:00
Dan Gohman
89452f7386 Reuse the Threshold value to size these containers because it's
currently somewhat convenient for them to have the same value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 18:48:53 +00:00
Devang Patel
8a24114b16 Reapply r90858, a cleanup patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 18:24:21 +00:00
Chris Lattner
af064aeee6 fix hte last remaining known (by me) phi translation bug. When we reanalyze
clobbers to forward pieces of large stores to small loads, we need to consider
the properly phi translated pointer in the store block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90978 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 18:21:46 +00:00
Chris Lattner
b2c6ae8c0b change GetStoreValueForLoad to use IRBuilder, which is cleaner and
implicitly constant folds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 18:13:28 +00:00
Bob Wilson
efc58e7933 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90975 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 18:05:27 +00:00
Chris Lattner
4d3a16f81b Add a minor optimization: if we haven't changed the operands of an
add, there is no need to scan the world to find the same add again.
This invalidates the previous testcase, which wasn't wonderful anyway,
because it needed a run of instcombine to permute the use-lists in 
just the right way to before GVN was run (so it was really fragile).
Not a big loss.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90973 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 17:27:45 +00:00
Anton Korobeynikov
16f1692dca Add note about loadable modules on windows.
Patch by Gregory Petrosyan!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90972 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 17:26:02 +00:00
Chris Lattner
eddc65aa0d fix PR5733, a case where we'd replace an add with a lexically identical
binary operator that wasn't an add.  In this case, a xor.  Whoops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 17:18:49 +00:00
David Goodwin
990d285765 <rdar://problem/7453528>. Track only physical registers that are valid for the target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 17:18:22 +00:00
Chris Lattner
1a247f32dd merge crash-2.ll into crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 17:17:26 +00:00
Eric Christopher
1e8c6934f2 Silence conversion warning from 64 to 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 08:29:32 +00:00
Chris Lattner
4ca70fe15f change AnalyzeLoadFromClobberingMemInst/AnalyzeLoadFromClobberingStore
to require the load ty/ptr to be passed in, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:37:07 +00:00
Chris Lattner
03f17da4da change AnalyzeLoadFromClobberingWrite and clients to pass in type
and pointer instead of the load.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:34:10 +00:00
Chris Lattner
dad451cb7c enhance NonLocalDepEntry to keep the per-block phi translated address
of the query.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:31:04 +00:00
Daniel Dunbar
022840e960 DeltaAlgorithm: Add a virtual destructor and home.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:19:48 +00:00
Chris Lattner
e18b97121c change NonLocalDepEntry from being a typedef for an std::pair to be its
own small class.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:08:01 +00:00
Lang Hames
6194569d22 Added a new "splitting" spiller.
When a call is placed to spill an interval this spiller will first try to
break the interval up into its component values. Single value intervals and
intervals which have already been split (or are the result of previous splits)
are spilled by the default spiller.

Splitting intervals as described above may improve the performance of generated
code in some circumstances. This work is experimental however, and it still
miscompiles many benchmarks. It's not recommended for general use yet.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 05:39:12 +00:00
Daniel Dunbar
164c7ba0ef Remove spurious extern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 03:26:33 +00:00
Daniel Dunbar
e854273892 Remove unneeded ';' and a class/struct mismatch (noticed by clang).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 02:58:09 +00:00
Chris Lattner
55fe79f044 the code in GVN that tries to forward large loads to small
stores is not phi translating, thus it miscompiles really
crazy testcases.  This is from inspection, I haven't seen
this in the wild.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 02:43:05 +00:00
Chris Lattner
b3f927f6dd add some aborts to #if 0's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90929 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 02:41:54 +00:00
Chris Lattner
05e15f8897 Switch GVN and memdep to use PHITransAddr, which correctly handles
phi translation of complex expressions like &A[i+1].  This has the
following benefits:

1. The phi translation logic is all contained in its own class with
   a strong interface and verification that it is self consistent.

2. The logic is more correct than before.  Previously, if intermediate
   expressions got PHI translated, we'd miss the update and scan for
   the wrong pointers in predecessor blocks.  @phi_trans2 is a testcase
   for this.

3. We have a lot less code in memdep.

We can handle phi translation across blocks of things like @phi_trans3,
which is pretty insane :).

This patch should fix the miscompiles of 255.vortex, and I tested it 
with a bootstrap of llvm-gcc, llvm-test and dejagnu of course.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90926 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:59:31 +00:00
Evan Cheng
7bd6478cd6 Teach InferPtrAlignment to infer GV+cst alignment and use it to simplify x86 isl lowering code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90925 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:53:58 +00:00
Devang Patel
a963306eed Remove tests that are not suitable anymore. Plus they are not testing the original bugfixes anymore. These tests were inserted to check bug fixes in code that handled debug info intrinsics. These intrinsics are no longer used and now llvm parser simply ignores old .dbg intrinsics from these dead tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:46:00 +00:00
Evan Cheng
64fa4a9584 Move isConsecutiveLoad to SelectionDAG. It's not target dependent and it's primary used by selectdag passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:36:00 +00:00
Chris Lattner
d632988eea fix a nasty variable that was shadowing the real CurBB but with the wrong value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:19:16 +00:00