Reid Spencer
ef784f01dd
bug 122:
...
- Minimize redundant isa<GlobalValue> usage
llvm-svn: 14948
2004-07-18 00:32:14 +00:00
Reid Spencer
c5afc9512b
bug 122:
...
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass
llvm-svn: 14947
2004-07-18 00:31:05 +00:00
Reid Spencer
9e855c6832
bug 122:
...
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
llvm-svn: 14946
2004-07-18 00:29:57 +00:00
Reid Spencer
5f6815980b
bug 122:
...
- Replace ConstantPointerRef usage with GlobalValue usage
- Rename methods to get ride of ConstantPointerRef usage
llvm-svn: 14945
2004-07-18 00:25:04 +00:00
Reid Spencer
83cae64faf
bug 122:
...
- Excise dead CPR procesing.
llvm-svn: 14944
2004-07-18 00:23:51 +00:00
Reid Spencer
e4de22874e
bug 122:
...
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct test ordering for GlobalValue subclass
llvm-svn: 14943
2004-07-18 00:19:45 +00:00
Reid Spencer
30d69a5af9
bug 122:
...
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
llvm-svn: 14942
2004-07-18 00:18:30 +00:00
Reid Spencer
51fe3361b6
bug 122:
...
- Correct ordering of tests because for GlobalValue isa Constant
llvm-svn: 14941
2004-07-18 00:16:21 +00:00
Reid Spencer
1d8d08f34a
User ValueListTy as the type of the ValueList. This avoides the ValueList
...
from being treated like a Function which can cause the contents of the list
to be come invalidated.
llvm-svn: 14940
2004-07-18 00:13:12 +00:00
Reid Spencer
db1863d50c
bug 122:
...
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass
llvm-svn: 14939
2004-07-18 00:12:03 +00:00
Reid Spencer
edbb40b23c
bug 122:
...
- Update for BytecodeHandler interface change resuing from CPRs going away
llvm-svn: 14938
2004-07-18 00:10:36 +00:00
Reid Spencer
ce6adaff1c
bug 122:
...
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
- Remove tabs
- Fix coments refering to ConstantPointerRef
llvm-svn: 14937
2004-07-18 00:08:11 +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
Reid Spencer
f47c779690
bug 122:
...
remove redundant isa<GlobalValue>
ensure isa<GlobalValue> case is processed before is<Constant>
llvm-svn: 14926
2004-07-17 23:36:58 +00:00
Reid Spencer
6dd4c27c7c
bug 122:
...
- Add ValueListTy to TypeTy so that the bcreader can have its own User
category that won't get factored into any optimizations or cleanup.
- Correct an isa_impl to correctly include GlobalValue now that it isa
Constant.
llvm-svn: 14925
2004-07-17 23:34:47 +00:00
Reid Spencer
f820a23365
bug 122:
...
Remove redundancy in User::classof(Value*); GlobalValue isa Constant now.
llvm-svn: 14924
2004-07-17 23:32:11 +00:00
Reid Spencer
591fc1ebf5
Fix a comment.
...
llvm-svn: 14923
2004-07-17 23:30:45 +00:00
Reid Spencer
fdc497d049
bug 122:
...
We don't need to keep track of CPRs any more.
llvm-svn: 14922
2004-07-17 23:30:11 +00:00
Reid Spencer
82b7ce69e1
bug 122:
...
Now that GlobalVariable is a constant (via derivation from GlobalValue),
override the replaceUsesOfWithOnConstant method.
llvm-svn: 14921
2004-07-17 23:29:46 +00:00
Reid Spencer
1a76c27988
bug 122:
...
- derive from Constant
- declare needed overrides from Constant class
llvm-svn: 14920
2004-07-17 23:28:28 +00:00
Reid Spencer
c5098ac9d4
****** ABOLISH ConstantPointerRef *****
...
llvm-svn: 14919
2004-07-17 23:26:57 +00:00
Reid Spencer
88cda9db1e
Extend constructor so that it can support GlobalValue's (with names).
...
Make GlobalValue a "classof" Constant
Fix the classof(Value*) to include GlobalValue's
llvm-svn: 14918
2004-07-17 23:26:12 +00:00
Reid Spencer
9521143ab7
Constant value not needed after CPR's disappear.
...
llvm-svn: 14917
2004-07-17 23:23:30 +00:00
Chris Lattner
e62af95bef
It looks like physref->virtreg joining is working fine. Enable it by default
...
but make virtreg->virtreg joining stay off by default
llvm-svn: 14916
2004-07-17 21:51:25 +00:00
Chris Lattner
c856e90d1d
Make sure to emit the immediate byte for instructions like:
...
shrd [mem], reg, imm
This fixes the jit-ls failure on 186.crafty.
llvm-svn: 14914
2004-07-17 20:26:14 +00:00
Chris Lattner
8a4039ed9a
Reserve the correct amt of space.
...
llvm-svn: 14913
2004-07-17 20:24:05 +00:00
Chris Lattner
96591356f7
Hrm, I think we need a "Reid is buggy" bug ;-)
...
llvm-svn: 14912
2004-07-17 18:50:19 +00:00
Misha Brukman
e6f4a5ebb0
We don't really need to #include IPO.h into this file.
...
llvm-svn: 14911
2004-07-17 18:37:46 +00:00
Reid Spencer
0fce16f6b1
Initial (outline only) draft of the System Library requirements, design
...
and details documentation.
llvm-svn: 14910
2004-07-17 10:04:49 +00:00
Reid Spencer
6d4c03ebfd
Added a README to point users to the documentation on the design of this
...
library which is a prerequisite for maintaining the library.
llvm-svn: 14909
2004-07-17 08:39:53 +00:00
Chris Lattner
3bbaaaa940
Fix incorrect computation of mod/ref sets. Do not ask for mod/ref information
...
for objects of size 0.
llvm-svn: 14908
2004-07-17 07:40:34 +00:00
Chris Lattner
2e8690bf57
Print modref information in a useful way.
...
llvm-svn: 14907
2004-07-17 06:43:20 +00:00
Chris Lattner
eed1a6f3dc
Cleanups: fold two loops into one
...
New features: -print-all-alias-modref-info option, print more info
llvm-svn: 14906
2004-07-17 06:28:49 +00:00
Chris Lattner
1dd789d775
link.h causes problems on some platforms and is not needed on solaris, where
...
the comment came from.
llvm-svn: 14905
2004-07-17 03:09:12 +00:00
Chris Lattner
2ed243b3a9
Remove dead file
...
llvm-svn: 14904
2004-07-17 02:56:48 +00:00
Chris Lattner
041e6c9fbe
Add note about IA64 C++
...
llvm-svn: 14903
2004-07-17 02:04:41 +00:00
Brian Gaeke
9905a2eb63
Fix warning on 64-bit machines
...
llvm-svn: 14902
2004-07-16 21:40:32 +00:00
Misha Brukman
b85c2522fa
* Use LI(S) to copy constants into registers intead of ADDI(S) as the latter is
...
a funky way to "use" R0 for a 0-valued operand
* Add IMPLICIT_DEFs for incoming function arguments via registers to help the
register allocator not clobber those registers
* Implement comparisons with longs
* Teach emitSelectOperation() to fold the SetCC operation
Patch contributed by Nate Begeman
llvm-svn: 14901
2004-07-16 21:06:24 +00:00
Misha Brukman
db032fb1f9
* Store all non-volatile int registers R13-31 on the stack, restore on exit
...
* Fix comment formatting
llvm-svn: 14900
2004-07-16 20:55:20 +00:00
Misha Brukman
780da8425f
Fix code formatting
...
llvm-svn: 14899
2004-07-16 20:54:25 +00:00
Misha Brukman
3adf84ba0d
Implement PowerPCInstrInfo::isMoveInstr(), patch by Nate Begeman
...
llvm-svn: 14898
2004-07-16 20:51:55 +00:00
Misha Brukman
f0def96a36
Add prototype for TargetInstrInfo::isMoveInstr()
...
llvm-svn: 14897
2004-07-16 20:50:55 +00:00
Misha Brukman
9c2c293225
* Enable allocation of registers r2-r10
...
* Allocate registers 13-31 backwards (to be able to store them all at once)
llvm-svn: 14896
2004-07-16 20:35:20 +00:00
Misha Brukman
6ed15fd181
Add IMPLICIT_DEFS pseudo-instruction; patch by: Nate Begeman
...
llvm-svn: 14895
2004-07-16 20:33:41 +00:00
Misha Brukman
8c9938654a
The generated instruction selector isn't (yet) functional
...
llvm-svn: 14894
2004-07-16 20:31:13 +00:00
Misha Brukman
d4ac818593
* Output non-lazy linking stubs for external global variables
...
* Get rid of dead and #if 0'd code
* Minor for loop speed-up: save end iterator instead of querying every time
llvm-svn: 14893
2004-07-16 20:29:04 +00:00
Misha Brukman
06773822b9
Correctly build shared objects on MacOS X for debugging code generators
...
llvm-svn: 14892
2004-07-16 19:45:45 +00:00
Misha Brukman
a6b9a566b9
Define double alignment as 8 bytes now that assert(DoubleAlignment == PointerSize)
...
has been eliminated
llvm-svn: 14891
2004-07-16 19:32:12 +00:00
Misha Brukman
d350b64352
* Add spaces between words and numbers in comments printed out for longs/floats
...
* Print out IMPLICIT_DEFS as comments in the assembly, patch by Nate Begeman
llvm-svn: 14890
2004-07-16 19:01:13 +00:00
Misha Brukman
65728ddf45
Fix grammar.
...
llvm-svn: 14888
2004-07-16 17:40:28 +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
Brian Gaeke
135b870f72
Add a class for pseudo-instructions. Use it.
...
Add IMPLICIT_USE and IMPLICIT_DEF, a la X86.
llvm-svn: 14884
2004-07-16 10:32:10 +00:00
Brian Gaeke
a57943154e
Add what will eventually be the TSFlags. Big switch(opcode) statements are bad.
...
llvm-svn: 14883
2004-07-16 10:31:59 +00:00
Brian Gaeke
f486726c56
Add special handling for pseudo-instructions (print them as comments).
...
llvm-svn: 14882
2004-07-16 10:31:47 +00:00
Brian Gaeke
97b71c9fa9
Add to-do list.
...
llvm-svn: 14881
2004-07-16 10:31:36 +00:00
Brian Gaeke
5ce1408537
Do IMPLICIT_DEFs on incoming args' hard regs, to avoid confusing the regalloc.
...
Support single-fp incoming args.
Support single-fp outgoing args ('call' operands).
Support double-fp return values.
llvm-svn: 14880
2004-07-16 10:31:25 +00:00
Chris Lattner
2453818b8a
The powerpc is now gone. However it is now just known as the Skeleton target.
...
llvm-svn: 14877
2004-07-16 07:14:34 +00:00
Chris Lattner
f1b8afb3b4
Build skeleton target
...
llvm-svn: 14876
2004-07-16 07:12:46 +00:00
Chris Lattner
a46d2a63c7
Build the skeleton target
...
llvm-svn: 14875
2004-07-16 07:11:53 +00:00
Chris Lattner
ed85542ad7
Initial checkin of the rest of the skeleton target
...
llvm-svn: 14874
2004-07-16 07:11:15 +00:00
Chris Lattner
3d53a4752d
Initial skeleton tablegen files
...
llvm-svn: 14873
2004-07-16 06:29:19 +00:00
Chris Lattner
42023220fa
Add skeleton makefile
...
llvm-svn: 14872
2004-07-16 06:20:55 +00:00
Chris Lattner
e8a034901d
Initial readme
...
llvm-svn: 14871
2004-07-16 06:12:28 +00:00
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
Chris Lattner
6652224c2a
Remove a gross and crufty "feature" that was never documented and doesn't work.
...
llvm-svn: 14809
2004-07-14 06:44:56 +00:00
Chris Lattner
88357937b6
Finegrainify namespacification
...
llvm-svn: 14808
2004-07-14 06:39:48 +00:00
Chris Lattner
4accae9c3e
Revamp handling of labels. In particular, if we create a forward reference
...
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
2004-07-14 06:28:35 +00:00
Brian Gaeke
590b5f12db
Add Machine-CFG edges to SparcV9 MachineBasicBlocks.
...
llvm-svn: 14806
2004-07-14 05:40:50 +00:00
Chris Lattner
95230b0cbc
Split the basic block handling case out of getVal into getBBVal.
...
llvm-svn: 14805
2004-07-14 01:33:11 +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
Misha Brukman
aa678b5ed4
* Specify that FP arith options have 3 operands
...
* Correctly load FP constants from the constant pool, should be refactored
llvm-svn: 14799
2004-07-13 15:35:45 +00:00
Chris Lattner
ab1aedab13
Actually, use an exception to stop verification. This gives us much better
...
error messages because verification stops at the first error.
llvm-svn: 14794
2004-07-13 08:48:04 +00:00
Chris Lattner
2c1bc9e7e2
There is no reason to abort and print a stack trace if there is a verification
...
error. Just print the message like a good little tool.
llvm-svn: 14793
2004-07-13 08:45:41 +00:00
Chris Lattner
d25cad9f38
Fine-grainify namespacification, prune #include
...
llvm-svn: 14792
2004-07-13 08:42:12 +00:00
Chris Lattner
e84a2ba99f
Fix typeo and refactor bb productions to make it possible for us to reuse any
...
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
2004-07-13 08:39:15 +00:00
Chris Lattner
d9c9c496e6
Eliminate some mega-cruft here. There is no reason to DERIVE FROM IR CLASSES
...
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
2004-07-13 08:28:21 +00:00
Chris Lattner
30b35cf3f7
Inline the now trivial setValueNameInternal function into both callers
...
llvm-svn: 14789
2004-07-13 08:12:39 +00:00
Chris Lattner
85a351f78d
Now that basic blocks are eagerly inserted into the Function, we can use
...
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
2004-07-13 08:10:10 +00:00
Chris Lattner
2ed776bb88
A couple of substantial cleanup fixes:
...
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
2004-07-13 07:59:27 +00:00
Brian Gaeke
b88d2a44f9
Fix warning on SparcV9, where sizeof (int) != sizeof (void *).
...
llvm-svn: 14786
2004-07-13 07:37:43 +00:00
Chris Lattner
cc459c9d66
Replace a bunch of complex ConstantPointerRef referring code with simple
...
code.
llvm-svn: 14785
2004-07-13 06:58:07 +00:00
Chris Lattner
8e30a4dfc5
Make tblgen not try to be smart. This is better handled in makefiles if
...
at all. Patch contributed by Vladimir Prus!
llvm-svn: 14784
2004-07-13 06:11:46 +00:00
Chris Lattner
35e24774eb
Factor some code to handle "load (constantexpr cast foo)" just like
...
"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
2004-07-13 01:49:43 +00:00
Misha Brukman
be1b680f54
Correctly load FP constants out of the constant pool.
...
llvm-svn: 14782
2004-07-12 23:49:47 +00:00
Misha Brukman
9dacda651f
Apple's MacOS X is another OS which does not provide alloca() via <alloca.h>
...
llvm-svn: 14781
2004-07-12 23:37:18 +00:00
Misha Brukman
dcb0eec80d
Implement getModuleMatchQuality and getJITMatchQuality() for PowerPC
...
llvm-svn: 14780
2004-07-12 23:36:12 +00:00
Misha Brukman
b6ee60667b
* Tabs to spaces
...
* Delete extra blank lines
llvm-svn: 14779
2004-07-12 22:58:07 +00:00
Misha Brukman
7596c249e9
New open proj: C/C++ compiler in C++, with link to Ed Willink's C++ yacc grammar
...
llvm-svn: 14778
2004-07-12 21:10:47 +00:00
Chris Lattner
5eb09d1ded
Add a helper method. The StructType element is completely redundant in most
...
cases
llvm-svn: 14777
2004-07-12 20:36:08 +00:00
Chris Lattner
d6108ca27e
implement new helper method
...
llvm-svn: 14776
2004-07-12 20:35:11 +00:00
Chris Lattner
420fd1425d
Fix unused var warning
...
llvm-svn: 14775
2004-07-12 20:29:52 +00:00