Commit Graph

1299 Commits

Author SHA1 Message Date
Chris Lattner 5bbf60a5b6 minor cleanup/fastpath for the bcreader. This speeds up the bcreader
from 1:41 -> 1:39 on the large python .bc file in a release build.

llvm-svn: 23623
2005-10-04 16:52:46 +00:00
Chris Lattner 8760ec73d8 implement the struct version of the array speedup, speeding up the
testcase a bit more from 1:48 -> 1.40.

llvm-svn: 23619
2005-10-04 01:17:50 +00:00
Chris Lattner b64419ac40 Change ConstantArray::replaceUsesOfWithOnConstant to attempt to update
constant arrays in place instead of reallocating them and replaceAllUsesOf'ing
the result.  This speeds up a release build of the bcreader from:

136.987u 120.866s 4:24.38
to
49.790u 49.890s 1:40.14

... a 2.6x speedup parsing a large python bc file.

llvm-svn: 23614
2005-10-03 22:51:37 +00:00
Chris Lattner c4062ba65f move some methods, no other changes
llvm-svn: 23613
2005-10-03 21:58:36 +00:00
Chris Lattner 0144fadc17 minor microoptimizations
llvm-svn: 23612
2005-10-03 21:56:24 +00:00
Chris Lattner e7e139e8e8 Split SimpleConstantVal up into its components, so each Constant subclass getsa different enum value. This allows 'classof' for these to be really simple,not needing to call getType() anymore.
This speeds up isa/dyncast/etc for constants, and also makes them smaller.
For example, the text section of a release build of InstCombine.cpp shrinks
from 230037 bytes to 216363 bytes, a 6% reduction.

llvm-svn: 23467
2005-09-27 06:09:08 +00:00
Chris Lattner cc9c03386f Add support for a marker byte that indicates that we shouldn't add the user
prefix to a symbol name

llvm-svn: 23421
2005-09-24 08:24:28 +00:00
Jim Laskey 8ad8f71447 Move code dependency for MathExtras.h out of Constants.h.
llvm-svn: 22840
2005-08-17 20:06:22 +00:00
Jim Laskey b74c666186 Culling out use of unions for converting FP to bits and vice versa.
llvm-svn: 22838
2005-08-17 19:34:49 +00:00
Andrew Lenharth ed07233868 only build .a on alpha
llvm-svn: 22787
2005-08-14 15:14:34 +00:00
Andrew Lenharth 107a0a7690 Testing a variable before it is defined doesn't work so well. It is a fairly small thing, so just let everyone build the .a file
llvm-svn: 22783
2005-08-13 14:58:23 +00:00
Andrew Lenharth 6b62b479fa Fix oversized GOT problem with gcc-4 on alpha
llvm-svn: 22777
2005-08-13 05:09:50 +00:00
Chris Lattner e09bbc800c Add a helper method
llvm-svn: 22768
2005-08-12 22:14:06 +00:00
Chris Lattner 24a0a43cb0 add new helper function
llvm-svn: 22698
2005-08-08 05:21:50 +00:00
Chris Lattner 6e709c1318 PHINode::hasConstantValue should never return the PHI itself, even if the
PHI is its only operand.

llvm-svn: 22676
2005-08-05 15:37:31 +00:00
Chris Lattner 1749aaa5e6 Fix an iterator invalidation problem when we decide a phi has a constant value
llvm-svn: 22675
2005-08-05 15:34:10 +00:00
Chris Lattner 37774affb1 Invoke instructions do not dominate all successors
llvm-svn: 22671
2005-08-05 01:03:27 +00:00
Chris Lattner 6f58350daf Now that hasConstantValue is more careful w.r.t. returning values that only
dominate the PHI node, this code can go away.  This also makes passes more
aggressive, e.g. implementing Transforms/CondProp/phisimplify2.ll

llvm-svn: 22670
2005-08-05 01:02:04 +00:00
Chris Lattner bcd8d2c6e5 Use the bool argument to hasConstantValue to decide whether the client is
prepared to deal with return values that do not dominate the PHI.  If we
cannot prove that the result dominates the PHI node, do not return it if
the client can't cope.

llvm-svn: 22669
2005-08-05 01:00:58 +00:00
Chris Lattner 1d8b24878f Mark hasConstantValue as a const method
llvm-svn: 22666
2005-08-05 00:49:06 +00:00
Nate Begeman 0a94dec78a Add an extra parameter that Chris requested
llvm-svn: 22665
2005-08-04 23:50:43 +00:00
Nate Begeman b392321cae Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into
BasicBlock's removePredecessor routine.  This requires shuffling around
the definition and implementation of hasContantValue from Utils.h,cpp into
Instructions.h,cpp

llvm-svn: 22664
2005-08-04 23:24:19 +00:00
Jeff Cohen 5f4ef3c5a8 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Andrew Lenharth 9144ec4764 core changes for varargs
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Reid Spencer 294715b33e Some cleanups for compilation with GCC 4.0.0 to remove warnings:
* Use C++ style casts, not C style casts
* Abstract base classes should have virtual destructor.

llvm-svn: 22057
2005-05-15 16:13:11 +00:00
Chris Lattner 2ad5aa8334 Verify that varargs functions all have ccc
llvm-svn: 21792
2005-05-08 22:27:09 +00:00
Chris Lattner f7b6d3191b add support for explicit calling conventions
llvm-svn: 21746
2005-05-06 20:26:43 +00:00
Chris Lattner 0603845a49 Add a 'tail' marker for call instructions, patch contributed by
Alexander Friedman.

llvm-svn: 21722
2005-05-06 05:51:46 +00:00
Andrew Lenharth 5e177826fd Implement count leading zeros (ctlz), count trailing zeros (cttz), and count
population (ctpop).  Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.

More coming soon.

llvm-svn: 21676
2005-05-03 17:19:30 +00:00
Chris Lattner c22333348e fix a bug in the 1 index GEP handling code
llvm-svn: 21670
2005-05-03 16:44:45 +00:00
Chris Lattner 8298120f17 add direct support for making GEP instrs with one index
llvm-svn: 21665
2005-05-03 05:43:30 +00:00
Jeff Cohen 4e3aedeaa6 Use ANSI-approved way of getting the value infinity (otherwise VC++ won't compile it)
llvm-svn: 21662
2005-05-03 03:13:01 +00:00
Andrew Lenharth c73e633a41 fold fp div by 0 to inf, the way gcc does. This is legal according to the FP spec
llvm-svn: 21655
2005-05-02 21:25:47 +00:00
Chris Lattner 1c636f1118 Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad
llvm-svn: 21627
2005-04-30 03:44:07 +00:00
Chris Lattner 0a6f42ac1d Unbreak the sparc backend.
llvm-svn: 21598
2005-04-27 18:57:15 +00:00
Chris Lattner 41d183ed8d don't let Reid build void*'s :)
llvm-svn: 21571
2005-04-26 20:03:33 +00:00
Chris Lattner e093c6f565 Make dominates(A,B) work with post dominators. Patch contributed by
Naveen Neelakantam, thanks!

llvm-svn: 21543
2005-04-25 20:50:33 +00:00
Reid Spencer 8edc8beacf Older compilers won't like the inline virtual destructor in the header file
so we put the destructor in Pass.cpp and make it non-inline.

llvm-svn: 21520
2005-04-25 01:01:35 +00:00
Reid Spencer 9c47b25868 Shut GCC 4.0 up about classes with virtual functions but no virtual
destructor.

llvm-svn: 21510
2005-04-24 22:27:20 +00:00
Chris Lattner 2c7d177d25 Allow these methods to take a generic Value* to simplify clients. Use
const_cast instead of c casts.

llvm-svn: 21493
2005-04-24 07:28:37 +00:00
Chris Lattner 8a878ccb25 Fix a bug in my previous checkin
llvm-svn: 21485
2005-04-23 22:01:39 +00:00
Chris Lattner 6263766133 Add a method, remove last use of Type.def
llvm-svn: 21483
2005-04-23 22:00:09 +00:00
Jeff Cohen 82639853c0 Eliminate tabs and trailing spaces
llvm-svn: 21480
2005-04-23 21:38:35 +00:00
Misha Brukman b1c9317bb4 Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner 954c64d532 Improve doxygen, from part of Evan's patch that didn't apply.
llvm-svn: 21394
2005-04-21 16:06:03 +00:00
Chris Lattner 7ceb081f3f Improve doxygen documentation, patch contributed by Evan Jones!
llvm-svn: 21393
2005-04-21 16:04:49 +00:00
Chris Lattner 9daef352e9 add an argument to allow avoiding deleting phi nodes.
llvm-svn: 21255
2005-04-12 18:52:14 +00:00
Andrew Lenharth b442791124 First step in adding pcmarker intrinsic. Second step (soon) is adding backend support.
llvm-svn: 20900
2005-03-28 20:05:49 +00:00
Alkis Evlogimenos 9160d5fd8b Add new function getPtrPtrFromArrayPtr().
llvm-svn: 20684
2005-03-19 11:40:31 +00:00
Misha Brukman 96eb878f2a Convert tabs to spaces
llvm-svn: 20638
2005-03-16 05:42:00 +00:00
Chris Lattner fb972add4f stop using arg_front
llvm-svn: 20599
2005-03-15 05:03:36 +00:00
Chris Lattner 531f9e92d4 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner b1d901427a correct the computation of the isAbstract bit for types.
llvm-svn: 20533
2005-03-09 17:34:27 +00:00
Reid Spencer f064bb2617 Fix a typo in an assertion comment.
Patch contributed by Vladimir Merzliakov.

llvm-svn: 20529
2005-03-09 15:19:41 +00:00
Chris Lattner 86fe3a1fdb rename insertEntry to insert
llvm-svn: 20484
2005-03-06 05:55:40 +00:00
Chris Lattner 533805e6da Merge SymbolTable::removeEntry into SymbolTable::remove, its only caller
llvm-svn: 20483
2005-03-06 05:51:09 +00:00
Chris Lattner 290d881f84 Delete the really inefficient method: void remove(const Type* Typ);
Speed up the symbol stripping code by avoiding a linear search of the
type table.

Get rid of removeEntry(type_iterator), since 'remove' is exactly the same
operation.

llvm-svn: 20481
2005-03-06 05:46:41 +00:00
Chris Lattner bad0e7e2d9 Remove some really gross and hard to understand code now that
InternallyInconsistent is always false.

llvm-svn: 20477
2005-03-06 05:21:40 +00:00
Chris Lattner cd56f5a8e4 Simplify some code.
llvm-svn: 20476
2005-03-06 05:13:42 +00:00
Chris Lattner eb9a12cbce remove these methods.
llvm-svn: 20474
2005-03-06 02:37:47 +00:00
Chris Lattner ffb3778f87 This fixes PR531, a crash when running the CBE on a bytecode file.
The problem is that Function::renameLocalSymbols is iterating through
the symbol table planes, occasionally calling setName to rename a value
(which used to do a symbol table remove/insert pair).

The problem is that if there is only a single value in a particular type
plane that the remove will nuke the symbol table plane, and the insert
will create and insert a new one.  This hoses Function::renameLocalSymbols
because it has an iterator to the old plane, under the (very reasonable)
assumption that simply renaming a value won't cause the type plane to
disappear.

This patch fixes the bug by making the rename operation a single atomic
operation, which has a side effect of making the whole thing faster too. :)

llvm-svn: 20469
2005-03-06 02:14:28 +00:00
Chris Lattner cdb9bfc150 remove all of the various setName implementations, consolidating them into
Value::setName, which is no longer virtual.

llvm-svn: 20464
2005-03-05 19:51:50 +00:00
Chris Lattner f66165674f 2nd arg to setName goes away.
llvm-svn: 20460
2005-03-05 19:02:15 +00:00
Chris Lattner cc77b84fcb Constants never get names.
llvm-svn: 20459
2005-03-05 19:01:59 +00:00
Chris Lattner ed2fb1cf93 Remove the 2nd argument to Value::setName
llvm-svn: 20458
2005-03-05 19:01:49 +00:00
Misha Brukman f090d1b3ab Fix the spelling of the word `the'
llvm-svn: 20412
2005-03-02 23:17:31 +00:00
Chris Lattner 4d8689edcb Print the module ID as a comment.
llvm-svn: 20411
2005-03-02 23:12:40 +00:00
Chris Lattner fe760deb75 Fix a nasty order of evaluation bug that Gabor Greif ran into. Here's an
explanation from IRC:

	|sabre|	I think it's an order of evaluation thing
	|sabre|	for me, the RHS of the assignment is evaluated first
	|sabre|	getTypeDescription checks to see if ConcreteTypeDescription[Ty] contains anything
	|sabre|	since it doesn't, it computes and returns the value
	|sabre|	this gets put into the map.
	|sabre|	For you, the LHS is evaluated first.
	|sabre|	Map[Ty] (aka ConcreteTypeDescriptions[Ty]) inserts an empty string into the map, returning a reference
	|sabre|	getTypeDesc then sees the empty string in the map
	|sabre|	and returns it
	|sabre|	bork :)

llvm-svn: 20394
2005-03-02 03:54:43 +00:00
Chris Lattner 1772c1a672 recognize llvm.prefetch. Patch contributed by Justin Wick!
llvm-svn: 20377
2005-02-28 19:28:00 +00:00
Chris Lattner 39637ef023 Verify llvm.prefetch.
llvm-svn: 20376
2005-02-28 19:27:42 +00:00
Chris Lattner 08f7d0c262 Fix some problems where the verifier would crash on invalid input instead of
reporting the problem and exiting.

llvm-svn: 20302
2005-02-24 16:58:29 +00:00
Chris Lattner 47ac187c08 switch instructions only allow constantints for their values, be more specific.
llvm-svn: 20298
2005-02-24 05:32:09 +00:00
Chris Lattner ce046ac9c6 add a new method.
llvm-svn: 20293
2005-02-24 02:37:26 +00:00
Chris Lattner 25169caa80 make this more efficient. Scan up to 16 nodes, not the whole list.
llvm-svn: 20289
2005-02-23 16:53:04 +00:00
Chris Lattner d36552f34f new method
llvm-svn: 20288
2005-02-23 16:51:11 +00:00
Chris Lattner cf08c21f2c Reduce the amount of searching this assertion does. On a testcase of mine,
this reduces the time for -simplifycfg in a debug build from 106s to 14.82s

llvm-svn: 20286
2005-02-23 07:09:08 +00:00
Chris Lattner 8d54dd37c9 Nuke blank line.
llvm-svn: 20154
2005-02-13 17:54:21 +00:00
Chris Lattner 159485ff1b Fix test/Regression/Assembler/2005-02-09-AsmWriterStoreBug.ll
llvm-svn: 20089
2005-02-09 17:45:03 +00:00
Chris Lattner df57a02be4 Instead of initializing the volatile field, use accessors to set it.
llvm-svn: 20045
2005-02-05 01:38:38 +00:00
Chris Lattner a29c92ffdd Initialize new field.
llvm-svn: 20044
2005-02-05 01:37:58 +00:00
Chris Lattner 4947e67c4f Updates for new use list changes.
llvm-svn: 19961
2005-02-01 01:24:21 +00:00
Chris Lattner b6c21dbb1e Update for API change.
llvm-svn: 19960
2005-02-01 01:24:01 +00:00
Chris Lattner f6c93e36c7 Improve conformance with the Misha spelling benchmark suite
llvm-svn: 19930
2005-01-30 00:09:23 +00:00
Chris Lattner e5c7b9a215 Adjust to ilist changes.
llvm-svn: 19923
2005-01-29 18:41:12 +00:00
Chris Lattner f711f8db41 Make sure that we always grow a multiple of 2 operands.
llvm-svn: 19902
2005-01-29 01:05:12 +00:00
Chris Lattner 5d1bc2c408 Adjust to changes in User class.
llvm-svn: 19892
2005-01-29 00:35:33 +00:00
Chris Lattner afdb3de4d7 Merge InstrTypes.cpp into this file
Adjust to changes in the User class, operand handling is very different.
PHI node and switch statements must handle explicit resizing of operand
lists.

llvm-svn: 19891
2005-01-29 00:35:16 +00:00
Chris Lattner d0df99ce86 Adjust to changes in User class. Aggregate constants now must explicitly
manage their operands.

llvm-svn: 19890
2005-01-29 00:34:39 +00:00
Chris Lattner 03adb1aa83 This file is now merged into Instructions.cpp
llvm-svn: 19889
2005-01-29 00:33:32 +00:00
Chris Lattner feaf92f7ad Fix a nasty thinko in my previous commit.
llvm-svn: 19881
2005-01-28 23:17:27 +00:00
Chris Lattner 60c47267a9 Fix ConstProp/2005-01-28-SetCCGEP.ll: indexing over zero sized elements does
not change the address.

llvm-svn: 19874
2005-01-28 19:09:51 +00:00
Misha Brukman 3852f652bf Fix grammar
llvm-svn: 19854
2005-01-27 06:46:38 +00:00
Jeff Cohen c8f1f4bc8e Use binary mode for reading/writing bytecode files
llvm-svn: 19751
2005-01-22 17:36:17 +00:00
Chris Lattner d3af59bec2 Make this compatible with the HP/intel compiler. Fix by Duraid, thanks!
llvm-svn: 19548
2005-01-14 15:53:26 +00:00
Chris Lattner f806d9f2d0 Allow arrays to have more than 4G elements.
llvm-svn: 19395
2005-01-08 20:19:51 +00:00
Chris Lattner 07b522d106 Add convenience method.
llvm-svn: 19321
2005-01-07 07:40:32 +00:00
Chris Lattner cd4003e228 No need to pessimize current code for future possibilities.
llvm-svn: 19311
2005-01-06 16:26:38 +00:00
Chris Lattner 472cc1062d To not break TBAA rules, use a union.
llvm-svn: 19280
2005-01-04 01:56:57 +00:00
Chris Lattner 1ece6f83ba Allow getZeroExtend and getSignExtend to work with boolean inputs.
llvm-svn: 19210
2005-01-01 15:59:57 +00:00
Chris Lattner e340065558 Add a verifier assertion
llvm-svn: 18965
2004-12-15 20:23:49 +00:00
Chris Lattner acc4e54552 Change this method to return ulong, not uint, for 64-bit targets.
llvm-svn: 18906
2004-12-13 19:48:51 +00:00
Chris Lattner 8d0b1b2a82 Check in the file I forgot last night, to solve all of the crashes in every
test in the suite.  :(

llvm-svn: 18804
2004-12-11 22:10:29 +00:00
Alkis Evlogimenos 991d6ad208 Fix writer to properly quote label names when they don't contain
simple characters.

llvm-svn: 18744
2004-12-10 05:41:10 +00:00
Chris Lattner 1c539a86c9 Work correctly with MSVC and ICC, patch contributed by Bjørn Wennberg
llvm-svn: 18631
2004-12-08 16:22:48 +00:00
Reid Spencer b95f8ab3ef Revert the recent patches to "fix" ConstantFP::isValueValidForType. None
of them seem to work everywhere.

llvm-svn: 18598
2004-12-07 07:38:08 +00:00
Reid Spencer ae056bdd36 Provide a missing header file.
llvm-svn: 18597
2004-12-07 07:08:08 +00:00
Reid Spencer 744d95e8c7 Fix some comments.
llvm-svn: 18596
2004-12-07 07:06:47 +00:00
Alkis Evlogimenos 2b91842092 Fix check for valid floats. Also use and HUGE_VALF instead
of std::numeric_limits, because they work in more platforms.

llvm-svn: 18593
2004-12-07 06:46:50 +00:00
Reid Spencer 9083936835 For PR387:\
Make only one print method to avoid overloaded virtual warnings when \
compiled with -Woverloaded-virtual

llvm-svn: 18589
2004-12-07 04:03:45 +00:00
Reid Spencer a8288d93ae For PR409: \
Test the range of float constants to ensure we are not attempting to create a \
float constant using a double value that is out of range for a float

llvm-svn: 18585
2004-12-06 22:18:37 +00:00
Chris Lattner 97e36f211b When printing out a function, make sure that local and global symbols
don't conflict.  This fixes Assembler/2004-12-05-LocalGlobalSymtabConflict.ll

llvm-svn: 18532
2004-12-05 06:44:09 +00:00
Chris Lattner b392d30761 Add a new method
llvm-svn: 18531
2004-12-05 06:43:27 +00:00
Alkis Evlogimenos be526cfba4 Check if a block has a terminator first before calling front() on
it. If a block has a terminator then it is certainly non-empty so the
verifier will not crash on it.

llvm-svn: 18484
2004-12-04 02:30:42 +00:00
Alkis Evlogimenos b92de19116 Make error msg reflect what exactly went wrong.
llvm-svn: 18478
2004-12-04 01:25:06 +00:00
Chris Lattner cf2e128758 Get GEP's working with packed types. Contributed by Morten Ofstad!
llvm-svn: 18404
2004-12-01 17:12:16 +00:00
Chris Lattner 0b6ebd8d10 Add method
llvm-svn: 18368
2004-11-30 02:51:53 +00:00
Chris Lattner 9e90720658 Fix test/Regression/CFrontend/2003-11-01-EmptyStructCrash.c
llvm-svn: 18115
2004-11-22 19:15:27 +00:00
Chris Lattner a8a8a03a85 Fix memory leaks, patch contributed by Morten Ofstad!
llvm-svn: 17999
2004-11-19 17:09:48 +00:00
Chris Lattner 99a669b110 Add hooks to free all memory allocated by the singleton factories in these
files.  Patch contributed by Morten Ofstad!

llvm-svn: 17995
2004-11-19 16:39:44 +00:00
Chris Lattner de5626cd40 These methods are inlined
llvm-svn: 17958
2004-11-18 17:47:13 +00:00
Alkis Evlogimenos 531e901deb Make ReturnInst accept a value of type void as the return value. The
ReturnInst constructed is the same as if NULL was passed instead of
the void value.

llvm-svn: 17923
2004-11-17 21:02:25 +00:00
Chris Lattner ba18b9a0da Generalize this code to turn any cast-to-first-element-of into a gep constexpr
llvm-svn: 17914
2004-11-17 17:59:35 +00:00
Chris Lattner 6d7c8d6801 Minor cleanup and speedup. This reduces link-time for 252.eon from 35.5s
to 34.7s with a profile build.

llvm-svn: 17906
2004-11-16 20:39:04 +00:00
Chris Lattner b38dd7cf54 Make this function work with non-abstract types.
llvm-svn: 17905
2004-11-16 20:30:53 +00:00
Misha Brukman d92f54ae6e Remove extra space char
llvm-svn: 17834
2004-11-15 19:30:05 +00:00
Reid Spencer 3afabd441b Moved to lib/Linker
llvm-svn: 17786
2004-11-14 22:15:31 +00:00
Misha Brukman 704576301f GhostLinkage not allowed in LLVM AsmWriter, either
llvm-svn: 17751
2004-11-14 21:04:34 +00:00
Reid Spencer 0c6a283b2a Stop propagating method names that violate the coding standard
llvm-svn: 17498
2004-11-05 22:15:36 +00:00
Misha Brukman 8d8fc6529e The Alpha (tm) intrinsics have never been used anywhere
llvm-svn: 17340
2004-10-29 18:43:17 +00:00
Alkis Evlogimenos 23e565484a Gep indices must be of int, uint, long or ulong type.
llvm-svn: 17313
2004-10-28 06:43:38 +00:00
Reid Spencer 57cbe39d1e Change Library Names Not To Conflict With Others When Installed
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Chris Lattner 7dfc2d29ac Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!

llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Alkis Evlogimenos ba28dc8c54 Make this actually work.
llvm-svn: 17199
2004-10-24 03:02:16 +00:00
Alkis Evlogimenos da5de05b9b Add ConstantExpr::getSizeOf(Type*).
llvm-svn: 17196
2004-10-24 01:41:10 +00:00
Reid Spencer c1c320c335 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer 6a11a75f31 Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Chris Lattner f60137501f fold gep undef, ... -> undef
This comes up many times in perlbmk and probably others.

llvm-svn: 17100
2004-10-17 21:54:55 +00:00
Chris Lattner 192eaccc1a Fix constant folding relational operators with undef operands.
llvm-svn: 17077
2004-10-17 04:01:51 +00:00
Chris Lattner fd7bf724d3 Implement constant folding of undef values.
llvm-svn: 17070
2004-10-16 23:31:32 +00:00
Chris Lattner 5e0b9f2eec Add support for undef and unreachable
llvm-svn: 17041
2004-10-16 18:08:06 +00:00
Chris Lattner d5f67d8ca6 Implement UndefValue class
llvm-svn: 17040
2004-10-16 18:07:16 +00:00
Chris Lattner f22be93428 Move the implementation of the instructions clone methods to this file so
that the vtables for these classes are only instantiated in this translation
unit, not in every xlation unit they are used.

llvm-svn: 17026
2004-10-15 23:52:53 +00:00
Misha Brukman 65c23ee5d3 Add a space between the type and name of value when printing error message
llvm-svn: 17022
2004-10-15 23:08:50 +00:00
Chris Lattner eb6b8e5772 Make sure any client of Dominators.h links in Dominators.cpp
Patch by Morten Ofstad

llvm-svn: 16987
2004-10-14 15:47:16 +00:00
Reid Spencer ace94df71f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Chris Lattner 1ccab843e2 Minor tweaks
llvm-svn: 16929
2004-10-12 04:32:37 +00:00
Chris Lattner 89046ca244 Implement a new method
llvm-svn: 16927
2004-10-12 04:20:25 +00:00
Chris Lattner 13128ab8fb Allow creation of GEP constantexprs with a vector of value* operands as
well as a vector of constant*'s.  It turns out that this is more efficient
and all of the clients want to do that, so we should cater to them.

llvm-svn: 16923
2004-10-11 22:52:25 +00:00
Chris Lattner 02a71e7748 Implement remove/eraseFromParent methods
llvm-svn: 16922
2004-10-11 22:21:39 +00:00
Chris Lattner b2b7f90caf If we are trying to create a ConstantExpr cast that is really a GEP to the
first element of an array, return a GEP instead of a cast.  This allows us
to transparently fold this:

int* getelementptr (int* cast ([100 x int]* %Gbody to int*), int 40)

into this:

int* getelementptr ([100 x int]* %Gbody, int 0, int 40)

llvm-svn: 16911
2004-10-11 03:57:30 +00:00
Reid Spencer 97327f05fc Initial version of automake Makefile.am file.
llvm-svn: 16893
2004-10-10 22:20:40 +00:00
Chris Lattner 251093ca5d Unfortunately the fix for the previous bug introduced the previous
exponential behavior (bork!).  This patch processes stuff with an
explicit SCC finder, allowing the algorithm to be more clear,
efficient, and also (as a bonus) correct!  This gets us back to taking
0.6s to disassemble my horrible .bc file that previously took something
> 30 mins.

llvm-svn: 16811
2004-10-07 19:20:48 +00:00
Chris Lattner cef3c06027 Fix a bug in my previous change. Unfortunately this reverts most of the
speedup, but has the advantage of not breaking a bunch of programs!

llvm-svn: 16806
2004-10-07 16:19:40 +00:00
Chris Lattner 43e03c9cdf Change Type::isAbstract to have better comments, a more correct name
(PromoteAbstractToConcrete), and to use a set to avoid recomputation.
In particular, this set eliminates the potentially exponential cases
from this little recursive algorithm.

On a particularly nasty testcase, llvm-dis on the .bc file went from 34
minutes (which is when I killed it, it still hadn't finished) to 0.57s.
Remember kids, exponential algorithms are bad.

llvm-svn: 16772
2004-10-06 16:36:46 +00:00
Chris Lattner 9b38ead89a Make sure the const bit gets inherited correctly when linking declarations
of disagreeing constness.  This fixes
test/Regression/Linker/ConstantGlobals[123].ll

llvm-svn: 16692
2004-10-05 02:28:11 +00:00
Chris Lattner cde15fb187 Make sure to check select instructions for generic instruction properties
llvm-svn: 16597
2004-09-29 21:19:28 +00:00
Chris Lattner c9e79d005b Don't use DominatorSet::dominates for intra-block instruction dom checks.
This method is linear time in the size of the basic block, which is very
bad for large basic blocks.  On the Assembler/2004-09-29-VerifierIsReallySlow.llx
testcase, the verifier changes from taking 50s to 0.23s with this patch.

llvm-svn: 16593
2004-09-29 20:07:45 +00:00
Chris Lattner 4f2cf030e8 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

llvm-svn: 16436
2004-09-20 04:48:05 +00:00
Chris Lattner 79e523de04 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

Also, fix some undefined behavior, expecting | on booleans to evaluate
left-to-right.

llvm-svn: 16435
2004-09-20 04:47:19 +00:00
Alkis Evlogimenos 0507ffebb1 When creating constant arrays check that the initializer vector is the
same size as the one in the array type.

llvm-svn: 16354
2004-09-15 02:32:15 +00:00
Reid Spencer f27c4cde06 Okay, the list of link-time passes wasn't such a hot idea. Its prone to
error. We'll strategize on this when we have multiple front ends to deal
with. For now llvm-ld just runs a standard set of transforms.

llvm-svn: 16333
2004-09-14 05:43:23 +00:00
Chris Lattner 2cdd49de2a Don't print newlines between passes in the pass list.
Note to self: sentences end with ".", not "...".
Note to reid: sentences end with ".", not "".   :)

llvm-svn: 16332
2004-09-14 05:06:58 +00:00
Chris Lattner 730cfe431a Don't print newlines between each library in the deplibs list.
llvm-svn: 16331
2004-09-14 04:51:44 +00:00
Reid Spencer b9e0877223 Add support for the link-time pass list to Modules.
llvm-svn: 16321
2004-09-13 23:44:23 +00:00
Reid Spencer 1b34fde1cc Implement support for dependent libraries. The "source" module's dependent
libraries list is merged into the "destination" module's list. Also, if the
source module is one of the dependent libraries, it is removed from the
list.

llvm-svn: 16282
2004-09-11 04:25:17 +00:00
Alkis Evlogimenos cb031d9518 Add assertion descriptiosn on type mismatches when creating
ConstantArray and ConstantPacked objects.

llvm-svn: 16261
2004-09-10 04:16:59 +00:00
Reid Spencer 7c16caa336 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer 3311669903 Add an assert to cature null Operands. It is better to catch it here than
to SIGSEGV in the bowels of isa<...> later.

llvm-svn: 16098
2004-08-29 19:37:59 +00:00
Reid Spencer 2e4bfff37c Give the -time-passes tool option a global storage location so that its
value can be discovered by the various LLVM tools.

llvm-svn: 16032
2004-08-24 17:52:35 +00:00
Chris Lattner 8439f382b6 Fix a nasty bug that Nate ran into. In particular, instead of emitting a 2+MB
error message, print out:

llvm-link: error linking in 'g.2.rbc': Global Variable Collision on
' %struct.D_Reduction* %d_reduction_10_gram' - External linkage globals have
different initializers

That's a bit more concise, huh?

llvm-svn: 15958
2004-08-21 00:50:59 +00:00
Reid Spencer e203d35be4 Fix a bug found exposed by: Regression/Other/2004-08-20-PackedControlFlow.ll
Packed types need to be allowed in type statements too.

Patch provided by Brad Jones.

llvm-svn: 15953
2004-08-20 15:37:30 +00:00
Brian Gaeke 0220904e7a Packed types, brought to you by Brad Jones
llvm-svn: 15938
2004-08-20 06:00:58 +00:00
Chris Lattner caf3f3e970 Check constant expression validity more strictly
llvm-svn: 15883
2004-08-17 17:28:46 +00:00
Chris Lattner 104bfb7576 Allow an arbitrary prefix
llvm-svn: 15865
2004-08-17 06:06:54 +00:00
Misha Brukman 30cee49933 Move these files (which are dependent on VMCore) into VMCore
llvm-svn: 15825
2004-08-16 19:04:36 +00:00
Reid Spencer b0ac8c48a6 Fix PR422.
Ouch! Changes in the lazy initialization code caused each incorporated
function to reprocess the entire function on every lookup of a value's
slot number. This caused a horrible slowdown in all functions. This
fix made llvm-dis go from "longer than I care to wait" (minutes) on a large
test case to 0.53 seconds.

llvm-svn: 15818
2004-08-16 07:46:33 +00:00
Alkis Evlogimenos 079fbde482 Split assertion to two in order to give better assertion messages.
llvm-svn: 15543
2004-08-06 14:33:37 +00:00
Alkis Evlogimenos f45cc7a56e Make GlobalVariable constructor assert when an initializer is of
incorrect type.

llvm-svn: 15519
2004-08-05 11:28:34 +00:00
Chris Lattner 5e18a2489d Fix another minor problem that exists if you ahve multiple functions with
nonunifiable types but the same name.  Down with PR411!

llvm-svn: 15511
2004-08-04 22:39:54 +00:00
Chris Lattner 6722f851ef Fix a typeo
llvm-svn: 15510
2004-08-04 22:29:05 +00:00
Chris Lattner 20a4dab308 Add a hack to work around a problem my changes exposed
llvm-svn: 15509
2004-08-04 22:26:13 +00:00
Chris Lattner 29ca2c6f7a Fix a latent bug exposed by my recent changes
llvm-svn: 15498
2004-08-04 18:50:09 +00:00
Chris Lattner a6241aed38 Fix a major regression in my previous checkin
llvm-svn: 15486
2004-08-04 08:30:43 +00:00
Alkis Evlogimenos 43252afdde Stop using getValues().
llvm-svn: 15485
2004-08-04 08:08:13 +00:00
Alkis Evlogimenos f0cc814974 Stop using getValues().
llvm-svn: 15482
2004-08-04 08:02:59 +00:00
Chris Lattner 3706708ede FindGlobalNamed used to take 2.92s out of 8.39s running a profile build of
gccld -disable-opt on 252.eon.

This patch deletes it and replaces it with a map.  The proper fix for this
is to fix PR411, but this will do in the short term.

gccld on eon now takes 5.51s, which is 50% faster than before this patch. :)

llvm-svn: 15480
2004-08-04 07:44:58 +00:00
Chris Lattner dd40787390 I swear I compiled this, really I did.
llvm-svn: 15467
2004-08-04 07:28:06 +00:00
Chris Lattner 9262acaed7 Factor some code out, no substantial change.
llvm-svn: 15466
2004-08-04 07:05:54 +00:00
Chris Lattner e19c36cc0f Concisify some code
Do not call FindGlobalNamed when we know we will ignore the result (because
we are not going to link a static symbol anyway).  This speeds up
gccld -disable-opt on 252.eon from 8.63s to 8.39s.

llvm-svn: 15465
2004-08-04 06:05:47 +00:00
Chris Lattner 3e650aff8b Implement a FIXME, by not searching linearly through a map to remove an
element.  This speeds up the bytecode reader from 12.86s to 8.72s on 252.eon.

llvm-svn: 15463
2004-08-04 04:48:01 +00:00
Chris Lattner 37b570a049 Add a cast
llvm-svn: 15457
2004-08-04 02:27:17 +00:00
Chris Lattner ea3d501de3 Change SymbolTable::insertEntry to be more careful about how many map
lookups it does.  This shaves another 5% off of bcreading 252.eon.  Note that
the proper solution to this problem is to fix PR411, but that will have to
wait until later.

llvm-svn: 15455
2004-08-04 00:37:31 +00:00
Misha Brukman 63b38bd2ed Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15334
2004-07-29 17:30:56 +00:00
Misha Brukman 2d3fa9e18e Fix #includes of i*.h files => Instructions.h as per PR403
llvm-svn: 15327
2004-07-29 16:53:53 +00:00
Alkis Evlogimenos 93a7c060db Merge i*.cpp definitions into Instructions.cpp as part of bug403.
llvm-svn: 15326
2004-07-29 12:33:25 +00:00
Alkis Evlogimenos fd7a2d4477 Merge i*.h headers into Instructions.h as part of bug403.
llvm-svn: 15325
2004-07-29 12:17:34 +00:00
Chris Lattner 89c0c0ae3f alloca void makes no sense
llvm-svn: 15262
2004-07-27 07:30:02 +00:00
Reid Spencer 48f98c8545 Avoid use of size(), which counts, in favor of other mechanisms.
llvm-svn: 15221
2004-07-25 21:44:54 +00:00
Reid Spencer ffec7df2c1 Adjust to new Module.h interface for dependent libraries
Only write the target triple and deplibs if they are non-empty.

llvm-svn: 15216
2004-07-25 21:29:43 +00:00
Reid Spencer a0b05b399d bug 263:
Ensure the list of libraries is cleared.

llvm-svn: 15212
2004-07-25 18:08:57 +00:00
Reid Spencer cc5ff64416 bug 263:
Add ability to write target triple and dependent libraries information.

llvm-svn: 15211
2004-07-25 18:08:18 +00:00
Alkis Evlogimenos 74614b0c30 Use name.empty() instead of testing against equality with the empty
string.

llvm-svn: 15191
2004-07-25 06:16:52 +00:00
Alkis Evlogimenos 2f130282bd Disallow creation of named values of type void.
llvm-svn: 15190
2004-07-25 06:07:15 +00:00
Brian Gaeke 657e590c93 Fix problem with inserting FunctionPasses that depend on ImmutablePasses
(e.g., LICM) into FunctionPassManagers. The problem is that we were
using a C-style cast to cast required analysis passes to PassClass*, but
if it's a FunctionPassManager, and the required analysis pass is an
ImmutablePass, the types aren't really compatible, so the C-style cast
causes a crash.

llvm-svn: 15140
2004-07-23 19:35:50 +00:00
Chris Lattner 001aba76fd Updates to gc intrinsics, contributed by Tobias Nurmiranta
llvm-svn: 15096
2004-07-22 05:50:01 +00:00
Chris Lattner 5230e70834 classof implementations are now inlined
llvm-svn: 14987
2004-07-19 00:59:10 +00:00
Chris Lattner 2730e6aef1 Method now returns null, dtor is inlined
llvm-svn: 14983
2004-07-19 00:55:35 +00:00
Chris Lattner 0145eb7835 Fix infinite loop gccld'ing povray
llvm-svn: 14962
2004-07-18 08:12:57 +00:00
Reid Spencer c9c90cfb29 Shrink some code.
llvm-svn: 14956
2004-07-18 01:04:19 +00:00
Reid Spencer 3d169b1c0d bug 122:
- Move these functions from other places
- Provide implementations of Constant class overrides in GlobalValue

llvm-svn: 14936
2004-07-18 00:06:26 +00:00
Reid Spencer 37e4e78cd5 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Replace tabs.

llvm-svn: 14935
2004-07-18 00:03:48 +00:00
Reid Spencer 49fc8a746e bug 122:
- Correct an assert to not have redundant isa<GlobalValue>

llvm-svn: 14934
2004-07-18 00:02:41 +00:00
Reid Spencer bbddbf3aed bug 122:
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14933
2004-07-18 00:01:50 +00:00
Reid Spencer 784638bbd5 bug 122:
- Correct isa<Constant> for GlobalValue subclass
- Fix some tabs and indentation.

llvm-svn: 14932
2004-07-17 23:57:36 +00:00
Reid Spencer 3c4824af7c bug 122:
- Module doesn't need to manage ConstantPointerRefs any more.

llvm-svn: 14931
2004-07-17 23:53:23 +00:00
Reid Spencer cd3936ee04 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14930
2004-07-17 23:50:57 +00:00
Reid Spencer c49dd8dec1 bug 122:
- Move GlobalValue and GlobalVariable implementations to Globals.cpp

llvm-svn: 14929
2004-07-17 23:50:19 +00:00
Reid Spencer 1ebe1abe22 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
- Delete ConstantPointerRef member function implementations

llvm-svn: 14928
2004-07-17 23:48:33 +00:00
Reid Spencer accd7c708d bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14927
2004-07-17 23:47:01 +00:00
Alkis Evlogimenos 763d930d22 Add convinience constructor for function calls with two args.
llvm-svn: 14885
2004-07-16 12:04:28 +00:00
Chris Lattner 9716100a5d IA64 compat
llvm-svn: 14867
2004-07-16 00:08:28 +00:00
Chris Lattner 60a7dd16c4 Fixes for PR341
llvm-svn: 14847
2004-07-15 02:51:31 +00:00
Chris Lattner 4bbd409749 Implement folding of expressions like 'uint cast (int* getelementptr (int*
null, uint 1) to uint)' to a constant integer.  We can only do this with
primitive LLVM types, because other types have target-specific sizes.

llvm-svn: 14837
2004-07-15 01:16:59 +00:00
Chris Lattner 92aecc9e3c Implement new helper methods for creating two-index GEP instructions
llvm-svn: 14821
2004-07-14 18:14:33 +00:00
Chris Lattner e52ed45890 Make Argument::print more resilient to non-verifiable IR
llvm-svn: 14801
2004-07-13 23:14:34 +00:00
Chris Lattner 8c54e58f7c Catch aggregates passed by value sooner rather than later.
llvm-svn: 14800
2004-07-13 20:09:51 +00:00
Chris Lattner d6108ca27e implement new helper method
llvm-svn: 14776
2004-07-12 20:35:11 +00:00
Chris Lattner 534d252330 Fix a really nasty logic error that VC noticed.
Reid, this might matter to you :)

llvm-svn: 14774
2004-07-12 20:27:31 +00:00
Chris Lattner 3df3e050dd Implement new method
llvm-svn: 14767
2004-07-12 01:17:34 +00:00
Reid Spencer f9776c34b6 Replace use of defunct Type::setName method with SymbolTable::insert.
Patch found and provided by Vladimir Merzliakov. Thanks Vladimir!

llvm-svn: 14732
2004-07-10 16:37:42 +00:00
Chris Lattner 848c8dd825 Remove unused method
llvm-svn: 14726
2004-07-09 16:48:13 +00:00
Chris Lattner 753026dae0 The uid mapping is no more
llvm-svn: 14708
2004-07-08 22:31:09 +00:00
Chris Lattner f2e960c5ab Eliminate the SignedType and UnsignedType classes.
llvm-svn: 14695
2004-07-08 17:30:07 +00:00
Misha Brukman 4233155533 There is no error message to print out, end sentence with `!'
llvm-svn: 14678
2004-07-07 21:22:05 +00:00
Reid Spencer 6967cd54f3 Fix for bug 391.
Improve exeception handling around bcreader invocations.

llvm-svn: 14674
2004-07-07 21:01:38 +00:00
Chris Lattner 9df9afddcf Fix regressions in these testcases:
Regression.Assembler.2002-01-24-BadSymbolTableAssert
 Regression.Assembler.2002-01-24-ValueRefineAbsType

Found through the nightly tester :)

llvm-svn: 14671
2004-07-07 18:07:46 +00:00
Chris Lattner e9e13f593f The bytecode reader wants to be able to read types that are not quite resolved
yet, then resolve them in it's own sweet time.  We must support this.

llvm-svn: 14666
2004-07-07 06:48:27 +00:00
Chris Lattner 71068a0462 When folding constant expr gep's, don't force the use of long indices.
llvm-svn: 14658
2004-07-07 04:45:13 +00:00
Chris Lattner 8f23abebfc Make sure people don't make functiontypes with an invalid return type
llvm-svn: 14654
2004-07-06 23:25:19 +00:00
Chris Lattner bea7247357 Find bugs sooner rather than later. In this case, don't allow the creation
of instructions that don't have a first-class or void type.

llvm-svn: 14646
2004-07-06 17:44:17 +00:00
Reid Spencer e484cc1925 Correct syntax typo .. ; -> :
llvm-svn: 14619
2004-07-04 12:15:11 +00:00
Reid Spencer 1e8005d013 - Changes for bug 122
- Remove Tabs
- Add inserters  needed since Value doesn't implement them any more
- Move some functions here to avoid cyclic header file dependencies.

llvm-svn: 14618
2004-07-04 12:14:17 +00:00
Reid Spencer 8baf8e270a - #include <iostream> since its not in Value.h any more.
llvm-svn: 14617
2004-07-04 11:55:37 +00:00
Reid Spencer c107d6ff87 Constify SymbolTable's use of Type* so that it never modifies them.
llvm-svn: 14616
2004-07-04 11:55:08 +00:00
Reid Spencer dbe02b7b1d - #include <iostream> since its not in Value.h any more.
- constify use of Type* returned from symbol table.

llvm-svn: 14615
2004-07-04 11:52:49 +00:00
Reid Spencer cf394bf2d5 #include <iostream> since its not in Value.h any more.
llvm-svn: 14614
2004-07-04 11:51:24 +00:00
Reid Spencer 58d30f24bb Adjust the slot machine to handle Types separately from Values. This was
done by doubling up the data structures so that Type based equivalents are
used. A consequence of this is overloading of function members that take a
Type* instead of a Value*. Various other cleanups related to Type != Value
(bug 122) were also implemented.

llvm-svn: 14613
2004-07-04 11:50:43 +00:00
Chris Lattner 971bbcb43a Fix Type::isSized() to realize that "{ opaque }" is not sized
llvm-svn: 14585
2004-07-02 23:20:17 +00:00
Chris Lattner 5b20870830 Add much better assertion checking for load and store insts.
Contributed by Vladimir Merzliakov!

llvm-svn: 14546
2004-07-01 20:23:52 +00:00
Chris Lattner dd7a707897 Fold iType into Value::VTy
llvm-svn: 14435
2004-06-27 18:38:48 +00:00