summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix for PR341Chris Lattner2004-07-151-1/+1
| | | | llvm-svn: 14842
* Patches towards fixing PR341Chris Lattner2004-07-158-14/+15
| | | | llvm-svn: 14841
* Progress on PR341Chris Lattner2004-07-155-35/+36
| | | | llvm-svn: 14840
* Fixes working towards PR341Chris Lattner2004-07-156-22/+23
| | | | llvm-svn: 14839
* Bug fixes for PR341Chris Lattner2004-07-152-5/+19
| | | | llvm-svn: 14838
* Implement folding of expressions like 'uint cast (int* getelementptr (int*Chris Lattner2004-07-151-0/+12
| | | | | | | 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
* Now that we codegen the portable "sizeof" efficiently, we can use it forChris Lattner2004-07-151-18/+22
| | | | | | | malloc lowering. This means that lowerallocations doesn't need targetdata anymore. yaay. llvm-svn: 14835
* Improve codegen for the LLVM offsetof/sizeof "operator". Before we compiledChris Lattner2004-07-151-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | this LLVM function: int %foo() { ret int cast (int** getelementptr (int** null, int 1) to int) } into: foo: mov %EAX, 0 lea %EAX, DWORD PTR [%EAX + 4] ret now we compile it into: foo: mov %EAX, 4 ret This sequence is frequently generated by the MSIL front-end, and soon the malloc lowering pass and Java front-ends as well.. -Chris llvm-svn: 14834
* This is logically part of the last patch. Just more really horrible codeChris Lattner2004-07-141-17/+0
| | | | | | that is made unnecessary by it. llvm-svn: 14831
* ** Finally DeclareNewGlobalValue is dead!Chris Lattner2004-07-141-125/+90
| | | | | | | | | | | | | | | | | | | | * Simplify a lot of code because type's cannot be in function symbol tables * Fix memory leaks in handling of redefined function prototypes * Don't use SymbolTable directly for stuff that we can go through the Module for. * Fix some minor bugs on obscure testcases like: test/Feature/globalredefinition.ll * Do not create GlobalVariable objects for forward referenced Functions! * When forward referencing a function in a constant expression, do not create a placeholder, add a bunch of references to it, then turn around and replaceAllUsesOfWith on it with a new global, deleting the placeholder. Instead, when we find the real definition of the global, just use the placeholder instead of creating a new object. This substantially simplifies the asmwriter and should even speed it up on cases heavy in constantexprs (like C++, Java, MSIL)... llvm-svn: 14830
* * Fairly substantial change. Instead of creating new globalvariables, thenChris Lattner2004-07-141-14/+49
| | | | | | | | | | replaceAllUsesWith'ing any forward references, just use the forward reference if it exists. This introduces GetForwardRefForGlobal, which will eventually completely replace the horrible DeclareNewGlobalValue function. llvm-svn: 14828
* Fold setValueNameMergingDuplicates into ParseGlobalVariable, allowing usChris Lattner2004-07-141-55/+38
| | | | | | | | | | | to substantially simplify the result. In particular, we no longer create GlobalVariables and then immediately destroy them when they are duplciate definitions. The real point of this patch though is that it gets us closer to the DeclareNewGlobalValue calls... llvm-svn: 14827
* Actually set the endian/pointersize flags on the module being read in!Brian Gaeke2004-07-141-0/+3
| | | | llvm-svn: 14826
* Simplify logic.Chris Lattner2004-07-141-2/+2
| | | | llvm-svn: 14825
* Fix a regression from last night. Apparently the CFE is broken and outputsChris Lattner2004-07-141-6/+16
| | | | | | | functions multiple times, expecting them to be merged. This should be fixed in the CFE, then here. llvm-svn: 14823
* Make sure MTSPR instruction is inserted into the BasicBlockMisha Brukman2004-07-142-2/+2
| | | | llvm-svn: 14822
* Implement new helper methods for creating two-index GEP instructionsChris Lattner2004-07-141-2/+42
| | | | llvm-svn: 14821
* Don't define the same register twice when loading a ConstantPointerRef to a regMisha Brukman2004-07-142-10/+6
| | | | llvm-svn: 14819
* * Fix multiplication by powers of two and otherwiseMisha Brukman2004-07-142-10/+18
| | | | | | * Clarify variable name (StoreInst SI instead of LI) llvm-svn: 14818
* Pull out code shared between GV forward-decl and definition processing.Chris Lattner2004-07-141-50/+37
| | | | | | | This gives us only a single call site for setValueNameMergingDuplicates. The next stage is the start merging them together. llvm-svn: 14811
* Simplify code. Do not allow functions to be redefined more than once.Chris Lattner2004-07-141-26/+9
| | | | | | | Since the stupid '%X = const int 4' thing is gone, we can now simplify setValueNameMergingDuplicates a bit more. llvm-svn: 14810
* Remove a gross and crufty "feature" that was never documented and doesn't work.Chris Lattner2004-07-142-7/+1
| | | | llvm-svn: 14809
* Finegrainify namespacificationChris Lattner2004-07-141-6/+4
| | | | llvm-svn: 14808
* Revamp handling of labels. In particular, if we create a forward referenceChris Lattner2004-07-141-22/+71
| | | | | | | | for a basic block, use it when the block is defined instead of deleting it and creating a new one. Also, only create at most ONE forward reference for any block, instead of one for each forward reference. llvm-svn: 14807
* Add Machine-CFG edges to SparcV9 MachineBasicBlocks.Brian Gaeke2004-07-141-6/+20
| | | | llvm-svn: 14806
* Split the basic block handling case out of getVal into getBBVal.Chris Lattner2004-07-141-34/+40
| | | | llvm-svn: 14805
* Make Argument::print more resilient to non-verifiable IRChris Lattner2004-07-131-1/+2
| | | | llvm-svn: 14801
* Catch aggregates passed by value sooner rather than later.Chris Lattner2004-07-131-0/+3
| | | | llvm-svn: 14800
* * Specify that FP arith options have 3 operandsMisha Brukman2004-07-132-26/+20
| | | | | | * Correctly load FP constants from the constant pool, should be refactored llvm-svn: 14799
* Fine-grainify namespacification, prune #includeChris Lattner2004-07-131-6/+2
| | | | llvm-svn: 14792
* Fix typeo and refactor bb productions to make it possible for us to reuse anyChris Lattner2004-07-131-11/+12
| | | | | | | | forward reference blocks if they have been created (instead of creating a new block, replaceAllUsesOfWith, then nuking the placeholder). This is not yet implemented. llvm-svn: 14791
* Eliminate some mega-cruft here. There is no reason to DERIVE FROM IR CLASSESChris Lattner2004-07-132-67/+26
| | | | | | | just to keep track of some per-object state! Gaah! Whoever wrote this stuff... oh wait, that would be me. Never mind. llvm-svn: 14790
* Inline the now trivial setValueNameInternal function into both callersChris Lattner2004-07-131-13/+10
| | | | llvm-svn: 14789
* Now that basic blocks are eagerly inserted into the Function, we can useChris Lattner2004-07-131-60/+12
| | | | | | | | the funciton symbol table to check for conflicts instead of having to keep a shadow named LocalSymtab. Totally eliminate LocalSymtab. Verified that this did not cause a regression on the testcase for PR107. llvm-svn: 14788
* A couple of substantial cleanup fixes:Chris Lattner2004-07-131-47/+72
| | | | | | | | | | | | | 1. Split setValueName into two separate functions, one that is only used at function scope and doesn't have to deal with duplicates, and one that can be used either at global or function scope but that does deal with conflicts. Conflicts were only in there because of the crappy old CFE and probably should be entirely eliminated. 2. Insert BasicBlock's into the parent functions when they are created instead of when they are complete. This effects name lookup (for the better), which will be exploited in the next patch. llvm-svn: 14787
* Fix warning on SparcV9, where sizeof (int) != sizeof (void *).Brian Gaeke2004-07-131-1/+1
| | | | llvm-svn: 14786
* Replace a bunch of complex ConstantPointerRef referring code with simpleChris Lattner2004-07-131-11/+3
| | | | | | code. llvm-svn: 14785
* Factor some code to handle "load (constantexpr cast foo)" just likeChris Lattner2004-07-131-20/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "load (cast foo)". This allows us to compile C++ code like this: class Bclass { public: virtual int operator()() { return 666; } }; class Dclass: public Bclass { public: virtual int operator()() { return 667; } } ; int main(int argc, char** argv) { Dclass x; return x(); } Into this: int %main(int %argc, sbyte** %argv) { entry: call void %__main( ) ret int 667 } Instead of this: int %main(int %argc, sbyte** %argv) { entry: %x = alloca "struct.std::bad_typeid" ; <"struct.std::bad_typeid"*> [#uses=3] call void %__main( ) %tmp.1.i.i = getelementptr "struct.std::bad_typeid"* %x, uint 0, uint 0, uint 0 ; <int (...)***> [#uses=1] store int (...)** getelementptr ([3 x int (...)*]* %vtable for Bclass, int 0, long 2), int (...)*** %tmp.1.i.i %tmp.3.i = getelementptr "struct.std::bad_typeid"* %x, int 0, uint 0, uint 0 ; <int (...)***> [#uses=1] store int (...)** getelementptr ([3 x int (...)*]* %vtable for Dclass, int 0, long 2), int (...)*** %tmp.3.i %tmp.5 = load int ("struct.std::bad_typeid"*)** cast (int (...)** getelementptr ([3 x int (...)*]* %vtable for Dclass, int 0, long 2) to int ("struct.std::bad_typeid"*)**) ; <int ("struct.std::bad_typeid"*)*> [#uses=1] %tmp.6 = call int %tmp.5( "struct.std::bad_typeid"* %x ) ; <int> [#uses=1] ret int %tmp.6 ret int 0 } In order words, we now resolve the virtual function call. llvm-svn: 14783
* Correctly load FP constants out of the constant pool.Misha Brukman2004-07-122-12/+6
| | | | llvm-svn: 14782
* Apple's MacOS X is another OS which does not provide alloca() via <alloca.h>Misha Brukman2004-07-121-1/+1
| | | | llvm-svn: 14781
* Implement getModuleMatchQuality and getJITMatchQuality() for PowerPCMisha Brukman2004-07-122-0/+23
| | | | llvm-svn: 14780
* implement new helper methodChris Lattner2004-07-121-0/+8
| | | | llvm-svn: 14776
* Fix unused var warningChris Lattner2004-07-121-3/+2
| | | | llvm-svn: 14775
* Fix a really nasty logic error that VC noticed.Chris Lattner2004-07-121-2/+2
| | | | | | Reid, this might matter to you :) llvm-svn: 14774
* Implement new methodChris Lattner2004-07-121-0/+36
| | | | llvm-svn: 14767
* Various cleanups:Reid Spencer2004-07-111-153/+193
| | | | | | | | | | | | | | | | - Remove tabs - Standardize use of space around ( and ). - Consolidate the ConstantPlaceHolder class - Rename two methods to be more meaningful (ParseType, ParseTypes) - Correct indentation of blocks - Add documentation - Convert input dependent asserts to error(...) so it throws instead. Provide placeholder implementations of read_float and read_double that still read in platform-specific endianess. When I figure out how to do this without knowing the endianess of the platform, it will get implemented correctly. llvm-svn: 14765
* - Rename two methods to give them more meaningReid Spencer2004-07-111-2/+8
| | | | | | | - Add read_float and read_double in preparation for a correct implementation of bytecode floating point support. llvm-svn: 14764
* Remove tabs.Reid Spencer2004-07-111-2/+2
| | | | llvm-svn: 14763
* Prepare the writer for a non-broken implementation of writing floatingReid Spencer2004-07-112-2/+19
| | | | | | | point values. This will be fixed when I figure out how to do it correctly without depending on knowing the endianess of a platform. llvm-svn: 14762
* The cleanup is done. Update comment.Chris Lattner2004-07-111-5/+2
| | | | llvm-svn: 14761
OpenPOWER on IntegriCloud