1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 14:32:51 +01:00
Commit Graph

6410 Commits

Author SHA1 Message Date
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