Anton Korobeynikov
7c5f998b22
Code cleanup. Provide generic way of selecting JIT pointer bitwidth regardless
...
of compiler used.
llvm-svn: 48702
2008-03-23 13:40:45 +00:00
Anton Korobeynikov
23d188b49c
Remove old-standing obsolete code.
...
llvm-svn: 48701
2008-03-23 12:32:54 +00:00
Anton Korobeynikov
95f522419c
Honour built-in defines on win64 targets for automatically subtarget recognize.
...
Force stack alignment to 16 bytes on win targets.
llvm-svn: 48695
2008-03-22 21:18:22 +00:00
Anton Korobeynikov
befd472d5e
Recognize "windows" in target triple, not only "win32"
...
llvm-svn: 48694
2008-03-22 21:12:53 +00:00
Anton Korobeynikov
dbde70d7d6
Add information about callee-saved registers on Win64
...
llvm-svn: 48692
2008-03-22 21:04:01 +00:00
Anton Korobeynikov
dad919f561
Add convenient helper for win64 check. Simplify things slightly.
...
llvm-svn: 48691
2008-03-22 20:57:27 +00:00
Anton Korobeynikov
27c8ad4020
Initial support for Win64 calling conventions. Still in early state.
...
llvm-svn: 48690
2008-03-22 20:37:30 +00:00
Anton Korobeynikov
38e7967f86
Register EH frames emitted in JIT when using gcc unwinding runtime
...
llvm-svn: 48688
2008-03-22 08:53:09 +00:00
Anton Korobeynikov
5dfc7591ef
Fix merge error
...
llvm-svn: 48687
2008-03-22 08:50:08 +00:00
Anton Korobeynikov
25a0157827
Add testcase for prev. commit. Minor fixes
...
llvm-svn: 48686
2008-03-22 08:37:05 +00:00
Anton Korobeynikov
197f07a72b
Aliasing chains cleanups: update langref, add check into verifier
...
llvm-svn: 48685
2008-03-22 08:36:14 +00:00
Anton Korobeynikov
06f3b7f4ee
Support chained aliases for LLVM IR printing. This fixes PR2145
...
llvm-svn: 48684
2008-03-22 08:17:17 +00:00
Anton Korobeynikov
4b85ece1ab
Another comments fixing
...
llvm-svn: 48683
2008-03-22 07:53:40 +00:00
Anton Korobeynikov
6ba56eb5e7
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
16f62d36e8
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
9a567d824d
implement the logic for memset insertion and store deletion.
...
llvm-svn: 48679
2008-03-22 04:13:49 +00:00
Owen Anderson
de2d3aca1b
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
5654dda62c
Add an AllocateRW to match AllocateRWX.
...
llvm-svn: 48676
2008-03-22 02:33:53 +00:00
Evan Cheng
874aee2eec
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
9d8b1ee347
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
a363ba510c
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
63ef3bbba0
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
479c8ef76d
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
ae161c1522
Fix -view-sunit-dags to support cross-rc-copy nodes.
...
llvm-svn: 48664
2008-03-21 22:51:06 +00:00
Chris Lattner
18f7655a45
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
15d06c679b
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
b8102d9de3
Minor cleanups and shrinkification.
...
llvm-svn: 48658
2008-03-21 21:14:38 +00:00
Dan Gohman
59aeac6320
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
308a452c90
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
32a6116ffd
A couple of kill marker maintainence bug.
...
llvm-svn: 48653
2008-03-21 19:09:30 +00:00
Andrew Lenharth
2ff2bcbde8
FunctionExtractorPass has been superceded by GVExtractorPass
...
llvm-svn: 48648
2008-03-21 16:46:53 +00:00
Duncan Sands
a53967843f
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
4153fc30c9
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
530554ab0a
Fix the build for gcc-4.2.
...
llvm-svn: 48639
2008-03-21 08:32:17 +00:00
Chris Lattner
edfc239ced
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
8a4fa95cae
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
933d0d318b
disable a bogus assertion.
...
llvm-svn: 48633
2008-03-21 06:01:05 +00:00
Chris Lattner
260473f983
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
96cdf21ed4
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
4ae9fee64c
Undo 48570. Correctly match mmx shift instructions with an immediate operand.
...
llvm-svn: 48627
2008-03-21 00:40:09 +00:00
Devang Patel
1b64c7d1e5
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
192124d0e6
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
dca0a5c5dc
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
6e32942dfa
enable -analyze for andersens
...
llvm-svn: 48601
2008-03-20 15:36:44 +00:00
Zhou Sheng
fc7856f528
Take the old function's name.
...
llvm-svn: 48588
2008-03-20 08:05:05 +00:00
Chris Lattner
f166a78d79
add a note.
...
llvm-svn: 48583
2008-03-20 04:46:13 +00:00
Christopher Lamb
110f66ca68
Check even more carefully before applying this DAGCombine transform.
...
llvm-svn: 48580
2008-03-20 04:31:39 +00:00
Devang Patel
f15fe34521
Restore isCFGOnly property of various analysis passes.
...
llvm-svn: 48579
2008-03-20 02:25:21 +00:00
Evan Cheng
8ecb189245
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
6c4486c5c7
detabify llvm, patch by Mike Stump!
...
llvm-svn: 48577
2008-03-20 01:22:40 +00:00
Devang Patel
e4f39224eb
Keep track of analysis information inherited from Module pass manager.
...
llvm-svn: 48576
2008-03-20 01:09:53 +00:00
Scott Michel
e747d20130
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
c5f34f6463
80 col violation.
...
llvm-svn: 48573
2008-03-20 00:20:23 +00:00
Evan Cheng
6f729b2820
Add intrinsics to match mmx shift builtin's with immediate operand.
...
llvm-svn: 48569
2008-03-19 23:38:52 +00:00
Devang Patel
c9c6d88ee5
Add comment.
...
llvm-svn: 48567
2008-03-19 23:05:52 +00:00
Devang Patel
3af681c5fb
#if 1 .. #endif markers do not add any value.
...
llvm-svn: 48560
2008-03-19 22:24:25 +00:00
Evan Cheng
5ef962445a
Remove dead options.
...
llvm-svn: 48556
2008-03-19 22:02:26 +00:00
Devang Patel
5e8cbbea65
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
c9dec33f3f
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
19a78545d9
Don't loose incoming argument registers. Fix documentation style.
...
llvm-svn: 48545
2008-03-19 16:39:45 +00:00
Christopher Lamb
958b0494c3
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
1642451cf7
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
e4b3339de8
C bindings for Module-, Function-, and BasicBlock::iterator.
...
llvm-svn: 48528
2008-03-19 03:47:18 +00:00
Evan Cheng
e9aa507edc
Fixed a coalescer bug caused by a typo.
...
llvm-svn: 48526
2008-03-19 02:26:36 +00:00
Gordon Henriksen
15006d5da0
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
3d9309c11d
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
38f181fa8c
Do not use virtual function to identify an analysis pass.
...
llvm-svn: 48520
2008-03-19 00:48:41 +00:00
Bill Wendling
7ae70d6441
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
5ac87b837e
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
5ea2aec3ac
Temporarily revert r48491. It's breaking test/CodeGen/X86/xorl.ll.
...
llvm-svn: 48510
2008-03-18 22:29:51 +00:00
Daniel Berlin
0f20fa71ba
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
7f51ebc90c
Make conversions of i8/i16 to ppcf128 work.
...
llvm-svn: 48493
2008-03-18 17:28:38 +00:00
Scott Michel
889ee011f7
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
1d70509b55
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
5750c3cd1e
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
811ca3ddba
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
7efcb7de6b
Update heuritics that estimates cost of call instructions.
...
llvm-svn: 48474
2008-03-17 23:41:20 +00:00
Dale Johannesen
861708b8bb
Make Complex long long/double/long double work
...
in ppc64 mode.
llvm-svn: 48459
2008-03-17 17:11:08 +00:00
Chris Lattner
c0ac2481af
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
98f1bf9d41
minor cleanups
...
llvm-svn: 48448
2008-03-17 06:57:02 +00:00
Evan Cheng
07643ce604
Unbreak JIT. Ignore TargetInstrInfo::IMPLICIT_DEF.
...
llvm-svn: 48447
2008-03-17 06:56:52 +00:00
Owen Anderson
5da16e856c
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
40ba51c972
remove dead code
...
llvm-svn: 48445
2008-03-17 06:04:10 +00:00
Chris Lattner
fa003f7a57
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
3098125c84
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
5cb886d4d6
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
5aef54c950
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
ee1e5be870
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
dc9bf8fda9
various rotate fun.
...
llvm-svn: 48438
2008-03-17 01:47:51 +00:00
Nate Begeman
f9691b8236
Add a couple missing SSE4 instructions
...
llvm-svn: 48430
2008-03-16 21:14:46 +00:00
Gordon Henriksen
04a60ddcd2
C and Objective Caml bindings for the TargetData class.
...
llvm-svn: 48422
2008-03-16 20:08:03 +00:00
Bill Wendling
301783caf7
Add assert for non-hexadecimal radixes.
...
llvm-svn: 48421
2008-03-16 20:05:52 +00:00
Gordon Henriksen
8c33afc50c
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
caeafc4911
C and Objective Caml bindings for PassManagers.
...
llvm-svn: 48413
2008-03-16 04:20:44 +00:00
Christopher Lamb
b4f4b41048
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
9af68f56c5
Remove isImplicitDef TargetInstrDesc flag.
...
llvm-svn: 48381
2008-03-15 00:19:36 +00:00
Evan Cheng
11d2c09adc
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
7ebaba8579
Expose Module::dump via C and Ocaml.
...
Patch by Erick Tryzelaar.
llvm-svn: 48379
2008-03-14 23:58:56 +00:00
Duncan Sands
3760c87373
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
3612a7ed30
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
c4f8df4a84
this was removed from the Unix side.
...
llvm-svn: 48370
2008-03-14 20:41:50 +00:00
Dan Gohman
37a26f973f
Update comments; getPassName no longer uses RTTI.
...
llvm-svn: 48369
2008-03-14 18:27:04 +00:00
Dale Johannesen
6195ace4c0
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
877c5ecabd
Fix some 80 col violations.
...
llvm-svn: 48361
2008-03-14 07:46:48 +00:00
Evan Cheng
fc6645a382
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
Evan Cheng
6ef1ca4e87
Add debugging stuff.
...
llvm-svn: 48359
2008-03-14 07:13:42 +00:00
Chris Lattner
c60749aa4c
Add an issue that is preventing instcombine from doing a simplification.
...
llvm-svn: 48356
2008-03-14 06:00:19 +00:00
Duncan Sands
d3859c83a5
Simplify using getIntPtrConstant.
...
llvm-svn: 48355
2008-03-14 05:23:57 +00:00
Bill Wendling
7d054f8b3f
The inst combining of inttoptr into GEP with one index was using the bit size of
...
the type instead of the byte size. This was causing troublesome mis-compilations.
True to form, this took 2 days to find and is a one-line fix. :-P
llvm-svn: 48354
2008-03-14 05:12:19 +00:00
Nate Begeman
f06c08e652
Tabs -> spaces
...
Use getIntPtrConstant in a couple places to shorten stuff up
Handle splitting vector shuffles with undefs in the mask
llvm-svn: 48351
2008-03-14 00:53:31 +00:00
Evan Cheng
1ce3ba341d
Livein copy scheduling fixes: do not coalesce physical register copies, correctly determine the safe location to insert the copies.
...
llvm-svn: 48348
2008-03-14 00:14:55 +00:00
Dan Gohman
6a74c23363
Use SDTNone instead of duplicating it.
...
llvm-svn: 48346
2008-03-13 23:07:40 +00:00
Dan Gohman
486f664806
More APInt-ification.
...
llvm-svn: 48344
2008-03-13 22:13:53 +00:00
Owen Anderson
6c2454d9d1
Fix a bug in GVN that Duncan noticed, where we potentially need to insert a
...
pointer bitcast when performing return slot optimization.
llvm-svn: 48343
2008-03-13 22:07:10 +00:00
Evan Cheng
b479bf0d0c
Undo tweak. It had no obvious benefit.
...
llvm-svn: 48341
2008-03-13 17:42:48 +00:00
Devang Patel
2c38efe128
Remove unused GetAddressOfSymbol()
...
Thanks Daniel Dunbar!
llvm-svn: 48340
2008-03-13 16:55:34 +00:00
Evan Cheng
a7c38d1ce9
Typo.
...
llvm-svn: 48337
2008-03-13 08:04:35 +00:00
Evan Cheng
9a7395ba78
Don't try to sink 3-address instruction if convertToThreeAddress created more than one instructions.
...
llvm-svn: 48336
2008-03-13 07:56:58 +00:00
Evan Cheng
38a8da7b16
Remove an unused command line option.
...
llvm-svn: 48334
2008-03-13 06:38:28 +00:00
Evan Cheng
0b8b1647dd
TwoAddressInstructionPass enhancement. After it converts a two address instruction into a 3-address one, sink it past the instruction that kills the read-mod-write register if its definition is used past the kill. This reduces the number of live register by one.
...
llvm-svn: 48333
2008-03-13 06:37:55 +00:00
Christopher Lamb
0f1c32eb63
Get rid of a pseudo instruction and replace it with subreg based operation on real instructions, ridding the asm printers of the hack used to do this previously. In the process, update LowerSubregs to be careful about eliminating copies that have side affects.
...
Note: the coalescer will have to be careful about this too, when it starts coalescing insert_subreg nodes.
llvm-svn: 48329
2008-03-13 05:47:01 +00:00
Chris Lattner
bc18b99af2
Fix Path::GetMainExecutable on cygwin, patch by Sam Bishop.
...
llvm-svn: 48328
2008-03-13 05:22:05 +00:00
Chris Lattner
3220bb0859
remove extraneous namespace qualifier, PR2142
...
llvm-svn: 48327
2008-03-13 05:17:59 +00:00
Chris Lattner
a14cdebdd9
move a bunch of trivial methods to be inline.
...
llvm-svn: 48326
2008-03-13 05:00:21 +00:00
Chris Lattner
d4a9aafc3f
Various improvements suggested by Duncan
...
llvm-svn: 48325
2008-03-13 04:33:03 +00:00
Nick Lewycky
b827640141
Update -mem2reg to use succ_iterator instead of iterating across TerminatorInst
...
successors. This makes it support nounwind.
llvm-svn: 48320
2008-03-13 02:42:41 +00:00
Evan Cheng
6b57844f0c
Remove unused options.
...
llvm-svn: 48319
2008-03-13 02:41:34 +00:00
Dan Gohman
e84a9f3740
Eliminate a few unnecessary uses of dynamic_cast.
...
llvm-svn: 48318
2008-03-13 02:08:36 +00:00
Dan Gohman
548e24d9ae
Fix a typo.
...
llvm-svn: 48317
2008-03-13 01:58:48 +00:00
Dan Gohman
971fdb877c
Don't redundantly clear std::vector members in destructors.
...
llvm-svn: 48316
2008-03-13 01:57:34 +00:00
Dan Gohman
abf6c9aa1d
Change PMTopLevelManager's PassManagers vector element type from
...
Pass* to PMDataManager*. PMDataManager is more specific than Pass,
so this more accurately describes the objects that are being stored.
This eliminates the need for several dynamic_casts to PMDataManager*.
It does introduce one dynamic_cast though, in dumpPasses(). Give
this one a comment describing why a dynamic_cast is being used.
llvm-svn: 48315
2008-03-13 01:48:32 +00:00
Dan Gohman
70f4b55e3f
Change PMStack::push to accept a PMDataManager* instead of
...
a Pass*. PMDataManager* is what it actually holds, so this
makes it clearer.
llvm-svn: 48314
2008-03-13 01:21:31 +00:00
Evan Cheng
b9fc5d6d07
Refactor some code out of MachineSink into a MachineInstr query.
...
llvm-svn: 48311
2008-03-13 00:44:09 +00:00
Dale Johannesen
1e54f7c2b6
Do not promote float params to double in varargs
...
calls here. This was done earlier for params in
the varargs part of the params; any float params
that survive to here are in the non-varargs part,
and must not be promoted.
llvm-svn: 48310
2008-03-12 23:40:01 +00:00
Evan Cheng
620fd19798
Experimental scheduler change to schedule / coalesce the copies added for function livein's. Take 2008-03-10-RegAllocInfLoop.ll, the schedule looks like this after these copies are inserted:
...
entry: 0x12049d0, LLVM BB @0x1201fd0, ID#0:
Live Ins: %EAX %EDX %ECX
%reg1031<def> = MOVPC32r 0
%reg1032<def> = ADD32ri %reg1031, <es:_GLOBAL_OFFSET_TABLE_>, %EFLAGS<imp-def>
%reg1028<def> = MOV32rr %EAX
%reg1029<def> = MOV32rr %EDX
%reg1030<def> = MOV32rr %ECX
%reg1027<def> = MOV8rm %reg0, 1, %reg0, 0, Mem:LD(1,1) [0x1201910 + 0]
%reg1025<def> = MOV32rr %reg1029
%reg1026<def> = MOV32rr %reg1030
%reg1024<def> = MOV32rr %reg1028
The copies unnecessarily increase register pressure and it will end up requiring a physical register to be spilled.
With -schedule-livein-copies:
entry: 0x12049d0, LLVM BB @0x1201fa0, ID#0:
Live Ins: %EAX %EDX %ECX
%reg1031<def> = MOVPC32r 0
%reg1032<def> = ADD32ri %reg1031, <es:_GLOBAL_OFFSET_TABLE_>, %EFLAGS<imp-def>
%reg1024<def> = MOV32rr %EAX
%reg1025<def> = MOV32rr %EDX
%reg1026<def> = MOV32rr %ECX
%reg1027<def> = MOV8rm %reg0, 1, %reg0, 0, Mem:LD(1,1) [0x12018e0 + 0]
Much better!
llvm-svn: 48307
2008-03-12 22:19:41 +00:00
Duncan Sands
f830ed681b
Initial soft-float support for LegalizeTypes. I rewrote
...
the fcopysign expansion from LegalizeDAG to get rid of
what seems to be a bug: the use of sign extension means
that when copying the sign bit from an f32 to an f64,
the upper 32 bits of the f64 (now an i64) are set, not
just the top bit... I also generalized it to work for
any sized floating point types, and removed the bogosity:
SDOperand Mask1 = (SrcVT == MVT::f64)
? DAG.getConstantFP(BitsToDouble(1ULL << 63), SrcVT)
: DAG.getConstantFP(BitsToFloat(1U << 31), SrcVT);
Mask1 = DAG.getNode(ISD::BIT_CONVERT, SrcNVT, Mask1);
(here SrcNVT is an integer with the same size as SrcVT).
As far as I can see this takes a 1 << 63, converts to
a double, converts that to a floating point constant
then converts that to an integer constant, ending up
with... 1 << 63 as an integer constant! So I just
generate this integer constant directly.
llvm-svn: 48305
2008-03-12 21:27:04 +00:00
Dan Gohman
e40582180e
Change VirtRegMap's dump to dump to cerr, not DOUT, so that it
...
can be called from within a debuger without having -debug specified
on the command-line.
llvm-svn: 48298
2008-03-12 20:52:10 +00:00
Dan Gohman
4e4f2e2ba4
Fix typos in comments.
...
llvm-svn: 48297
2008-03-12 20:50:04 +00:00
Duncan Sands
f9de87eae8
Fix typo.
...
llvm-svn: 48295
2008-03-12 20:35:19 +00:00
Duncan Sands
05eb212b2d
Don't try to extract an i32 from an f64. This
...
getCopyToParts problem was noticed by the new
LegalizeTypes infrastructure. In order to avoid
this kind of thing in the future I've added a
check that EXTRACT_ELEMENT is only used with
integers. Once LegalizeTypes is up and running
most likely BUILD_PAIR and EXTRACT_ELEMENT can
be removed, in favour of using apints instead.
llvm-svn: 48294
2008-03-12 20:30:08 +00:00
Chris Lattner
7925cc72c0
Reimplement the parameter attributes support, phase #1 . hilights:
...
1. There is now a "PAListPtr" class, which is a smart pointer around
the underlying uniqued parameter attribute list object, and manages
its refcount. It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
ParamAttrsWithIndex's, no need to make a SmallVector of a specific
size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
dereferencing the pointer is simplified to just access the
PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
bit simpler.
Phase #2 will rename some stuff (e.g. PAListPtr) and do other less
invasive changes.
llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Owen Anderson
5887233a3f
Improve the return slot optimization to be both more aggressive (not limited to sret parameters), and
...
safer (when the passed pointer might be invalid). Thanks to Duncan and Chris for the idea behind this,
and extra thanks to Duncan for helping me work out the trap-safety.
llvm-svn: 48280
2008-03-12 07:37:44 +00:00
Evan Cheng
df92afe7d3
Clean up my own mess.
...
X86 lowering normalize vector 0 to v4i32. However DAGCombine can fold (sub x, x) -> 0 after legalization. It can create a zero vector of a type that's not expected (e.g. v8i16). We don't want to disable the optimization since leaving a (sub x, x) is really bad. Add isel patterns for other types of vector 0 to ensure correctness. It's highly unlikely to happen other than in bugpoint reduced test cases.
llvm-svn: 48279
2008-03-12 07:02:50 +00:00
Owen Anderson
df98435a16
We also need to collect the VN IDs for the PHI instructions for later updating.
...
llvm-svn: 48278
2008-03-12 04:22:57 +00:00
Owen Anderson
ecc3b561eb
When we're determining what registers to coallesce, track the VNInfo IDs for the definitions that
...
feed the PHI instructions. We'll need these IDs in order to update LiveIntervals properly.
llvm-svn: 48277
2008-03-12 03:13:29 +00:00
Chris Lattner
5563a38088
when the bitcode reader is referencing a paramattr, make sure to bump its refcount.
...
llvm-svn: 48276
2008-03-12 02:25:52 +00:00
Evan Cheng
ee092b2dfc
Total brain cramp.
...
llvm-svn: 48274
2008-03-12 02:05:05 +00:00
Chris Lattner
1eca74f70e
This is a simple fix for getting error messages from dlerror in
...
LoadLibraryPermanently. The current code modifies the value of a pointer
that is passed by value, so the caller never gets the message.
Patch by Julien Lerouge!
llvm-svn: 48270
2008-03-12 00:50:01 +00:00
Dale Johannesen
19b4c2dfaf
One more bit of Altivec parameter passing.
...
llvm-svn: 48269
2008-03-12 00:49:20 +00:00
Anton Korobeynikov
192ff9b2d3
Be backward compatible
...
llvm-svn: 48268
2008-03-12 00:49:19 +00:00