Chandler Carruth
00e56b0e81
This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future.
...
This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported.
llvm-svn: 40807
2007-08-04 01:51:18 +00:00
Dale Johannesen
976a1cf6cf
long double patch 3 of N. Add to MVT.
...
llvm-svn: 40793
2007-08-03 20:51:37 +00:00
Dale Johannesen
dda00eb44d
Long double, part 1 of N. Support in IR.
...
llvm-svn: 40774
2007-08-03 01:03:46 +00:00
Anders Carlsson
122059b2e9
Fix bug spotted by Chris.
...
llvm-svn: 40725
2007-08-02 06:05:19 +00:00
Anders Carlsson
89ea07e724
Add extend and extOrTrunc methods that do sign or zero extension depending on whether the integer is signed or not
...
llvm-svn: 40724
2007-08-02 06:00:13 +00:00
Evan Cheng
a06b9cf09f
Do not emit copies for physical register output if it's not used.
...
llvm-svn: 40722
2007-08-02 05:29:38 +00:00
Evan Cheng
14bd520741
Instead of adding copyfromreg's to handle physical definitions. Now isel can
...
simply specify them as results and let scheduledag handle them. That
is, instead of
SDOperand Flag = DAG.getTargetNode(Opc, MVT::i32, MVT::Flag, ...)
SDOperand Result = DAG.getCopyFromReg(Chain, X86::EAX, MVT::i32, Flag)
Just write:
SDOperand Result = DAG.getTargetNode(Opc, MVT::i32, MVT::i32, ...)
And let scheduledag emit the move from X86::EAX to a virtual register.
llvm-svn: 40710
2007-08-02 00:28:15 +00:00
Evan Cheng
8f126e59f5
Added TargetInstrDescriptor::numDefs - num of results.
...
llvm-svn: 40709
2007-08-02 00:20:17 +00:00
Owen Anderson
7028dfaf9d
Make non-local memdep not be recursive, and fix a bug on 403.gcc that this exposed.
...
llvm-svn: 40692
2007-08-01 22:01:54 +00:00
Dan Gohman
7dd04fb91c
More explicit keywords.
...
llvm-svn: 40673
2007-08-01 15:32:29 +00:00
Dan Gohman
53bb686577
Make ImmutablePass::runOnModule non-virtual, since it is not
...
intended to be overridden.
llvm-svn: 40671
2007-08-01 14:28:20 +00:00
Owen Anderson
58e64df595
Rename FastDSE to just DSE.
...
llvm-svn: 40668
2007-08-01 06:36:51 +00:00
David Greene
f06a395bb9
New CallInst interface to address GLIBCXX_DEBUG errors caused by
...
indexing an empty std::vector.
Updates to all clients.
llvm-svn: 40660
2007-08-01 03:43:44 +00:00
David Greene
4251f42689
Fix GLIBCXX_DEBUG error owing to dereference of end iterator. There's
...
no guarantee that an instruction returned by getDependency exists in
the maps.
llvm-svn: 40647
2007-07-31 20:01:27 +00:00
Devang Patel
6dd3a5f747
Introduce Simple Analysis interface for loop passes.
...
Right now, this interface provides hooks for only to operations, 1) clone basic block 2) delete value.
llvm-svn: 40625
2007-07-31 08:00:57 +00:00
Anton Korobeynikov
13fd2f7128
Add detection of __dso_handle presence during configure. Use this information in the
...
JITer (short path is added for darwin). This is needed to properly JIT llvm-gcc-4.2-built
binaries, since cxa_atexit is enabled by default on much more targets.
llvm-svn: 40600
2007-07-30 20:02:02 +00:00
Dan Gohman
51e7be7b8f
Fix the comments for the 'fast' parameter in addPassesToEmitFile.
...
llvm-svn: 40592
2007-07-30 15:04:59 +00:00
Dan Gohman
23f9a3ad3b
Fix the comment for getClosestTargetForJIT to reflect the fact that
...
it does not have a Module parameter.
llvm-svn: 40590
2007-07-30 14:58:59 +00:00
Dan Gohman
75473b49ea
More explicit keywords.
...
llvm-svn: 40589
2007-07-30 14:51:59 +00:00
Dan Gohman
b757cdd2e6
Fix pastos in comments for doFinalization functions.
...
llvm-svn: 40588
2007-07-30 14:51:13 +00:00
Devang Patel
780ecf20d1
Add facility to dump pass manager structure
...
to make it easier to understand failure.
llvm-svn: 40567
2007-07-27 20:06:09 +00:00
Devang Patel
a03e82d7ee
Use SmallPtrSet.
...
llvm-svn: 40560
2007-07-27 18:34:27 +00:00
Owen Anderson
997b15d967
Allow SmallPtrSet to hold pointers to const data.
...
llvm-svn: 40556
2007-07-27 18:07:02 +00:00
Duncan Sands
e8bb2c6d32
Support for trampolines, except for X86 codegen which is
...
still under discussion.
llvm-svn: 40549
2007-07-27 12:58:54 +00:00
Christopher Lamb
258dab5389
Add a MachineFunction pass, which runs post register allocation, that turns subreg insert/extract instruction into register copies. This ensures correct code gen if the coalescer isn't able to remove all subreg instructions.
...
llvm-svn: 40521
2007-07-26 08:18:32 +00:00
Christopher Lamb
08bcd5c0f8
Teach DAG scheduling how to properly emit subreg insert/extract machine instructions. PR1350
...
llvm-svn: 40520
2007-07-26 08:12:07 +00:00
Christopher Lamb
7bef240f69
Have register info provide the inverse mapping of register->superregisters. PR1350
...
llvm-svn: 40519
2007-07-26 08:01:58 +00:00
Christopher Lamb
9a0d88efde
Add target independent MachineInstr's to represent subreg insert/extract in MBB's. PR1350
...
llvm-svn: 40518
2007-07-26 07:48:21 +00:00
Christopher Lamb
73c3cd47cc
Add selection DAG nodes for subreg insert/extract. PR1350
...
llvm-svn: 40516
2007-07-26 07:34:40 +00:00
Christopher Lamb
2d47a6faec
Fix 80 col violation.
...
llvm-svn: 40515
2007-07-26 07:03:08 +00:00
Christopher Lamb
cb63a77a51
Remove subreg index from MachineInstr's and also keep vregs as unsigned when adding operands.
...
llvm-svn: 40514
2007-07-26 07:00:46 +00:00
Christopher Lamb
fb7a157ebc
Fix comments for new types.
...
llvm-svn: 40507
2007-07-26 01:48:57 +00:00
Christopher Lamb
f3881994a7
Add support for 3 element 32-bit vector ValueTypes.
...
llvm-svn: 40506
2007-07-26 01:46:52 +00:00
Evan Cheng
4b747bb6a0
EmitAlignment() also emits optional fill value.
...
llvm-svn: 40500
2007-07-25 23:35:07 +00:00
Owen Anderson
906d9d4a10
Forgot to include this file in my last commit.
...
llvm-svn: 40496
2007-07-25 21:30:15 +00:00
Owen Anderson
6a1a8d05b8
Add basic support for performing whole-function RLE.
...
Note: This has not yet been thoroughly tested. Use at your own risk.
llvm-svn: 40489
2007-07-25 19:57:03 +00:00
Devang Patel
d7b401bafd
Add BasicInliner interface.
...
This interface allows clients to inline bunch of functions with module
level call graph information.:wq
llvm-svn: 40486
2007-07-25 18:00:25 +00:00
Dan Gohman
1444c5840b
Add const to CanBeFoldedBy, CheckAndMask, and CheckOrMask.
...
llvm-svn: 40480
2007-07-24 23:00:27 +00:00
Owen Anderson
b9ad251288
Add initial support for non-local memory dependence analysis.
...
NOTE: This has only been cursorily tested. Expected improvements soon.
llvm-svn: 40476
2007-07-24 21:52:37 +00:00
Owen Anderson
eb9f1b612c
Add a GVN pass, using the value numbering code I developed for GVNPRE and the
...
load elimination code from RedundantLoadElimination.
llvm-svn: 40469
2007-07-24 17:55:58 +00:00
Owen Anderson
5969a3cb91
Rename a lot of things to change FastDLE to RedundantLoadElimination.
...
llvm-svn: 40457
2007-07-24 00:17:04 +00:00
Owen Anderson
8523f2d7c4
Forgot to commit this file.
...
llvm-svn: 40447
2007-07-23 22:00:03 +00:00
Owen Anderson
0448fc9e66
Fix a comment.
...
llvm-svn: 40446
2007-07-23 21:51:37 +00:00
Owen Anderson
bd3360e856
Add FastDLE, the load-elimination counterpart of FastDSE.
...
llvm-svn: 40445
2007-07-23 21:48:08 +00:00
Bill Wendling
97342a9b0c
Add missing SSE builtins:
...
__builtin_ia32_cvtss2si64
__builtin_ia32_cvttss2si64
__builtin_ia32_cvtsi642ss
__builtin_ia32_cvtsd2si64
__builtin_ia32_cvttsd2si64
__builtin_ia32_cvtsi642sd
llvm-svn: 40411
2007-07-23 03:07:27 +00:00
Chris Lattner
06bdb78751
Disable the string map copy ctor and assignment operators,
...
they don't do the right thing.
Implement StringMap::erase.
Fix a nasty bug in the default ctor.
llvm-svn: 40395
2007-07-22 20:08:01 +00:00
Dan Gohman
ac8ccab48f
Don't assume that only Uses can be kills. Defs are marked as kills initially
...
when there are no uses. This fixes a dangling-pointer bug, where pointers to
deleted instructions were not removed from kills lists. More info here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-July/009749.html
llvm-svn: 40131
2007-07-20 23:17:34 +00:00
Dan Gohman
d1cc67ea8d
Simplify the logic for setVolatile.
...
llvm-svn: 40130
2007-07-20 23:14:50 +00:00
Evan Cheng
cdb4e7949f
Added -print-emitted-asm to print out JIT generated asm to cerr.
...
llvm-svn: 40123
2007-07-20 21:56:13 +00:00
Owen Anderson
2ceefaf94d
Make the heuristic for shrinking DenseMap smarter.
...
llvm-svn: 40114
2007-07-20 18:56:46 +00:00
Devang Patel
133b5cb6b6
Use SmallVector instead of std::vector.
...
llvm-svn: 40109
2007-07-20 18:04:54 +00:00
Owen Anderson
07f3b97796
Have DenseMap auto-shrink itself on clear(). This improves the time to optimize
...
403.gcc from 15.2s to 14.3s.
llvm-svn: 40100
2007-07-20 16:15:24 +00:00
Devang Patel
45675e56ad
Verify loop info.
...
llvm-svn: 40062
2007-07-19 18:02:32 +00:00
Anton Korobeynikov
609ef3bdb9
Properly initialize value :)
...
llvm-svn: 40059
2007-07-19 15:32:47 +00:00
Devang Patel
9c100bc7e9
Set up ground work to verify preserved analysis info.
...
llvm-svn: 40039
2007-07-19 05:36:09 +00:00
Dan Gohman
4d64f82ab5
Add constructor overloads for LoadInst and StoreInst that insert at the
...
end of a BasicBlock and have an alignment parameter.
llvm-svn: 40016
2007-07-18 20:51:11 +00:00
Reid Spencer
3dd7b1699b
Unbreak the build by putting calls to free into the implementation file and
...
having that implementation file #include <cstdlib>.
llvm-svn: 39952
2007-07-17 02:16:12 +00:00
Owen Anderson
efc00e35cf
Add support for walking up memory def chains, which enables finding many more
...
dead stores on 400.perlbench.
llvm-svn: 39929
2007-07-16 21:52:50 +00:00
Owen Anderson
f01c29815d
Use realloc() to (potentially) resize the contents of SmallPtrSet in place.
...
llvm-svn: 39926
2007-07-16 21:27:44 +00:00
Dan Gohman
0ba554c0c8
Fix comments about vectors to use the current wording.
...
llvm-svn: 39921
2007-07-16 14:29:03 +00:00
Nick Lewycky
43e5fd5be7
Handle decrementing loops properly. Fixes PR1533.
...
Always pass the constant as the second parameter to HowManyLessThans.
Remove obsolete "isSigned" parameter.
llvm-svn: 39893
2007-07-16 02:08:00 +00:00
Chris Lattner
03bc1d9018
add a helper method.
...
llvm-svn: 39885
2007-07-15 23:32:03 +00:00
Nick Lewycky
701e227136
Clarify the language. Pointed out by Duncan Sands.
...
llvm-svn: 39857
2007-07-14 17:41:03 +00:00
Anton Korobeynikov
5635277c36
Long live the exception handling!
...
This patch fills the last necessary bits to enable exceptions
handling in LLVM. Currently only on x86-32/linux.
In fact, this patch adds necessary intrinsics (and their lowering) which
represent really weird target-specific gcc builtins used inside unwinder.
After corresponding llvm-gcc patch will land (easy) exceptions should be
more or less workable. However, exceptions handling support should not be
thought as 'finished': I expect many small and not so small glitches
everywhere.
llvm-svn: 39855
2007-07-14 14:06:15 +00:00
Nick Lewycky
42e8a060a0
Add alternate ConstantRange intersection algorithm.
...
llvm-svn: 39851
2007-07-14 02:51:34 +00:00
Devang Patel
9166ad7658
Make LCSSA a loop pass.
...
llvm-svn: 39844
2007-07-13 23:57:11 +00:00
Dale Johannesen
469ed8e17e
Skeleton of post-RA scheduler; doesn't do anything yet.
...
Change name of -sched option and DEBUG_TYPE to
pre-RA-sched; adjust testcases.
llvm-svn: 39816
2007-07-13 17:13:54 +00:00
Reid Spencer
09aba24630
Regenerate to pick up Gabor's changes.
...
llvm-svn: 39802
2007-07-13 10:05:30 +00:00
Tanya Lattner
a715bbe152
Adding ability to demote phi to stack.
...
llvm-svn: 39744
2007-07-11 18:41:34 +00:00
Owen Anderson
1eaba31f12
Add FastDSE, a new algorithm for doing dead store elimination. This algorithm is not as accurate
...
as the current DSE, but it only a linear scan over each block, rather than quadratic. Eventually
(once it has been improved somewhat), this will replace the current DSE.
NOTE: This has not yet been extensively tested.
llvm-svn: 38517
2007-07-11 00:46:18 +00:00
Evan Cheng
6125079452
Add OptionalDefOperand. Remove clobbersPred. Also add DefinesPredicate to be used by if-converter.
...
llvm-svn: 38499
2007-07-10 18:06:29 +00:00
Owen Anderson
1f5fb875b6
Add support for finding the dependencies of call and invoke instructions.
...
llvm-svn: 38497
2007-07-10 17:59:22 +00:00
Owen Anderson
1fabbda503
Fix a bunch of things from Chris' feedback
...
llvm-svn: 38493
2007-07-10 17:08:11 +00:00
Evan Cheng
cf3b1c89a9
When a node value is only used by a CopyToReg, use the user's dest. This should not be restricted to nodes that produce only a single value.
...
llvm-svn: 38485
2007-07-10 07:08:32 +00:00
Evan Cheng
23dc96f640
Move DenseMapKeyInfo<SDOperand> from LegalizeDAG.cpp to SelectionDAGNodes.h
...
llvm-svn: 38484
2007-07-10 06:59:55 +00:00
Owen Anderson
31eaa152b8
Evidently my earlier fix did not go far enough. When resizing a zero-sized
...
BitVector, make sure to set or clear ALL of the bits.
llvm-svn: 38481
2007-07-10 02:01:16 +00:00
Owen Anderson
1ab53d5ee7
When resizing a BitVector with size 0, be sure to clear the low word before using it.
...
llvm-svn: 38476
2007-07-09 23:39:39 +00:00
Devang Patel
65f3717db9
Expose struct size threhold to allow users to tweak their own setting.
...
llvm-svn: 38472
2007-07-09 21:19:23 +00:00
Owen Anderson
e48ed4f7a8
Make the assignment operator for SmallPtrSet return a reference, and fix a long-standing bug in the copy
...
ctor while I'm at it.
Thanks to Chris Lattner for help with this patch.
llvm-svn: 38470
2007-07-09 20:59:01 +00:00
Devang Patel
f1b6294e80
Fix memory leak.
...
llvm-svn: 38469
2007-07-09 20:52:39 +00:00
Chris Lattner
39e93bf0e0
work around an aparent gcc name resolution bug by
...
detemplatizing this.
llvm-svn: 38461
2007-07-09 17:11:53 +00:00
Chris Lattner
97ba0c99ed
implement operator= for smallptrset
...
llvm-svn: 38460
2007-07-09 16:54:03 +00:00
Dan Gohman
4e45063081
Move the APInt form of SCEVUnknown::getIntegerSCEV to SCEVConstant::get, and
...
use SCEVConstant::get instead of SCEVUnknown::get when constructing a SCEV
for a ConstantInt.
llvm-svn: 38457
2007-07-09 15:25:17 +00:00
Dan Gohman
3f7558673e
Fix a typo in a comment.
...
llvm-svn: 38456
2007-07-09 15:15:24 +00:00
Gabor Greif
0c10b17f03
missed this one
...
llvm-svn: 38454
2007-07-09 12:20:30 +00:00
Gabor Greif
89919e17b4
fix typos
...
llvm-svn: 38453
2007-07-09 12:00:59 +00:00
Owen Anderson
23d5d3add4
A first stab at memory dependence analysis. This is an interface on top of
...
alias analysis, adding caching and lazy computation of queries. This will
be used in planned improvements to memory access optimizations.
llvm-svn: 37958
2007-07-06 23:14:35 +00:00
Owen Anderson
6644d23a16
Add some accessors to improve consistency.
...
llvm-svn: 37957
2007-07-06 23:13:31 +00:00
Devang Patel
d9043c7501
Add SplitEdge and SplitBlock utility routines.
...
llvm-svn: 37952
2007-07-06 21:39:20 +00:00
Gabor Greif
018330fd12
finishing touches of bytecode -> bitcode changes. also unbreak Windows
...
llvm-svn: 37950
2007-07-06 20:28:40 +00:00
Dan Gohman
61966b8551
Remove redundant declarations.
...
llvm-svn: 37946
2007-07-06 13:59:28 +00:00
Gabor Greif
f5e225a756
eliminate residual cruft related to recognizing bytecode
...
files.
bitcode files are the only LLVM format left.
llvm-svn: 37945
2007-07-06 13:38:17 +00:00
Dan Gohman
dd89857d45
Fix a comment so that the element numbering match the actual element
...
operand numbering.
llvm-svn: 37944
2007-07-06 13:27:33 +00:00
Rafael Espindola
7b3de98989
Add the byval attribute
...
llvm-svn: 37940
2007-07-06 10:57:03 +00:00
Dan Gohman
a83ac4f3b4
Add explicit keywords.
...
llvm-svn: 37925
2007-07-05 20:40:15 +00:00
Dan Gohman
98470536ff
Make MachineFunctionPass::runOnFunction non-virtual. Subclasses override
...
the virtual function runOnMachineFunction instead. And add access specifiers.
llvm-svn: 37924
2007-07-05 20:39:35 +00:00
Gabor Greif
5f705671e4
Here is the bulk of the sanitizing.
...
Almost all occurrences of "bytecode" in the sources have been eliminated.
llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Duncan Sands
eca2fa295b
Make sure only one copy of a filter is placed in the
...
exception handling table if we encounter it multiple
times. Filters could be folded harder than this, but
that would mean a lot more work for not much gain.
llvm-svn: 37908
2007-07-05 15:15:01 +00:00
Duncan Sands
4441eff1ac
Extend eh.selector to support both catches and filters.
...
Drop the eh.filter intrinsic.
llvm-svn: 37875
2007-07-04 20:52:51 +00:00
Devang Patel
7d791bb10c
Remove unused method - getIDomBlock().
...
llvm-svn: 37865
2007-07-04 01:11:19 +00:00