1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 14:33:02 +02:00
Commit Graph

25661 Commits

Author SHA1 Message Date
Duncan Sands
50acaf2367 Formating/comment changes - no functionality change.
llvm-svn: 58801
2008-11-06 08:51:32 +00:00
Evan Cheng
aa24d19533 Remove opcode from instruction TS flags; add MOVCC support; fix addrmode3 encoding bug.
llvm-svn: 58800
2008-11-06 08:47:38 +00:00
Bill Wendling
b6e2d60e7a - Rename stackprotector_{prologue,epilogue} to stackprotector_{create,check}.
- Get rid of "HasStackProtector" in MachineFrameInfo.
- Modify intrinsics to tell which are doing what with memory.

llvm-svn: 58799
2008-11-06 07:23:03 +00:00
Mon P Wang
41f90a3ee5 Widening cleanup
llvm-svn: 58796
2008-11-06 05:31:54 +00:00
Evan Cheng
078361bddc Handle smul<x><y>, smulw<y>, smla<x><y>, smlaw<y>.
llvm-svn: 58793
2008-11-06 03:35:07 +00:00
Bill Wendling
489791a127 Adjust the stack protector heuristic to care about only arrays or calls to
"alloca".

llvm-svn: 58792
2008-11-06 02:38:58 +00:00
Bill Wendling
08905ed703 Implement the stack protector stack accesses via intrinsics:
- stackprotector_prologue creates a stack object and stores the guard there.

- stackprotector_epilogue reads the stack guard from the stack position created
  by stackprotector_prologue.

- The PrologEpilogInserter was changed to make sure that the stack guard is
  first on the stack frame.

llvm-svn: 58791
2008-11-06 02:29:10 +00:00
Evan Cheng
058721d10b Fix so_imm encoding bug; add support for MOVi2pieces.
llvm-svn: 58790
2008-11-06 02:25:39 +00:00
Evan Cheng
ca6759021b Fix encoding of multiple instructions with 3 src operands; also handle smmul, smmla, and smmls.
llvm-svn: 58789
2008-11-06 01:21:28 +00:00
Evan Cheng
3e727721d0 Need a \n.
llvm-svn: 58788
2008-11-06 01:18:29 +00:00
Devang Patel
cea9dfa11f InstructionNamer preserves everything.
llvm-svn: 58787
2008-11-06 01:00:16 +00:00
Devang Patel
ec135e1f33 Emit label for llvm.dbg.func.start of the inlined function.
llvm-svn: 58786
2008-11-06 00:30:09 +00:00
Evan Cheng
7390b46342 Undo 58778 but makes the binary dump prettier.
llvm-svn: 58782
2008-11-05 23:44:08 +00:00
Bill Wendling
538cbf1e09 Add comments to function.
llvm-svn: 58781
2008-11-05 23:42:27 +00:00
Evan Cheng
ce97712aa6 Encode pic load / store instructions; fix some encoding bugs.
llvm-svn: 58780
2008-11-05 23:22:34 +00:00
Evan Cheng
575f3150cf Remove debug output that's not really useful.
llvm-svn: 58778
2008-11-05 23:21:11 +00:00
Evan Cheng
9970c31dcf Restructure ARM code emitter to use instruction formats instead of addressing modes to determine how to encode instructions.
llvm-svn: 58764
2008-11-05 18:35:52 +00:00
Dan Gohman
1db84e57c5 Reintroduce a comment that was removed with the AddToISelQueue
changes.

llvm-svn: 58760
2008-11-05 17:16:24 +00:00
Richard Osborne
efd7edc731 Test commit, add Makefile for XCore target, more to follow.
llvm-svn: 58755
2008-11-05 09:53:58 +00:00
Duncan Sands
f56e2fb5c2 Fix thinko in ppcf128 expansion of truncating store.
llvm-svn: 58753
2008-11-05 07:17:27 +00:00
Evan Cheng
1378d6c7a9 Add more vector move low and zero-extend patterns.
llvm-svn: 58752
2008-11-05 06:04:51 +00:00
Evan Cheng
1bde698192 Type of shuffle mask has changed.
llvm-svn: 58751
2008-11-05 06:04:18 +00:00
Evan Cheng
fdd6d65e39 Indentation.
llvm-svn: 58750
2008-11-05 06:03:38 +00:00
Dan Gohman
cd4b68bee9 Eliminate the ISel priority queue, which used the topological order for a
priority function. Instead, just iterate over the AllNodes list, which is
already in topological order. This eliminates a fair amount of bookkeeping,
and speeds up the isel phase by about 15% on many testcases.

The impact on most targets is that AddToISelQueue calls can be simply removed.

In the x86 target, there are two additional notable changes.

The rule-bending AND+SHIFT optimization in MatchAddress that creates new
pre-isel nodes during isel is now a little more verbose, but more robust.
Instead of either creating an invalid DAG or creating an invalid topological
sort, as it has historically done, it can now just insert the new nodes into
the node list at a position where they will be consistent with the topological
ordering.

Also, the address-matching code has logic that checked to see if a node was
"already selected". However, when a node is selected, it has all its uses
taken away via ReplaceAllUsesWith or equivalent, so it won't recieve any
further visits from MatchAddress. This code is now removed.

llvm-svn: 58748
2008-11-05 04:14:16 +00:00
Dan Gohman
215587186e Use getTargetConstant instead of getConstant for nodes that should not be visited
by isel and potentially forced into registers.

llvm-svn: 58747
2008-11-05 02:06:09 +00:00
Evan Cheng
2702e22b83 Rename isGVLazyPtr to isGVNonLazyPtr relocation. This represents Mac OS X
indirect gv reference. Please don't call it lazy.

llvm-svn: 58746
2008-11-05 01:50:32 +00:00
Devang Patel
de9b95965a Do now allow InlineAlways pass to remove dead functions.
llvm-svn: 58744
2008-11-05 01:39:16 +00:00
Devang Patel
b55a78e553 Silence unused variable warnings.
llvm-svn: 58743
2008-11-05 01:37:40 +00:00
Devang Patel
bc6ef4c191 Check Attribute::NoInline.
llvm-svn: 58742
2008-11-05 01:37:05 +00:00
Bill Wendling
986e386794 Remove dead variable.
llvm-svn: 58741
2008-11-05 00:56:35 +00:00
Bill Wendling
8c86d20576 Simplify the allocated size calculation.
llvm-svn: 58740
2008-11-05 00:54:27 +00:00
Bill Wendling
2461aaa183 Fix comment
llvm-svn: 58739
2008-11-05 00:46:15 +00:00
Owen Anderson
df29b0d7b2 Use the new predicate to control when we do prealloc splitting. Fix a small bug.
llvm-svn: 58738
2008-11-05 00:32:13 +00:00
Evan Cheng
8a5c3c5cc3 Debugging output tweak.
llvm-svn: 58737
2008-11-05 00:22:28 +00:00
Oscar Fuentes
afb65a6c2a CMake: updated list of source files.
llvm-svn: 58736
2008-11-05 00:11:22 +00:00
Bill Wendling
e73f31f526 Some code simplification. It now doesn't generate a prologue if the epilogue
isn't going to be generated.

llvm-svn: 58734
2008-11-05 00:00:21 +00:00
Dan Gohman
c162a200ad Add a new pass to simplify specific half_powr function calls. This is
a specialized pass that it not likely to be generally useful.

llvm-svn: 58732
2008-11-04 23:41:45 +00:00
Nuno Lopes
a5d766c285 fix memory leak in pass manager when adding an analysis pass that already existed. as pass manager takes ownership of the added passes, it has to delete the pass if it isnt added to the pass list
tweak the opt tool so that it doesnt access a Pass after the ownership was taken by the pass manager

llvm-svn: 58730
2008-11-04 23:03:58 +00:00
Bill Wendling
214f515922 Small simplification of the stack guard type.
llvm-svn: 58728
2008-11-04 22:54:43 +00:00
Bill Wendling
79a8798e07 - Add a "getOrInsertGlobal" method to the Module class. This acts similarly to
"getOrInsertFunction" in that it either adds a new declaration of the global
  and returns it, or returns the current one -- optionally casting it to the
  correct type.
- Use the new getOrInsertGlobal in the stack protector code.
- Use "splitBasicBlock" in the stack protector code.

llvm-svn: 58727
2008-11-04 22:51:24 +00:00
Owen Anderson
2ed3bc9016 First pass at checking for the creation of a new join point when doing pre-alloc splitting. This is not turned on yet.
llvm-svn: 58726
2008-11-04 22:22:41 +00:00
Evan Cheng
59112bc108 Actually ARM / Mac OS X does have UINTTOFP_I64_F{64|32} libcalls.
llvm-svn: 58725
2008-11-04 22:19:55 +00:00
Bill Wendling
ae168b2c83 Update in response to feedback from Chris:
- Use enums instead of magic numbers.

- Rework algorithm to use the bytes size from the target to determine when to
  emit stack protectors.

- Get rid of "propolice" in any comments.

- Renamed an option to its expanded form.

- Other miscellanenous changes.

More changes will come after this.

llvm-svn: 58723
2008-11-04 21:53:09 +00:00
Dale Johannesen
e51c5296a6 Allow SROA of vectors. Removing this caused a
huge performance regression in something we care
about.  This may not be final fix.

llvm-svn: 58718
2008-11-04 20:54:03 +00:00
Dale Johannesen
eee3a8a2e0 80 columns
llvm-svn: 58717
2008-11-04 20:52:49 +00:00
Evan Cheng
45496b349f Custom lower bit_convert i64 -> f64 into FMDRR. This is now happening with legalizetypes.
llvm-svn: 58714
2008-11-04 19:57:48 +00:00
Duncan Sands
aed2dfe3f6 Fix typo. Patch by nlewycky.
llvm-svn: 58709
2008-11-04 18:05:30 +00:00
Evan Cheng
d63b7563b7 Debug output tweak.
llvm-svn: 58708
2008-11-04 17:58:53 +00:00
Evan Cheng
088f7c51a4 LDM_RET restores pc, do not set 's' bit which would restore CPSR from SPSR.
llvm-svn: 58707
2008-11-04 17:57:07 +00:00
Duncan Sands
58ebf09772 Fix PR3011: LegalizeTypes support for scalarizing
SELECT_CC.

llvm-svn: 58706
2008-11-04 17:31:08 +00:00
Dan Gohman
50183113b9 Duncan pointed out that the Extended case in getTypeForMVT could
be considerably simplified.

llvm-svn: 58703
2008-11-04 16:19:44 +00:00
Dan Gohman
13237dda2d Add a return statement to suppress warnings in NDEBUG builds.
llvm-svn: 58702
2008-11-04 16:08:57 +00:00
Dan Gohman
2dff90b025 Add some asserts to verify MVT invariant assumptions.
llvm-svn: 58701
2008-11-04 16:03:56 +00:00
Nuno Lopes
b16d9bd0c3 regenerate
llvm-svn: 58697
2008-11-04 14:43:20 +00:00
Nuno Lopes
064bb29c9d fix leakage of APFloats in getExistingVal()
llvm-svn: 58696
2008-11-04 14:42:19 +00:00
Nuno Lopes
8499bc5e1d regenerate
llvm-svn: 58694
2008-11-04 14:28:33 +00:00
Nuno Lopes
5caf466051 fix leakage of APSInt in getVal()
llvm-svn: 58693
2008-11-04 14:26:58 +00:00
Nuno Lopes
0995eae6b8 fix leakage of IfcvtTokens
llvm-svn: 58690
2008-11-04 13:02:59 +00:00
Evan Cheng
28e234a959 For some targets, it's not possible to place GVs in the same memory buffer as the MachineCodeEmitter allocated memory. Code and data has different read / write / execution privilege requirements.
This is a short term workaround. The current solution is for the JIT memory manager to manage code and data memory separately.

llvm-svn: 58688
2008-11-04 09:30:48 +00:00
Evan Cheng
7847f4f030 80 col violation.
llvm-svn: 58684
2008-11-04 06:10:31 +00:00
Evan Cheng
f15a9cfb31 Stylistic change.
llvm-svn: 58683
2008-11-04 06:10:06 +00:00
Evan Cheng
0369860450 hasDisassembler should return false if disassembler isn't available.
llvm-svn: 58682
2008-11-04 06:09:38 +00:00
Oscar Fuentes
9f6d4e7fb0 CMake: Updated list of source files.
llvm-svn: 58676
2008-11-04 03:24:04 +00:00
Bill Wendling
0f3f36688b Initial checkin for stack protectors. Here's what it does:
* The prologue is modified to read the __stack_chk_guard global and insert it
  onto the stack.

* The epilogue is modified to read the stored guard from the stack and compare
  it to the original __stack_chk_guard value. If they differ, then the
  __stack_chk_fail() function is called.

* The stack protector needs to be first on the stack (after the parameters) to
  catch any stack-smashing activities.

Front-end support will follow after a round of beta testing.

llvm-svn: 58673
2008-11-04 02:10:20 +00:00
Evan Cheng
f117632c3f Handle ARM machine constantpool entries.
llvm-svn: 58671
2008-11-04 00:50:32 +00:00
Dan Gohman
0ba8aad1af The ANDMask node folds to a constant, and isn't the node that needs to
have its node id set. The new and and shift nodes are the nodes that need
the IDs. This fixes PR2982.

llvm-svn: 58655
2008-11-03 23:43:55 +00:00
Devang Patel
09aea7e93e Fix unused variable warnings.
llvm-svn: 58653
2008-11-03 23:20:04 +00:00
Devang Patel
40cfcf7ce2 Fix unused variable warnings.
llvm-svn: 58651
2008-11-03 23:14:09 +00:00
Dan Gohman
3258c45d0f Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel!
llvm-svn: 58650
2008-11-03 22:55:43 +00:00
Evan Cheng
999398c004 Remove a dead switch statement.
llvm-svn: 58644
2008-11-03 21:26:52 +00:00
Evan Cheng
b3fd30ed7c Minor code restructuring. No functionality change.
llvm-svn: 58643
2008-11-03 21:02:39 +00:00
Dale Johannesen
d9906b90d0 Fix some ppcf128 regressions: make ExpandFloatRes_LOAD
work correctly, and bring over a late change to ppcf128
SetCC handling.

llvm-svn: 58642
2008-11-03 20:47:45 +00:00
Duncan Sands
8a94be8c5b Make VAARG promotion work correctly with large funky
sized integers like i129, and also reduce the number
of assumptions made about how vaarg is implemented.
This still doesn't work correctly for small integers
like (eg) i1 on x86, since x86 passes each of them
(essentially an i8) in a 4 byte stack slot, so the
pointer needs to be advanced by 4 bytes not by 1 byte
as now.  But this is no longer a LegalizeTypes problem
(it was also wrong in LT before): it is a bug in the
operation expansion in LegalizeDAG: now LegalizeTypes
turns an i1 vaarg into an i8 vaarg which would work
fine if only the i8 vaarg was turned into correct code
later.

llvm-svn: 58635
2008-11-03 20:22:12 +00:00
Dan Gohman
1532a1621c Overload AddInteger on int/long/long long instead of on int/int64_t,
to avoid overload ambiguities. This fixes build errors introduced
by r58623.

llvm-svn: 58632
2008-11-03 19:40:18 +00:00
Devang Patel
c959b4dbd3 Ignore conditions that are outside the loop.
llvm-svn: 58631
2008-11-03 19:38:07 +00:00
Andrew Lenharth
97343f0e8b add a period at the end of the comment, ignoring the fact that the comment would be hard pressed to be considered a sentence, but if it makes Bill happy...
llvm-svn: 58630
2008-11-03 19:29:29 +00:00
Jim Grosbach
5262898365 Add binary encoding support for multiply instructions. Some blanks left to fill in, but the basics are there.
llvm-svn: 58626
2008-11-03 18:38:31 +00:00
Devang Patel
78b7de25d1 Turn floating point IVs into integer IVs where possible.
This allows SCEV users to effectively calculate trip count.
LSR later on transforms back integer IVs to floating point IVs
later on to avoid int-to-float casts inside the loop.

llvm-svn: 58625
2008-11-03 18:32:19 +00:00
Dan Gohman
155df8a79e Refactor various TargetAsmInfo subclasses' TargetMachine members away
adding a TargetMachine member to the base TargetAsmInfo class instead.

llvm-svn: 58624
2008-11-03 18:22:42 +00:00
Dan Gohman
edf3dc97c2 Change how extended types are represented in MVTs. Instead of fiddling
bits, use a union of a SimpleValueType enum and a regular Type*.

This increases the size of MVT on 64-bit hosts from 32 bits to 64 bits.
In most cases, this doesn't add significant overhead. There are places
in codegen that use arrays of MVTs, so these are now larger, but
they're small in common cases.

This eliminates restrictions on the size of integer types and vector
types that can be represented in codegen. As the included testcase
demonstrates, it's now possible to codegen very large add operations.
There are still some complications with using very large types. PR2880
is still open so they can't be used as return values on normal targets,
there are no libcalls defined for very large integers so operations
like multiply and divide aren't supported.

This also introduces a minimal tablgen Type library, capable of
handling IntegerType and VectorType. This will allow parts of
TableGen that don't depend on using SimpleValueType values to handle
arbitrary integer and vector types.

llvm-svn: 58623
2008-11-03 17:56:27 +00:00
Andrew Lenharth
312c00cdd4 Ensure that we are checking only calls to the function we are interested in specializing
llvm-svn: 58615
2008-11-03 16:05:35 +00:00
Duncan Sands
a9047944bc Make VAARG work with x86 long double (which is
10 bytes long, but is passed in 12/16 bytes).

llvm-svn: 58608
2008-11-03 11:51:11 +00:00
Matthijs Kooijman
a91b759ccf Make MachineFrameInfo::print not crash when no TargetFrameInfo is available.
llvm-svn: 58606
2008-11-03 11:16:43 +00:00
Evan Cheng
45516a94c1 Silence a compiler warning.
llvm-svn: 58598
2008-11-03 07:14:02 +00:00
Nick Lewycky
f393d56364 Replace explicit loop with utility function.
llvm-svn: 58593
2008-11-03 03:49:14 +00:00
Nick Lewycky
cc1b7622a5 Don't crash analyzing certain quadratics (addrec of {X,+,Y,+,1}).
We're still waiting on code that actually analyzes them properly.

llvm-svn: 58592
2008-11-03 02:43:49 +00:00
Owen Anderson
6d82fd0e8e Revert my last patch until I consult with Evan about it.
llvm-svn: 58591
2008-11-03 02:33:28 +00:00
Nick Lewycky
49abbde699 Changes from Duncan's review:
* merge two weak functions by making them both alias a third non-weak fn
 * don't reimplement CallSite::hasArgument
 * whitelist the safe linkage types

llvm-svn: 58568
2008-11-02 16:46:26 +00:00
Anton Korobeynikov
9e3342fcdf Silence a warning
llvm-svn: 58563
2008-11-02 11:47:11 +00:00
Duncan Sands
613d060c2e Get this building on 64 bit machines (error:
cast from ‘const llvm::PointerType*’ to ‘unsigned int’
loses precision).

llvm-svn: 58561
2008-11-02 09:00:33 +00:00
Owen Anderson
146d114669 Don't do pre-splitting if doing so would create a value join that did not
exist before.  Updating the live intervals in that care is tricky in the general
case.

Evan, if you see a tighter guard condition for this, let me know.

llvm-svn: 58560
2008-11-02 08:08:18 +00:00
Oscar Fuentes
45b63793cf CMake: added a source file.
llvm-svn: 58559
2008-11-02 06:01:39 +00:00
Nick Lewycky
15a23d029c Add a new MergeFunctions pass. It finds identical functions and merges them.
This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc)
and so it probably wont be turned on by default. Also, may of those are likely
to go away when PR2973 is fixed.

llvm-svn: 58557
2008-11-02 05:52:50 +00:00
Nick Lewycky
bcadcbb1ec Fix demanded bits analysis with srem by negative number. Based on a patch
by Richard Osborne.

llvm-svn: 58555
2008-11-02 02:41:50 +00:00
Dan Gohman
1f1ebc5389 Fix this recently moved code to use the correct type. CI is now a
ConstantInt, and SI is the original cast instruction. This fixes
PR2996.

llvm-svn: 58549
2008-11-02 00:17:33 +00:00
Mon P Wang
0d137a1c51 Added interface to allow clients to create a MemIntrinsicNode for
target intrinsics that touches memory

llvm-svn: 58548
2008-11-01 20:24:53 +00:00
Sanjiv Gupta
945942c4ad Reverting back 58505. Will commit it once I have the bc reader/writer/docs
ready.

llvm-svn: 58547
2008-11-01 10:57:12 +00:00
Bill Wendling
c4e34b42f3 Whitespace fixes. No functionality change.
llvm-svn: 58539
2008-10-31 21:26:08 +00:00
Anton Korobeynikov
705faa7911 Invalidate debug/eh/gc labels when unreachable MBB is deleted.
Based on patch by Martin Nowack!

llvm-svn: 58536
2008-10-31 20:08:30 +00:00
Evan Cheng
53d4b6531e Add comment.
llvm-svn: 58533
2008-10-31 19:56:03 +00:00
Evan Cheng
07f57f0e41 Use better data structure for ConstPoolId2AddrMap.
llvm-svn: 58532
2008-10-31 19:55:13 +00:00
Evan Cheng
31306c546f Actually make debug output understandable.
llvm-svn: 58529
2008-10-31 19:15:52 +00:00
Mon P Wang
6363e90277 x86_64 rip-relative and magic mode address
llvm-svn: 58528
2008-10-31 19:13:42 +00:00
Evan Cheng
6a824a7741 Forgot this in last commit.
llvm-svn: 58527
2008-10-31 19:11:09 +00:00
Evan Cheng
afe2deb372 Encode PICADD; some code clean up.
llvm-svn: 58526
2008-10-31 19:10:44 +00:00
Dan Gohman
f46431018c Remove some unused virtual function bodies.
llvm-svn: 58524
2008-10-31 19:06:33 +00:00
Bill Wendling
f8f6ed82f1 Revert r58489. It isn't correct for all cases.
llvm-svn: 58523
2008-10-31 18:30:19 +00:00
Evan Cheng
168bd3be1b Change x86 register allocation ordering to match that of gcc. Otherwise some tools get confused by prologue generated by llvm.
llvm-svn: 58517
2008-10-31 16:52:57 +00:00
Evan Cheng
d3b31c4fe1 Add a fixme.
llvm-svn: 58514
2008-10-31 16:41:59 +00:00
Duncan Sands
d2500010a3 Add a bunch of libcalls for ppcf128 that were somehow
completely forgotten about when writing LegalizeTypes.

llvm-svn: 58508
2008-10-31 14:06:52 +00:00
Sanjiv Gupta
5cd04857b1 For some targets pointer and int are 16-bits. Allow 16-bits as a valid index
in such cases.

llvm-svn: 58505
2008-10-31 10:26:20 +00:00
Bill Wendling
0f1f4f8bb1 Don't skip over all "terminator" instructions when determining where to put the
callee-saved restore code. It could skip over conditional jumps
accidentally. Instead, just skip the "return" instructions.

llvm-svn: 58489
2008-10-31 04:00:23 +00:00
Daniel Dunbar
8abdac1eb4 Fix warning.
llvm-svn: 58486
2008-10-31 01:50:01 +00:00
Dan Gohman
481e1fd0a6 Use MOVSSmr instead of EXTRACTPSmr in the case of extracting
vector element 0 for a store, as it's smaller and faster.

llvm-svn: 58483
2008-10-31 00:57:24 +00:00
Jim Grosbach
31e64cbf49 Revert errant deletion. The target needs to be able to specify that it doesn't want the generic constant pool to be emitted.
llvm-svn: 58475
2008-10-30 23:44:39 +00:00
Evan Cheng
56f4944f9a I think we got non-machine specific constpool entries covered.
llvm-svn: 58474
2008-10-30 23:43:36 +00:00
Dan Gohman
50061675c5 Canonicalize sext(i1) to i1?-1:0, and update various instcombine
optimizations accordingly.

llvm-svn: 58457
2008-10-30 20:40:10 +00:00
Duncan Sands
615567edc6 Fix PR2986: do not use a potentially illegal
type for the shift amount type.  Add a check
that shifts and rotates use the type returned
by getShiftAmountTy for the amount.  This
exposed some problems in CellSPU and PPC,
which have already been fixed.

llvm-svn: 58455
2008-10-30 20:26:50 +00:00
Duncan Sands
720e5548cb Shift amounts should have type getShiftAmountTy
(i32 for PPC, not i8).  Correct this, and some
formatting while there.

llvm-svn: 58451
2008-10-30 19:28:32 +00:00
Daniel Dunbar
097da598fb Add InlineCost class for represent the estimated cost of inlining a
function.
 - This explicitly models the costs for functions which should
   "always" or "never" be inlined. This fixes bugs where such costs
   were not previously respected.

llvm-svn: 58450
2008-10-30 19:26:59 +00:00
Duncan Sands
ae31c14963 Shift amounts should have the type given by
getShiftAmountTy (i32 in the case of CellSPU).

llvm-svn: 58449
2008-10-30 19:24:28 +00:00
Mon P Wang
64e6e15947 Add missing vsetcc expansion for widening
llvm-svn: 58443
2008-10-30 18:21:52 +00:00
Evan Cheng
6f41528b91 ARM JIT should observe -relocation-model command line option.
llvm-svn: 58433
2008-10-30 16:10:54 +00:00
Mon P Wang
d7e34cd378 Add initial support for vector widening. Logic is set to widen for X86.
One will only see an effect if legalizetype is not active.  Will move
support to LegalizeType soon.

llvm-svn: 58426
2008-10-30 08:01:45 +00:00
Scott Michel
5b588212d8 Resolve bug 2947: vararg-marked functions must spill registers R3-R79 to stack
so that va_start/va_arg/et.al. will walk arguments correctly for Cell SPU.

N.B.: Because neither clang nor llvm-gcc-4.2 can be built for CellSPU, this is
still unexorcised code.

llvm-svn: 58415
2008-10-30 01:51:48 +00:00
Evan Cheng
69c2588244 Correct way to handle CONSTPOOL_ENTRY instructions.
llvm-svn: 58409
2008-10-29 23:55:43 +00:00
Evan Cheng
5e8fa6ef36 Add debugging support.
llvm-svn: 58408
2008-10-29 23:55:17 +00:00
Evan Cheng
479adf22ee Let target resolve some relocation results.
llvm-svn: 58407
2008-10-29 23:54:46 +00:00
Nate Begeman
e621f0539e Fix PEXTRQ encoding
llvm-svn: 58403
2008-10-29 23:07:17 +00:00
Dale Johannesen
ff738e8897 Add a RM pseudoreg for the rounding mode, which
allows ppcf128->int conversion to work with
DeadInstructionElimination.  This is now turned
off but RM is harmless.  It does not do a complete
job of modeling the rounding mode.

Revert marking MFCR as using all 7 CR subregisters;
while correct, this caused the problem in PR 2964,
plus the local RA crash noted in the comments.
This was needed to make DeadInstructionElimination,
but as we are not running that, it is backed out
for now.  Eventually it should go back in and the
other problems fixed where they're broken.

llvm-svn: 58391
2008-10-29 18:26:45 +00:00
Duncan Sands
4f4d9d24a4 Uniformize capitalization of NodeId.
llvm-svn: 58386
2008-10-29 17:52:12 +00:00
Chris Lattner
4af91a146a Fix PR2967 by not deleting volatile load/stores that occur before unreachable.
I don't really see this as being needed, but there is little harm from doing
it.

llvm-svn: 58385
2008-10-29 17:46:26 +00:00
Duncan Sands
fd032c5bef Fix PR2977: LegalizeTypes support for expanding
VAARG.

llvm-svn: 58379
2008-10-29 14:25:28 +00:00
Duncan Sands
ada9e7a16d Add sanity checking for BUILD_PAIR (I noticed the
other day that PPC custom lowering could create
a BUILD_PAIR of two f64 with a result type of...
f64! - already fixed).  Fix a place that triggers
the sanity check.

llvm-svn: 58378
2008-10-29 14:22:20 +00:00
Evan Cheng
6125b9e097 - More pre-split fixes: spill slot live interval computation bug; restore point bug.
- If a def is spilt, remember its spill index to allow its reuse.

llvm-svn: 58375
2008-10-29 08:39:34 +00:00
Duncan Sands
3faee6737e Fix a FIXME: in ReplaceNodeWith, if the new node
is morphed by AnalyzeNewNode into a previously
processed node, and different result values of
that node are remapped to values with different
nodes, then we could end up using wrong values
here [we were assuming that all results remap
to values with the same underlying node].  This
seems theoretically possible, but I don't have
a testcase.  The meat of the patch is in the
changes to AnalyzeNewNode/AnalyzeNewValue and
ReplaceNodeWith.  While there, I changed names
like RemapNode to RemapValue, since it really
remaps values.  To tell the truth, I would be
much happier if we were only remapping nodes
(it would simplify a bunch of logic, and allow
for some cute speedups) but I haven't yet worked
out how to do that.

llvm-svn: 58372
2008-10-29 06:42:19 +00:00
Duncan Sands
cb5432cdb4 Fix 80 column violations.
llvm-svn: 58371
2008-10-29 06:33:00 +00:00
Duncan Sands
790e7e655b Fix 80 column violations.
llvm-svn: 58370
2008-10-29 06:31:03 +00:00
Evan Cheng
cd21d433bb - Rewrite code that update register live interval that's split.
- Create and update spill slot live intervals.
- Lots of bug fixes.

llvm-svn: 58367
2008-10-29 05:06:14 +00:00
Daniel Dunbar
2265cf485e Factor shouldInline method out of Inliner.
- No functionality change.

llvm-svn: 58355
2008-10-29 01:02:02 +00:00
Daniel Dunbar
e2fe2de3f4 Assorted comment/naming fixes, 80-col violations, and reindentation.
- No functionality change.

llvm-svn: 58352
2008-10-28 23:24:26 +00:00
Dan Gohman
3ceee36545 (A & sext(C)) | (B & ~sext(C) -> C ? A : B
llvm-svn: 58351
2008-10-28 22:38:57 +00:00
Dan Gohman
eb869eb116 Take Chris' suggestion and define EnableFastISelVerbose and
EnableFastISelAbort variables for Release mode instead of
using ifdefs in the code.

llvm-svn: 58350
2008-10-28 20:35:31 +00:00
Daniel Dunbar
ffd2bedc44 Reuse PrintEscapedString for printing names in .ll
- One functionality change, '\\' in a name is now printed as a hex
   escape instead of "\\\\". This is consistent with other users of
   PrintEscapedString.

llvm-svn: 58343
2008-10-28 19:33:02 +00:00
Dan Gohman
5a2a8f4b9b Protect the code for fast-isel debugging with #ifndef NDEBUG.
llvm-svn: 58340
2008-10-28 19:08:46 +00:00
Jim Grosbach
d735f403a0 Support for constant islands in the ARM JIT.
Since the ARM constant pool handling supercedes the standard LLVM constant
pool entirely, the JIT emitter does not allocate space for the constants,
nor initialize the memory. The constant pool is considered part of the 
instruction stream.

Likewise, when resolving relocations into the constant pool, a hook into
the target back end is used to resolve from the constant ID# to the
address where the constant is stored.

For now, the support in the ARM emitter is limited to 32-bit integer. Future
patches will expand this to the full range of constants necessary.

llvm-svn: 58338
2008-10-28 18:25:49 +00:00
Duncan Sands
a64641fbd2 Fix darwin ppc llvm-gcc build breakage: intercept
ppcf128 to i32 conversion and expand it into a code
sequence like in LegalizeDAG.  This needs custom
ppc lowering of FP_ROUND_INREG, so turn that on and
make it work with LegalizeTypes.  Probably PPC should
simply custom lower the original conversion.

llvm-svn: 58329
2008-10-28 15:00:32 +00:00
Duncan Sands
ce82e0aa82 Fix a testcase provided by Bill in which the node
id could end up being wrong mostly because of
forgetting to remap new nodes that morphed into
processed nodes through CSE.

llvm-svn: 58323
2008-10-28 09:38:36 +00:00
Chris Lattner
508a62823e Don't produce invalid comparisons after legalize.
llvm-svn: 58320
2008-10-28 07:11:07 +00:00
Chris Lattner
e39269e22a fix some whitespace stuff
llvm-svn: 58319
2008-10-28 07:10:51 +00:00
Chris Lattner
63e92876e0 Fix a nasty miscompilation of 176.gcc on linux/x86 where we synthesized
a memset using 16-byte XMM stores, but where the stack realignment code
didn't work.  Until it does (PR2962) disable use of xmm regs in memcpy
and memset formation for linux and other targets with insufficiently
aligned stacks.

This is part of PR2888

llvm-svn: 58317
2008-10-28 05:49:35 +00:00
Evan Cheng
8f9bfa5bff If def is in the same mbb as the barrier, spilt the value after the last use before the barrier.
llvm-svn: 58314
2008-10-28 05:28:21 +00:00
Evan Cheng
6242a4f47b Add command line option to limit the number splits to help debugging.
llvm-svn: 58312
2008-10-28 01:48:24 +00:00
Evan Cheng
9bbf76a1e9 Avoid putting a split past the end of the live range; always shrink wrap live interval in the barrier mbb.
llvm-svn: 58309
2008-10-28 00:47:49 +00:00
Evan Cheng
420490d6c4 Silence a bogus compile time warning.
llvm-svn: 58297
2008-10-27 23:29:28 +00:00
David Greene
48e4fdef50 Re-apply 55137 with fixes.
llvm-svn: 58296
2008-10-27 23:24:03 +00:00
Evan Cheng
056ef89e68 Remove val# defined by a remat'ed def that is now dead.
llvm-svn: 58294
2008-10-27 23:21:01 +00:00
Ted Kremenek
03c067710c Fix bogus comparison of "const char *" with c-string literal. Use strcmp instead.
llvm-svn: 58290
2008-10-27 22:43:07 +00:00
David Greene
93f9f0f718 Have TableGen emit setSubgraphColor calls under control of a -gen-debug
flag.  Then in a debugger developers can set breakpoints at these calls
to see waht is about to be selected and what the resulting subgraph
looks like.  This really helps when debugging instruction selection.

llvm-svn: 58278
2008-10-27 21:56:29 +00:00
David Greene
5015610892 Add setSubgraphColor to color an entire portion of a SelectionDAG. This
will be used to support debug features in TableGen.

llvm-svn: 58257
2008-10-27 18:17:03 +00:00
David Greene
78744a795a Fix PR2634. Create new virtual registers from spills early so that we
can give it the same stack slot as the spilled interval if it is folded.
This prevents the fold/unfold code from pointing to the wrong register.

llvm-svn: 58255
2008-10-27 17:38:59 +00:00
Duncan Sands
22451e0303 Fix UpdateNodeOperands so that it does CSE of calls
(and a bunch of other node types).  While there, I
added a doNotCSE predicate and used it to reduce code
duplication (some of the duplicated code was wrong...).
This fixes ARM/cse-libcalls.ll when using LegalizeTypes. 

llvm-svn: 58249
2008-10-27 15:30:53 +00:00
Duncan Sands
039edb065f Fix a bug in which a node could be added to the
worklist twice: UpdateNodeOperands could morph
a new node into a node already on the worklist.
We would then recalculate the NodeId for this
existing node and add it to the worklist.  The
testcase is ARM/cse-libcalls.ll, the problem
showing up once UpdateNodeOperands is taught to
do CSE for calls.

llvm-svn: 58246
2008-10-27 13:18:32 +00:00
Torok Edwin
ebd7fd5e7a Avoid crashing if instruction is not part of a loop.
If it is not part of a loop it is obviously invariant wrt to all loops.

llvm-svn: 58240
2008-10-27 10:18:45 +00:00
Torok Edwin
0c0acebd09 export an ID for the instructionNamer, allowing analysis/transformation passes
that need it to require it by ID.

llvm-svn: 58238
2008-10-27 10:16:27 +00:00
Duncan Sands
a6bbc047d5 Turn on LegalizeTypes, the new type legalization
codegen infrastructure, by default.  Please report
any breakage to the mailing lists.

llvm-svn: 58232
2008-10-27 08:42:46 +00:00
Nick Lewycky
c1f8a23665 Fix an obvious copy/pasto.
llvm-svn: 58231
2008-10-27 07:28:44 +00:00
Evan Cheng
3bcbccf563 For now, don't split live intervals around x87 stack register barriers. FpGET_ST0_80 must be right after a call instruction (and ADJCALLSTACKUP) so we need to find a way to prevent reload of x87 registers between them.
llvm-svn: 58230
2008-10-27 07:14:50 +00:00
Chris Lattner
17afc211e7 Rewrite all the 'PromoteLocallyUsedAlloca[s]' logic. With the power of
LargeBlockInfo, we can now dramatically simplify their implementation
and speed them up at the same time.  Now the code has time proportional
to the number of uses of the alloca, not the size of the block.

This also eliminates code that tried to batch up different allocas which
are used in the same blocks, and eliminates the 'retry list' logic which
was baroque and no unneccesary.  In addition to being a speedup for crazy
cases, this is also a nice cleanup:

PromoteMemoryToRegister.cpp |  270 +++++++++++++++-----------------------------
 1 file changed, 96 insertions(+), 174 deletions(-)

llvm-svn: 58229
2008-10-27 07:05:53 +00:00
Chris Lattner
39c853cf16 Add a new LargeBlockInfo helper, which is just a wrapper around
a trivial dense map.  Use this in RewriteSingleStoreAlloca to
avoid aggressively rescanning blocks over and over again.  This
fixes PR2925, speeding up mem2reg on the testcase in that bug
from 4.56s to 0.02s in a debug build on my machine.

llvm-svn: 58227
2008-10-27 06:05:26 +00:00
Dale Johannesen
d0a0ce909b Increase default setting of tail-merge-threshold to
150, based on llvm-test measurements.

llvm-svn: 58225
2008-10-27 02:10:21 +00:00
Chris Lattner
3fed68158c fix PR2953, an off-by-one error handling formatted i/o.
Thanks to Török Edwin for the awesome reduced testcase.

llvm-svn: 58199
2008-10-26 19:20:47 +00:00
Evan Cheng
8a7f04e7c2 Do not shrink wrap live interval in a mbb if it's livein any of its successor blocks. The mbb can be revisited again after all of the successors are processed.
llvm-svn: 58184
2008-10-26 07:49:03 +00:00
Bill Wendling
617f3d4b3a Fix type-o in ExprMapKeyType::operator ==(). The "&&" was missing.
Patch by Frits van Bommel!

llvm-svn: 58175
2008-10-26 00:19:56 +00:00
Evan Cheng
db1c135283 Handle cases where there aren't uses in the barrier mbb.
llvm-svn: 58174
2008-10-25 23:49:39 +00:00
Dan Gohman
64431fe1db Make comments and code for QuietWarnings and QuietErrors
actually correspond to what their names suggest.

llvm-svn: 58146
2008-10-25 17:57:20 +00:00
Dan Gohman
e7c43e94b0 SDNodes may have at most one Flag result. Update this comment
to reflect that.

llvm-svn: 58145
2008-10-25 17:51:24 +00:00
Dan Gohman
66e878f316 Move the code that adds the DeadMachineInstructionElimPass from
target-independent code to target-specific code. This prevents it
from running on targets that aren't using fast-isel.

In addition to saving compile time, this addresses the problem
that not all targets are prepared for it. In order to use this
pass, all instructions must declare all their fixed uses and
defs of physical registers.

llvm-svn: 58144
2008-10-25 17:46:52 +00:00
Gordon Henriksen
e5b0182e94 Related to PR2911, reject as invalid non-pointer GC roots.
llvm-svn: 58143
2008-10-25 16:28:35 +00:00
Nicolas Geoffray
ce30b5caf0 Support for allocation of TLS variables in the JIT. Allocation of a global
variable is moved to the execution engine. The JIT calls the TargetJITInfo
to allocate thread local storage. Currently, only linux/x86 knows how to
allocate thread local global variables.

llvm-svn: 58142
2008-10-25 15:41:43 +00:00
Nicolas Geoffray
323dc44a69 Generate code for TLS instructions.
llvm-svn: 58141
2008-10-25 15:22:06 +00:00
Oscar Fuentes
51e77b801a CMake: lib/Target/ARM/AsmPrinter/CMakeLists.txt added.
llvm-svn: 58133
2008-10-25 03:40:32 +00:00
Oscar Fuentes
64fd2ab298 CMake: Cross-platform support for using pre-generated llvmAsmParser.cpp and llvmAsmParser.h.
llvm-svn: 58130
2008-10-25 03:19:08 +00:00
Evan Cheng
0c78ace7dc If val# def is ~0U, meaning it's defined by a PHI, and it's previously split, spill before the barrier because it's impossible to determine if all the defs are spilled in the same spill slot.
llvm-svn: 58129
2008-10-25 00:52:41 +00:00
Dale Johannesen
20f93b45e7 Mark MFCR as reading all condition code registers.
Prevents some more overzealous deletions (mostly
in AltiVec code).

llvm-svn: 58121
2008-10-24 22:08:01 +00:00
Dale Johannesen
a3d7e7e900 Rewrite logic to figure out whether LR needs to
be saved/restored in the prolog/epilog.  We need
to do this iff something in the function stores
into it.

llvm-svn: 58116
2008-10-24 21:24:23 +00:00
Torok Edwin
e0ecce06a0 move the note to the correct README
llvm-svn: 58104
2008-10-24 19:23:07 +00:00
Torok Edwin
5560590122 add note about va_arg code on x86 and x86-64
llvm-svn: 58103
2008-10-24 19:20:05 +00:00
Evan Cheng
cfd2ecd29f Fix a pasto.
llvm-svn: 58102
2008-10-24 18:46:44 +00:00
Duncan Sands
4b148a29ef Fix translateX86CC: if SetCCOpcode is SETULE and
LHS is a foldable load, then LHS and RHS are swapped
and SetCCOpcode is changed to SETUGT.  But the later
code is expecting operands to be the wrong way round
for SETUGT, but they are not in this case, resulting
in an inverted compare.  The solution is to move the
load normalization before the correction for SETUGT.
This bug was tickled by LegalizeTypes which happened
to legalize the testcase slightly differently to
LegalizeDAG.

llvm-svn: 58092
2008-10-24 13:03:10 +00:00
Cedric Venet
c5bd480a57 Modify the cmake build system so that if it doesn't find bison, it will use the pregenerated file in from the svn (.cvs). Work only for windows for the moment. Tested on Vista64 with MSVC2008express.
llvm-svn: 58090
2008-10-24 11:24:33 +00:00
Nick Lewycky
44356e13da Don't try to create a mask when we don't need one. Fixes a crash.
llvm-svn: 58075
2008-10-24 06:14:27 +00:00
Evan Cheng
efb8edb805 Fix a end() dereference; remove an abort() that wasn't meant to be left in.
llvm-svn: 58072
2008-10-24 05:53:44 +00:00
Nick Lewycky
3d4f21006b Add value range analyzing of Add and Sub.
Understand that mul %x, 1 = %x.

llvm-svn: 58069
2008-10-24 04:00:26 +00:00
Evan Cheng
a7a0aabf99 Avoid splitting an interval multiple times; avoid splitting re-materializable val# (for now).
llvm-svn: 58068
2008-10-24 02:05:00 +00:00
Dan Gohman
ed90fd3ecf Fix constant-offset emission for x86-64 absolute addresses. This
fixes a bunch of test-suite JIT failures on x86-64 in
-relocation-model=static mode.

llvm-svn: 58066
2008-10-24 01:57:54 +00:00
Dale Johannesen
9edd60f710 Initialize uninitialized variable.
llvm-svn: 58057
2008-10-24 01:06:58 +00:00
Ted Kremenek
b04b85f615 Added raw_fd_ostream::close().
llvm-svn: 58052
2008-10-23 23:49:09 +00:00
Evan Cheng
c906d4938e Committing a good chunk of the pre-register allocation live interval splitting pass. It's handling simple cases and appear to do good things. Next: avoid splitting an interval multiple times; renumber registers when possible; record stack slot live intervals for coloring; rematerialize defs when possible.
llvm-svn: 58044
2008-10-23 20:43:13 +00:00
Dale Johannesen
b79ddda5bf Mark defs and uses of CTR and LR correctly.
Prevents DeadMachineInstructionElim from thinking
things like MTCTR are dead (fixes massive
testsuite breakage at -O0).

llvm-svn: 58043
2008-10-23 20:41:28 +00:00