oota-llvm.git
17 years agoFor PR601:
Reid Spencer [Tue, 27 Mar 2007 02:49:31 +0000 (02:49 +0000)]
For PR601:
Add a little flesh to the document skeleton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35377 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSDISel does not preserve all, it changes CFG and other info.
Evan Cheng [Tue, 27 Mar 2007 00:53:36 +0000 (00:53 +0000)]
SDISel does not preserve all, it changes CFG and other info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35376 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDon't call getOperandConstraint() if operand index is greater than
Evan Cheng [Tue, 27 Mar 2007 00:48:28 +0000 (00:48 +0000)]
Don't call getOperandConstraint() if operand index is greater than
TID->numOperands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35375 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSpell check.
Devang Patel [Tue, 27 Mar 2007 00:16:08 +0000 (00:16 +0000)]
Spell check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35374 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement some minor review feedback.
Reid Spencer [Mon, 26 Mar 2007 23:58:26 +0000 (23:58 +0000)]
Implement some minor review feedback.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35373 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAnother test case for PR1271 where bad shift masks were generated.
Reid Spencer [Mon, 26 Mar 2007 23:48:52 +0000 (23:48 +0000)]
Another test case for PR1271 where bad shift masks were generated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35372 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1271:
Reid Spencer [Mon, 26 Mar 2007 23:45:51 +0000 (23:45 +0000)]
For PR1271:
Fix another incorrectly converted shift mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35371 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoReduce malloc/free traffic.
Devang Patel [Mon, 26 Mar 2007 23:19:29 +0000 (23:19 +0000)]
Reduce malloc/free traffic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35370 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoIt is not possible to determie dominance between two PHI nodes
Devang Patel [Mon, 26 Mar 2007 23:18:28 +0000 (23:18 +0000)]
It is not possible to determie dominance between two PHI nodes
based on their ordering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35369 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUse std::vector<DFCalculateWorkObject> instead of
Devang Patel [Mon, 26 Mar 2007 23:17:19 +0000 (23:17 +0000)]
Use std::vector<DFCalculateWorkObject> instead of
std::vector<DFCalculateWorkObject *> to reduce malloc/free traffic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35368 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTest case for PR1266.
Evan Cheng [Mon, 26 Mar 2007 22:58:35 +0000 (22:58 +0000)]
Test case for PR1266.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35367 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofindRegisterUseOperand() changed.
Evan Cheng [Mon, 26 Mar 2007 22:41:48 +0000 (22:41 +0000)]
findRegisterUseOperand() changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35366 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix for PR1266. Don't mark a two address operand IsKill.
Evan Cheng [Mon, 26 Mar 2007 22:40:42 +0000 (22:40 +0000)]
Fix for PR1266. Don't mark a two address operand IsKill.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35365 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1277:
Reid Spencer [Mon, 26 Mar 2007 22:38:01 +0000 (22:38 +0000)]
For PR1277:
Implement error handling for bytecode parsing.

Patch by Scott Michel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35364 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoChange findRegisterUseOperand() to return operand index instead.
Evan Cheng [Mon, 26 Mar 2007 22:37:45 +0000 (22:37 +0000)]
Change findRegisterUseOperand() to return operand index instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35363 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix reversed logic in getRegsUsed. Rename RegStates to RegsAvailable to
Dale Johannesen [Mon, 26 Mar 2007 22:23:54 +0000 (22:23 +0000)]
Fix reversed logic in getRegsUsed.  Rename RegStates to RegsAvailable to
hopefully forestall similar errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35362 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoeliminate use of std::set
Chris Lattner [Mon, 26 Mar 2007 20:40:50 +0000 (20:40 +0000)]
eliminate use of std::set

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35361 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a comment to explain a folding transform.
Reid Spencer [Mon, 26 Mar 2007 20:09:02 +0000 (20:09 +0000)]
Add a comment to explain a folding transform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35360 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix this test case to match output after a bug was fixed.
Reid Spencer [Mon, 26 Mar 2007 18:04:38 +0000 (18:04 +0000)]
Fix this test case to match output after a bug was fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35359 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoGet better debug output by having modified instructions print both the
Reid Spencer [Mon, 26 Mar 2007 17:44:01 +0000 (17:44 +0000)]
Get better debug output by having modified instructions print both the
original and new instruction. A slight performance hit with ostringstream
but it is only for debug.
Also, clean up an uninitialized variable warning noticed in a release build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35358 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoGet the number of bits to set in a mask correct for a shl/lshr transform.
Reid Spencer [Mon, 26 Mar 2007 17:18:58 +0000 (17:18 +0000)]
Get the number of bits to set in a mask correct for a shl/lshr transform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35357 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix testsuite hang.
Duncan Sands [Mon, 26 Mar 2007 10:59:13 +0000 (10:59 +0000)]
Fix testsuite hang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35355 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR601:
Reid Spencer [Mon, 26 Mar 2007 09:32:31 +0000 (09:32 +0000)]
For PR601:
Initial skeleton for pass documentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35354 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoPromote to v1i64 type...
Bill Wendling [Mon, 26 Mar 2007 08:03:33 +0000 (08:03 +0000)]
Promote to v1i64 type...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35353 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUpdated.
Bill Wendling [Mon, 26 Mar 2007 07:55:58 +0000 (07:55 +0000)]
Updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35352 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd support for the v1i64 type. This makes better code for this:
Bill Wendling [Mon, 26 Mar 2007 07:53:08 +0000 (07:53 +0000)]
Add support for the v1i64 type. This makes better code for this:

#include <mmintrin.h>

extern __m64 C;

void baz(__v2si *A, __v2si *B)
{
  *A = C;
  _mm_empty();
}

We get this:

_baz:
        call "L1$pb"
"L1$pb":
        popl %eax
        movl L_C$non_lazy_ptr-"L1$pb"(%eax), %eax
        movq (%eax), %mm0
        movl 4(%esp), %eax
        movq %mm0, (%eax)
        emms
        ret

GCC gives us this:

_baz:
        pushl   %ebx
        call    L3
"L00000000001$pb":
L3:
        popl    %ebx
        subl    $8, %esp
        movl    L_C$non_lazy_ptr-"L00000000001$pb"(%ebx), %eax
        movl    (%eax), %edx
        movl    4(%eax), %ecx
        movl    16(%esp), %eax
        movl    %edx, (%eax)
        movl    %ecx, 4(%eax)
        emms
        addl    $8, %esp
        popl    %ebx
        ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35351 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSIGN_EXTEND_INREG requires one extra operand, a ValueType node.
Evan Cheng [Mon, 26 Mar 2007 07:12:51 +0000 (07:12 +0000)]
SIGN_EXTEND_INREG requires one extra operand, a ValueType node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35350 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTest case for PR1271 involving construction of a bad mask to replace a
Reid Spencer [Mon, 26 Mar 2007 05:32:16 +0000 (05:32 +0000)]
Test case for PR1271 involving construction of a bad mask to replace a
shift instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35349 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1271:
Reid Spencer [Mon, 26 Mar 2007 05:25:00 +0000 (05:25 +0000)]
For PR1271:
Fix SingleSource/Regression/C/2003-05-21-UnionBitFields.c by changing a
getHighBitsSet call to getLowBitsSet call that was incorrectly converted
from the original lshr constant expression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35348 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoLook through bitcast when finding IVs. (Chris' patch really.)
Dale Johannesen [Mon, 26 Mar 2007 03:01:27 +0000 (03:01 +0000)]
Look through bitcast when finding IVs.  (Chris' patch really.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35347 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoStart value symbol tables out small (space for 16 elts), not huge (space for 512).
Chris Lattner [Mon, 26 Mar 2007 01:45:35 +0000 (01:45 +0000)]
Start value symbol tables out small (space for 16 elts), not huge (space for 512).

This is particularly useful for the JIT, which lazily deserializes functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35346 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd "feature" testcase for new switch lowering code
Anton Korobeynikov [Sun, 25 Mar 2007 22:01:14 +0000 (22:01 +0000)]
Add "feature" testcase for new switch lowering code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35345 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCompute getLowBitsSet correctly. Using the complement of a 64-bit value
Reid Spencer [Sun, 25 Mar 2007 21:58:42 +0000 (21:58 +0000)]
Compute getLowBitsSet correctly. Using the complement of a 64-bit value
and shifting down without regard for the bitwidth of the APInt can lead
to incorrect initialization values. Instead, check for the word size case
(to avoid undef results from shift) and then do (1 << loBitsSet) - 1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35344 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a test case for PR1271 (necessary, but not sufficient).
Reid Spencer [Sun, 25 Mar 2007 21:30:41 +0000 (21:30 +0000)]
Add a test case for PR1271 (necessary, but not sufficient).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35343 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1271:
Reid Spencer [Sun, 25 Mar 2007 21:11:44 +0000 (21:11 +0000)]
For PR1271:
Remove a use of getLowBitsSet that caused the mask used for replacement of
shl/lshr pairs with an AND instruction to be computed incorrectly. Its not
clear exactly why this is the case. This solves the disappearing shifts
problem, but it doesn't fix Regression/C/2003-05-21-UnionBitFields. It
seems there is more going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35342 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoimplement Transforms/InstCombine/cast2.ll:test3 and PR1263
Chris Lattner [Sun, 25 Mar 2007 20:43:09 +0000 (20:43 +0000)]
implement Transforms/InstCombine/cast2.ll:test3 and PR1263

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35341 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agonew testcase
Chris Lattner [Sun, 25 Mar 2007 20:42:40 +0000 (20:42 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35340 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSome cleanup from review:
Reid Spencer [Sun, 25 Mar 2007 19:55:33 +0000 (19:55 +0000)]
Some cleanup from review:
* Don't assume shift amounts are <= 64 bits
* Avoid creating an extra APInt in SubOne and AddOne by using -- and ++
* Add another use of getLowBitsSet
* Convert a series of if statements to a switch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35339 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFirst step of switch lowering refactoring: perform worklist-driven
Anton Korobeynikov [Sun, 25 Mar 2007 15:07:15 +0000 (15:07 +0000)]
First step of switch lowering refactoring: perform worklist-driven
strategy, emit JT's where possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35338 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix authorship
Anton Korobeynikov [Sun, 25 Mar 2007 13:44:26 +0000 (13:44 +0000)]
Fix authorship

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35337 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofold constantexprs more aggressively, fixing PR1265
Chris Lattner [Sun, 25 Mar 2007 05:47:04 +0000 (05:47 +0000)]
fold constantexprs more aggressively, fixing PR1265

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35336 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRefactor several ConstantExpr::getXXX calls with ConstantInt arguments
Reid Spencer [Sun, 25 Mar 2007 05:33:51 +0000 (05:33 +0000)]
Refactor several ConstantExpr::getXXX calls with ConstantInt arguments
using the facilities of APInt. While this duplicates a tiny fraction of
the constant folding code, it also makes the code easier to read and
avoids large ConstantExpr overhead for simple, known computations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35335 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd a note
Chris Lattner [Sun, 25 Mar 2007 05:10:46 +0000 (05:10 +0000)]
add a note

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35334 91177308-0d34-0410-b5e6-96231b3b80d8

17 years ago1. Avoid unnecessary APInt construction if possible.
Zhou Sheng [Sun, 25 Mar 2007 05:01:29 +0000 (05:01 +0000)]
1. Avoid unnecessary APInt construction if possible.
2. Use isStrictlyPositive() instead of isPositive() in two places where
   they need APInt value > 0 not only >=0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35333 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement support for vector operands to inline asm, implementing
Chris Lattner [Sun, 25 Mar 2007 05:00:54 +0000 (05:00 +0000)]
Implement support for vector operands to inline asm, implementing
CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35332 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agonew testcase
Chris Lattner [Sun, 25 Mar 2007 05:00:23 +0000 (05:00 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35331 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd a note
Chris Lattner [Sun, 25 Mar 2007 04:46:28 +0000 (04:46 +0000)]
add a note

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35330 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix CodeGen/PowerPC/2007-03-24-cntlzd.ll
Chris Lattner [Sun, 25 Mar 2007 04:44:03 +0000 (04:44 +0000)]
Fix CodeGen/PowerPC/2007-03-24-cntlzd.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35329 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agotest that the ppc backend can do 64-bit cntlz
Chris Lattner [Sun, 25 Mar 2007 04:43:51 +0000 (04:43 +0000)]
test that the ppc backend can do 64-bit cntlz

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35328 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoimplement initial support for the silly X constraint. Testcase here: CodeGen/X86...
Chris Lattner [Sun, 25 Mar 2007 04:35:41 +0000 (04:35 +0000)]
implement initial support for the silly X constraint.  Testcase here: CodeGen/X86/2007-03-24-InlineAsmXConstraint.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35327 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agonew testcase
Chris Lattner [Sun, 25 Mar 2007 04:35:23 +0000 (04:35 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35326 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake more uses of getHighBitsSet and get rid of some pointless & of an
Reid Spencer [Sun, 25 Mar 2007 04:26:16 +0000 (04:26 +0000)]
Make more uses of getHighBitsSet and get rid of some pointless & of an
APInt with its type mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35325 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement CodeGen/X86/2007-03-24-InlineAsmMultiRegConstraint.ll
Chris Lattner [Sun, 25 Mar 2007 02:18:14 +0000 (02:18 +0000)]
Implement CodeGen/X86/2007-03-24-InlineAsmMultiRegConstraint.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35324 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agonew testcase
Chris Lattner [Sun, 25 Mar 2007 02:17:58 +0000 (02:17 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35323 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoswitch TargetLowering::getConstraintType to take the entire constraint,
Chris Lattner [Sun, 25 Mar 2007 02:14:49 +0000 (02:14 +0000)]
switch TargetLowering::getConstraintType to take the entire constraint,
not just the first letter.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35322 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMore APIntification:
Reid Spencer [Sun, 25 Mar 2007 02:03:12 +0000 (02:03 +0000)]
More APIntification:
* Convert the last use of a uint64_t that should have been an APInt.
* Change ComputeMaskedBits to have a const reference argument for the Mask
  so that recursions don't cause unneeded temporaries. This causes temps
  to be needed in other places (where the mask has to change) but this
  change optimizes for the recursion which is more frequent.
* Remove two instances of &ing a Mask with getAllOnesValue. Its not
  needed any more because APInt is accurate in its bit computations.
* Start using the getLowBitsSet and getHighBits set methods on APInt
  instead of shifting. This makes it more clear in the code what is
  going on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35321 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAllow the b/h/w/k constraints to be applied to values that have multiple alternatives...
Chris Lattner [Sun, 25 Mar 2007 02:01:03 +0000 (02:01 +0000)]
Allow the b/h/w/k constraints to be applied to values that have multiple alternatives, and end up not being registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35320 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoenforce the proper range for the i386 N constraint.
Chris Lattner [Sun, 25 Mar 2007 01:57:35 +0000 (01:57 +0000)]
enforce the proper range for the i386 N constraint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35319 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
Chris Lattner [Sun, 25 Mar 2007 01:44:57 +0000 (01:44 +0000)]
Fix test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35318 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agonew testcase
Chris Lattner [Sun, 25 Mar 2007 01:44:40 +0000 (01:44 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35317 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a typo in a comment.
Reid Spencer [Sun, 25 Mar 2007 01:13:46 +0000 (01:13 +0000)]
Fix a typo in a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35316 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoActually, for getHighBitsSet and getLowBitsSet, don't make a 0 bit size
Reid Spencer [Sun, 25 Mar 2007 00:01:47 +0000 (00:01 +0000)]
Actually, for getHighBitsSet and getLowBitsSet, don't make a 0 bit size
illegal. Instead do the 0 valued construction for the user. This is because
the caller may not know (or care to check) that the number of bits set is
zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35315 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agofix a regression on vector or instructions.
Chris Lattner [Sat, 24 Mar 2007 23:56:43 +0000 (23:56 +0000)]
fix a regression on vector or instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35314 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake it illegal to set 0 bits in getHighBitsSet and getLowBitsSet. For that
Reid Spencer [Sat, 24 Mar 2007 23:47:58 +0000 (23:47 +0000)]
Make it illegal to set 0 bits in getHighBitsSet and getLowBitsSet. For that
they should have used the uint64_t constructor. This avoids causing
undefined results via shifts by the word size when the bit width is an
exact multiple of the word size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35313 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoIn the getBitsSet function, don't optimize for a common case that is
Reid Spencer [Sat, 24 Mar 2007 23:42:47 +0000 (23:42 +0000)]
In the getBitsSet function, don't optimize for a common case that is
already covered by getLowBitsSet (i.e. when loBits==0). Consequently, remove
the default value for loBits and reorder the arguments to the more natural
loBits, hiBits order. This makes it more clear that this function is for bit
groups in the middle of the bit width and not towards one end or the other.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35312 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDon't invoke undefined behavior in shifts in the functions getHighBitsSet
Reid Spencer [Sat, 24 Mar 2007 23:35:54 +0000 (23:35 +0000)]
Don't invoke undefined behavior in shifts in the functions getHighBitsSet
and getLowBitsSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35311 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement the getBitsSet function.
Reid Spencer [Sat, 24 Mar 2007 23:27:48 +0000 (23:27 +0000)]
Implement the getBitsSet function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35310 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemove the last vestiges of this directory.
Reid Spencer [Sat, 24 Mar 2007 23:07:49 +0000 (23:07 +0000)]
Remove the last vestiges of this directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35309 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplement the getHighBitsSet and getLowBitsSet functions.
Reid Spencer [Sat, 24 Mar 2007 23:05:35 +0000 (23:05 +0000)]
Implement the getHighBitsSet and getLowBitsSet functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35308 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoGet the signs in the right place!
Reid Spencer [Sat, 24 Mar 2007 22:50:43 +0000 (22:50 +0000)]
Get the signs in the right place!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35307 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a link.
Reid Spencer [Sat, 24 Mar 2007 22:40:44 +0000 (22:40 +0000)]
Fix a link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35306 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUndo the last change and make this really implement remainder and not
Reid Spencer [Sat, 24 Mar 2007 22:37:23 +0000 (22:37 +0000)]
Undo the last change and make this really implement remainder and not
modulus. The previous change was a result of incorrect documentation in
the LangRef.html.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35305 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFlip the srem tests around. Previous commit was to correct an apparent
Reid Spencer [Sat, 24 Mar 2007 22:34:10 +0000 (22:34 +0000)]
Flip the srem tests around. Previous commit was to correct an apparent
bug in the srem implementation. Turns out it was a documentation bug
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35304 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCorrect the description of srem. remainder follows the dividend not the
Reid Spencer [Sat, 24 Mar 2007 22:23:39 +0000 (22:23 +0000)]
Correct the description of srem. remainder follows the dividend not the
divisor!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35303 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCorrect the implementation of srem to be remainder, not modulus. The sign of
Reid Spencer [Sat, 24 Mar 2007 21:56:22 +0000 (21:56 +0000)]
Correct the implementation of srem to be remainder, not modulus. The sign of
the result must follow the sign of the divisor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35302 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix incorrect test cases for srem. The definition of srem is a remainder so
Reid Spencer [Sat, 24 Mar 2007 21:55:26 +0000 (21:55 +0000)]
Fix incorrect test cases for srem. The definition of srem is a remainder so
that the sign of the result follows the sign of the divisor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35301 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoClean up this interface:
Reid Spencer [Sat, 24 Mar 2007 18:09:18 +0000 (18:09 +0000)]
Clean up this interface:
1. Group similar methods into doxygen groups
2. Reorganize the groups into a consist flow.
3. Significantly improve the quality of the documentation on several methods
4. Rewrite srem and sdiv to eliminate a copy and improve readability.
5. Eliminate unneeded forward references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35300 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agodon't rely on ADL
Chris Lattner [Sat, 24 Mar 2007 17:37:03 +0000 (17:37 +0000)]
don't rely on ADL

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35299 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd a valuetype for v1i64, which is needed by mmx.
Chris Lattner [Sat, 24 Mar 2007 17:36:26 +0000 (17:36 +0000)]
add a valuetype for v1i64, which is needed by mmx.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35298 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake some codes more efficient.
Zhou Sheng [Sat, 24 Mar 2007 15:34:37 +0000 (15:34 +0000)]
Make some codes more efficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35297 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoadd a bad case evan though of.
Chris Lattner [Sat, 24 Mar 2007 06:01:32 +0000 (06:01 +0000)]
add a bad case evan though of.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35296 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Sat, 24 Mar 2007 00:42:08 +0000 (00:42 +0000)]
For PR1205:
Convert some calls to ConstantInt::getZExtValue() into getValue() and
use APInt facilities in the subsequent computations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35294 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdjust offset to compensate for big endian machines.
Evan Cheng [Sat, 24 Mar 2007 00:02:43 +0000 (00:02 +0000)]
Adjust offset to compensate for big endian machines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35293 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAutodetect MMX & SSE stuff for AMD processors
Anton Korobeynikov [Fri, 23 Mar 2007 23:46:48 +0000 (23:46 +0000)]
Autodetect MMX & SSE stuff for AMD processors

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35292 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoThis is dead. DEAD I tells you!!
Bill Wendling [Fri, 23 Mar 2007 22:42:04 +0000 (22:42 +0000)]
This is dead. DEAD I tells you!!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35291 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoPR1260:
Bill Wendling [Fri, 23 Mar 2007 22:35:46 +0000 (22:35 +0000)]
PR1260:
Add final support to get the QT example to compile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35290 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake sure SEXTLOAD of the specific type is supported on the target.
Evan Cheng [Fri, 23 Mar 2007 22:13:36 +0000 (22:13 +0000)]
Make sure SEXTLOAD of the specific type is supported on the target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35289 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd more test cases for APIntified InstCombine.
Reid Spencer [Fri, 23 Mar 2007 21:57:47 +0000 (21:57 +0000)]
Add more test cases for APIntified InstCombine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35288 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Fri, 23 Mar 2007 21:24:59 +0000 (21:24 +0000)]
For PR1205:
* APIntify visitAdd and visitSelectInst
* Remove unused uint64_t versions of utility functions that have been
  replaced with APInt versions.
This completes most of the changes for APIntification of InstCombine. This
passes llvm-test and llvm/test/Transforms/InstCombine/APInt.

Patch by Zhou Sheng.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35287 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAlso replace uses of SRL if that's also folded during ReduceLoadWidth().
Evan Cheng [Fri, 23 Mar 2007 20:55:21 +0000 (20:55 +0000)]
Also replace uses of SRL if that's also folded during ReduceLoadWidth().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35286 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd test case for testing InstCombine with arbitrary precision integer
Reid Spencer [Fri, 23 Mar 2007 20:48:34 +0000 (20:48 +0000)]
Add test case for testing InstCombine with arbitrary precision integer
types. These tests mimic the integer test cases in the normal InstCombine
test suite but use "strange" integer bit widths.

Most tests written by Zhou Sheng, a few by me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35284 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Fri, 23 Mar 2007 20:05:17 +0000 (20:05 +0000)]
For PR1205:
APIntify visitDiv, visitMul and visitRem.

Patch by Zhou Sheng.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35283 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoswitch AddReachableCodeToWorklist from being recursive to being iterative.
Chris Lattner [Fri, 23 Mar 2007 19:17:18 +0000 (19:17 +0000)]
switch AddReachableCodeToWorklist from being recursive to being iterative.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35282 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFor PR1205:
Reid Spencer [Fri, 23 Mar 2007 18:46:34 +0000 (18:46 +0000)]
For PR1205:
APIntify several utility functions supporting logical operators and shift
operators.

Patch by Zhou Sheng.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35281 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd the 'explicit' keyword to several constructors that accept one
Dan Gohman [Fri, 23 Mar 2007 18:44:11 +0000 (18:44 +0000)]
Add the 'explicit' keyword to several constructors that accept one
argument that don't appear intended as implicit-conversion operators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35280 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoTest handling of switches with wide case ranges.
Duncan Sands [Fri, 23 Mar 2007 07:17:52 +0000 (07:17 +0000)]
Test handling of switches with wide case ranges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35279 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix constant fold of div by zero and rem by zero to match IEEE 754
Reid Spencer [Fri, 23 Mar 2007 05:33:23 +0000 (05:33 +0000)]
Fix constant fold of div by zero and rem by zero to match IEEE 754
requirements. We must return NaN in some cases and correctly signed
infinity in other cases. Passes CFP2006 (not that that says much).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35277 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMake the "KnownZero ^ TypeMask" computation just once.
Zhou Sheng [Fri, 23 Mar 2007 03:13:21 +0000 (03:13 +0000)]
Make the "KnownZero ^ TypeMask" computation just once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35276 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSimplify the code.
Zhou Sheng [Fri, 23 Mar 2007 02:39:25 +0000 (02:39 +0000)]
Simplify the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35275 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoA couple of bug fixes for reducing load width xform:
Evan Cheng [Fri, 23 Mar 2007 02:16:52 +0000 (02:16 +0000)]
A couple of bug fixes for reducing load width xform:
1. Address offset is in bytes.
2. Make sure truncate node uses are replaced with new load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35274 91177308-0d34-0410-b5e6-96231b3b80d8