Chris Lattner
fe05024b0f
Fix the regressions handling unnamed global variables
...
llvm-svn: 14870
2004-07-16 01:18:09 +00:00
Chris Lattner
1fbd76ecba
For 64-bit platform support, we now use the clEnumValEnd macro to terminate
...
cl::values lists
llvm-svn: 14869
2004-07-16 00:10:54 +00:00
Chris Lattner
9716100a5d
IA64 compat
...
llvm-svn: 14867
2004-07-16 00:08:28 +00:00
Chris Lattner
34afafc190
Fix IA64 compatibility
...
llvm-svn: 14866
2004-07-16 00:06:01 +00:00
Chris Lattner
cc36c670e8
Use new macro
...
llvm-svn: 14865
2004-07-16 00:04:54 +00:00
Chris Lattner
597555fd45
Be compatible with IA64
...
llvm-svn: 14864
2004-07-16 00:04:13 +00:00
Chris Lattner
89ae115aa5
Passing integer 0 in for a pointer value doesn't work on IA64. Fix this
...
by using a new macro.
llvm-svn: 14863
2004-07-16 00:02:21 +00:00
Chris Lattner
b50070175d
Add a new macro to be used for the end of enum lists.
...
llvm-svn: 14862
2004-07-16 00:01:05 +00:00
Chris Lattner
d79334df33
This patch was contributed by Daniel Berlin!
...
Speed up SCCP substantially by processing overdefined values quickly. This
patch speeds up SCCP by about 30-40% on large testcases.
llvm-svn: 14861
2004-07-15 23:36:43 +00:00
Chris Lattner
f2c018c0c1
Fix PR404 try #2
...
This version takes about 1s longer than the previous one (down to 2.35s),
but on the positive side, it actually works :)
llvm-svn: 14856
2004-07-15 08:20:22 +00:00
Chris Lattner
9b1f3dc990
Give SetVector range support
...
llvm-svn: 14855
2004-07-15 08:18:31 +00:00
Chris Lattner
072a4c0091
Nuke a clearly bogus assertion
...
llvm-svn: 14854
2004-07-15 07:44:34 +00:00
Chris Lattner
daa12135da
Revert previous patch until I get a bug fixed
...
llvm-svn: 14853
2004-07-15 05:36:31 +00:00
Chris Lattner
34cc695252
QOI issue fixed
...
llvm-svn: 14852
2004-07-15 04:30:35 +00:00
Chris Lattner
70177e402d
Fix PR404: Loop simplify is really slow on 252.eon
...
This eliminates an N*N*logN algorithm from the loop simplify pass, replacing
it with a much simpler and faster alternative. In a debug build, this reduces
gccas time on eon from 85s to 42s.
llvm-svn: 14851
2004-07-15 04:27:04 +00:00
Chris Lattner
a4d8ce6399
Bug fixed
...
llvm-svn: 14850
2004-07-15 02:59:24 +00:00
Chris Lattner
29850c5d62
Final fix for PR341: eliminate operator<<(ostream, Value*). Clients should
...
now send references to ostreams instead of pointers. Sending pointers to
ostreams will print their addresses.
llvm-svn: 14849
2004-07-15 02:54:36 +00:00
Chris Lattner
5c4de70691
Fixes for PR341
...
llvm-svn: 14848
2004-07-15 02:51:32 +00:00
Chris Lattner
60a7dd16c4
Fixes for PR341
...
llvm-svn: 14847
2004-07-15 02:51:31 +00:00
Chris Lattner
f2b5817b1b
Fix for PR341
...
llvm-svn: 14846
2004-07-15 02:50:38 +00:00
Chris Lattner
fcdab1b5f5
Fix for PR341
...
llvm-svn: 14845
2004-07-15 02:40:04 +00:00
Chris Lattner
c9819f09c2
Revert stuff that I didn't mean to checkin
...
llvm-svn: 14844
2004-07-15 02:33:38 +00:00
Chris Lattner
3c42077c37
Fixes for PR341
...
llvm-svn: 14843
2004-07-15 02:31:46 +00:00
Chris Lattner
558cebc775
Fix for PR341
...
llvm-svn: 14842
2004-07-15 02:26:49 +00:00
Chris Lattner
7dc9de5f43
Patches towards fixing PR341
...
llvm-svn: 14841
2004-07-15 02:14:30 +00:00
Chris Lattner
32c518e526
Progress on PR341
...
llvm-svn: 14840
2004-07-15 02:06:12 +00:00
Chris Lattner
9a63520b1a
Fixes working towards PR341
...
llvm-svn: 14839
2004-07-15 01:50:47 +00:00
Chris Lattner
cae777bb4f
Bug fixes for PR341
...
llvm-svn: 14838
2004-07-15 01:29:12 +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
030f84f215
Yeah, how about those 'primative' types huh?
...
llvm-svn: 14836
2004-07-15 01:15:53 +00:00
Chris Lattner
ba7aef39fd
Now that we codegen the portable "sizeof" efficiently, we can use it for
...
malloc lowering. This means that lowerallocations doesn't need targetdata
anymore. yaay.
llvm-svn: 14835
2004-07-15 01:08:08 +00:00
Chris Lattner
33930ad7bd
Improve codegen for the LLVM offsetof/sizeof "operator". Before we compiled
...
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
2004-07-15 00:58:53 +00:00
Chris Lattner
969d6fbcee
You cannot pass functions by value, what does that even mean??
...
llvm-svn: 14833
2004-07-14 23:14:07 +00:00
Chris Lattner
1e780d3d26
this "feature" is gone
...
llvm-svn: 14832
2004-07-14 23:12:09 +00:00
Chris Lattner
4babbe04e1
This is logically part of the last patch. Just more really horrible code
...
that is made unnecessary by it.
llvm-svn: 14831
2004-07-14 23:07:13 +00:00
Chris Lattner
8abe1a11b4
** Finally DeclareNewGlobalValue is dead!
...
* 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
2004-07-14 23:03:46 +00:00
Chris Lattner
7e40f4f9c5
New, horrible, testcase
...
llvm-svn: 14829
2004-07-14 22:59:47 +00:00
Chris Lattner
4c9210ed64
* Fairly substantial change. Instead of creating new globalvariables, then
...
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
2004-07-14 21:44:00 +00:00
Chris Lattner
e875d48a92
Fold setValueNameMergingDuplicates into ParseGlobalVariable, allowing us
...
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
2004-07-14 20:42:57 +00:00
Brian Gaeke
def1a51232
Actually set the endian/pointersize flags on the module being read in!
...
llvm-svn: 14826
2004-07-14 20:33:13 +00:00
Chris Lattner
cbdf371d30
Simplify logic.
...
llvm-svn: 14825
2004-07-14 20:27:12 +00:00
Chris Lattner
47fb34c00a
Make PATypeHolder and friends return non-const pointers to the types they
...
hold. Because types are basically immutable anyway, they should not be
referenced as "const Type*" everywhere. Just "Type*" should suffice!
llvm-svn: 14824
2004-07-14 20:10:26 +00:00
Chris Lattner
91393ee84f
Fix a regression from last night. Apparently the CFE is broken and outputs
...
functions multiple times, expecting them to be merged. This should be fixed
in the CFE, then here.
llvm-svn: 14823
2004-07-14 19:33:47 +00:00
Misha Brukman
2661c50173
Make sure MTSPR instruction is inserted into the BasicBlock
...
llvm-svn: 14822
2004-07-14 18:26:31 +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
29f231ce4e
* Change code to use a static_cast instead of reinterpret_cast
...
* Add comments
* Add two new gep ctors for the very common case of creating a two operand
GEP instruction.
llvm-svn: 14820
2004-07-14 18:13:54 +00:00
Misha Brukman
5193410cd9
Don't define the same register twice when loading a ConstantPointerRef to a reg
...
llvm-svn: 14819
2004-07-14 17:57:04 +00:00
Misha Brukman
d4cbe67ce6
* Fix multiplication by powers of two and otherwise
...
* Clarify variable name (StoreInst SI instead of LI)
llvm-svn: 14818
2004-07-14 15:29:51 +00:00
Chris Lattner
42dd47437e
Pull out code shared between GV forward-decl and definition processing.
...
This gives us only a single call site for setValueNameMergingDuplicates.
The next stage is the start merging them together.
llvm-svn: 14811
2004-07-14 08:23:52 +00:00
Chris Lattner
70ef57d001
Simplify code. Do not allow functions to be redefined more than once.
...
Since the stupid '%X = const int 4' thing is gone, we can now simplify
setValueNameMergingDuplicates a bit more.
llvm-svn: 14810
2004-07-14 07:12:48 +00:00