Commit Graph

2512 Commits

Author SHA1 Message Date
Chris Lattner
bbedb0e408 Fix a bunch of bugs handling vector compare constant expressions, fixing
PR2317.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 05:17:31 +00:00
Chris Lattner
071aade5f0 Document and fix Constant::getVectorElements to return an empty vector
when presented with a constant expr.

If ConstantExpr::getV[IF]Cmp to work when ConstantFoldCompareInstruction
returns an undef or constant expr.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53541 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 05:10:41 +00:00
Dan Gohman
c418bf3dd5 Use find instead of lower_bound.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 20:58:19 +00:00
Chris Lattner
7cc9a4b990 SImplify ConstantVector::get a bit and make it turn a vector
of all undefs into a single undef value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:44:03 +00:00
Chris Lattner
fea85c46c0 Fix a case where vector comparison constant folding would cause an
infinite recursion.  part of PR2529


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53383 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:29:28 +00:00
Chris Lattner
8638144825 add a helper method for code that wants to handle vector
constants by element without caring how they are formed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53381 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:28:11 +00:00
Chris Lattner
330e7e4d25 elementwise comparison of vector constants was completely wrong. Fix
it for PR2529


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53380 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:08:17 +00:00
Evan Cheng
250c1d8734 - Replace use of std::map<std::string, ..> with StringMap. Replace use of std::map with DenseMap, std::set with SmallPtrSet. This results in minor speed up.
- Some code clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53379 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:04:23 +00:00
Dan Gohman
0af8225088 Consistently put quotes around pass names in debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 00:50:40 +00:00
Chris Lattner
8013954f15 improve comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53243 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 18:47:38 +00:00
Duncan Sands
cfa3c236b2 Add some helpers for manipulating function
parameter attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 09:41:30 +00:00
Duncan Sands
2e033f31dc Add some convenience methods for manipulating
call attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 08:38:44 +00:00
Chris Lattner
155a490258 Fix three bugs:
1) evaluate [v]fcmp true/false with undefs to true or false instead
   of undef.
2) fix vector comparisons with undef to return a vector result instead 
   of i1
3) fix vector comparisons with evaluatable results to return vector
   true/false instead of i1 true/false (PR2529)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53220 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 05:46:34 +00:00
Dan Gohman
1002c02034 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:00:37 +00:00
Bill Wendling
10fff6078a Revert my previous check-in that split up MachineModuleInfo. It turns out to
slow the compiler down at -O0 some 30% or more. Ooops.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53120 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 22:53:42 +00:00
Matthijs Kooijman
10b9de62ff Add newline at the end of Constants.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 07:46:41 +00:00
Dan Gohman
8de552d6f3 Use operator new instead of new char[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53066 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 00:53:09 +00:00
Devang Patel
f35cfe11ef Disable dom info verifier by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52983 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 21:36:11 +00:00
Devang Patel
844a3d163b Fix typos in comments.
Thanks for the feedback!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52978 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 19:50:56 +00:00
Devang Patel
5b57e720c8 Add dom info verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 17:44:24 +00:00
Devang Patel
687e03b2fa Move dominator info printer into tool/opt/GraphPrinters.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52907 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 17:32:58 +00:00
Evan Cheng
0ff39b3feb - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag.
- Correctly handle memcpy from constant string which is zero-initialized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 07:31:25 +00:00
Anton Korobeynikov
6d116bc7ce Revert (52748 and friends):
Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.

This unbreaks llvm-gcc bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-29 17:57:03 +00:00
Chris Lattner
97388469b1 implement some fixme's by making "autorenaming" in the value symbol table not
thrash the heap with string stuff (e.g. utostr).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52838 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:26:26 +00:00
Chris Lattner
48cd712d4c simplify some code to avoid string thrashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52837 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:25:24 +00:00
Chris Lattner
bb0e248718 Add a new version of Module::getFunction that takes a const char* instead
of a std::string.  This avoids copying the string to the heap in common
cases.  Patch by Pratik Solanki!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:09:10 +00:00
Devang Patel
42af887105 Add dominator info printer pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52829 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 16:43:21 +00:00
Bill Wendling
305635abea Refactor the DebugInfoDesc stuff out of the MachineModuleInfo file. Clean up
some uses of std::vector, where it's return std::vector by value. Yuck!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52800 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 00:09:40 +00:00
Eric Christopher
0d2b0aba42 Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 00:31:12 +00:00
Mon P Wang
2887310630 Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52706 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 08:15:39 +00:00
Owen Anderson
e4f6ee590b Use push_back rather than operator[], which is incorrect in this cases. Unfortunately, this slow the testcase down a little bit,
but only marginally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52700 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 01:05:05 +00:00
Owen Anderson
45e3958941 In ConstantArray::getAsString(), we know the size of the resultant string in advance so we can pre-allocate it and just fill in
the entries.  This improves the time for the AsmPrinter on InstructionCombining.cpp from 0.4248s to 0.3370s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52690 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 21:58:29 +00:00
Dan Gohman
78f39da1e8 Use const_cast instead of a C-style cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52684 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 17:47:37 +00:00
Dan Gohman
2f27e174a9 Remove two convenience constructors because they're now private, and the
private implementation doesn't really need the convenience.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 16:48:17 +00:00
Dan Gohman
7894ea75b5 Use std::copy instead of a loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52628 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 16:45:24 +00:00
Dan Gohman
1a203571ca More changes from Chris' review: simplify getIndices and avoid
copying its return value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52627 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 16:39:44 +00:00
Dan Gohman
4d515d0b09 Use Function's arg_size() and size() methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52605 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 22:06:54 +00:00
Chris Lattner
a1aabe422f fix some warnings when assertions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 19:47:03 +00:00
Dan Gohman
09ef00f979 Simplify this code. Thanks Chris!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 00:47:44 +00:00
Dan Gohman
44f6a2c951 Auto-upgrade code for multiple-value return statements. This code
isn't actually called yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 23:38:43 +00:00
Dan Gohman
80b9626ee3 In InsertValueInst's copy ctor, actually copy the operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 23:25:49 +00:00
Dan Gohman
b79bf1966d Implement the ExtractValueInst::getIndexedType that accepts one
index value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 21:07:55 +00:00
Owen Anderson
26bb50ab48 Add an insertBefore method for attaching previously unattached instructions,
such as those created by clone(), to a basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52424 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 18:29:27 +00:00
Chris Lattner
d34ff14358 switch TypeHasCycleThroughItself from using an std::set to using a SmallPtrSet,
this speeds up the linking testcase in PR1860 by 44% (.379 -> 0.263)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52365 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 21:20:58 +00:00
Chris Lattner
6520aa0f5e fix pr2460
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52294 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 04:02:40 +00:00
Evan Cheng
502a4f5162 Do not speculatively execute an instruction by hoisting it to its predecessor BB if any of its operands are defined but not used in BB. The transformation will prevent the operand from being sunk into the use block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52244 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-12 21:15:59 +00:00
Dan Gohman
7dc1def162 Re-apply 52002, allowing the verifier to accept non-MRV struct return
types on functions, with adjustments so that it accepts both
new-style aggregate returns and old-style MRV returns, including those
with only a single member.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 21:26:13 +00:00
Gabor Greif
76aca6f38f get rid of ExtractValueInst::init's Value argument, it is already passed to the UnaryInstruction ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52064 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 21:06:32 +00:00
Gabor Greif
d4f268bdd4 make ExtractValueInst derived from UnaryInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52061 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 20:28:12 +00:00
Devang Patel
8fb6a94b69 Print debug message only if there are dead passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52052 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 17:50:36 +00:00
Duncan Sands
83ec4b6711 Wrap MVT::ValueType in a struct to get type safety
and better control the abstraction.  Rename the type
to MVT.  To update out-of-tree patches, the main
thing to do is to rename MVT::ValueType to MVT, and
rewrite expressions like MVT::getSizeInBits(VT) in
the form VT.getSizeInBits().  Use VT.getSimpleVT()
to extract a MVT::SimpleValueType for use in switch
statements (you will get an assert failure if VT is
an extended value type - these shouldn't exist after
type legalization).
This results in a small speedup of codegen and no
new testsuite failures (x86-64 linux).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52044 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 12:08:01 +00:00
Dan Gohman
836bfcd689 Revert 52002.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 23:57:06 +00:00
Matthijs Kooijman
411e6a5efb Change the Verifier to support returning first class aggregrates.
Add a testcase for functions returning first class aggregrates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52002 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 14:00:36 +00:00
Matthijs Kooijman
045b3f7bf1 * Make CallSite::hasArgument const and let it take a const parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51989 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 08:04:58 +00:00
Matthijs Kooijman
9515a8f88a Add CallSite::hasArgument to allow for seeing if a call passes a certain value as an argument quickly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 16:31:12 +00:00
Matthijs Kooijman
338169ddc9 Add a Name parameter to two of the init methods of GetElementPointer to make the name setting more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51945 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 16:14:12 +00:00
Matthijs Kooijman
444099f615 Implement the two constructors in InsertValueInst and ExtractValueInst.
Add a Name argment to two init methods in these classes as well to make things
a bit more consistent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51937 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 14:40:55 +00:00
Evan Cheng
7c9b65207e More pass manager debugging outputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 09:13:31 +00:00
Dale Johannesen
24f07dc6e4 Prevent a crash in debug dumps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 18:14:29 +00:00
Devang Patel
c0c33f5e2c "Unable to schedule <A> required by <B>" is more helpful then
"Unable to handle Pass that requires lower level Analysis pass"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 01:20:02 +00:00
Devang Patel
e62f750784 Add debugging aid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 01:02:16 +00:00
Dan Gohman
6e68f59b78 Constant folding for insertvalue and extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 00:15:20 +00:00
Dan Gohman
995be7d07a AsmWriter support for insertvalue/extractvalue. These instructions can
now round-trip through assembly and bitcode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:12:39 +00:00
Dan Gohman
35651cdf0b Fix some bugs with the handling of indices in insertvalue/extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:09:08 +00:00
Dan Gohman
7e2dd6628e Factor several methods, including getInversePredicate and
getSwappedPredicate, from ICmpInst and FCmpInst into common
methods in CmpInst. This allows CmpInsts to be manipulated
generically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51810 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 02:47:54 +00:00
Dan Gohman
81a0c0b44e IR, bitcode reader, bitcode writer, and asmparser changes to
insertvalue and extractvalue to use constant indices instead of
Value* indices. And begin updating LangRef.html.

There's definately more to come here, but I'm checking this 
basic support in now to make it available to people who are
interested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51806 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 00:58:22 +00:00
Matthijs Kooijman
74b5e07cc4 Let Instruction::getOpcodeName() return something useful for the new
insertvalue / extractvalue instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 10:31:54 +00:00
Gabor Greif
0a4fd1ab7e back out last commit: The .cpp file for a module should include its corresponding header first, even if redundant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51598 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 17:26:02 +00:00
Gabor Greif
3d8710e80a prune unneeded #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51590 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 11:06:03 +00:00
Gabor Greif
b9d9eba916 remove unneeded reinterpret_casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51589 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 11:03:29 +00:00
Gabor Greif
9a6246c734 We have the correct headers included to know that BB isa Value. No reinterpret_cast necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51588 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 10:48:39 +00:00
Gabor Greif
6c80c38160 eliminate calls to deprecated Use::init() interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51570 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-26 21:33:52 +00:00
Duncan Sands
28c3cff825 Factor code to copy global value attributes like
the section or the visibility from one global
value to another: copyAttributesFrom.  This is
particularly useful for duplicating functions:
previously this was done by explicitly copying
each attribute in turn at each place where a
new function was created out of an old one, with
the result that obscure attributes were regularly
forgotten (like the collector or the section).
Hopefully now everything is uniform and nothing
is forgotten.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-26 19:58:59 +00:00
Evan Cheng
a31593901d Eliminate x86.sse2.punpckh.qdq and x86.sse2.punpckl.qdq.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51533 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-24 02:56:30 +00:00
Evan Cheng
e716bb1c59 Eliminate x86.sse2.movs.d, x86.sse2.shuf.pd, x86.sse2.unpckh.pd, and x86.sse2.unpckl.pd intrinsics. These will be lowered into shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51531 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-24 02:14:05 +00:00
Evan Cheng
4797f61657 Autoupgrade x86.sse2.loadh.pd and x86.sse2.loadl.pd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51523 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-24 00:08:39 +00:00
Dan Gohman
02dea8b39f Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
use it instead of duplicating its functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51499 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 21:05:58 +00:00
Dan Gohman
ee335e35ac Add #includes to make some dependencies explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 20:40:06 +00:00
Dan Gohman
e4569943d9 Add more IR support for the new extractvalue and insertvalue
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:36:11 +00:00
Chris Lattner
ea21ad4926 Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs.  Testcase here: 
test/CodeGen/X86/asm-indirect-mem.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 04:46:38 +00:00
Gordon Henriksen
83eaae19ad Remove a duplicative binding. Patch by Mahadevan R.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51238 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 05:47:10 +00:00
Nick Lewycky
08de1e476c Revert constant-folding change that will miscompile in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17 19:00:05 +00:00
Nick Lewycky
6cccce3e58 Unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51217 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17 09:05:22 +00:00
Nick Lewycky
d24ae8703f Constant fold inttoptr and ptrtoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51216 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17 09:03:26 +00:00
Eric Christopher
0bf7b414ae Add functions to enable adding a single attribute to a function and
its associated call site.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51204 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 20:39:43 +00:00
Gabor Greif
7cbd8a3e92 API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51200 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 19:29:10 +00:00
Dan Gohman
eedff319dc Revert the change from r51157 in
test/Verifier/2002-11-05-GetelementptrPointers.ll, which was incorrect.
Instead, fix getIndexedType to not follow pointer types, as
PointerType is a subclass of CompositeType.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51171 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 00:16:32 +00:00
Dan Gohman
041e2eb517 IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 19:50:34 +00:00
Gabor Greif
b1dbcd886a Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 10:04:30 +00:00
Nate Begeman
ff155f03bd Move the operator new and operator delete out of line. This fixes an issue with
operator new() referring to the static initTags function, which has to be in the 
same linkage unit as any file including User.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51136 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 01:23:11 +00:00
Dale Johannesen
aafce77b17 Add CommonLinkage; currently tentative definitions
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both.  The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51118 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 20:12:51 +00:00
Dan Gohman
4d9dd6beae Make PreVerifyID, IntSigsEnd, and KillSigsEnd const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51088 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 00:42:30 +00:00
Gabor Greif
94fb68ba21 Merge of r51073-51074 from use-diet branch.
Do not rely on std::swap<Use>, provide a (faster) member function instead.
This change is primarily necessitated by MSVC++'s incompatibility with
declaring std::swap<Use> to be a friend of Use.

Also contains some minor tweaks to Use inline functions,
to undo pointless changes that sneaked in with the last merge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51078 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 22:51:52 +00:00
Devang Patel
2527e88416 Dominance Frontier is cfg only pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51075 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 22:43:21 +00:00
Gabor Greif
d6a2218586 Derive GetResultInst from UnaryInstruction, this simplifies code and removes a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51023 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 07:09:08 +00:00
Dan Gohman
6ddba2b933 Change class' public PassInfo variables to by initialized with the
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.

Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51022 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 02:05:11 +00:00
Dan Gohman
844731a7f1 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 00:00:25 +00:00
Nate Begeman
c83ad0d8e7 Pointer comparisons should be handled by icmp, not vicmp :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 20:11:05 +00:00
Nate Begeman
18e4e8500f Hard code CmpInst back to i1 for now while I go track down what in the bitcode reader/writer is assuming i1
This was breaking a bunch of tests


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50992 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 20:01:56 +00:00
Nate Begeman
6fd90ce2ee Fix build breakage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50986 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 19:23:22 +00:00
Nate Begeman
ac80ade158 Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRef
for details.  CodeGen support coming in a follow up patch


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50985 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 19:01:56 +00:00
Dan Gohman
9b38d7db6d Update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50974 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 16:34:30 +00:00
Gabor Greif
efe65369a7 merge of use-diet branch to trunk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-10 08:32:32 +00:00
Anton Korobeynikov
018f771398 Check for validity of aliasee pointer before dereference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 23:11:06 +00:00
Chris Lattner
748118d8aa conservatively say that volatile stores read memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50872 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 21:58:49 +00:00
Chris Lattner
38818b072f store can't read from memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 21:47:43 +00:00
Chris Lattner
d96288a2ff add a new Instruction::mayReadFromMemory predicate, make
Instruction::mayWriteToMemory stronger for invokes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 17:16:51 +00:00
Anton Korobeynikov
0b12ecf6ff Turn StripPointerCast() into a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 22:54:15 +00:00
Anton Korobeynikov
b04adddd50 Make StripPointerCast a common function (should we mak it method of Value instead?)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 22:52:30 +00:00
Dan Gohman
84b7df43fb Remove uses of llvm/System/IncludeFile.h that are no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50695 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 01:32:53 +00:00
Gordon Henriksen
16c1f44d91 Use (void) instead of () in C code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-04 12:55:34 +00:00
Evan Cheng
22b942aa4d Add separate intrinsics for MMX / SSE shifts with i32 integer operands. This allow us to simplify the horribly complicated matching code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50601 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-03 00:52:09 +00:00
Chris Lattner
5c5f1095ec fix a bug in my previous patch, a classic =/== bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 15:27:09 +00:00
Chris Lattner
12e6d20059 add a method for comparing to see if a value has a specified name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 03:55:40 +00:00
Gordon Henriksen
e2435da8ab Expose parameter attributes via C bindings.
Patch by Anders Johnsen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50360 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 17:37:06 +00:00
Chris Lattner
96bb622646 Allow asms to return multiple results by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 23:33:55 +00:00
Nick Lewycky
280a6e607d Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 16:53:59 +00:00
Chris Lattner
80b8f5dd6b tighten up verifier checks which missed cases where
return instrs operands didn't match up with function results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50182 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 20:33:41 +00:00
Chris Lattner
d52b62ae05 Enforce that multiple return values have to have at least one result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 05:36:34 +00:00
Chris Lattner
42369b7e4b Verify that the operand of a getresult instruction is a
call/invoke or undef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50129 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 04:06:15 +00:00
Chris Lattner
eb411291fa more fallout from Nicholas' asmprinter patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50078 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 02:45:44 +00:00
Chris Lattner
ea705199af don't print dominators every time it is computed with -debug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 06:19:02 +00:00
Chris Lattner
a1b5858fda another bug introduced in r47802 by nicholas, for no apparent reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50031 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 06:12:55 +00:00
Chris Lattner
96c5b2f8c7 fix a bug introduced by Nicholas' "unwinds to" stuff: we
lost newlines between blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50024 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 04:20:33 +00:00
Chris Lattner
7ae40e7d8a add a handy helper method to instruction, useful for determining
whether it is used outside of some block.  This can be used to see
if there are any non-local references, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50004 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 22:11:30 +00:00
Chris Lattner
3e5d1d8d08 hopefully resolve PR2240
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49999 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 19:59:12 +00:00
Chris Lattner
0e4b6c7551 rearrange some code, simplify handling of shifts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49995 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 18:24:14 +00:00
Chris Lattner
eb9c8e1e3f Use simplified ConstantFP::get method, fix a bug handling frem x, 0 with long doubles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49976 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 00:26:06 +00:00
Chris Lattner
d881ad2c57 Implement PR2206.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 22:17:26 +00:00
Chris Lattner
1c14c29746 refactor handling of symbolic constant folding, picking up
a few new cases( see Integer/a1.ll), but not anything that
would happen in practice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49965 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 21:58:19 +00:00
Chris Lattner
61783d7322 indentation fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 21:13:00 +00:00
Dale Johannesen
48325f4b08 Don't read off end of the input array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49799 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 17:31:41 +00:00
Owen Anderson
1f23e16319 Major repairs to the post-dominators implementation. Patch from Florian Brandner!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49768 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:21:16 +00:00
Dan Gohman
d660f973dc VAArg may trap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 15:07:08 +00:00
Duncan Sands
89f6d88db3 Merge LLVMBuilder and FoldingBuilder, calling
the result IRBuilder.  Patch by Dominic Hamon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49604 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 06:22:09 +00:00
Dan Gohman
3bd659ba20 Make several symbols static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 21:11:47 +00:00
Chris Lattner
288e78fbe7 add a simplified accessor for creating an fp constant of a
particular value but variable type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49416 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 06:38:30 +00:00
Chris Lattner
4592230265 add a version of ConstantFP::get that doesn't take a redundant Type* value,
start migrating code over to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 00:45:01 +00:00
Duncan Sands
92432a8db1 Convenience method for setting the nounwind
attribute for a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 07:23:58 +00:00
Duncan Sands
79ab3e8014 Make sure that intrinsics automagically get the
right parameter attributes no matter how they
are obtained.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49335 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 13:39:11 +00:00
Gabor Greif
c024cbca22 fix a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 21:42:13 +00:00
Gabor Greif
051a950000 API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 20:25:17 +00:00
Chris Lattner
038112a4e0 Change the MemoryBuffer::getFile* methods to take just a pointer to the
start of a filename, not a filename+length.  All clients can produce a
null terminated name, and the system api's require null terminated 
strings anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49041 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 18:04:03 +00:00
Nate Begeman
83ad90a779 Don't eliminate bitcast instructions that change the type of a pointer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48971 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 00:22:16 +00:00
Duncan Sands
66a1a05c86 Fix comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-30 19:38:55 +00:00
Nick Lewycky
0c78ac11dd Update example to new syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-28 06:46:51 +00:00
Dan Gohman
950a4c40b8 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48801 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 22:06:05 +00:00
Evan Cheng
26471c48b3 Handle a special case xor undef, undef -> 0. Technically this should be transformed to undef. But this is such a common idiom (misuse) we are going to handle it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 20:08:07 +00:00
Bill Wendling
92e73d7628 Fix PR2062: Don't build Intrinsics.gen in the source directory. Do it in the
object directory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 09:12:48 +00:00
Dan Gohman
52837078c7 Shrink the size of AllocationInst by using its SubclassData
field to store the alignment value instead of haing a
separate field.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48727 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 16:55:58 +00:00