Commit Graph

3361 Commits

Author SHA1 Message Date
Chris Lattner
9da0715aa4 Add Module::dump() method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3375 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 23:32:47 +00:00
Chris Lattner
58dda9a8f2 Add Module::dump() method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3374 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 23:32:42 +00:00
Chris Lattner
09674a297b Add a simple testcase that just uses a CPR instead of a CPR & ConstExpr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3373 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 23:20:37 +00:00
Chris Lattner
4a2211e980 New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3372 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 22:57:52 +00:00
Chris Lattner
374a0950cc Do not leak memory for passes when using -stopAfterNPasses or -stopraise
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3371 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 22:40:03 +00:00
Chris Lattner
0e4ca08843 Run GlobalDCE before deadtypeelim so that we do not retain types for global
variables that are obviously dead.  The most common case is %FILE


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3370 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 22:38:02 +00:00
Chris Lattner
22de210b60 Include a basic simple test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3369 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 22:36:45 +00:00
Chris Lattner
9b76123124 Promote getelementptr instructions to constexprs if we can.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3368 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 22:21:59 +00:00
Chris Lattner
e4619181cc Fix stupid oversight of missing #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3367 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 22:02:41 +00:00
Chris Lattner
7473413072 - Finally nailed: test/Regression/Assembler/2002-08-16-ConstExprInlined.llx
- ParseConstantPool was resolving reference to value using the function
      slot # instead of the global slot #.
  - Bytecode reader changes:
    - Remove the failure<> template from Bytecode Reader
    - Remove extraneous #includes
    - s/method/function/ a bit
    - Eliminate the fwdRefs class that just added abstraction where it was not
      needed, making things more complex.
    - Use a vector instead of a list for function signatures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3366 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 22:01:27 +00:00
Chris Lattner
8e28a70044 Throw purify temporary files into /shared if we have it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3365 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 21:39:58 +00:00
Chris Lattner
edf6a84a75 Add new testcase for gep instruction -> get constexpr promotion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3364 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-16 21:18:21 +00:00
Chris Lattner
1c93e5bd26 Changed parser to always use parenthesis on ConstExprs to be consistent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3363 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-16 21:17:11 +00:00
Chris Lattner
d78700de8e - Remove unused STRING token from lexer & parser
- Changed parser to always use parenthesis on ConstExprs to be consistent
  - Parser now passes TRUE and FALSE tokens as a special case of the ConstExpr
    machinery instead of a special case of constant int stuff
  - Fix the AsmParser to use ValueRef ::= ConstExpr, and remove
    ResolvedVal ::= ConstExpr this allows constexprs to be used in PHI nodes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3362 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-16 21:14:40 +00:00
Chris Lattner
750b9b080d Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3361 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-16 19:34:33 +00:00
Chris Lattner
a9c677e41b New testcase distilled from much larger problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3360 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-16 16:54:52 +00:00
Chris Lattner
85907a64c2 Convert constexpr over to new syntax
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3359 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 21:14:39 +00:00
Chris Lattner
81003a4cc4 New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3358 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 21:08:38 +00:00
Chris Lattner
d1c58ac7c3 Make 'features' testsuite work with the /shared changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3357 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 19:49:06 +00:00
Chris Lattner
83a278efad Convert testcase to use correct syntax
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3356 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 19:48:48 +00:00
Chris Lattner
9edfe8aa18 Add another testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3355 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 19:38:03 +00:00
Chris Lattner
95586b8c83 Write constexpr casts using the cast X to Y notation, not using the implicit
type result


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3354 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 19:37:43 +00:00
Chris Lattner
ec1b8a0796 Parse const expr cast instruction the same way the instruction is formed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3353 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 19:37:11 +00:00
Chris Lattner
2b4dcbb91d Add a note mentioning that bools promote to 0 or 1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3352 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 19:36:05 +00:00
Chris Lattner
d05e359b10 Move ConstExpr production to unify ConstVal stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3351 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 18:17:28 +00:00
Chris Lattner
3101c25293 Fix bug: test/Regression/Assembler/2002-08-15-UnresolvedGlobalReference.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3350 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 17:58:33 +00:00
Chris Lattner
657882cf6e There seem to be issues with constant exprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3349 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 17:04:40 +00:00
Chris Lattner
96ad1ec876 Simplify the code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3348 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 16:15:36 +00:00
Chris Lattner
3ecce66e25 Handle more cases of cast-of-cast in more general forms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3347 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 16:15:25 +00:00
Chris Lattner
c5b74477c0 Remove the last traces of the NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3346 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 16:14:49 +00:00
Chris Lattner
8decbcbbfe Add a bunch of testcases for cast-of-casts that should be removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3345 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 16:13:29 +00:00
Vikram S. Adve
917d551969 Change opLabel numbers for Not and BNot.
Also, these tree nodes are now binary, not unary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3344 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 14:20:45 +00:00
Vikram S. Adve
85af131d9e Unary Not (boolean and bitwise) is no longer a separate LLVM instruction
but is instead implemented with XOR.  Note that the InstrForest opLabels
for Not and BNot remain the same, i.e., the XOR is recognized and
represented as a (boolean or bitwise) Not when building the instruction
trees.  But these tree nodes are now binary, not unary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3343 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 14:19:22 +00:00
Vikram S. Adve
ce08e1dd3e Revise code generation for unary Not (boolean and bitwise), which is
no longer a separate instruction but is instead implemented with XOR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3342 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 14:17:37 +00:00
Vikram S. Adve
1718337cf7 Added more helper functions for binary instructions emulating
unary Neg and Not: isNeg, isNot, getNegArgument, and getNotArgument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3341 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 14:15:48 +00:00
Vikram S. Adve
0f63e22e84 Add tests for unary NOT operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3340 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 14:09:56 +00:00
Chris Lattner
5cf6f112e6 Implement capability to fold this:
uint %test4(int %A, int %B) {
        %COND = setlt int %A, %B                ; <bool> [#uses=1]
        %result = cast bool %COND to uint               ; <uint> [#uses=1]
        ret uint %result
}
into a single cast instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3339 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 23:21:10 +00:00
Chris Lattner
8360d0922a Fix testcase to actually test what we think we are
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3338 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 23:01:19 +00:00
Chris Lattner
b9a7793ecb Avoid creating 'load X, 0' instead of just 'load X'
This _trivial_ change causes GCSE and LICM to be much more effective at
hoisting loads.  Before it would not be able to eliminate 'load X' if there
was just a dominating 'load X, 0' because the expressions were not identical.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3337 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 22:11:52 +00:00
Chris Lattner
db6e4d6625 Avoid inserting an entry block unless we need it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3336 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 21:35:02 +00:00
Chris Lattner
7ce83e576a Gross, some whitespace escaped
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3335 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 20:07:01 +00:00
Chris Lattner
17a4c3ecfb Fix bug in documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3334 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 20:06:13 +00:00
Chris Lattner
d022471260 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3333 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 19:29:38 +00:00
Chris Lattner
a939a1e664 This file does not belong here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3332 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 19:29:32 +00:00
Chris Lattner
f39c24cbeb Fix tests that use the now dead not instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3331 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 19:28:22 +00:00
Chris Lattner
985792d870 Fix testcases that used to now dead 'not' instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3330 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 19:28:09 +00:00
Chris Lattner
d0cad7a5f5 Change not's to xors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3329 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 19:26:34 +00:00
Chris Lattner
ad333484ea Remove support for Not ConstantExpr. This simplifies the unary case to only
have to support the cast instruction, so the function is renamed to getCast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3328 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:24:09 +00:00
Chris Lattner
9b2b80fd48 Fix bug introduced in last checkin due to CastInst not being visible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3327 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:22:19 +00:00
Chris Lattner
9c16dba29f Remove support for unary operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3326 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:19:46 +00:00