1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

303 Commits

Author SHA1 Message Date
Owen Anderson
1404d6e7d1 Move more functionality over to LLVMContext.
llvm-svn: 75559
2009-07-13 23:50:59 +00:00
Owen Anderson
9ff3b6191e Move a bit more functionality to LLVMContext, which apparently wasn't being used anyways.
llvm-svn: 75546
2009-07-13 23:16:26 +00:00
Owen Anderson
3501454313 These don't really need contexts either.
llvm-svn: 75528
2009-07-13 22:18:28 +00:00
Owen Anderson
7b2ee7dc21 As Chris pointed out, this doesn't actually need an LLVMContext to operate.
llvm-svn: 75508
2009-07-13 21:27:19 +00:00
Owen Anderson
1e5155161a Move more functionality over to LLVMContext.
llvm-svn: 75497
2009-07-13 20:58:05 +00:00
Owen Anderson
393d8b0a0c Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context.  This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.

llvm-svn: 75445
2009-07-13 04:09:18 +00:00
Nick Lewycky
d46a7b2d22 Remove the vicmp and vfcmp instructions. Because we never had a release with
these instructions, no autoupgrade or backwards compatibility support is
provided.

llvm-svn: 74991
2009-07-08 03:04:38 +00:00
Devang Patel
715a8c1154 Add constructor to create MDString using std::string
llvm-svn: 74133
2009-06-24 22:42:39 +00:00
Owen Anderson
733fa621f6 Revert r73790, and replace it with a significantly less ugly solution. Rather than trying to make the global reader-writer lock work,
create separate recursive mutexes for each value map.  The recursive-ness fixes the double-acquiring issue, which having one per ValueMap
lets us continue to maintain some concurrency.

llvm-svn: 73801
2009-06-20 00:24:58 +00:00
Owen Anderson
295610c408 Fix a serious bug that would cause deadlock during abstract type refinement. The constant creation
gets involved, and we end up trying to recursively acquire a writer lock.  The fix for this is slightly horrible,
and involves passing a boolean "locked" parameter around in Constants.cpp, but it's better than having locked and
unlocked versions of most of the code.

llvm-svn: 73790
2009-06-19 23:16:19 +00:00
Dan Gohman
b501e5ddbd Add comments to ConstantInt::get and ConstantFP::get to more fully
describe their behavior.

llvm-svn: 73454
2009-06-16 01:02:32 +00:00
Dan Gohman
2e737ac21f Support vector casts in more places, fixing a variety of assertion
failures.

To support this, add some utility functions to Type to help support
vector/scalar-independent code. Change ConstantInt::get and
ConstantFP::get to support vector types, and add an overload to
ConstantInt::get that uses a static IntegerType type, for
convenience.

Introduce a new getConstant method for ScalarEvolution, to simplify
common use cases.

llvm-svn: 73431
2009-06-15 22:12:54 +00:00
Dan Gohman
5f6f8101d5 Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt

llvm-svn: 72897
2009-06-04 22:49:04 +00:00
Nick Lewycky
a9de2f1c81 Give embedded metadata its own type instead of relying on EmptyStructTy.
llvm-svn: 72610
2009-05-30 05:06:04 +00:00
Duncan Sands
316352b541 Add a getAlignOf helper for getting the ABI alignment of a
type as a target independent constant expression.  I confess
that I didn't check that this method works as intended (though
I did test the equivalent hand-written IR a little).  But what
could possibly go wrong!

llvm-svn: 72213
2009-05-21 15:52:21 +00:00
Nick Lewycky
f417462ddf Make MDNode use CallbackVH. Also change MDNode to store Value* instead of
Constant* in preperation of a future change to support holding non-Constants
in an MDNode.

llvm-svn: 71407
2009-05-10 20:57:05 +00:00
Bill Wendling
bbd2110a60 Use intptr_t.
llvm-svn: 70076
2009-04-25 21:06:53 +00:00
Mon P Wang
e001e33842 size() should return a size_t; avoids a warning for 64 bit machines.
llvm-svn: 70072
2009-04-25 20:46:59 +00:00
Chris Lattner
961e0a34e0 fix a typo noticed by duncan
llvm-svn: 69962
2009-04-24 06:37:12 +00:00
Chris Lattner
e90528cac5 "I got annoyed at the compiler warnings from ConstantInt::get(Ty, -1,
true), and casts make me nervous and are verbose anyway, so here's a
ConstantInt::getSigned(Ty, int64_t) method. Just overloading
ConstantInt::get() to take an int64_t too would cause ambiguous
overload errors."

Patch by Jeffrey Yasskin!

llvm-svn: 69958
2009-04-24 05:30:14 +00:00
Nick Lewycky
eea5412e19 Add support for embedded metadata to LLVM. This introduces two new types of
Constant, MDString and MDNode which can only be used by globals with a name
that starts with "llvm." or as arguments to a function with the same naming
restriction.

llvm-svn: 68420
2009-04-04 07:22:01 +00:00
Dan Gohman
51d4e8db6a Fix a bunch of Doxygen syntax issues. Escape special characters,
and put @file directives on their own comment line.

llvm-svn: 65920
2009-03-03 02:55:14 +00:00
Bob Wilson
873bfcf34f Fix a duplicated word in a comment.
llvm-svn: 65496
2009-02-26 00:58:09 +00:00
Dan Gohman
a8303269cf Reword the comment for ConstantInt's getLimitedValue.
llvm-svn: 61280
2008-12-20 17:06:39 +00:00
Dan Gohman
f187690987 Make ConstantAggregateZero::get return a ConstantAggregateZero*,
as suggested in PR3182.

llvm-svn: 60691
2008-12-08 07:10:54 +00:00
Dale Johannesen
2fa6e000b1 A file missed from previous checkin.
llvm-svn: 57330
2008-10-09 23:01:07 +00:00
Bill Wendling
505ec388e2 Prevent warning about conversion from 64-bit to 32-bit by (yuck) casting...
llvm-svn: 56359
2008-09-19 18:34:40 +00:00
Chris Lattner
7a310366a6 Add a new ConstantExpr::getWithOperands that takes any array of operands
instead of requiring an std::vector.

llvm-svn: 55084
2008-08-20 22:27:40 +00:00
Nate Begeman
a6cdff50b0 Remove unnecessary implicit argument
llvm-svn: 54031
2008-07-25 17:56:27 +00:00
Nate Begeman
ce064348d9 Fix minor issues with VICmp/VFCmp constant expressions
llvm-svn: 54030
2008-07-25 17:35:37 +00:00
Dan Gohman
ac5c3382fe IR, bitcode reader, bitcode writer, and asmparser changes to
insertvalue and extractvalue to use constant indices instead of
Value* indices. And begin updating LangRef.html.

There's definately more to come here, but I'm checking this 
basic support in now to make it available to people who are
interested.

llvm-svn: 51806
2008-05-31 00:58:22 +00:00
Bill Wendling
1866fa680f Remove warnings about unused parameters and shadowed variables.
llvm-svn: 51266
2008-05-19 20:15:12 +00:00
Dan Gohman
821bf58428 IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.

llvm-svn: 51157
2008-05-15 19:50:34 +00:00
Nate Begeman
b5b1e1353b Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRef
for details.  CodeGen support coming in a follow up patch

llvm-svn: 50985
2008-05-12 19:01:56 +00:00
Gabor Greif
724556e521 remove commented-out code, it is subsumed by DECLARE_TRANSPARENT_OPERAND_ACCESSORS
llvm-svn: 50944
2008-05-10 09:36:58 +00:00
Gabor Greif
49bf1a4cf6 merge of use-diet branch to trunk
llvm-svn: 50943
2008-05-10 08:32:32 +00:00
Chris Lattner
9b05ba1b41 remove obsolete method.
llvm-svn: 50622
2008-05-04 18:14:55 +00:00
Dale Johannesen
08671c6cac Don't try to convert PPC long double.
llvm-svn: 50369
2008-04-28 19:46:58 +00:00
Chris Lattner
02cc33d0ad ConstantFP::get should be static.
llvm-svn: 49434
2008-04-09 17:16:28 +00:00
Evan Cheng
94983505c5 Unbreak teh build.
llvm-svn: 49417
2008-04-09 07:06:01 +00:00
Chris Lattner
9d4d2f566e add a version of ConstantFP::get that doesn't take a redundant Type* value,
start migrating code over to use it.

llvm-svn: 49413
2008-04-09 00:45:01 +00:00
Chris Lattner
6e11e1a381 make ConstantFP::isExactlyValue work for long double as well.
llvm-svn: 49410
2008-04-09 00:03:58 +00:00
Gabor Greif
6c6b8a57f3 API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.

llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Nick Lewycky
3903f2f24e ubyte and sbyte? what are those?
llvm-svn: 48585
2008-03-20 06:19:51 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Gordon Henriksen
8430f1ff9a Reverting dtor devirtualization patch.
_sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed
_sabre_: the vtable lives to fight another day

llvm-svn: 44760
2007-12-10 02:14:30 +00:00
Gordon Henriksen
a18a78e6e5 Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
llvm-svn: 44747
2007-12-09 22:46:10 +00:00
Bill Wendling
51375114ca Get rid of compilation warning during release builds
llvm-svn: 43608
2007-11-01 08:24:40 +00:00
Dan Gohman
231159e8a3 Define a helper function ConstantVector::getSplatValue for testing for
and working with broadcasted constants.

llvm-svn: 43076
2007-10-17 17:51:30 +00:00
Gordon Henriksen
65ce7c3085 Adding C and Ocaml bindings for ConstantExpr.
llvm-svn: 42696
2007-10-06 14:29:36 +00:00
Dale Johannesen
575bd6070a Remove the assumption that FP's are either float or
double from some of the many places in the optimizers
it appears, and do something reasonable with x86
long double.
Make APInt::dump() public, remove newline, use it to
dump ConstantSDNode's.
Allow APFloats in FoldingSet.
Expand X86 backend handling of long doubles (conversions
to/from int, mostly).

llvm-svn: 41967
2007-09-14 22:26:36 +00:00
Dale Johannesen
86f367a6b7 Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double.  Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)

llvm-svn: 41747
2007-09-06 18:13:44 +00:00
Dale Johannesen
e91a908971 Change LegalFPImmediates to use APFloat.
Add APFloat interfaces to ConstantFP, SelectionDAG.
Fix integer bit in double->APFloat conversion.
Convert LegalizeDAG to use APFloat interface in
ConstantFPSDNode uses.

llvm-svn: 41587
2007-08-30 00:23:21 +00:00
Dale Johannesen
a3ab055b9d Change internal representation of ConstantFP to use APFloat.
Interface to rest of the compiler unchanged, as yet.

llvm-svn: 41348
2007-08-24 00:56:33 +00:00
Reid Spencer
3e54e72ef1 Fix minor doxygen nits.
llvm-svn: 40854
2007-08-05 20:06:04 +00:00
Dan Gohman
0ba554c0c8 Fix comments about vectors to use the current wording.
llvm-svn: 39921
2007-07-16 14:29:03 +00:00
Dan Gohman
2c5d31ee81 Minor comment cleanups.
llvm-svn: 37321
2007-05-24 14:36:04 +00:00
Dan Gohman
2d4b1767ab Rename Value::getValueType to getValueID, to avoid confusion with
other things named getValueType.

llvm-svn: 35964
2007-04-13 18:12:09 +00:00
Chris Lattner
da0e61ca4c getLimitedValue now just forward to APInt's getLimitedValue. Mark it const.
llvm-svn: 35861
2007-04-10 06:44:12 +00:00
Chris Lattner
96c4c71f2c add a helper function to constantint.
llvm-svn: 35610
2007-04-03 01:41:34 +00:00
Zhou Sheng
68b7faad88 Make sure this method just return value equal or less than Limit.
llvm-svn: 35509
2007-03-30 16:50:28 +00:00
Zhou Sheng
3352181fc8 Rename and correct the method "greaterOrEqual".
llvm-svn: 35502
2007-03-30 05:10:59 +00:00
Zhou Sheng
489a1dbb92 Add two utility methods into ConstantInt.
llvm-svn: 35501
2007-03-30 03:22:55 +00:00
Dan Gohman
42a3f4e16e Add the 'explicit' keyword to several constructors that accept one
argument that don't appear intended as implicit-conversion operators.

llvm-svn: 35280
2007-03-23 18:44:11 +00:00
Reid Spencer
7d20e42a97 Allow ConstantInt::get(Ty, uint64_t) to interpret the 64-bit values as a
negative number. This is needed to fix test/Assembler/2007-03-19-NegValue.ll

llvm-svn: 35181
2007-03-19 20:39:08 +00:00
Reid Spencer
53a673b3ed Add a non-virtual test for zero, isZero, and rename isUnitValue isOne.
These will be used in upcoming patches to avoid virtual function call when
the client knows it is a ConstantInt.

llvm-svn: 34820
2007-03-02 00:27:06 +00:00
Reid Spencer
c5d33cef76 Remove virtual keyword from method that doesn't need to be virtual.
llvm-svn: 34817
2007-03-01 23:20:52 +00:00
Reid Spencer
2ce72a4bd8 Add an isUnitValue method for comparison against 1. This just follows a
common pattern with isNullValue, isAllOnesValue, etc. It also helps to
prevent things like getZExtValue() == 1, which could assert for large
bitwidths.

llvm-svn: 34813
2007-03-01 21:50:41 +00:00
Reid Spencer
b4e877c488 Drop the ConstantInt(const Type&, const APInt&) constructor. It is
redundant and more verbose than the ConstantInt(const APInt&) constructor.

llvm-svn: 34792
2007-03-01 19:30:34 +00:00
Reid Spencer
a9d0cc903b Implement a convenience method to construct a ConstantInt directly from an
APInt. The implied type is the integer type that corresponds to the bit
width of the APInt.

llvm-svn: 34757
2007-02-28 19:50:21 +00:00
Reid Spencer
c8cc0f997e For PR1205:
Implement the first step towards arbitrary precision integer support in
LLVM. The APInt class provides arbitrary precision arithmetic and value
representation. This patch changes ConstantInt to use APInt as its value
representation without supporting bit widths > 64 yet. That change will
come after ConstantFolding handles bit widths > 64 bits.

llvm-svn: 34647
2007-02-26 23:54:03 +00:00
Chris Lattner
b6ddd260ec eliminate some dead friends.
llvm-svn: 34447
2007-02-20 07:18:01 +00:00
Chris Lattner
37a49eb48d cleanup ConstantInt to use a single DenseMap for uniquing instead of the
heavy-weight ValueMap class.  This reduces mem usage bc reading kc++ by 29K,
even though it only creates 2955 constant ints!

llvm-svn: 34445
2007-02-20 06:39:57 +00:00
Chris Lattner
adb16a1a53 Make ConstantInt::getTrue/getFalse be llvm_shutdown safe.
llvm-svn: 34443
2007-02-20 06:11:36 +00:00
Chris Lattner
c8db23f8a7 Clean up the internals of the ConstantInt machinery
llvm-svn: 34441
2007-02-20 05:55:46 +00:00
Chris Lattner
f501d245c8 llvm-gcc issue fixed, revert reversal :)
llvm-svn: 34425
2007-02-19 20:01:23 +00:00
Evan Cheng
936deee790 Temporarily reverting the patch. It's breaking llvm-gcc build.
llvm-svn: 34423
2007-02-19 19:23:41 +00:00
Chris Lattner
865b2f741a remove dead methods
llvm-svn: 34419
2007-02-19 07:44:24 +00:00
Chris Lattner
35a14c07e4 add alternate version of constant ctors that don't take a vector. For now
this offers no performance advantage.

llvm-svn: 34415
2007-02-19 07:23:24 +00:00
Reid Spencer
55e4e98a2a For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Reid Spencer
591bfa1e0b 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.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Chris Lattner
677cab8ef3 Revise APIs for creating constantexpr GEPs to not require the use of
vectors.  This allows us to eliminate many temporary vectors, and their
associated malloc/free pairs.

llvm-svn: 33691
2007-01-31 04:39:29 +00:00
Reid Spencer
e33c18f4d2 For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!

llvm-svn: 33415
2007-01-21 00:29:26 +00:00
Reid Spencer
14b42c0040 For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*

This also fixes PR1120.

Patch by Sheng Zhou.

llvm-svn: 33370
2007-01-19 21:13:56 +00:00
Jim Laskey
3410ca8bf4 virtual not needed.
llvm-svn: 33161
2007-01-12 23:39:50 +00:00
Jim Laskey
ee29cc6016 Allow isAllOnesValue testing on packed constants
llvm-svn: 33146
2007-01-12 22:39:14 +00:00
Reid Spencer
3d986f6487 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.

llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Reid Spencer
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng
3c49580e44 Fixed a bug in ConstantInt::Inverted().
Modified comment of that method.

llvm-svn: 33074
2007-01-11 14:31:10 +00:00
Zhou Sheng
23d24526b2 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Chris Lattner
d9342d1db3 Add a new ConstantPacked::getAllOnesValue method
llvm-svn: 32856
2007-01-04 01:49:26 +00:00
Reid Spencer
4428c3483b 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.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Reid Spencer
2d69d6e962 Correct the description of ConstantInt::isValueValidForType.
llvm-svn: 32664
2006-12-19 01:34:39 +00:00
Reid Spencer
e9d6e54b36 Make ConstantInt not care about sign any more. To ensure the AsmParser can
still check the validity of signed values an overload to isValueValidForType
was added to allow passing in an int64_t to check.

llvm-svn: 32663
2006-12-19 01:28:19 +00:00
Reid Spencer
6769fa4ba2 Remove the two-argument (inferred cast) form of ConstantExpr::getCast now
that its last uses have been removed.

llvm-svn: 32653
2006-12-18 08:18:46 +00:00
Reid Spencer
be18cd1575 Fix problems in the CBE and InstructionCombining which use the isMaxValue
and isMinValue methods of ConstantInt. These have been broken since the
isSigned parameter was added. It is necessary to use the signed version
of the type in the call to isValueValidForType or else incorrect results
are returned.

llvm-svn: 32637
2006-12-17 06:07:30 +00:00
Reid Spencer
0e981c9088 Replace inferred getCast(V,Ty) calls with more strict variants.
Rename getZeroExtend and getSignExtend to getZExt and getSExt to match
the the casting mnemonics in the rest of LLVM.

llvm-svn: 32514
2006-12-12 23:36:14 +00:00
Reid Spencer
3fbfed6e2c Implement getIntegerCast and getFPCast for ConstantExpr. These are similar
to the createIntegerCast and createFPCast for CastInst instructions.

llvm-svn: 32457
2006-12-12 00:51:07 +00:00
Andrew Lenharth
d115fe7ce3 Packed Structures
llvm-svn: 32361
2006-12-08 18:06:16 +00:00
Reid Spencer
19cb81393d For PR950:
Remove the getMaxValue and getMinValue functions from ConstantIntegral.
They don't make sense for a signless type. Also, for isMaxValue and
isMinValue, have the caller provided the signedness rather than obtaining
it from the constant's type.

llvm-svn: 32287
2006-12-06 20:30:17 +00:00
Reid Spencer
c87c3e5a70 Bail on the getInferredCast idea. Remove the function and convert
remaining uses to more specific casts.

llvm-svn: 32231
2006-12-05 19:14:13 +00:00
Reid Spencer
671de8b576 Add cast creation functions for Pointer Casts, either BitCast or PtrToInt
llvm-svn: 32207
2006-12-04 23:14:27 +00:00
Reid Spencer
2e158ac2a0 Separate the get and getTy functions for ICmp and FCmp into getCompare
and getCompareTy. Also, fix some incorrect comments.

llvm-svn: 32199
2006-12-04 21:34:17 +00:00
Reid Spencer
2d2a26767e Implement new cast creation functions for both instructions and constant
expressions. These will get used to reduce clutter as we replace various
calls to createInferredCast and getCast.

llvm-svn: 32191
2006-12-04 20:17:56 +00:00
Reid Spencer
b45bf0421e For PR950: Provide an isCompare method for detection of ICmp and FCmp constant expressions. Change interfaces to allow for ICmp and FCmp predicate values.
llvm-svn: 32167
2006-12-04 05:19:02 +00:00
Reid Spencer
4cb4234c17 Take a baby step towards getting rid of inferred casts. Provide methods on
CastInst and ConstantExpr that allow the signedness to be explicitly passed
in and reliance on signedness removed from getCastOpcode. These are
temporary measures useful during the conversion of inferred casts.

llvm-svn: 32164
2006-12-04 02:43:42 +00:00
Reid Spencer
a468638458 Implement creation of ICmp and FCmp constant expressions.
llvm-svn: 32147
2006-12-03 05:48:19 +00:00
Chris Lattner
497c976859 add a new ConstantIntegral::get method. Simplify the implementation of
ConstantInt::get

llvm-svn: 32080
2006-12-01 19:20:02 +00:00
Reid Spencer
992d9788b3 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.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Reid Spencer
da1f5b882a 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.

llvm-svn: 31542
2006-11-08 06:47:33 +00:00
Reid Spencer
1abf69e923 For PR950:
Replace the REM instruction with UREM, SREM and FREM.

llvm-svn: 31369
2006-11-02 01:53:59 +00:00
Evan Cheng
9d0bfecda6 Add isCString() - returns true if a ConstantArray is a CString.
llvm-svn: 31201
2006-10-26 19:15:05 +00:00
Reid Spencer
6833ffe8b8 For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.

llvm-svn: 31195
2006-10-26 06:15:43 +00:00
Reid Spencer
82347acc95 Fix a comment to be accurate.
llvm-svn: 31064
2006-10-20 07:24:55 +00:00
Reid Spencer
d414793dbc 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.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Chris Lattner
155e6b8403 Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().

llvm-svn: 30666
2006-09-28 23:36:21 +00:00
Chris Lattner
93bc6e881f fix typo
llvm-svn: 30453
2006-09-18 04:58:06 +00:00
Reid Spencer
741140980f For PR797:
Remove exception throwing/handling from lib/Bytecode, and adjust its users
to compensate for changes in the interface.

llvm-svn: 29875
2006-08-25 17:43:11 +00:00
Chris Lattner
cff735d69e Add another helper method.
llvm-svn: 29147
2006-07-14 22:19:18 +00:00
Chris Lattner
b78b91260b Add a new method for bugpoint to use.
llvm-svn: 29142
2006-07-14 19:37:01 +00:00
Reid Spencer
1e1cfbb6fe Provide a simpler interface for getting a ConstantArray from a character
string. Instead of specifying the length, just specify whether the user
wants a terminating null or not. The default is "true" to retain the same
behavior as previously provided by this function.

llvm-svn: 28562
2006-05-30 18:15:07 +00:00
Reid Spencer
a79b2a00c1 Properly document the second form of ConstArray::get()
llvm-svn: 28553
2006-05-30 08:26:13 +00:00
Reid Spencer
ce05d51e82 Adjust the interface to ConstantArray::get. The previous
implementation always added a null byte to the end of the string. It turns
out that this is not always wanted. By adding a length parameter we preserve
this behavior when length==0 (default value) but also allow other lengths
(not null terminated) to be created.

llvm-svn: 28552
2006-05-30 08:23:18 +00:00
Reid Spencer
574d4e6992 For PR786:
Minor tweaks in public headers and a few .cpp files so that LLVM can build
successfully with -pedantic and projects using LLVM with -pedantic don't
get warnings from LLVM. There's still more -pedantic warnings to fix.

llvm-svn: 28453
2006-05-24 19:21:13 +00:00
Chris Lattner
e2d0c1084a Add a new shufflevector instruction
llvm-svn: 27507
2006-04-08 01:15:18 +00:00
Chris Lattner
0c8352628d add a new Type::getIntegralTypeMask() method, which is useful for clients that
want to do bitwise inspection of integer types.

llvm-svn: 26032
2006-02-07 06:17:10 +00:00
Robert Bocchino
a5ec2815a1 Instruction and constant expression definitions for the insertelement
operation.

llvm-svn: 25402
2006-01-17 20:05:59 +00:00
Robert Bocchino
1088fb019d Added an instruction and constant expression for the extractelement
operation.

llvm-svn: 25176
2006-01-10 19:04:13 +00:00
Chris Lattner
536a465ceb Change the signature of replaceUsesOfWithOnConstant to take a Use* and not
take the bool.  The bool is always true dynamically.

llvm-svn: 23625
2005-10-04 18:12:13 +00:00
Chris Lattner
92616caa1a Split SimpleConstantVal up into its components, so each Constant subclass gets
a different enum value.  This allows 'classof' for these to be really simple,
not needing to call getType() anymore.

This speeds up isa/dyncast/etc for constants, and also makes them smaller.
For example, the text section of a release build of InstCombine.cpp shrinks
from 230037 bytes to 216363 bytes, a 6% reduction.

llvm-svn: 23466
2005-09-27 06:08:32 +00:00
Chris Lattner
808a5d8750 Add long-overdue helpers for getting constants with known upper bits
llvm-svn: 23426
2005-09-24 22:57:28 +00:00
Jim Laskey
5f57048c62 Move code dependency for MathExtras.h out of Constants.h.
llvm-svn: 22840
2005-08-17 20:06:22 +00:00
Jim Laskey
61e3d7bca5 Culling out use of unions for converting FP to bits and vice versa.
llvm-svn: 22838
2005-08-17 19:34:49 +00:00
Misha Brukman
3f0aa3dbf8 Remove trailing whitespace
llvm-svn: 21408
2005-04-21 20:19:05 +00:00
Alkis Evlogimenos
19bea8930f Add new function getPtrPtrFromArrayPtr().
llvm-svn: 20684
2005-03-19 11:40:31 +00:00
Chris Lattner
9b289130f7 Eliminate the explicit opcode field in ConstantExpr, using the SubclassData
field to hold it instead.  This shrinks memory usage for 176.gcc from
57628728 to 57598144 bytes, a small reduction of about 30K.

llvm-svn: 20047
2005-02-05 02:00:12 +00:00
Chris Lattner
d8266ae3dd Adjust to changes in the User class.
llvm-svn: 19888
2005-01-29 00:33:00 +00:00
Chris Lattner
79c3a57af7 Change this method to return ulong, not uint, for 64-bit targets.
llvm-svn: 18906
2004-12-13 19:48:51 +00:00
Alkis Evlogimenos
f57d029464 Use getOperand() and remove getElementAt() function.
llvm-svn: 18612
2004-12-08 03:45:20 +00:00
Alkis Evlogimenos
806fb993fe Add accessors for Constants in a ConstantStruct.
llvm-svn: 18550
2004-12-05 20:09:18 +00:00
Misha Brukman
dd92de83ca Fix grammar in comments to getSizeOf()
llvm-svn: 17200
2004-10-24 03:18:30 +00:00
Alkis Evlogimenos
75aa7bdf21 Improve comments and wrap to 80 columns.
llvm-svn: 17198
2004-10-24 03:01:32 +00:00
Alkis Evlogimenos
a893aad8fb Add ConstantExpr::getSizeOf(Type*).
llvm-svn: 17196
2004-10-24 01:41:10 +00:00
Chris Lattner
1217610926 Add new UndefValue class
llvm-svn: 17035
2004-10-16 18:05:25 +00:00
Chris Lattner
aa3facb3fe Update doco, make doxygen more, use standard dividers.
llvm-svn: 16948
2004-10-13 04:44:53 +00:00
Chris Lattner
63ba63bb56 Allow creation of GEP constantexprs with a vector of value* operands as
well as a vector of constant*'s.  It turns out that this is more efficient
and all of the clients want to do that, so we should cater to them.

llvm-svn: 16923
2004-10-11 22:52:25 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Brian Gaeke
01636f4e0f Packed types, brought to you by Brad Jones
llvm-svn: 15938
2004-08-20 06:00:58 +00:00
Chris Lattner
c53f15303d Move method out of line
llvm-svn: 15497
2004-08-04 18:49:52 +00:00
Alkis Evlogimenos
f846e483bb Remove uneeded getValues() functions.
llvm-svn: 15488
2004-08-04 08:47:21 +00:00