Commit Graph

13506 Commits

Author SHA1 Message Date
Reid Spencer
a60ff2e144 A utility to run an arbitrary program on each of the LLVM source files.
This is like llvmgrep but instead of running grep, it runs the command
given by the first argument. For example, to find the top ten files with
the most lines in llvm, you could:

utils/llvmdo wc -l | sort -nb | tail

Or, to find any source files with the wrong permissions, you could:

utils/llvmdo ls -l | grep -v rw-r--r--

Hopefully, you get the idea.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15246 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 22:52:44 +00:00
Misha Brukman
ab640a5728 Do not store the stack pointer if the stack size is 0.
Also, convert C-style comments to C++ and make sure code wraps at 80 cols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15245 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 22:00:26 +00:00
Misha Brukman
3ada3e3f82 ADDI can take several forms, including:
addi r1, r2, 0
  addi r1, <frame index #n>, 0

so we must check for the second parameter being a register for this instruction
to be considered a reg-to-reg copy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15244 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 21:50:38 +00:00
Misha Brukman
8790d47453 assert() on MachineInstr properties instead of checking them dynamically
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15243 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 21:35:58 +00:00
Misha Brukman
774a297c83 * Recognize `addi r1, r2, 0' a move instruction
* List formats of instructions currently recognized as moves


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15242 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 21:29:00 +00:00
Chris Lattner
1aab327293 Remove dead section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15241 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 21:16:55 +00:00
Misha Brukman
8606aea117 Fix indentation: should be 2 spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15240 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 18:48:58 +00:00
Misha Brukman
91b5ca838a Fix file header as it has been renamed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15239 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 18:45:48 +00:00
Misha Brukman
c6d398abbb Renamed files to have the `X86' prefix for uniqueness purposes.
All CVS history was renamed, the *,v were copied over.  No worries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15238 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 18:43:11 +00:00
Misha Brukman
b097f216b0 * Rewrote casts
* Implemented GEP folding
* Dynamically output global address stuff once per function
* Fix casting fp<->short/byte

Patch contributed by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15237 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 18:13:24 +00:00
Misha Brukman
cf8d244394 Increment the label number in runOnFunction() rather than while printing out
some instruction.  Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15236 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 16:28:33 +00:00
Misha Brukman
bb966a4a59 More notes on bugs, unimplemented features, and suggested code improvements.
Written by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15235 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 16:23:55 +00:00
Misha Brukman
3c616b45e7 Fix subtracting values > 2^15 in the prologue/epilogue, by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15234 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 16:22:52 +00:00
Reid Spencer
8f6c42ba84 Added another test case for double FP constants as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15233 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 15:04:13 +00:00
Chris Lattner
a000279a7d Implement DeadStoreElim/alloca.llx by observing that allocas are dead at the
end of the function (either return or unwind)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15232 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 06:14:11 +00:00
Chris Lattner
a00064a383 New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15231 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 06:11:42 +00:00
Chris Lattner
61d462760b Add some new methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15230 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 05:50:23 +00:00
Chris Lattner
558cb5f4a1 New methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15229 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 05:50:09 +00:00
Chris Lattner
8ea3f1b3bc Update test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15228 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 05:04:25 +00:00
Chris Lattner
595ee7ec26 Throttle back indvar substitution from creating multiplies in loops. This is bad bad bad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15227 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 02:47:12 +00:00
Chris Lattner
8d65a06a3e Fix bug in previous patch :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15226 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 01:40:20 +00:00
Chris Lattner
badf091b47 Fix an extremely serious regression that was causing LLVM basic blocks to be
scrambled around almost at random, having really bad effects on icache locality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15225 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 01:22:59 +00:00
Chris Lattner
1d78516c65 Fix a serious bug in the double constant reader. In particular, because
(At[3] << 24) is an int type and it is being coerced to uint64_t, it was
getting sign extended, causing us to get FFFFFFFFxxxxxxxx constants all of
the time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15224 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 23:15:44 +00:00
Chris Lattner
a9d790c831 Temporarily disable this code, as it is emitting LLVM_NAN("nan") which results in a call to the
glibc 'nan' function because the initializer is not a string.  This breaks when used in a global
initializer.  Try compiling this testcase for example:

%X = global float <some nan value>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15223 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 22:36:35 +00:00
Reid Spencer
f847432f77 Bugs fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15222 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 22:15:33 +00:00
Reid Spencer
cddc86f27c Avoid use of size(), which counts, in favor of other mechanisms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15221 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:44:54 +00:00
Reid Spencer
ada1618afa Always write FP values correctly.
Adjust for new Module.h interface for dependent libraries.
Excise unused backwards compatibility flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15220 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:36:26 +00:00
Reid Spencer
7d146e1107 Don't create a backwards compatibility flag for something that was a
regression bug introduced in release 1.2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15219 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:32:51 +00:00
Reid Spencer
5ac8812c54 Adjust to new Module.h interface for dependent libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15218 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:32:02 +00:00
Reid Spencer
feaf10e571 Adjust to new Module.h interface for dependent libraries
Remove mem leaks resulting from not freeing parse strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15217 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:30:51 +00:00
Reid Spencer
c9a1f0dcdd Adjust to new Module.h interface for dependent libraries
Only write the target triple and deplibs if they are non-empty.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15216 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:29:43 +00:00
Reid Spencer
641588bb3e Reduce the footprint of the dependent library interface
Document the dependent library interface
Constify the std::string& parameters in the dep lib interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15215 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:28:19 +00:00
Chris Lattner
34a1005737 Fix a latent bug in the AliasSetTracker that was exposed by the FreeInst additions and broke a bunch of programs last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15214 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:32:01 +00:00
Reid Spencer
c5b27621e0 bug 263:
Add target triple and dependent libraries support to this test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15213 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:09:47 +00:00
Reid Spencer
801db47373 bug 263:
Ensure the list of libraries is cleared.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15212 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:08:57 +00:00
Reid Spencer
83f6a77c8f bug 263:
Add ability to write target triple and dependent libraries information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15211 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:08:18 +00:00
Reid Spencer
ad89bd6a1a bug 263:
- encode/decode target triple and dependent libraries
bug 401:
- fix encoding/decoding of FP values to be little-endian only
bug 402:
- initial (compatible) cut at 24-bit types instead of 32-bit
- reduce size of block headers by 50%
Other:
- cleanup Writer by consolidating to one compilation unit, rem. other files
- use a std::vector instead of std::deque so the buffer can be allocated
  in multiples of 64KByte chunks rather than in multiples of some smaller
  (default) number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15210 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:07:36 +00:00
Reid Spencer
0be13e7f14 bug 263:
Provide parsing for the target triple and dependent libraries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15209 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 17:58:28 +00:00
Reid Spencer
3cd2fe3d2f bug 263:
Provide new tokens for target triples and dependent libraries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15208 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 17:56:00 +00:00
Reid Spencer
af8ea13dd6 bug 263:
The necessary changes to module in order to support both target triples and
a list of dependent libraries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15207 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 17:52:27 +00:00
Reid Spencer
7105f4ae8c bug 402:
A new set of block identifiers has been added for version 1.3 so that the
range of values can fit within 5 bits. This aids in halving the size of
block headers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15206 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 17:50:00 +00:00
Chris Lattner
002f29b0f0 Codify my thoughts on where we want to end up with the target-independent
code generator.  Comments welcome.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15205 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 12:13:35 +00:00
Chris Lattner
70e9b59b0e * Substantially simplify how free instructions are handled (potentially fixing
a bug in DSE).
* Delete dead operand uses iteratively instead of recursively, using a
  SetVector.
* Defer deletion of dead operand uses until the end of processing, which means
  we don't have to bother with updating the AliasSetTracker.  This speeds up
  DSE substantially.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15204 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 11:09:56 +00:00
Chris Lattner
f90fcaf572 Add back() and pop_back() methods to SetVector
Move clear to the end of the class
Add assertions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15203 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 11:07:02 +00:00
Alkis Evlogimenos
5a0a1c2cba Add some comments to the backtracking code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15200 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 08:10:33 +00:00
Chris Lattner
a9e2f3d0ab Free instructions kill values too. This implements DeadStoreElim/free.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15199 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:58:38 +00:00
Chris Lattner
9ec6e46ad8 New testcase for DSE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15198 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:57:50 +00:00
Chris Lattner
5c88260f70 Add support for free instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15197 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:57:37 +00:00
Chris Lattner
c25b55a5b2 Fix the sense of joinable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15196 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:47:25 +00:00
Chris Lattner
d67e439241 Remove linux/solaris specific stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15195 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:34:00 +00:00