Commit Graph

3190 Commits

Author SHA1 Message Date
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
Chris Lattner
935bb0d071 Remove reference to GenericUnaryInst class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3325 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:18:50 +00:00
Chris Lattner
30551d02f5 Remove support for unary instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3324 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:18:28 +00:00
Chris Lattner
0513e9fe03 Remove support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3323 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:18:02 +00:00
Chris Lattner
48a4531ee4 Remove extra #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3322 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:17:32 +00:00
Chris Lattner
f4e3c006ac Remove constant propogation support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3321 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:17:07 +00:00
Chris Lattner
20e8e01c5d Remove support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3320 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:00:52 +00:00
Chris Lattner
e489aa563c Remove information about dead 'not' instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3319 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:55:59 +00:00
Chris Lattner
b804760b56 Remove support for unary operators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3318 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:53:45 +00:00
Chris Lattner
a9261ff5b7 Implement two constructor functions for "unary" instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3317 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:52:27 +00:00
Chris Lattner
589fda514c Remove support forNOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3316 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:52:06 +00:00
Chris Lattner
af2930efa0 - Fix InstCombine pass to not generate or process NOT instructions
- Fixed testcases to not use them either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3315 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:51:49 +00:00
Chris Lattner
75309f844a Expose two new static methods from BinaryOperator: createNeg, createNot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3314 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:51:29 +00:00
Chris Lattner
e4c3764a9f Remove support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3313 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:45:39 +00:00
Chris Lattner
500888b7e8 Remove illegal test now that not instruction does not exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3312 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:44:00 +00:00
Chris Lattner
3a6c063699 Make sure there is SOME output always so the test is not rerun when unneccesary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3311 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:38:15 +00:00
Chris Lattner
23fbe30bc3 The not instruction is just a specialized form of XOR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3310 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:37:04 +00:00
Chris Lattner
699f1eb214 AsmParser turns 'not' instructions into 'xor' instructions now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3309 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:12:33 +00:00
Chris Lattner
227b86c5fb Return null on failure, instead of aborting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3308 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:12:13 +00:00
Vikram S. Adve
a7710518da Add method MachineInstr::substituteValue() which substitutes
one Value with another one in all operands and implicit references
of the machine instruction.

Also add method MachineOperand::getVRegValueOrNull().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3307 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 16:54:11 +00:00
Vikram S. Adve
e2a78e3186 Add method MachineInstr::substituteValue() which substitutes
one Value with another one in all operands and implicit references
of the machine instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3306 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 16:52:58 +00:00
Chris Lattner
cefbd32637 Updated GettingStarted guide to be accurate now that binaries are in /shared
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3305 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-13 21:10:30 +00:00