Commit Graph

86 Commits

Author SHA1 Message Date
Zhou Sheng
02031c0ff8 Make LowerCTPOP() support arbitrary bitwidth integer type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37397 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-02 04:10:33 +00:00
Zhou Sheng
924361aef9 Correct the logic in LowerPartSet which cleared the bits from 0 to low-1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37331 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-26 03:43:13 +00:00
Reid Spencer
76c94b6169 Un-brain-dead-ify the lowering of part set for the reverse case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37071 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-15 02:26:52 +00:00
Reid Spencer
9bd57b6561 Give names to the final result values of the part_set computations. This
just aids in readability and debugability of the output. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37037 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-14 17:21:17 +00:00
Reid Spencer
5156f5b214 Get the size of auto arrays right, regardless of its changing size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37006 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-12 11:07:40 +00:00
Reid Spencer
9a9203b894 Fix problems in the PartSet lowering having to do with incorrect bit width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36180 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 22:21:14 +00:00
Reid Spencer
df41353497 Make sure intrinsics that are lowered to functions make the function weak
linkage so we only end up with one of them in a program. These are, after
all overloaded and templatish in nature.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35956 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 21:53:38 +00:00
Reid Spencer
eeedcb6905 Fix bugs in generated code for part_select and part_set so that llc doesn't
barf when CBE is run with a program that contains these intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35946 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 13:30:14 +00:00
Reid Spencer
37958093c6 Fix a bug in PartSet. The replacement value needs to be zext or trunc to
the size of the value, not just zext. Also, give better names to two BBs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35945 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 12:46:33 +00:00
Reid Spencer
f75b874957 For PR1284:
Implement the "part_set" intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 02:48:46 +00:00
Chris Lattner
c6eb6d7255 apparently some people commit without building the tree, or they forget to
commit a LOT of files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-10 03:20:39 +00:00
Reid Spencer
addd11d98e Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35678 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-04 23:48:25 +00:00
Reid Spencer
dc1966e6ba For PR1297:
Make sure that the CTPOP result is casted to i32 as the bit counting
intrinsics all return i32 now (this affects CTLZ and CTTZ as well).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35567 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-02 01:01:49 +00:00
Reid Spencer
e9391fd9b5 For PR1297:
Support overloaded intrinsics bswap, ctpop, cttz, ctlz.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35547 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 07:35:23 +00:00
Jim Laskey
0b4711bd94 Lower eh filter intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34802 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:24:30 +00:00
Jim Laskey
63f3e3fa1d Provide a more meaningful name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:37:50 +00:00
Jim Laskey
774b864f0e Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34502 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 18:51:19 +00:00
Jim Laskey
f9b1cbc80d Remove assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 16:12:17 +00:00
Jim Laskey
b180aa1753 Selection and lowering for exception handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34481 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:53:45 +00:00
Chris Lattner
990b849abc eliminate vector-related allocations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34223 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 06:01:22 +00:00
Chris Lattner
c67da0cf13 Two fixes:
1. Memset takes an i32 for the value to set, not i8.  This was causing GCC to
   ICE all over the place (PR1183).
2. memcpy/memmove were not properly zext/trunc'ing the size in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33970 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-06 19:06:38 +00:00
Chris Lattner
7d6f77db28 Fix PR1181 and CodeGen/CBackend/2007-02-05-memset.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33957 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-06 06:07:51 +00:00
Reid Spencer
1b19cd35fe Use short form of BinaryOperator create function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33784 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 14:09:34 +00:00
Reid Spencer
832254e1c2 Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 02:16:23 +00:00
Reid Spencer
5cbf985dcb For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-30 20:08:39 +00:00
Reid Spencer
6addf2ceeb Use TargetData to obtain the correct size of the "size_t" argument for
functions like memcpy, memmove and memset. Ensure only one prototype is
used for these functions and that it matches the system definition by
using the appropriate type for the size argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33618 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-29 17:42:06 +00:00
Reid Spencer
1e9126b3c4 For PR1138:
Force memcpy to be the 32-bit variant. Since this is only used with
CBE and lli which both target 32-bit machines, this should be okay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33608 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28 22:28:00 +00:00
Chris Lattner
42a7551725 rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:27:26 +00:00
Chris Lattner
0ee69bbd33 eliminate calls to Type::isInteger, preferring isIntegral instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33222 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:03:16 +00:00
Chris Lattner
f01da5939d llvm 2.0 doesn't support llvm.isunordered.*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32994 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 08:52:43 +00:00
Chris Lattner
b76efb71d4 Change the interface to Module::getOrInsertFunction to be easier to use,to resolve PR1088, and to help PR411.
This simplifies many clients also


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32989 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 08:12:01 +00:00
Reid Spencer
47857812e2 For PR950:
Three changes:
1. Convert signed integer types to signless versions.
2. Implement the @sext and @zext parameter attributes. Previously the
   type of an function parameter was used to determine whether it should
   be sign extended or zero extended before the call. This information is
   now communicated via the function type's parameter attributes.
3. The interface to LowerCallTo had to be changed in order to accommodate
   the parameter attribute information. Although it would have been
   convenient to pass in the FunctionType itself, there isn't always one
   present in the caller. Consequently, a signedness indication for the
   result type and for each parameter was provided for in the interface
   to this method. All implementations were changed to make the adjustment
   necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32788 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:55:36 +00:00
Reid Spencer
e4d87aa2de For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-23 06:05:41 +00:00
Reid Spencer
eefef64e59 Simplify all the casting business and get rid of isSigned().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32731 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-21 08:28:31 +00:00
Reid Spencer
8a903db499 Convert the last uses of CastInst::createInferredCast to a normal cast
creation. These changes are still temporary but at least this pushes
knowledge of signedness out closer to where it can be determined properly
and allows signedness to be removed from VMCore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32654 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-18 08:47:13 +00:00
Chris Lattner
3bb7e3f3ba This case isn't needed with recent changes to ConstantInt::get
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32472 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 05:19:46 +00:00
Reid Spencer
15f46d6c28 Change inferred cast creation calls to more specific cast creations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32460 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 01:17:41 +00:00
Bill Wendling
e81561909d Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:30:32 +00:00
Bill Wendling
d9fd2acc1f Changed to using llvm streams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31954 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 02:08:17 +00:00
Reid Spencer
3da59db637 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 01:05:10 +00:00
Chris Lattner
b71fd7897f Simplify IntrinsicLowering and clarify that it is only for use by the
CBE and interpreter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31755 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-15 18:00:10 +00:00
Reid Spencer
3822ff5c71 For PR950:
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31542 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 06:47:33 +00:00
Reid Spencer
b83eb6447b For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 07:07:24 +00:00
Jim Laskey
43970fec32 Handle new forms of llvm.dbg intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26988 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-23 18:06:46 +00:00
Jim Laskey
f4321a3a43 Handle the removal of the debug chain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-13 13:07:37 +00:00
Chris Lattner
59bcce5ae5 remove dbg_declare, it's not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26659 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 20:02:42 +00:00
Chris Lattner
03dd465215 Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709, and paving the way for future progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26476 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 00:00:25 +00:00
Reid Spencer
0b118206bf For PR411:
This patch is an incremental step towards supporting a flat symbol table.
It de-overloads the intrinsic functions by providing type-specific intrinsics
and arranging for automatically upgrading from the old overloaded name to
the new non-overloaded name. Specifically:
  llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64
  llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64
  llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64
  llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64
  llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64
New code should not use the overloaded intrinsic names. Warnings will be
emitted if they are used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25366 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-16 21:12:35 +00:00
Nate Begeman
e598181889 Add BSWAP stuff to intrinsic lowering for CBE & friends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25355 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-16 07:57:00 +00:00
Chris Lattner
0c067bc11d Add "support" for the llvm.stacksave/stackrestore intrinsics, this is
used by the C backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25267 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-13 02:22:08 +00:00