Chris Lattner
4c8b57ea31
Add support for the setp instructions
...
llvm-svn: 14140
2004-06-11 04:30:06 +00:00
Chris Lattner
c66e996765
Split compare instruction handling OUT of handleTwoArgFP into handleCompareFP.
...
This makes the code much simpler, and the two cases really do belong apart.
Once we do it, it's pretty obvious how flawed the logic was for A != A case,
so I fixed it (fixing PR369).
This also uses freeStackSlotAfter instead of inserting an fxchg then
popStackAfter'ing in the case where there is a dead result (unlikely, but
possible), producing better code.
llvm-svn: 14139
2004-06-11 04:25:06 +00:00
Reid Spencer
7172b26a18
Revert an unneeded interface change to Instruction.h
...
llvm-svn: 14137
2004-06-11 03:06:43 +00:00
Chris Lattner
94a66c3038
Fix lowering to work correctly
...
llvm-svn: 14134
2004-06-11 02:54:02 +00:00
Chris Lattner
b07bf147cd
I misled Alkis: LLVM should have isnan, not isunordered.
...
isunordered(X, Y) === isnan(X) | isnan(Y)
Remove isunordered, add isnan.
llvm-svn: 14132
2004-06-11 02:29:43 +00:00
Brian Gaeke
c5bb88c934
Turn loads of ConstantPointerNulls into loads of zero... don't spill
...
them into the constant pool.
llvm-svn: 14128
2004-06-11 02:03:48 +00:00
Alkis Evlogimenos
1ae8b4e7c4
Add the isunordered intrinsic.
...
llvm-svn: 14127
2004-06-11 01:08:18 +00:00
Reid Spencer
35e67bbc91
Remove tabs.
...
llvm-svn: 14123
2004-06-10 22:03:00 +00:00
Reid Spencer
024d735433
Implement detailed function level data collection and reporting.
...
llvm-svn: 14122
2004-06-10 22:00:54 +00:00
Reid Spencer
4a21e2053a
Adjust prototypes to new Handler interface.
...
llvm-svn: 14121
2004-06-10 22:00:29 +00:00
Reid Spencer
11466e62a7
Make the parser deal with functions instead of just function types.
...
llvm-svn: 14120
2004-06-10 21:59:20 +00:00
Reid Spencer
4dcaebd069
Doxygenize a comment.
...
llvm-svn: 14115
2004-06-10 08:27:00 +00:00
Reid Spencer
ce1adf1ff0
Implemented the bulk of the functionality. Cleaned up the code.
...
llvm-svn: 14113
2004-06-10 08:09:13 +00:00
Chris Lattner
71f351ddf9
Fix the prolog epilog code inserter to match the documentation and support
...
targets whose stack grows up.
Patch contributed by Vladimir Prus
llvm-svn: 14111
2004-06-10 06:23:35 +00:00
Chris Lattner
1f0e0d55c4
Fix the fixed stack offset, patch contributed by Vladimir Prus
...
llvm-svn: 14110
2004-06-10 06:19:25 +00:00
Chris Lattner
52654bf072
Fix a bug in my checkin from last night that caused miscompilations of
...
186.crafty, fhourstones and 132.ijpeg.
Bugpoint makes really nasty miscompilations embarassingly easy to find. It
narrowed it down to the instcombiner and this testcase (from fhourstones):
bool %l7153_l4706_htstat_loopentry_2E_4_no_exit_2E_4(int* %i, [32 x int]* %works, int* %tmp.98.out) {
newFuncRoot:
%tmp.96 = load int* %i ; <int> [#uses=1]
%tmp.97 = getelementptr [32 x int]* %works, long 0, int %tmp.96 ; <int*> [#uses=1]
%tmp.98 = load int* %tmp.97 ; <int> [#uses=2]
%tmp.99 = load int* %i ; <int> [#uses=1]
%tmp.100 = and int %tmp.99, 7 ; <int> [#uses=1]
%tmp.101 = seteq int %tmp.100, 7 ; <bool> [#uses=2]
%tmp.102 = cast bool %tmp.101 to int ; <int> [#uses=0]
br bool %tmp.101, label %codeRepl4.exitStub, label %codeRepl3.exitStub
codeRepl4.exitStub: ; preds = %newFuncRoot
store int %tmp.98, int* %tmp.98.out
ret bool true
codeRepl3.exitStub: ; preds = %newFuncRoot
store int %tmp.98, int* %tmp.98.out
ret bool false
}
... which only has one combination performed on it:
$ llvm-as < t.ll | opt -instcombine -debug | llvm-dis
IC: Old = %tmp.101 = seteq int %tmp.100, 7 ; <bool> [#uses=1]
New = setne int %tmp.100, 0 ; <bool>:<badref> [#uses=0]
IC: MOD = br bool %tmp.101, label %codeRepl3.exitStub, label %codeRepl4.exitStub
IC: MOD = %tmp.97 = getelementptr [32 x int]* %works, uint 0, int %tmp.96 ; <int*> [#uses=1]
It doesn't get much better than this. :)
llvm-svn: 14109
2004-06-10 02:33:20 +00:00
Chris Lattner
18cab818db
More minor cleanups
...
llvm-svn: 14108
2004-06-10 02:12:35 +00:00
Chris Lattner
ba89f54271
Eliminate many occurrances of Instruction::
...
llvm-svn: 14107
2004-06-10 02:07:29 +00:00
Chris Lattner
2c6bea32de
Share some code
...
llvm-svn: 14106
2004-06-10 01:57:38 +00:00
Chris Lattner
75e5aa4d22
Tolerate more errors
...
llvm-svn: 14104
2004-06-09 22:22:10 +00:00
Brian Gaeke
9cf9c6e184
Encode %fsr correctly; don't fail an assertion.
...
llvm-svn: 14103
2004-06-09 21:54:59 +00:00
Brian Gaeke
badbc7476a
Fix encoding of ST*FSR instructions.
...
llvm-svn: 14102
2004-06-09 21:54:58 +00:00
Brian Gaeke
8e446cf7a2
Fix assertion failure message to have the right method name.
...
llvm-svn: 14101
2004-06-09 20:44:42 +00:00
Chris Lattner
3aa77d0e5e
Make the asmwriter much more tolerant of errors (which are common when working
...
on new front-ends and stuff). Also get rid of some tabs that snuck in.
llvm-svn: 14100
2004-06-09 19:41:19 +00:00
Reid Spencer
a07033fecd
Made it possible for the printInfoComment method to invoke getSlot in
...
such a way that if the Value being printed is standalone that we don't
assert and abort but just print ":??" for the slot number instead.
llvm-svn: 14097
2004-06-09 15:26:53 +00:00
John Criswell
287e3fc88b
Fix for PR#366. We use getClassB() so that we can handle cast instructions
...
that cast to bool.
llvm-svn: 14096
2004-06-09 15:18:51 +00:00
Chris Lattner
b2434f1222
Implement InstCombine/select.ll:test15*
...
llvm-svn: 14095
2004-06-09 07:59:58 +00:00
Reid Spencer
8bb8138b54
Cleanup alignment of output.
...
llvm-svn: 14093
2004-06-09 06:22:00 +00:00
Reid Spencer
aa5110231e
Implement analysis output. Don't dump function details unless requested.
...
llvm-svn: 14091
2004-06-09 06:17:58 +00:00
Reid Spencer
ca3bcbc07b
Implement some rudimentary analysis.
...
llvm-svn: 14090
2004-06-09 06:16:43 +00:00
Reid Spencer
49f1f6f4c4
Clean up indentation of file body output.
...
Don't dump functions unless "detailedResults" is requested.
llvm-svn: 14089
2004-06-09 06:16:19 +00:00
Reid Spencer
b3f8b06dfc
Move parsing details to Parser.cpp.
...
llvm-svn: 14088
2004-06-09 06:15:21 +00:00
Reid Spencer
d2e7399ba0
Bring some things out of header files that belong only in this file.
...
llvm-svn: 14087
2004-06-09 06:14:52 +00:00
Chris Lattner
90a2bbc74c
Be more careful about the order we put stuff onto the worklist. This allow us to
...
collapse this:
bool %le(int %A, int %B) {
%c1 = setgt int %A, %B
%tmp = select bool %c1, int 1, int 0
%c2 = setlt int %A, %B
%result = select bool %c2, int -1, int %tmp
%c3 = setle int %result, 0
ret bool %c3
}
into:
bool %le(int %A, int %B) {
%c3 = setle int %A, %B ; <bool> [#uses=1]
ret bool %c3
}
which is handy, because the Java FE makes these sequences all over the place.
This is tested as: test/Regression/Transforms/InstCombine/JavaCompare.ll
llvm-svn: 14086
2004-06-09 05:08:07 +00:00
Reid Spencer
323cc6283d
Cleaned up a dead header file to prevent duplicate definition warnings
...
in doxygen.
llvm-svn: 14084
2004-06-09 04:38:34 +00:00
Chris Lattner
a7b01d4467
Implement select.ll:test14*
...
llvm-svn: 14083
2004-06-09 04:24:29 +00:00
Chris Lattner
6a6148fda0
Workaround or a VS miscompilation bug
...
llvm-svn: 14078
2004-06-08 23:21:39 +00:00
Chris Lattner
9579beadfe
Don't grab the condition of unconditional branches!
...
This fixes PR363
llvm-svn: 14076
2004-06-08 21:50:30 +00:00
Brian Gaeke
91a3d0f55f
Fix a minor bug in the map - since this pass adds a global symbol, it must be
...
accounted for in the map (at least, in its current format).
llvm-svn: 14075
2004-06-08 20:08:30 +00:00
Brian Gaeke
4b0b12c188
Add a TmpInstruction ctor that doesn't take a MCFI.
...
llvm-svn: 14073
2004-06-08 18:52:46 +00:00
Chris Lattner
4996a6e7cb
Fix a link error using VS8.0
...
llvm-svn: 14071
2004-06-08 17:53:24 +00:00
Reid Spencer
7495cebbb1
Fix the bug that was preventing the parser from working on all bytecode
...
files. It was reading non-initialized global vars when the flag said it was
initialized and vice versa. Causes mis-alignment since initialized and
non-initialized constants have different bytecode lengths.
llvm-svn: 14057
2004-06-08 05:54:47 +00:00
Reid Spencer
17fdffaf33
Make it #include Parser.h instead of AnalyzerInternals.h since it only
...
needs the BytecodeHandler interface which is now in Parser.h
llvm-svn: 14056
2004-06-08 05:53:14 +00:00
Reid Spencer
596ef471a8
Adjust what's included to compensate for changes in Parser.h
...
llvm-svn: 14055
2004-06-08 05:52:29 +00:00
Reid Spencer
9cdb71239e
Merged BytecodeHandler.h into Parser.h since the parser and the handler
...
must always coexist. Cleaned up the documentation on these interfaces
significantly. This is in preparation for moving Parser.h to the include
directories to make it a public interface.
llvm-svn: 14054
2004-06-08 05:51:18 +00:00
Chris Lattner
a1c9755c7c
Fix PR361.
...
Dominance properties don't hold in unreachable code
llvm-svn: 14053
2004-06-07 23:07:33 +00:00
Chris Lattner
fef60b53ff
Make all of this functionality work directly on win32. Properly conditionalize
...
system specific stuff on HAVE_MKSTEMP
llvm-svn: 14051
2004-06-07 19:37:24 +00:00
Chris Lattner
18512612b7
Implement getTimeRecord natively in Win32, properly conditionalize the
...
getrusage implementation on HAVE_GETRUSAGE
llvm-svn: 14050
2004-06-07 19:34:51 +00:00
Reid Spencer
329505d08b
Commit For New Tool: llvm-abcd (Analysis of ByteCode Dumper). This tool
...
will (eventually) provide statistical analysis of bytecode files as well
as the ability to dump them in a low level format (slot numbers not
resolved). The purpose of this is to aid in the Type!=Value change of
bug 122. With this initial release, llvm-abcd merely dumps out the
bytecode. However, the infrastructure for separating bytecode parsing from
handling the parsing events is in place. The style chosen is similar to
SAX XML parsing where a handler object is called to handlign the parsing
events. This probably isn't useful to anyone but me right now as there is
no analysis yet, and the dumper doesn't work on every bytecode file. It
will probably be useful by the end of this week. Note that there is some
duplication of code from the bytecode reader. This was done to eliminate
errors from being introduced in the reader and to minimize the impact to
other LLVM developers. At some point, the Analyzer and the Reader will be
integrated to use the same infrastructure. Also, sorry for the minor change
to Instruction.h but I just couldn't bring myself to write code that
depends on Instruction internals.
llvm-svn: 14048
2004-06-07 17:53:43 +00:00
Chris Lattner
1515fd1851
Add some notes so I can throw away one of my many todo lists.
...
llvm-svn: 14046
2004-06-05 20:12:36 +00:00
Chris Lattner
6e63236846
Fix GCC warning
...
llvm-svn: 14045
2004-06-05 17:44:48 +00:00
Chris Lattner
dfca9d7f7b
Fix GCC warnings
...
llvm-svn: 14044
2004-06-05 17:43:52 +00:00
Alkis Evlogimenos
65de990145
Include cerrno.
...
llvm-svn: 14041
2004-06-05 08:59:43 +00:00
Chris Lattner
c0f5e68d4d
Remove an unused variable.
...
Work around for bogus errors: no those static functions don't need to
be executed to be initialized!
llvm-svn: 14040
2004-06-05 01:05:19 +00:00
Chris Lattner
c107a4d1c5
Add missing #include
...
llvm-svn: 14037
2004-06-05 00:24:59 +00:00
Chris Lattner
678cafb8a9
Work around VS bug
...
llvm-svn: 14036
2004-06-05 00:22:04 +00:00
Chris Lattner
6e6ab3888b
As much as I dislike doing this, it's the only fix for VC8.0 that I can come
...
up with, even though it's perfectly conformant code. :(
llvm-svn: 14034
2004-06-05 00:11:27 +00:00
Chris Lattner
cf111f5951
Remove unused var
...
llvm-svn: 14033
2004-06-05 00:03:27 +00:00
Chris Lattner
f609ec6329
Squelch a warning
...
llvm-svn: 14032
2004-06-04 23:53:20 +00:00
Chris Lattner
f6950439d6
Delete some unreachable code
...
llvm-svn: 14031
2004-06-04 23:52:36 +00:00
Misha Brukman
99137fd27a
* No more CachedWriter::setStream()
...
* ostream is back to being a reference instead of a pointer
* Output single characters as chars, not as length-1 strings
llvm-svn: 14030
2004-06-04 21:11:51 +00:00
Brian Gaeke
c6715bec89
Fix up some spacing & fix a typo in an assertion in cpValue2Value.
...
llvm-svn: 14027
2004-06-04 20:51:40 +00:00
Chris Lattner
871a5eb37c
Ugh, apparently there is no common ground here.
...
llvm-svn: 14026
2004-06-04 20:48:51 +00:00
Chris Lattner
2afbad063f
Don't send random junk to CachedWriter's. Also remove a cast that could be
...
problematic when Type does not derive from Value.
llvm-svn: 14022
2004-06-04 20:25:55 +00:00
Chris Lattner
4bd463c15e
Squish a warning
...
llvm-svn: 14020
2004-06-04 20:14:29 +00:00
Chris Lattner
c51b272047
This file is obsolete
...
llvm-svn: 14005
2004-06-04 00:15:21 +00:00
Chris Lattner
e78fedecf2
* Verify function prototypes, not just functions with bodies.
...
* Verify that functions do not take aggregates as arguments.
llvm-svn: 13984
2004-06-03 06:38:43 +00:00
Brian Gaeke
4f0fc86456
Add new internal-global-symbol mapping info pass... may its life be short
...
and sweet.
llvm-svn: 13983
2004-06-03 05:03:37 +00:00
Brian Gaeke
68eb7345df
Expand head-of-file comment.
...
llvm-svn: 13982
2004-06-03 05:03:02 +00:00
Brian Gaeke
e3a1c92896
Add new mapping info pass, when EmitMappingInfo is on.
...
llvm-svn: 13981
2004-06-03 05:03:01 +00:00
Brian Gaeke
ceb3e78152
Fix big mistake in my last checkin... the big question is, how did I ever
...
get this to link before?
llvm-svn: 13980
2004-06-03 05:03:00 +00:00
Brian Gaeke
a960c641e0
Add decl. for new mapping info pass factory method.
...
llvm-svn: 13979
2004-06-03 05:02:59 +00:00
Brian Gaeke
e3e792cefa
Collapse together the abstract superclass TargetRegInfo and SparcV9RegInfo, its
...
only concrete implementation.
llvm-svn: 13977
2004-06-03 02:45:09 +00:00
Chris Lattner
42730da855
<alloca.h> on cygwin pulls in a ton of stuff (macros and function protos)
...
that we REALLY don't want in the CBE code.
With this fix, the CBE passes all of the MultiSource tests on cygwin that
it does on linux. Yaay!
llvm-svn: 13975
2004-06-02 23:10:26 +00:00
Chris Lattner
a764d77ed3
Oops, this was not to go in
...
llvm-svn: 13958
2004-06-02 06:06:45 +00:00
Chris Lattner
ee2687a351
Adjust to the new TargetMachine interface
...
llvm-svn: 13957
2004-06-02 06:06:20 +00:00
Chris Lattner
0046ea7105
Adjust to new TargetMachine interface
...
llvm-svn: 13956
2004-06-02 05:57:12 +00:00
Chris Lattner
1dbe919e91
Inline findOptimalStorageSize into it's caller, both of which are sparc specific
...
llvm-svn: 13955
2004-06-02 05:56:52 +00:00
Chris Lattner
74da010962
Adjust to new TM interface
...
llvm-svn: 13954
2004-06-02 05:56:04 +00:00
Chris Lattner
ccfec9c7fd
Method has been inlined into all callers
...
llvm-svn: 13953
2004-06-02 05:55:48 +00:00
Chris Lattner
5ad9eaab1a
Convert to the new TargetMachine interface.
...
llvm-svn: 13952
2004-06-02 05:55:25 +00:00
Chris Lattner
4e2777cb30
Stubs are no longer needed
...
llvm-svn: 13951
2004-06-02 05:53:52 +00:00
Chris Lattner
5ce60a188d
Adjust to new TM interfaces
...
llvm-svn: 13949
2004-06-02 05:47:26 +00:00
Chris Lattner
7d6b37af05
Finegrainify namespacification
...
llvm-svn: 13948
2004-06-02 04:28:06 +00:00
Chris Lattner
98a6bb89cf
Fix a trivial but blatant bug
...
llvm-svn: 13947
2004-06-02 03:57:43 +00:00
Chris Lattner
2a058b248c
Implement the new CopyFile function
...
llvm-svn: 13945
2004-06-02 00:52:22 +00:00
Misha Brukman
cc25fb9142
Fix spelling, trim empty space, tighten up function header comment.
...
llvm-svn: 13940
2004-06-02 00:09:46 +00:00
Chris Lattner
2ac00d274f
Implement PR315: abort, don't warn, when missing external functions encountered
...
This fixes some critical problems building libstdc++ on cygwin.
llvm-svn: 13934
2004-06-01 21:49:00 +00:00
Brian Gaeke
56ae0e9023
Use new form of unconditional branch constructor.
...
llvm-svn: 13930
2004-06-01 20:06:10 +00:00
John Criswell
1a6863e08b
Modified calcTypeName() so that it does not allocate a std::string for
...
every recursive call.
This makes it more robust for deeply nested, unnamed types.
llvm-svn: 13915
2004-06-01 14:54:08 +00:00
Brian Gaeke
8b022564d2
There is no "mcff" here; delete the confusing comments that refer to it.
...
llvm-svn: 13911
2004-05-30 08:29:16 +00:00
Alkis Evlogimenos
f410424283
Pull Interval class out of LiveIntervals.
...
llvm-svn: 13910
2004-05-30 07:46:27 +00:00
Brian Gaeke
18006c7075
Transform an occurrence of if(...) { assert (0) }.
...
llvm-svn: 13908
2004-05-30 07:34:01 +00:00
Alkis Evlogimenos
2598a63586
When spilling an register, introduce a new temporary for each of its
...
spills. This allows for more flexibility when allocating registers for
spill code.
llvm-svn: 13907
2004-05-30 07:24:39 +00:00
Brian Gaeke
f2f7cc0d50
Reduce the amount of LLVM Values for which we save reg. allocator
...
state. Also, save the state for the incoming register of each phi
node.
llvm-svn: 13906
2004-05-30 07:08:43 +00:00
Brian Gaeke
7f4ad50481
Rename verifySavedState to dumpSavedState. Give it a new comment.
...
Call it at a more appropriate point.
llvm-svn: 13905
2004-05-30 04:22:24 +00:00
Brian Gaeke
b4f49d8da5
Insert machine instructions generated for Phi nodes into their
...
corresponding MachineCodeForInstruction vectors.
I need to be able to get the register allocated for the thing which is
called PhiCpRes in this code; this should make that task easier, plus,
Phi nodes are no longer "special" in the sense that their
MachineCodeForInstruction is empty.
llvm-svn: 13904
2004-05-30 03:33:49 +00:00
Brian Gaeke
2281858cf6
Fix typo in head-of-file comment.
...
llvm-svn: 13903
2004-05-30 03:33:48 +00:00
Reid Spencer
d98738fe4d
Fix a bug that Chris asserts emphatically is a bug. The changed clause
...
would always return false because the Type of a type value is always
Type::TypeTY and can never be a floating point type.
llvm-svn: 13902
2004-05-30 01:19:48 +00:00
Reid Spencer
00aca582a2
Moved this file to lib/Bytecode/Writer because its used there only.
...
llvm-svn: 13900
2004-05-30 00:09:32 +00:00
Brian Gaeke
8daa49f754
Remove unused #include.
...
llvm-svn: 13899
2004-05-29 23:26:13 +00:00
Brian Gaeke
7d68f2e9b0
Add comments.
...
llvm-svn: 13898
2004-05-29 23:10:20 +00:00
Brian Gaeke
3913fdf0e9
Trim whitespace.
...
llvm-svn: 13897
2004-05-29 22:49:51 +00:00
Brian Gaeke
608e0b76e1
Give InsertCodeForPhis() a new documentation comment.
...
llvm-svn: 13896
2004-05-29 22:20:59 +00:00
Alkis Evlogimenos
516e16441b
Add method to assign stack slot to virtual register without creating a
...
new one.
llvm-svn: 13895
2004-05-29 20:38:05 +00:00
Alkis Evlogimenos
c5923ac8b1
Add grow() member that grows the maps when the number of virtual
...
registers in the function has changed.
llvm-svn: 13893
2004-05-29 19:03:29 +00:00
Alkis Evlogimenos
d50a5109ff
Remove defs vector from live intervals.
...
llvm-svn: 13892
2004-05-29 16:18:57 +00:00
Chris Lattner
f1e8e0a0cf
Thoroughly rehack the dynamic linking mechanisms on Win32. The Win32
...
dynamic linker does not automatically search libraries when looking up
symbols with GetProcAddress. Because of this we have to emulate it. The
only detail is that there doesn't seem to be a way to enumerate the
libraries loaded, so we have a gross hack (tm).
This make the JIT functional on win32 under cygwin.
llvm-svn: 13887
2004-05-28 23:54:07 +00:00
Chris Lattner
1909d2de05
Prune #includes
...
llvm-svn: 13886
2004-05-28 23:35:39 +00:00
Tanya Lattner
a275dfcce4
updates to ModuloSched
...
llvm-svn: 13881
2004-05-28 20:14:12 +00:00
Brian Gaeke
403be90321
Give PhiCp nodes better names in many cases.
...
Simplify InsertPhiElimInstructions(), and give it a better doxygen comment.
llvm-svn: 13880
2004-05-28 19:34:00 +00:00
Brian Gaeke
2bd005cb45
Make debugging output with -print-machineinstrs more useful: always print out
...
the transformed LLVM code which is the input to the instruction selector.
llvm-svn: 13879
2004-05-28 19:33:59 +00:00
Chris Lattner
a49f11bec4
Fix the big regression that has been killing the nightly tester these last
...
few days. Apparently the old symbol table used to auto rename collisions in
the type symbol table and the new one does not. It doesn't really make sense
for the new one to do so, so we just make the client do it.
llvm-svn: 13877
2004-05-28 05:47:27 +00:00
Chris Lattner
9bf4cbeb4b
Don't use size() when you mean empty()
...
llvm-svn: 13876
2004-05-28 05:40:19 +00:00
Chris Lattner
37c8081a07
Minor efficiency gain: do 1 nlogn lookup instead of two
...
Code cleanup
llvm-svn: 13875
2004-05-28 05:36:49 +00:00
Chris Lattner
75036dce04
Minor changes. Switch to a SymbolTable remove that does not take linear time
...
llvm-svn: 13874
2004-05-28 05:30:51 +00:00
Chris Lattner
d702e10ea0
Fix one of the major things that is causing the C Backend to infinite loop
...
llvm-svn: 13872
2004-05-28 05:02:13 +00:00
Chris Lattner
928f12aa15
Add support for getting executable memory on Windows. This is actually
...
much easier than on unix. :) The only evil thing is that windows.h defines
a macro named FindExecutable, which collides with one of our names.
The JIT now runs on windows, but it cannot resolve external functions
(like printf) yet.
llvm-svn: 13871
2004-05-28 01:20:58 +00:00
Chris Lattner
2df71158fb
Add a new function for the JIT. libsupport is now the only library that
...
includes mman.h
llvm-svn: 13870
2004-05-28 00:59:40 +00:00
Chris Lattner
14dedcd354
Use the SystemUtils.h file to do our dirty work.
...
llvm-svn: 13868
2004-05-28 00:57:27 +00:00
Chris Lattner
12e4e9ea43
Add support for zero length files
...
llvm-svn: 13866
2004-05-28 00:34:42 +00:00
Chris Lattner
61876bd662
Use the new FileUtilities.h API for mapping a file into an address
...
space
llvm-svn: 13864
2004-05-28 00:24:41 +00:00
Chris Lattner
77bd6789a8
Add a pair of functions to hide system specific details of mapping a file in for reading.
...
llvm-svn: 13863
2004-05-28 00:23:48 +00:00
Reid Spencer
686af1f8bc
Remove some more dead code resulting from adding setTypeName().
...
llvm-svn: 13862
2004-05-28 00:21:06 +00:00
Reid Spencer
3077b8e168
Remove an assertion that uses Type::TypeTy that is never hit and will
...
break when Type::TypeTy goes away. Also remove a dead block of code and
dead comments.
llvm-svn: 13861
2004-05-27 22:05:50 +00:00
Reid Spencer
0030dfe486
Clean up a comment.
...
llvm-svn: 13860
2004-05-27 22:04:46 +00:00
Reid Spencer
693dcc2f89
Fix for bug 348.
...
The SymbolTable changes caused this one too.
llvm-svn: 13859
2004-05-27 21:58:13 +00:00
Brian Gaeke
76a1ec7f00
Make comment lines stick out less.
...
llvm-svn: 13858
2004-05-27 21:41:48 +00:00
Chris Lattner
d646e15d1a
Remove long unused #includes
...
llvm-svn: 13857
2004-05-27 21:25:44 +00:00
Chris Lattner
8014d498cb
These #includes are long dead
...
llvm-svn: 13856
2004-05-27 21:24:38 +00:00
John Criswell
e56868d266
Fix a bug in the -deadtypeelim pass. The SymbolTable re-write changed it
...
to eliminate the wrong type.
llvm-svn: 13855
2004-05-27 21:16:46 +00:00
Chris Lattner
91633c1b92
Fix warnings about reaching end of non-void function
...
llvm-svn: 13852
2004-05-27 20:57:01 +00:00
Chris Lattner
b45f773d5f
Add DynamicLinker support for systems that provide windows.h
...
llvm-svn: 13851
2004-05-27 20:53:10 +00:00
Reid Spencer
b2939fc651
Use the SymbolTable::isEmpty() method instead of checking for no value
...
planes. A SymbolTable could still have types in it! This fixes problems
with two regression tests that failed because a symbol table that only
contained types was being omitted from bytecode files. Thanks to Chris
for the reduced test case that helped find this immediately.
llvm-svn: 13842
2004-05-27 20:18:51 +00:00
Chris Lattner
736ca634a7
This code is a real mess, but at least get the JIT *building* on platforms
...
(such as plan 9) without mmap. Of course it won't RUN... but that's another
step. :)
llvm-svn: 13839
2004-05-27 18:03:56 +00:00
Chris Lattner
a7e4eba812
Add support for dos-style files
...
llvm-svn: 13837
2004-05-27 17:49:14 +00:00
Chris Lattner
97bd391386
Fix InstCombine/load.ll & PR347.
...
This code hadn't been updated after the "structs with more than 256 elements"
related changes to the GEP instruction. Also it was not handling the
ConstantAggregateZero class.
Now it does!
llvm-svn: 13834
2004-05-27 17:30:27 +00:00
Chris Lattner
c65ff058f3
Implement constant folding of fmod, which is used a lot in povray
...
llvm-svn: 13823
2004-05-27 07:25:00 +00:00
Chris Lattner
e91dc2545c
Restructure call constant folding code a bit to make it simpler
...
Add support for acos/asin/atan. 188.ammp contains three calls to acos with
constant arguments. Constant folding it allows elimination of those 3 calls
and three FP divisions of the results.
llvm-svn: 13821
2004-05-27 06:26:28 +00:00
Chris Lattner
a07e742087
Signals.h header moved. Eventually this should move into a lib/System library,
...
but not right now.
llvm-svn: 13811
2004-05-27 05:31:24 +00:00
Chris Lattner
fa8fd150ca
Changes to make libSupport build on systems that don't have the wait syscall.
...
llvm-svn: 13806
2004-05-27 01:20:55 +00:00
Alkis Evlogimenos
2c463a8a99
Add constructors that take a BasicBlock to append to, to the rest of
...
the llvm::Instruction hierarchy.
llvm-svn: 13800
2004-05-27 00:15:23 +00:00
Alkis Evlogimenos
7542a978fc
Do not pass a null pointer if this instruction is not prepended or
...
appended anywhere.
llvm-svn: 13798
2004-05-26 22:50:28 +00:00
Alkis Evlogimenos
bf27c54995
Inline trivial constructors.
...
llvm-svn: 13797
2004-05-26 22:07:18 +00:00
Reid Spencer
b7b1b9d4b2
Several clean ups suggested by Chris: remove tabs, make SlotMachine do lazy
...
initialization so we don't scan large Modules/Functions needlessly, tighten
up restrictions on what can be put in SlotMachine (no Constants that aren't
GlobalValues).
llvm-svn: 13796
2004-05-26 21:56:09 +00:00
Reid Spencer
9a0451787d
Provide the correct patch for bug 345. The solution is to add a setTypeName
...
function to llvmAsmParser.y and then use it in the one place in the grammar
that needs it. Also had to make Type::setName public because setTypeName
needs it in order to retain compatibility with setValueName.
llvm-svn: 13795
2004-05-26 21:48:31 +00:00
Alkis Evlogimenos
edff018f18
Refactor common initialization code in private init() functions.
...
This is a first step in supplying append to basic block constructors
for all instruction types.
llvm-svn: 13793
2004-05-26 21:41:09 +00:00
Alkis Evlogimenos
3c45e590c5
Use one destination constructor for the unconditional branch.
...
llvm-svn: 13792
2004-05-26 21:38:14 +00:00
Chris Lattner
a1a78f0b68
Fix PR344: the incorrect remove was being used.
...
llvm-svn: 13790
2004-05-26 17:20:52 +00:00
Chris Lattner
70d84370e1
A quick and ugly hack to fix PR345. I used TypeTy specifically to make
...
Reid cringe :)
llvm-svn: 13788
2004-05-26 17:08:25 +00:00
Reid Spencer
dccf1747a1
Part of bug 122:
...
This change removes the BuildBytecodeInfo flag from the SlotCalculator
class. This flag was needed to distinguish between the Bytecode/Writer
and the AsmWriter. Now that AsmWriter doesn't use SlotCalculator, we can
remove this flag and simplify some code. Also, some minor name changes
to CachedWriter.h needed to be committed (missed in previous commit).
llvm-svn: 13785
2004-05-26 07:37:11 +00:00
Reid Spencer
58bad426cc
Part of bug 122. Removed dependency of AsmWriter on SlotCalculator by
...
incorporating a significantly simpler "SlotMachine" into this file. The
SlotMachine is tailored for use by only the AsmWriter whose requirements
for slot numbers are vastly different than from the Bytecode/Writer. Code
change passes all Feature and Regression tests.
llvm-svn: 13784
2004-05-26 07:18:52 +00:00
Tanya Lattner
8c5d9dcc42
Adding scheduling class.
...
llvm-svn: 13783
2004-05-26 06:27:36 +00:00
Tanya Lattner
bd1298d574
Updating my cvs versions. THis is still in progress and much will be changed.
...
llvm-svn: 13782
2004-05-26 06:27:18 +00:00
Brian Gaeke
fd48b88dfa
Add a (not very meaningful) default constructor for AllocInfo objects.
...
llvm-svn: 13773
2004-05-25 20:43:47 +00:00
Reid Spencer
96fe333298
Put SlotTable.h inclusion back at front of list to be coding standards
...
compliant. Thanks, Chris.
llvm-svn: 13771
2004-05-25 20:09:05 +00:00
Reid Spencer
8e6d7148c1
Make the constructor explicit so we can't implicitly convert bool to
...
SlotTable.
llvm-svn: 13766
2004-05-25 19:09:25 +00:00
Reid Spencer
dc5f9c805c
Make some improvements suggested by Chris.
...
llvm-svn: 13765
2004-05-25 19:03:21 +00:00
Reid Spencer
92adcaf58c
Adding the initial implementation of the SlotTable class. This class is
...
the Abstract Data Type that holds slot number values and associates them
with Type* and Value*. The SlotTable is simply the holder of the slot
numbers and provides a controlled interface for building the table. It does
not enforce any particular idiom or functionality for manipulating the slot
numbers.
This is part of bug_122. The SlotCalculator and SlotMachine classes will
follow.
llvm-svn: 13764
2004-05-25 18:44:51 +00:00
Alkis Evlogimenos
84fac6229c
Remove this file as well as it is no longer needed nor it compiles
...
llvm-svn: 13762
2004-05-25 18:24:27 +00:00
Reid Spencer
756f392365
Document a couple functions.
...
llvm-svn: 13761
2004-05-25 18:14:38 +00:00
Reid Spencer
0e78929263
Changed to use SymbolTable's new iteration interfaces.
...
llvm-svn: 13759
2004-05-25 17:29:59 +00:00
Reid Spencer
1190d6061c
Changed to use SymbolTable's new lookup interface.
...
llvm-svn: 13758
2004-05-25 17:29:21 +00:00
Reid Spencer
2791d48685
Made it illegal to pass a Type* through one of the Value* interfaces. The
...
SymbolTable will now assert if this is done. This didn't find any incorrect
usage of SymbolTable but will prevent future mistakes until Type != Value.
llvm-svn: 13755
2004-05-25 15:20:47 +00:00
Reid Spencer
fec48b0d9d
Convert to SymbolTable's new iteration interface.
...
llvm-svn: 13754
2004-05-25 08:53:40 +00:00
Reid Spencer
e6cf613d2a
Convert to SymbolTable's new iteration interface. Remove tabs.
...
llvm-svn: 13753
2004-05-25 08:53:29 +00:00
Reid Spencer
e6e0da0b9f
Completely rewrote the class. SymbolTable now separates Type* from Value* in preparation\
...
for making Type not derive from Value. There are now separate interfaces \
for looking up, finding, and inserting Types and Values. There are also \
three separate iterator interfaces, one for type planes, one for the types \
(type type plane), and one for values within a type plane. See the \
documentation in the Header file.
llvm-svn: 13752
2004-05-25 08:52:42 +00:00
Reid Spencer
08e75b22a5
Convert to SymbolTable's new lookup and iteration interfaces.
...
llvm-svn: 13751
2004-05-25 08:52:20 +00:00
Reid Spencer
09c1dbce28
Remove unused header file.
...
llvm-svn: 13750
2004-05-25 08:51:36 +00:00
Reid Spencer
169865d831
Make this pass simply invoke SymbolTable::strip().
...
llvm-svn: 13749
2004-05-25 08:51:25 +00:00
Reid Spencer
65559ced22
Remove use of Type::TypeTy from an assert. It will go away soon.
...
llvm-svn: 13748
2004-05-25 08:50:52 +00:00
Reid Spencer
63530c743e
Get rid of a wart: useless getFILE function is now a cast macro.
...
llvm-svn: 13747
2004-05-25 08:46:15 +00:00
Vikram S. Adve
6026f572eb
Recognize memalign and friends, and handle them specially.
...
llvm-svn: 13741
2004-05-25 08:14:52 +00:00
Chris Lattner
66f55c8e78
Implement InstCombine:shift.ll:test16, which turns (X >> C1) & C2 != C3
...
into (X & (C2 << C1)) != (C3 << C1), where the shift may be either left or
right and the compare may be any one.
This triggers 1546 times in 176.gcc alone, as it is a common pattern that
occurs for bitfield accesses.
llvm-svn: 13740
2004-05-25 06:32:08 +00:00
Chris Lattner
84431acbf1
Implement some helpers
...
llvm-svn: 13738
2004-05-25 05:32:43 +00:00
Chris Lattner
b8fb5e789b
Implement instcombine/cast.ll:test16:
...
Canonicalize cast X to bool into a setne instruction
llvm-svn: 13736
2004-05-25 04:29:21 +00:00
Tanya Lattner
7cf16701f7
Moved MachineBasicBlock deconstructor to cpp file and removed it from LeakDetector to fix memory leak bug.
...
llvm-svn: 13718
2004-05-24 07:14:35 +00:00
Chris Lattner
79409ebc27
Fix a bug in my previous checkin
...
llvm-svn: 13717
2004-05-24 06:24:46 +00:00
Tanya Lattner
aabaaec037
Added MachineFunction parent* to MachineBasicBlock. Customized ilist template
...
to set the parent when a MachineBasicBlock is added to a MachineFunction.
llvm-svn: 13716
2004-05-24 06:11:51 +00:00
Chris Lattner
f38d51ea42
Eliminate an explicit use of the LLVM basic block, using getParent instead,
...
which simplifies the code
llvm-svn: 13707
2004-05-24 03:44:52 +00:00
Tanya Lattner
55477a5af1
Changed clone to be const.
...
Changed copy constructor to set parent, prev, and next pointers to null.
llvm-svn: 13706
2004-05-24 03:14:18 +00:00
Chris Lattner
52e7345268
Spelling people's names right is kinda important
...
llvm-svn: 13702
2004-05-23 21:27:29 +00:00
Chris Lattner
1e22b42cb6
Add support for accurate garbage collection to the LLVM code generators
...
llvm-svn: 13696
2004-05-23 21:23:35 +00:00
Chris Lattner
85f19c7b3f
Add some notes to myself, no functional changes
...
llvm-svn: 13695
2004-05-23 21:23:12 +00:00
Chris Lattner
5862899c44
minor wording change
...
llvm-svn: 13694
2004-05-23 21:22:55 +00:00
Chris Lattner
fbdf40f86a
Fix cases where we missed inlining some more obvious candidates because the
...
caller was in an SCC.
llvm-svn: 13693
2004-05-23 21:22:17 +00:00
Chris Lattner
bf8b81252f
Simplify the interface and remove an unneeded #include
...
llvm-svn: 13692
2004-05-23 21:21:35 +00:00
Chris Lattner
fee8ce6131
Fairly substantial changes to update the alias analysis we are querying as
...
we make the transformation. This allows us to use interprocedural alias
analyses successfully.
llvm-svn: 13691
2004-05-23 21:21:17 +00:00
Chris Lattner
cf81f974b8
Adjust to the changes in the AliasSetTracker interface
...
llvm-svn: 13690
2004-05-23 21:20:19 +00:00
Chris Lattner
33de90e8c6
Add support for replacement of formal arguments with simpler expressions.
...
llvm-svn: 13689
2004-05-23 21:19:55 +00:00
Chris Lattner
f113f6a630
Implement the -lowergc pass which is used by code generators (like the CBE)
...
that do not have builtin support for garbage collection.
llvm-svn: 13688
2004-05-23 21:19:22 +00:00
Chris Lattner
5f65590915
Recognize and verify the new GC intrinsics.
...
llvm-svn: 13687
2004-05-23 21:16:51 +00:00
Chris Lattner
dd4c06d2bf
Changes to work with the changes to the AliasAnalysis interface. The -no-aa
...
class is now in the BasicAliasAnalysis.cpp file
llvm-svn: 13684
2004-05-23 21:15:48 +00:00
Chris Lattner
7ccc4c2ed9
Move the -no-aa AA implementation into this file since both of these
...
alias analysis implementations are special: they do not autoforward to a
chained implementation of alias analysis
llvm-svn: 13683
2004-05-23 21:15:12 +00:00
Chris Lattner
1336a3f17a
Updates to work with the new auto-forwarding AA interface changes
...
llvm-svn: 13682
2004-05-23 21:14:27 +00:00
Chris Lattner
0e1a543d88
Fix a really nasty bug with the -disable-ds-field-sensitivity option
...
llvm-svn: 13681
2004-05-23 21:14:09 +00:00
Chris Lattner
89353483d6
Update to match the autochaining interface that the AA interface uses
...
llvm-svn: 13680
2004-05-23 21:13:51 +00:00
Chris Lattner
6c71895a16
Implement the interfaces to update value numbering information. Add an
...
assert.
llvm-svn: 13679
2004-05-23 21:13:24 +00:00
Chris Lattner
0588bd19d2
Rename a method
...
llvm-svn: 13676
2004-05-23 21:10:58 +00:00
Chris Lattner
fa5d566d95
Add a simple implementation of Andersen's interprocedural pointer analysis
...
llvm-svn: 13666
2004-05-23 21:00:47 +00:00