Commit Graph

22409 Commits

Author SHA1 Message Date
Anton Korobeynikov 7f125b2ba5 Add convenient helper for win64 check. Simplify things slightly.
llvm-svn: 48691
2008-03-22 20:57:27 +00:00
Anton Korobeynikov 7b4f4e1a86 Initial support for Win64 calling conventions. Still in early state.
llvm-svn: 48690
2008-03-22 20:37:30 +00:00
Anton Korobeynikov 7ebdd255b5 Register EH frames emitted in JIT when using gcc unwinding runtime
llvm-svn: 48688
2008-03-22 08:53:09 +00:00
Anton Korobeynikov dd8c695746 Fix merge error
llvm-svn: 48687
2008-03-22 08:50:08 +00:00
Anton Korobeynikov 3f7fab913d Add testcase for prev. commit. Minor fixes
llvm-svn: 48686
2008-03-22 08:37:05 +00:00
Anton Korobeynikov 25b2e8203a Aliasing chains cleanups: update langref, add check into verifier
llvm-svn: 48685
2008-03-22 08:36:14 +00:00
Anton Korobeynikov 72d5d42dbc Support chained aliases for LLVM IR printing. This fixes PR2145
llvm-svn: 48684
2008-03-22 08:17:17 +00:00
Anton Korobeynikov 2fa75184f3 Another comments fixing
llvm-svn: 48683
2008-03-22 07:53:40 +00:00
Anton Korobeynikov 2fb3897f1b Slightly increase default set size. It's cheap and won't hurt.
llvm-svn: 48682
2008-03-22 07:48:40 +00:00
Chris Lattner 53ccb62712 implement an initial hack at a straight-line store -> memset optimization.
This fires dozens of times across spec and multisource, but I don't know
if it actually speeds stuff up.  Hopefully the testers will show something
nice :)

llvm-svn: 48680
2008-03-22 05:37:16 +00:00
Chris Lattner 168be766a8 implement the logic for memset insertion and store deletion.
llvm-svn: 48679
2008-03-22 04:13:49 +00:00
Owen Anderson 5b993fd70d Add a comment, and fix a bug where AllocateRW recurred to AllocateRWX instead of itself.
llvm-svn: 48677
2008-03-22 02:59:54 +00:00
Owen Anderson c1e4e3e9a1 Add an AllocateRW to match AllocateRWX.
llvm-svn: 48676
2008-03-22 02:33:53 +00:00
Evan Cheng 31604a62f6 Teach DAG combiner to commute commutable binary nodes in order to achieve sdisel CSE.
llvm-svn: 48673
2008-03-22 01:55:50 +00:00
Chris Lattner f5d41c67af This is a partially implemented and currently disabled start of a store
merging optimization.  Nothing to see here, hopefully more later :)

llvm-svn: 48670
2008-03-22 00:31:52 +00:00
Dan Gohman 9988569af8 Don't include <map> in Pass.h, which doesn't need it. This requires
adding <map> to many files that actually do need it.

llvm-svn: 48667
2008-03-21 23:51:57 +00:00
Dan Gohman 026eed69e7 Avoid calling array_endof in a static initializer, as it incurs
dynamic initialization.

llvm-svn: 48666
2008-03-21 23:44:21 +00:00
Dan Gohman 5a6ac79738 Specialize FORCE_DEFINING_FILE_TO_BE_LINKED using a GCC trick
to avoid using constructor calls for static objects. This reduces
the number of objects requiring static constructors in a typical
LLVM build by around 20%.

llvm-svn: 48665
2008-03-21 23:38:23 +00:00
Dan Gohman 30e44a4b40 Fix -view-sunit-dags to support cross-rc-copy nodes.
llvm-svn: 48664
2008-03-21 22:51:06 +00:00
Chris Lattner 804209d17c the size of a smallvector shouldn't be part of the interface to these methods.
llvm-svn: 48662
2008-03-21 22:01:16 +00:00
Chris Lattner beb216da0a make gvn marginally faster by reallocating the lastSeenLoad map for
each basic block.

llvm-svn: 48660
2008-03-21 21:33:23 +00:00
Chris Lattner 2876a645c3 Minor cleanups and shrinkification.
llvm-svn: 48658
2008-03-21 21:14:38 +00:00
Dan Gohman a25dde6fee Handle getresult instructions in different basic blocks
from their aggregate operands by moving the getresult
instructions.

llvm-svn: 48657
2008-03-21 21:01:32 +00:00
Chris Lattner c55b444a8f Restore this assert now that the livevar bug is fixed.
This verifies kill info for "ret" fp operands is right.

llvm-svn: 48656
2008-03-21 20:41:27 +00:00
Evan Cheng 8c19af1b7e A couple of kill marker maintainence bug.
llvm-svn: 48653
2008-03-21 19:09:30 +00:00
Andrew Lenharth 74d154ce57 FunctionExtractorPass has been superceded by GVExtractorPass
llvm-svn: 48648
2008-03-21 16:46:53 +00:00
Duncan Sands dec270a6db Make it possible to get an empty struct using
the new StructType::get method.  The second NULL
is to pacify the gcc warning mechanism.  This
patch compiles but is otherwise untested.

llvm-svn: 48645
2008-03-21 15:53:17 +00:00
Duncan Sands d97eea372a Introduce a new node for holding call argument
flags.  This is needed by the new legalize types
infrastructure which wants to expand the 64 bit
constants previously used to hold the flags on
32 bit machines.  There are two functional changes:
(1) in LowerArguments, if a parameter has the zext
attribute set then that is marked in the flags;
before it was being ignored; (2) PPC had some bogus
code for handling two word arguments when using the
ELF 32 ABI, which was hard to convert because of
the bogusness.  As suggested by the original author
(Nicolas Geoffray), I've disabled it for the moment.
Tested with "make check" and the Ada ACATS testsuite.

llvm-svn: 48640
2008-03-21 09:14:45 +00:00
Duncan Sands c9e09a0588 Fix the build for gcc-4.2.
llvm-svn: 48639
2008-03-21 08:32:17 +00:00
Chris Lattner 68b11e14bc remove Evan's "ugly hack" that sorta attempted to get
x86-64 return conventions correct, but was never enabled.
We can now do the "right thing" with multiple return values.

llvm-svn: 48635
2008-03-21 06:50:21 +00:00
Chris Lattner 5abbe6cef5 Add support for calls that return two FP values in
ST(0)/ST(1).

llvm-svn: 48634
2008-03-21 06:38:26 +00:00
Chris Lattner 7e59a30e9f disable a bogus assertion.
llvm-svn: 48633
2008-03-21 06:01:05 +00:00
Chris Lattner b6f04a3e0a Enable support for returning two long-double values in ST(0)/ST(1).
This allows us to compile fp-stack-2results.ll into:

_test:
	fldz
	fld1
	ret

which returns 1 in ST(0) and 0 in ST(1).  This is needed for x86-64
_Complex long double.

llvm-svn: 48632
2008-03-21 05:57:20 +00:00
Chris Lattner c44160ce6e Teach masked value is zero about add and sub, and use MVIZ to
simplify things like (X & 4) >> 1 == 2  --> (X & 4) == 4.

since it is obvious that the shift doesn't remove any bits.

llvm-svn: 48631
2008-03-21 05:19:58 +00:00
Evan Cheng 92b4488202 Undo 48570. Correctly match mmx shift instructions with an immediate operand.
llvm-svn: 48627
2008-03-21 00:40:09 +00:00
Devang Patel 4d638f1a42 These passes preserve CFG.
This patch fixes Benchmarks/Trimaran/enc-pc1/enc-pc1 failure reported by Grawp-PIC i386 nightly tester

llvm-svn: 48623
2008-03-20 23:27:18 +00:00
Devang Patel 5ca2ea6479 Incorporate feedback.
- Fix loop nest.
- Use RetVals.size()
- Check for null return value.

llvm-svn: 48605
2008-03-20 18:30:32 +00:00
Gordon Henriksen b81777a354 C and Objective Caml bindings for mem2reg and reg2mem.
Patch by Erick Tryzelaar.

llvm-svn: 48602
2008-03-20 17:16:03 +00:00
Andrew Lenharth 1a3ebe36f7 enable -analyze for andersens
llvm-svn: 48601
2008-03-20 15:36:44 +00:00
Zhou Sheng a30cdb9417 Take the old function's name.
llvm-svn: 48588
2008-03-20 08:05:05 +00:00
Chris Lattner fd5fe2a83d add a note.
llvm-svn: 48583
2008-03-20 04:46:13 +00:00
Christopher Lamb 3e9f49716e Check even more carefully before applying this DAGCombine transform.
llvm-svn: 48580
2008-03-20 04:31:39 +00:00
Devang Patel 80e43fa744 Restore isCFGOnly property of various analysis passes.
llvm-svn: 48579
2008-03-20 02:25:21 +00:00
Evan Cheng 7a3e750fd2 Fix this xform: (sra (shl X, m), result_size) -> (sign_extend (trunc (shl X, result_size - n - m)))
llvm-svn: 48578
2008-03-20 02:18:41 +00:00
Chris Lattner a7cca362af detabify llvm, patch by Mike Stump!
llvm-svn: 48577
2008-03-20 01:22:40 +00:00
Devang Patel cbbf291f34 Keep track of analysis information inherited from Module pass manager.
llvm-svn: 48576
2008-03-20 01:09:53 +00:00
Scott Michel bbaf3edace Add more patterns to match in the integer comparison test harnesses.
Fix bugs encountered, mostly due to range matching for immediates;
the CellSPU's 10-bit immediates are sign extended, covering a
larger range of unsigned values.

llvm-svn: 48575
2008-03-20 00:51:36 +00:00
Evan Cheng 5daf090a1a 80 col violation.
llvm-svn: 48573
2008-03-20 00:20:23 +00:00
Evan Cheng bbba76fc99 Add intrinsics to match mmx shift builtin's with immediate operand.
llvm-svn: 48569
2008-03-19 23:38:52 +00:00
Devang Patel b727960f78 Add comment.
llvm-svn: 48567
2008-03-19 23:05:52 +00:00
Devang Patel fbf53a4d1d #if 1 .. #endif markers do not add any value.
llvm-svn: 48560
2008-03-19 22:24:25 +00:00
Evan Cheng a90fdc4340 Remove dead options.
llvm-svn: 48556
2008-03-19 22:02:26 +00:00
Devang Patel 718da668ab PassInfo keep tracks whether a pass is an analysis pass or not.
llvm-svn: 48554
2008-03-19 21:56:59 +00:00
Dan Gohman b9056838d2 Add support for multiple return values for the PPC target by
converting call result lowering to use the CallingConvLowering
infastructure.

llvm-svn: 48552
2008-03-19 21:39:28 +00:00
Arnold Schwaighofer 7da2bceb3b Don't loose incoming argument registers. Fix documentation style.
llvm-svn: 48545
2008-03-19 16:39:45 +00:00
Christopher Lamb 8fe9109469 Fix X86's isTruncateFree to not claim that truncate to i1 is free. This fixes Bill's testcase that failed for r48491.
llvm-svn: 48542
2008-03-19 08:30:06 +00:00
Chris Lattner f5ec84c4f3 add some convenience methods for creating GEP instructions and
struct types.  Patch by David Chisnall, with some tweaks.

llvm-svn: 48531
2008-03-19 05:06:05 +00:00
Gordon Henriksen 054817ce06 C bindings for Module-, Function-, and BasicBlock::iterator.
llvm-svn: 48528
2008-03-19 03:47:18 +00:00
Evan Cheng 56e9e57d28 Fixed a coalescer bug caused by a typo.
llvm-svn: 48526
2008-03-19 02:26:36 +00:00
Gordon Henriksen 265f780c22 C and Objective Caml bindings for the various getParent methods of the IR.
Based on Erick Tryzelaar's patch.

llvm-svn: 48523
2008-03-19 01:11:35 +00:00
Evan Cheng 44c0b4f754 Fix live variables issues:
1. If part of a register is re-defined, an implicit kill and an implicit def are added to denote read / mod / write. However, this should only be necessary if the register is actually read later. This is a performance issue.
2. If a sub-register is being defined, and it doesn't have a previous use, do not add a implicit kill to the last use of a super-register:
   = EAX, AX<imp-use,kill>
...
AX =
In this case, EAX is live but AX is killed, this is wrong and will cause the coalescer to do bad things.

llvm-svn: 48521
2008-03-19 00:52:20 +00:00
Devang Patel af75ab8130 Do not use virtual function to identify an analysis pass.
llvm-svn: 48520
2008-03-19 00:48:41 +00:00
Bill Wendling 2f6ab65d77 On Darwin, GCC issues a ".globl" for something that has a "visibility protected"
attribute instead of ".protected".

llvm-svn: 48516
2008-03-18 23:38:12 +00:00
Evan Cheng 484064370a Fix a x86-64 isel lowering bug that's been around forever. A x86-64 varargs function implicitly reads X86::AL, don't clobber it!
llvm-svn: 48515
2008-03-18 23:36:35 +00:00
Bill Wendling efb4d9ef80 Temporarily revert r48491. It's breaking test/CodeGen/X86/xorl.ll.
llvm-svn: 48510
2008-03-18 22:29:51 +00:00
Daniel Berlin 5fef9aea12 Fix PR 2160 by making sure arguments to external functions get marked as pointing to anything
llvm-svn: 48509
2008-03-18 22:22:53 +00:00
Dale Johannesen 12c76db312 Make conversions of i8/i16 to ppcf128 work.
llvm-svn: 48493
2008-03-18 17:28:38 +00:00
Scott Michel 08ef1b2bdb Dial down gcc's warnings: don't use 0UL when 0U suffices (and when the
variables and methods themselves only use unsigned.)

llvm-svn: 48492
2008-03-18 16:55:06 +00:00
Christopher Lamb 3e408d4d82 Target independent DAG transform to use truncate for field extraction + sign extend on targets where this is profitable. Passes nightly on x86-64.
llvm-svn: 48491
2008-03-18 16:46:39 +00:00
Evan Cheng d096ec0a86 Rewrite code that propagate isDead information after a dead copy is coalesced. This remove some ugly spaghetti code and fixed a number of subtle bugs.
llvm-svn: 48490
2008-03-18 08:26:47 +00:00
Devang Patel 864970e9b6 Identify Analysis pass.
Do not run analysis pass again if analysis info is still available.
This fixes PR1441.

llvm-svn: 48476
2008-03-18 00:39:19 +00:00
Devang Patel 924ca7f01d Update heuritics that estimates cost of call instructions.
llvm-svn: 48474
2008-03-17 23:41:20 +00:00
Dale Johannesen cf87e71053 Make Complex long long/double/long double work
in ppc64 mode.

llvm-svn: 48459
2008-03-17 17:11:08 +00:00
Chris Lattner 7d4152bda6 Check in some #ifdef'd out code switching call argument
lowering over to SparcCallingConv.td.  We can't make the switch
yet because we can't say to pass f64 registers in 2 x i32 registers
with the td file yet.

llvm-svn: 48449
2008-03-17 06:58:37 +00:00
Chris Lattner 52f16deb65 minor cleanups
llvm-svn: 48448
2008-03-17 06:57:02 +00:00
Evan Cheng 24bc123e80 Unbreak JIT. Ignore TargetInstrInfo::IMPLICIT_DEF.
llvm-svn: 48447
2008-03-17 06:56:52 +00:00
Owen Anderson 488e645938 A first attempt at updating live intervals, with code lifted from
the coalescer.  This doesn't really work, but gets us farther than
before.

llvm-svn: 48446
2008-03-17 06:08:26 +00:00
Chris Lattner 4eabbb8f11 remove dead code
llvm-svn: 48445
2008-03-17 06:04:10 +00:00
Chris Lattner db26db2158 Switch sparc from using LowerCallTo to using LowerOperation(CALL) like
other targets.  Use autogenerated calling conv to lower result of
calls.

llvm-svn: 48444
2008-03-17 06:01:07 +00:00
Chris Lattner 49b269d780 Start moving sparc to use SparcCallingConv.td, switching over
return lowering first.  This fixes a bug where the top and bottom
of i64 values were returned in the wrong registers before.

llvm-svn: 48443
2008-03-17 05:41:48 +00:00
Chris Lattner 0a1762e374 split sparc lowering out into SparcISelLowering.{cpp|h} to follow
best practices.

llvm-svn: 48442
2008-03-17 03:21:36 +00:00
Chris Lattner 5c5597a572 refactor the LowerOperation code out to individual functions for
each lowering, which is 'best practice'.

llvm-svn: 48441
2008-03-17 02:52:07 +00:00
Dale Johannesen 92dcf1e0c2 Next round of PPC32 ABI changes. Allow for gcc
behavior where a callee thinks a param will be
present in memory, even though the ABI doc says
it doesn't have to be.  Handle complex long long
and complex double (4 and 8 return regs).

llvm-svn: 48439
2008-03-17 02:13:43 +00:00
Chris Lattner af8d3c6699 various rotate fun.
llvm-svn: 48438
2008-03-17 01:47:51 +00:00
Nate Begeman 9030ecec88 Add a couple missing SSE4 instructions
llvm-svn: 48430
2008-03-16 21:14:46 +00:00
Gordon Henriksen ab4b7d36cd C and Objective Caml bindings for the TargetData class.
llvm-svn: 48422
2008-03-16 20:08:03 +00:00
Bill Wendling 9a11a0174f Add assert for non-hexadecimal radixes.
llvm-svn: 48421
2008-03-16 20:05:52 +00:00
Gordon Henriksen 82a0e74f43 C and Objective Caml bindings for several scalar transforms.
Patch originally by Erick Tryzelaar, but has been modified somewhat.

llvm-svn: 48419
2008-03-16 16:32:40 +00:00
Gordon Henriksen 878114bf16 C and Objective Caml bindings for PassManagers.
llvm-svn: 48413
2008-03-16 04:20:44 +00:00
Christopher Lamb d3d0ad3f58 Make insert_subreg a two-address instruction, vastly simplifying LowerSubregs pass. Add a new TII, subreg_to_reg, which is like insert_subreg except that it takes an immediate implicit value to insert into rather than a register.
llvm-svn: 48412
2008-03-16 03:12:01 +00:00
Evan Cheng ec7533b620 Remove isImplicitDef TargetInstrDesc flag.
llvm-svn: 48381
2008-03-15 00:19:36 +00:00
Evan Cheng 0e7b00d79f Replace all target specific implicit def instructions with a target independent one: TargetInstrInfo::IMPLICIT_DEF.
llvm-svn: 48380
2008-03-15 00:03:38 +00:00
Gordon Henriksen 6c6075e326 Expose Module::dump via C and Ocaml.
Patch by Erick Tryzelaar.

llvm-svn: 48379
2008-03-14 23:58:56 +00:00
Duncan Sands 858e6385f7 Do not generate special entries in the dwarf eh
table for nounwind calls.

llvm-svn: 48373
2008-03-14 21:36:24 +00:00
Evan Cheng 84aec09fdb Fix PR2138. Apparently any modification to a std::multimap (including remove entries for a different key) can invalidate multimap iterators.
llvm-svn: 48371
2008-03-14 20:44:01 +00:00
Chris Lattner bb8c2406dc this was removed from the Unix side.
llvm-svn: 48370
2008-03-14 20:41:50 +00:00
Dan Gohman 94f57c56f9 Update comments; getPassName no longer uses RTTI.
llvm-svn: 48369
2008-03-14 18:27:04 +00:00
Dale Johannesen 0dfd3f33f7 Implement the real calling convention for ppc32 Altivec:
vectors go at the end of the memory area, after all
non-vector parameters.

llvm-svn: 48364
2008-03-14 17:41:26 +00:00
Evan Cheng 5be52a6053 Fix some 80 col violations.
llvm-svn: 48361
2008-03-14 07:46:48 +00:00
Evan Cheng 96bdbd6c5d Fix a number of encoding bugs. SSE 4.1 instructions MPSADBWrri, PINSRDrr, etc. have 8-bits immediate field (ImmT == Imm8).
llvm-svn: 48360
2008-03-14 07:39:27 +00:00