1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

34344 Commits

Author SHA1 Message Date
Dan Gohman
b2cbb1e37e Fix the result type of SELECT nodes lowered from Select instructions with
aggregate return values. This fixes PR5754.

llvm-svn: 91145
2009-12-11 19:50:50 +00:00
Anton Korobeynikov
f8b2e2868e Honour setHasCalls() set from isel.
This is used in some weird cases like general dynamic TLS model.
This fixes PR5723

llvm-svn: 91144
2009-12-11 19:39:55 +00:00
Johnny Chen
5d6f117ed5 Store Register Exclusive should leave the source register Inst{3-0} unspecified.
llvm-svn: 91143
2009-12-11 19:37:26 +00:00
Jim Grosbach
89e51fb5ff Update properties.
llvm-svn: 91140
2009-12-11 18:52:41 +00:00
Bill Wendling
895f84dd62 Revert part of r91101 which was causing an infinite loop in the self-hosting
build bots.

llvm-svn: 91113
2009-12-11 10:43:41 +00:00
Duncan Sands
d73da0fbb9 Add utility method for determining whether a function argument
has the 'nest' attribute.

llvm-svn: 91109
2009-12-11 08:36:17 +00:00
Evan Cheng
01a56041a5 Add support to 3-addressify 16-bit instructions.
llvm-svn: 91104
2009-12-11 06:01:48 +00:00
Evan Cheng
5f1738960e Coalesce insert_subreg undef, x first to avoid phase ordering issue.
llvm-svn: 91103
2009-12-11 06:01:00 +00:00
Bill Wendling
8f04cee7e1 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.

llvm-svn: 91101
2009-12-11 03:14:18 +00:00
Bill Wendling
0082253b13 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.

llvm-svn: 91092
2009-12-11 01:49:14 +00:00
Jim Grosbach
5a1c16e5bb Rough first pass at compare_and_swap atomic builtins for ARM mode. Work in progress.
llvm-svn: 91090
2009-12-11 01:42:04 +00:00
Devang Patel
1202338fa5 If VariableDIe is not created (may be because global was optimzed away) then do not try to use the variable die.
llvm-svn: 91077
2009-12-10 23:25:41 +00:00
Evan Cheng
4b7cf3ed41 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>

llvm-svn: 91061
2009-12-10 20:59:45 +00:00
Devang Patel
30bc9263b9 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.

llvm-svn: 91055
2009-12-10 19:14:49 +00:00
Jim Grosbach
608ef114aa Add instruction encoding for DMB/DSB
llvm-svn: 91053
2009-12-10 18:35:32 +00:00
Devang Patel
32e16ff8a2 Refactor.
llvm-svn: 91051
2009-12-10 18:05:33 +00:00
Jakob Stoklund Olesen
c1a6340d54 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.

llvm-svn: 91049
2009-12-10 17:48:32 +00:00
Torok Edwin
7879b5fae2 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.

llvm-svn: 91046
2009-12-10 10:01:47 +00:00
Eric Christopher
70ca0b3d58 Make sure the immediate dominator isn't NULL through iterations
of the loop. We could get to this condition via indirect
branches.

llvm-svn: 91009
2009-12-10 00:25:41 +00:00
Chris Lattner
ffedf37584 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'

llvm-svn: 91004
2009-12-10 00:11:45 +00:00
Jim Grosbach
be89da9845 Add memory barrier intrinsic support for ARM. Moving towards adding the atomic operations intrinsics.
llvm-svn: 91003
2009-12-10 00:11:09 +00:00
Chris Lattner
af8114cef6 allow this to build when the #if 0's are enabled. No functionality change.
llvm-svn: 90999
2009-12-10 00:04:46 +00:00
Dan Gohman
3ae2ed72a7 Dereference loopHeader after checking for null rather than before.
llvm-svn: 90990
2009-12-09 22:55:01 +00:00
Evan Cheng
9e2442c0be 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).

llvm-svn: 90984
2009-12-09 21:00:30 +00:00
Dan Gohman
663165c16f Reuse the Threshold value to size these containers because it's
currently somewhat convenient for them to have the same value.

llvm-svn: 90980
2009-12-09 18:48:53 +00:00
Devang Patel
796d04d168 Reapply r90858, a cleanup patch.
llvm-svn: 90979
2009-12-09 18:24:21 +00:00
Chris Lattner
bf3d03b576 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.

llvm-svn: 90978
2009-12-09 18:21:46 +00:00
Chris Lattner
a97922837e change GetStoreValueForLoad to use IRBuilder, which is cleaner and
implicitly constant folds.

llvm-svn: 90977
2009-12-09 18:13:28 +00:00
Bob Wilson
9e68616e49 Fix a comment.
llvm-svn: 90975
2009-12-09 18:05:27 +00:00
Chris Lattner
2f9b661ab8 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.

llvm-svn: 90973
2009-12-09 17:27:45 +00:00
Chris Lattner
e05f9a128c 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.

llvm-svn: 90971
2009-12-09 17:18:49 +00:00
David Goodwin
2bc2d833ab <rdar://problem/7453528>. Track only physical registers that are valid for the target.
llvm-svn: 90970
2009-12-09 17:18:22 +00:00
Chris Lattner
db0baa713d change AnalyzeLoadFromClobberingMemInst/AnalyzeLoadFromClobberingStore
to require the load ty/ptr to be passed in, no functionality change.

llvm-svn: 90960
2009-12-09 07:37:07 +00:00
Chris Lattner
b3587059c8 change AnalyzeLoadFromClobberingWrite and clients to pass in type
and pointer instead of the load.  No functionality change.

llvm-svn: 90959
2009-12-09 07:34:10 +00:00
Chris Lattner
366b8ac755 enhance NonLocalDepEntry to keep the per-block phi translated address
of the query.

llvm-svn: 90958
2009-12-09 07:31:04 +00:00
Daniel Dunbar
a8dc0ca084 DeltaAlgorithm: Add a virtual destructor and home.
llvm-svn: 90957
2009-12-09 07:19:48 +00:00
Chris Lattner
e0207b46d2 change NonLocalDepEntry from being a typedef for an std::pair to be its
own small class.  No functionality change.

llvm-svn: 90956
2009-12-09 07:08:01 +00:00
Lang Hames
a5a7da896e 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.

llvm-svn: 90951
2009-12-09 05:39:12 +00:00
Daniel Dunbar
3d073e0978 Remove spurious extern.
llvm-svn: 90937
2009-12-09 03:26:33 +00:00
Chris Lattner
4645bb977a add some aborts to #if 0's.
llvm-svn: 90929
2009-12-09 02:41:54 +00:00
Chris Lattner
dda5ca59e2 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.

llvm-svn: 90926
2009-12-09 01:59:31 +00:00
Evan Cheng
41c13e41fe Teach InferPtrAlignment to infer GV+cst alignment and use it to simplify x86 isl lowering code.
llvm-svn: 90925
2009-12-09 01:53:58 +00:00
Evan Cheng
7941695285 Move isConsecutiveLoad to SelectionDAG. It's not target dependent and it's primary used by selectdag passes.
llvm-svn: 90922
2009-12-09 01:36:00 +00:00
Chris Lattner
9c2474e272 fix a nasty variable that was shadowing the real CurBB but with the wrong value.
llvm-svn: 90920
2009-12-09 01:19:16 +00:00
Evan Cheng
ad75af2aa2 Infer alignment for non-fixed stack object.
llvm-svn: 90919
2009-12-09 01:17:24 +00:00
Evan Cheng
293ec7b394 Add const qualifier.
llvm-svn: 90918
2009-12-09 01:10:37 +00:00
Evan Cheng
b925774a74 Refactor InferAlignment out of DAGCombine.
llvm-svn: 90917
2009-12-09 01:04:59 +00:00
Chris Lattner
3211af28ba fix many input tracking bugs.
llvm-svn: 90915
2009-12-09 00:56:14 +00:00
Dan Gohman
ed3d370a10 Fix a typo in a comment, and adjust SmallSet and SmallVector sizes,
that Chris noticed.

llvm-svn: 90910
2009-12-09 00:28:42 +00:00
Chris Lattner
c457aaea0d fix PHI translation to take the PHI out of the instinputs set and add
the translated value back to it if an instruction.

llvm-svn: 90909
2009-12-09 00:18:13 +00:00
Chris Lattner
b0d20540ad instructions defined in CurBB may be intermediate nodes of the computation.
llvm-svn: 90908
2009-12-09 00:10:55 +00:00
Chris Lattner
83cb0b1450 add dumping and sanity checking support.
llvm-svn: 90906
2009-12-09 00:01:00 +00:00
Dan Gohman
2d7d4fb9a6 Put a threshold on the number of users PointerMayBeCaptured
examines; fall back to a conservative answer if there are
more. This works around some several compile time problems
resulting from BasicAliasAnalysis calling PointerMayBeCaptured.

The value has been chosen arbitrarily.

This fixes rdar://7438917 and may partially address PR5708.

llvm-svn: 90905
2009-12-08 23:59:12 +00:00
Chris Lattner
604cebbfc1 make sure that PHITransAddr keeps its 'InstInputs' list up to
date when instsimplify kicks in.

llvm-svn: 90901
2009-12-08 23:42:51 +00:00
Devang Patel
11874672da Revert 90858 90875 and 90805 for now.
llvm-svn: 90898
2009-12-08 23:21:45 +00:00
Evan Cheng
edcc21919f - Support inline asm 'w' constraint for 128-bit vector types.
- Also support the 'q' NEON registers asm code.

llvm-svn: 90894
2009-12-08 23:06:22 +00:00
Bob Wilson
04cc375a1a Some superficial cleanups.
llvm-svn: 90866
2009-12-08 18:27:03 +00:00
Bob Wilson
d673b32280 Clean up dead operands left around after SROA replaces a mem intrinsic.
I'm not aware that this does anything significant on its own, but it's
needed for another patch that I'm working on.

llvm-svn: 90864
2009-12-08 18:22:03 +00:00
Devang Patel
5905a705fe Cleanup.
There is no need to supply ModuleCU to addType() as a parameter.

llvm-svn: 90858
2009-12-08 15:31:31 +00:00
Devang Patel
cb39ef375f Do not try to push dead variable's debug info into namespace info.
llvm-svn: 90857
2009-12-08 15:01:35 +00:00
Benjamin Kramer
2d6d1651cf Remove useless calls to c_str().
llvm-svn: 90855
2009-12-08 13:07:38 +00:00
Duncan Sands
897f9579d6 Teach GlobalOpt to delete aliases with internal linkage (after
forwarding any uses).  GlobalDCE can also do this, but is only
run at -O3.

llvm-svn: 90850
2009-12-08 10:10:20 +00:00
Chris Lattner
8cc673c6a0 fix a typo (and -> add) and fix GetAvailablePHITranslatedSubExpr to not
side-effect the current object.

llvm-svn: 90837
2009-12-08 06:06:26 +00:00
Nick Lewycky
5a00cea348 Remove unnecessary #include "llvm/LLVMContext.h".
llvm-svn: 90836
2009-12-08 05:45:41 +00:00
Chris Lattner
acc9c4f542 whitespace cleanup
llvm-svn: 90834
2009-12-08 05:31:46 +00:00
Anton Korobeynikov
0ace515a4c Reduce (cmp 0, and_su (foo, bar)) into (bit foo, bar). This saves extra instruction. Patch inspired by Brian Lucas!
llvm-svn: 90819
2009-12-08 01:03:04 +00:00
Evan Cheng
58a787bc55 Watch out for duplicated PHI instructions.
llvm-svn: 90816
2009-12-07 23:11:03 +00:00
Evan Cheng
fe32f969cd Follow up to 90488. Turn a check into an assertion.
llvm-svn: 90815
2009-12-07 23:10:34 +00:00
Jeffrey Yasskin
d9047c44e4 Fix the OProfileJITEventListener for StringRef being returned from debug info.
llvm-svn: 90813
2009-12-07 22:32:38 +00:00
Victor Hernandez
f5143485fa Rename DIFactory::InsertValue() as DIFactory::InsertDbgValueIntrinsic()
llvm-svn: 90807
2009-12-07 21:54:43 +00:00
Devang Patel
e59f4f7204 Add support to emit debug info for c++ style namespaces.
llvm-svn: 90805
2009-12-07 21:41:32 +00:00
Evan Cheng
72c07bfcad Delete code accidentally left behind.
llvm-svn: 90804
2009-12-07 21:19:33 +00:00
Chris Lattner
3d338590d6 fix typo
llvm-svn: 90793
2009-12-07 19:52:57 +00:00
Chris Lattner
9ed7e3ffb9 add accessor, improve comment.
llvm-svn: 90792
2009-12-07 19:45:30 +00:00
Victor Hernandez
2a16652946 Introduce the "@llvm.dbg.value" debug intrinsic.
The semantics of llvm.dbg.value are that starting from where it is executed, an offset into the specified user source variable is specified to get a new value.

An example:
  call void @llvm.dbg.value(metadata !{ i32 7 }, i64 0, metadata !2)
Here the user source variable associated with metadata #2 gets the value "i32 7" at offset 0.
 

llvm-svn: 90788
2009-12-07 19:36:34 +00:00
Chris Lattner
233d9bf82d add support for phi translation and incorpation of new expression.
llvm-svn: 90782
2009-12-07 19:04:49 +00:00
Dan Gohman
44e25ed254 Don't enable the post-RA scheduler on x86 except at -O3. In its
current form, it is too expensive in compile time.

llvm-svn: 90781
2009-12-07 19:04:31 +00:00
Chris Lattner
0a810a827f checkpoint of the new PHITransAddr code, still not done and not used by
anything.

llvm-svn: 90779
2009-12-07 18:36:53 +00:00
Evan Cheng
79d3b53208 Pre-regalloc tale duplication. Work in progress.
llvm-svn: 90759
2009-12-07 10:15:19 +00:00
Oscar Fuentes
d4427a6b63 Fixes the Atomic implementation if compiled by MSVC compiler.
sys::cas_flag should be long on this platform, InterlockedAdd() is
defined only for the Itanium architecture (according to MSDN).

Patch by Michael Beck!

llvm-svn: 90748
2009-12-07 05:29:59 +00:00
Evan Cheng
2a99985e86 If BB is empty, insert PHI before end() instead of front().
llvm-svn: 90744
2009-12-07 03:07:01 +00:00
Anton Korobeynikov
615499bd84 Some pretty-printing
llvm-svn: 90742
2009-12-07 02:28:41 +00:00
Anton Korobeynikov
b4b8c71b20 Truncate the arguments of llvm.frameaddress / llvm.returnaddress intrinsics from i32 to platform's largest native type
llvm-svn: 90741
2009-12-07 02:28:26 +00:00
Anton Korobeynikov
d01ed4146b Add lowering of returnaddr and frameaddr intrinsics. Shamelessly stolen from x86 :)
llvm-svn: 90740
2009-12-07 02:28:10 +00:00
Anton Korobeynikov
71b92ae4e0 Initial codegen support for MSP430 ISRs
llvm-svn: 90739
2009-12-07 02:27:53 +00:00
Anton Korobeynikov
fadc276b81 Add MSP430 interrupt calling conv. No functionality change yet.
llvm-svn: 90738
2009-12-07 02:27:35 +00:00
Anton Korobeynikov
02fa40119e Add ability to select hw multiplier mode and select appropriate libcalls.
llvm-svn: 90737
2009-12-07 02:27:08 +00:00
Anton Korobeynikov
eee906f4f0 Dynamic stack realignment use of sp register as source/dest register
in "bic sp, sp, #15" leads to unpredicatble behaviour in Thumb2 mode.
Emit the following code instead:
mov r4, sp
bic r4, r4, #15
mov sp, r4

llvm-svn: 90724
2009-12-06 22:39:50 +00:00
Chris Lattner
7066a138ff fix PR5698
llvm-svn: 90708
2009-12-06 17:17:23 +00:00
Chris Lattner
ea3007ddb8 constant fold loads from memcpy's from global constants. This is important
because clang lowers nontrivial automatic struct/array inits to memcpy from
a global array.

llvm-svn: 90698
2009-12-06 05:29:56 +00:00
Chris Lattner
8885e71303 add support for forwarding mem intrinsic values to non-local loads.
llvm-svn: 90697
2009-12-06 04:54:31 +00:00
Chris Lattner
5eba6ee969 Handle forwarding local memsets to loads. For example, we optimize this:
short x(short *A) {
  memset(A, 1, sizeof(*A)*100);
  return A[42];
}

to 'return 257' instead of doing the load.  

llvm-svn: 90695
2009-12-06 01:57:02 +00:00
Dan Gohman
e6ce676cb2 Remove old DBG_LABEL code.
llvm-svn: 90669
2009-12-05 17:56:26 +00:00
Dan Gohman
d2797bf9ae Remove the unused DisableLegalizeTypes option and related code.
llvm-svn: 90668
2009-12-05 17:51:33 +00:00
Bill Wendling
60e15336be Calling InvalidateEntry during the refinement was breaking the bootstrap.
llvm-svn: 90656
2009-12-05 07:59:04 +00:00
Bill Wendling
a24fa4e67b Final cleanups:
- Privatize a typedef.
- Call the InvalidateEntry when refining a type.

llvm-svn: 90655
2009-12-05 07:46:49 +00:00
Bill Wendling
887646a585 Temporarily revert r90502. It was causing the llvm-gcc bootstrap on PPC to fail.
llvm-svn: 90653
2009-12-05 07:30:23 +00:00
Nick Lewycky
056fe5f97d Fix indentation in switch statement.
llvm-svn: 90650
2009-12-05 06:37:24 +00:00
Nick Lewycky
10693e2bb0 Generalize this optimization to work on equality comparisons between any two
integers that are constant except for a single bit (the same n-th bit in each).

llvm-svn: 90646
2009-12-05 05:00:00 +00:00
Dan Gohman
bdf1b76e0f Don't print a space before the : between the file name and line number.
And separate the directory and file name with a '/'.

llvm-svn: 90641
2009-12-05 02:00:34 +00:00