Owen Anderson
7d42b95b6c
Move Threading.[h|cpp] from Support to System.
...
llvm-svn: 73707
2009-06-18 16:54:52 +00:00
Owen Anderson
f89c38cace
Factor out some common code.
...
llvm-svn: 73631
2009-06-17 20:43:39 +00:00
Owen Anderson
65c5cd728e
Add an RAII ScopedWriter, which allows one to acquire a writer lock for the duration of a scope. Simplify a lot of uses of
...
writer locks in Constants.cpp by using it.
llvm-svn: 73630
2009-06-17 20:34:43 +00:00
Owen Anderson
61794049e4
Simplify the locking on the Constants tables, and make it more efficient, by pushing it into the ValueMap from the callers.
...
Document those ValueMap functions that are _not_ locked, so that callers are aware that they need to do the locking themselves.
llvm-svn: 73628
2009-06-17 20:10:08 +00:00
Owen Anderson
2d7231d4c3
Type safety for Constants.cpp! Some of this is temporary, as I'm planning to push some of the R/W locking into FoldingSet.
...
llvm-svn: 73624
2009-06-17 18:40:29 +00:00
Dan Gohman
7889f2b5e2
Use Type::isIntOrIntVector and Type::isFPOrFPVector.
...
llvm-svn: 73433
2009-06-15 22:25:12 +00:00
Dan Gohman
7ccc52f131
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
a5b9645c4b
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
adbc284666
Give embedded metadata its own type instead of relying on EmptyStructTy.
...
llvm-svn: 72610
2009-05-30 05:06:04 +00:00
Duncan Sands
d334aca93f
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
b8f9b7a965
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
Nick Lewycky
49f891958f
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
Anton Korobeynikov
255a3cbfb4
Fix infinite looping
...
llvm-svn: 68034
2009-03-30 15:28:21 +00:00
Anton Korobeynikov
d5e8e93a92
Properly propagate Kind.
...
llvm-svn: 68033
2009-03-30 15:28:00 +00:00
Anton Korobeynikov
7437b59caf
Extend the relocation tracker handler, so we can filter on different 'kinds' of relocations required.
...
llvm-svn: 68004
2009-03-29 17:13:18 +00:00
Chris Lattner
cbeda87da1
add a fastpath to ConstantExpr::getBitCast to handle the case when an obviously
...
unneeded bitcast is requested. This is common for frontends who just unconditionally
cast even if the target is often the right type already. THis prevents going into
getFoldedCast which switches on the opcode and does a bunch of other stuff before
doing the same opzn.
llvm-svn: 67435
2009-03-21 06:55:54 +00:00
Dan Gohman
79975d5ffb
Apply a patch by Micah Villmow to fix AsmParser to accept vector
...
shift constant expressions, and add support for folding vector
shift constant expressions. This fixes PR3802.
llvm-svn: 67010
2009-03-14 17:09:17 +00:00
Chris Lattner
e408601cec
fix typo
...
llvm-svn: 66367
2009-03-08 04:06:26 +00:00
Dan Gohman
92b551bc2b
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
Nate Begeman
94aa38d568
Add suppport for ConstantExprs of shufflevectors whose result type is not equal to the
...
type of the vectors being shuffled.
llvm-svn: 64401
2009-02-12 21:28:33 +00:00
Chris Lattner
4163213750
select constant exprs should have the same constraints as select instructions,
...
notably, they should support vectors and aggregates.
llvm-svn: 61462
2008-12-29 00:16:12 +00:00
Dan Gohman
8214fc12a3
Make ConstantAggregateZero::get return a ConstantAggregateZero*,
...
as suggested in PR3182.
llvm-svn: 60691
2008-12-08 07:10:54 +00:00
Devang Patel
d26344d252
Fix unused variable warnings.
...
llvm-svn: 58653
2008-11-03 23:20:04 +00:00
Bill Wendling
97f7de8875
Fix type-o in ExprMapKeyType::operator ==(). The "&&" was missing.
...
Patch by Frits van Bommel!
llvm-svn: 58175
2008-10-26 00:19:56 +00:00
Dale Johannesen
4f0bd68cfe
Add a "loses information" return value to APFloat::convert
...
and APFloat::convertToInteger. Restore return value to
IEEE754. Adjust all users accordingly.
llvm-svn: 57329
2008-10-09 23:00:39 +00:00
Gordon Henriksen
b52d1ed7e9
Fix ConstantExpr::getInsertElement.
...
Breakage was exposed in the Ocaml bindings tests after Chris
uncommented an assertion in r55084.
llvm-svn: 55566
2008-08-30 15:41:51 +00:00
Chris Lattner
f97ab6df07
the bug was apparently fixed long ago, reenable the assertion
...
llvm-svn: 55224
2008-08-23 03:48:35 +00:00
Dale Johannesen
47a5ef381e
Accept NOT of a constant vector of int.
...
llvm-svn: 55140
2008-08-21 21:20:09 +00:00
Chris Lattner
b078e28338
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
Dan Gohman
e955c481fd
Fix several const-correctness issues, resolving some -Wcast-qual warnings.
...
llvm-svn: 54349
2008-08-05 14:45:15 +00:00
Nate Begeman
098cc6f22c
Remove unnecessary implicit argument
...
llvm-svn: 54031
2008-07-25 17:56:27 +00:00
Nate Begeman
c96e2e4968
Fix minor issues with VICmp/VFCmp constant expressions
...
llvm-svn: 54030
2008-07-25 17:35:37 +00:00
Dan Gohman
d5d24f63fd
InsertValue and ExtractValue constant expressions are always
...
folded. Remove code that handled the case where they aren't
folded, and remove bitcode reader/writer support for them.
llvm-svn: 53887
2008-07-21 23:30:30 +00:00
Chris Lattner
eab49263b5
Fix a bunch of bugs handling vector compare constant expressions, fixing
...
PR2317.
llvm-svn: 53544
2008-07-14 05:17:31 +00:00
Chris Lattner
c5098a2877
Document and fix Constant::getVectorElements to return an empty vector
...
when presented with a constant expr.
If ConstantExpr::getV[IF]Cmp to work when ConstantFoldCompareInstruction
returns an undef or constant expr.
llvm-svn: 53541
2008-07-14 05:10:41 +00:00
Dan Gohman
3707f1daba
Use find instead of lower_bound.
...
llvm-svn: 53474
2008-07-11 20:58:19 +00:00
Chris Lattner
d977c07680
SImplify ConstantVector::get a bit and make it turn a vector
...
of all undefs into a single undef value.
llvm-svn: 53384
2008-07-10 00:44:03 +00:00
Chris Lattner
2105d66c05
add a helper method for code that wants to handle vector
...
constants by element without caring how they are formed.
llvm-svn: 53381
2008-07-10 00:28:11 +00:00
Matthijs Kooijman
ba5d7efc6c
Add newline at the end of Constants.cpp.
...
llvm-svn: 53092
2008-07-03 07:46:41 +00:00
Evan Cheng
da3db11db3
- Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag.
...
- Correctly handle memcpy from constant string which is zero-initialized.
llvm-svn: 52891
2008-06-30 07:31:25 +00:00
Anton Korobeynikov
a7c583d584
Revert (52748 and friends):
...
Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.
This unbreaks llvm-gcc bootstrap.
llvm-svn: 52884
2008-06-29 17:57:03 +00:00
Eric Christopher
d0ab9c47e6
Move GetConstantStringInfo to lib/Analysis. Remove
...
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.
llvm-svn: 52748
2008-06-26 00:31:12 +00:00
Owen Anderson
ee9c30d435
Use push_back rather than operator[], which is incorrect in this cases. Unfortunately, this slow the testcase down a little bit,
...
but only marginally.
llvm-svn: 52700
2008-06-25 01:05:05 +00:00
Owen Anderson
79c69bc45f
In ConstantArray::getAsString(), we know the size of the resultant string in advance so we can pre-allocate it and just fill in
...
the entries. This improves the time for the AsmPrinter on InstructionCombining.cpp from 0.4248s to 0.3370s.
llvm-svn: 52690
2008-06-24 21:58:29 +00:00
Dan Gohman
a469bdbcdf
More changes from Chris' review: simplify getIndices and avoid
...
copying its return value.
llvm-svn: 52627
2008-06-23 16:39:44 +00:00
Dan Gohman
3db11c2bd9
Constant folding for insertvalue and extractvalue.
...
llvm-svn: 51889
2008-06-03 00:15:20 +00:00
Dan Gohman
7bb04509f2
Fix some bugs with the handling of indices in insertvalue/extractvalue.
...
llvm-svn: 51820
2008-05-31 19:09:08 +00:00
Dan Gohman
1ecaf45cf1
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
Gabor Greif
2d3024d838
eliminate calls to deprecated Use::init() interface
...
llvm-svn: 51570
2008-05-26 21:33:52 +00:00
Dan Gohman
0752bffe9a
Add more IR support for the new extractvalue and insertvalue
...
instructions.
llvm-svn: 51461
2008-05-23 00:36:11 +00:00