Dan Gohman
c852b7450b
Remove an unnecessary static_cast.
...
llvm-svn: 42261
2007-09-24 15:46:02 +00:00
Chris Lattner
1b622ad721
Fix PR1666, SPASS with the CBE and 254.gap with the CBE.
...
GCC optimizes away things like ptr < NULL to false. To "fix" this,
have the CBE emit casts of pointers to intptr_t when doing relational
pointer comparisons.
llvm-svn: 41983
2007-09-15 06:51:03 +00:00
David Greene
8cda5af2e7
Update GEP constructors to use an iterator interface to fix
...
GLIBCXX_DEBUG issues.
llvm-svn: 41697
2007-09-04 15:46:09 +00:00
Chris Lattner
5e16fd8310
Silence implicit 64->32-bit conversion warnings.
...
llvm-svn: 41567
2007-08-29 16:32:50 +00:00
David Greene
5b85021be8
Update InvokeInst to work like CallInst
...
llvm-svn: 41506
2007-08-27 19:04:21 +00:00
Chris Lattner
af91aa2f5e
sink clone() down the class hierarchy from CmpInst into ICmpInst/FCmpInst.
...
This eliminates a conditional on that path, and ensures ICmpInst/FCmpInst
both have an out-of-line virtual method to home the class.
llvm-svn: 41371
2007-08-24 20:48:18 +00:00
Chris Lattner
cce6cf78e4
remove #if 0 code.
...
llvm-svn: 40879
2007-08-06 22:01:53 +00:00
David Greene
f06a395bb9
New CallInst interface to address GLIBCXX_DEBUG errors caused by
...
indexing an empty std::vector.
Updates to all clients.
llvm-svn: 40660
2007-08-01 03:43:44 +00:00
Dan Gohman
d1cc67ea8d
Simplify the logic for setVolatile.
...
llvm-svn: 40130
2007-07-20 23:14:50 +00:00
Dan Gohman
4d64f82ab5
Add constructor overloads for LoadInst and StoreInst that insert at the
...
end of a BasicBlock and have an alignment parameter.
llvm-svn: 40016
2007-07-18 20:51:11 +00:00
Owen Anderson
6644d23a16
Add some accessors to improve consistency.
...
llvm-svn: 37957
2007-07-06 23:13:31 +00:00
Dan Gohman
fad75ac3af
Simplify BranchInst::getSuccessor, avoiding a conditional operator.
...
llvm-svn: 36991
2007-05-11 20:59:29 +00:00
Chris Lattner
9bfe8f4517
add a GEP helper function
...
llvm-svn: 36515
2007-04-27 20:35:56 +00:00
Christopher Lamb
041ee2a78d
PR400 phase 1 implementation feedback.
...
llvm-svn: 36354
2007-04-22 22:22:02 +00:00
Christopher Lamb
5606cd66e2
PR400 work phase 1. Add attributed load/store instructions for volatile/align to LLVM.
...
llvm-svn: 36349
2007-04-22 19:24:39 +00:00
Reid Spencer
4169952dab
For PR1136:
...
Add reference counting to ParamAttrsList and make use of it in Function,
CallInst and InvokeInst classes.
llvm-svn: 36346
2007-04-22 17:28:03 +00:00
Reid Spencer
81070d52da
Revert Christopher Lamb's load/store alignment changes.
...
llvm-svn: 36309
2007-04-21 18:36:27 +00:00
Jeff Cohen
193124f5f1
The expression "SubclassData = (SubclassData & ~1) | (V) ? 1 : 0;" does not do what
...
was intended! | has higher precedence than ?. Caught by Visual Studio.
llvm-svn: 36302
2007-04-21 14:32:59 +00:00
Christopher Lamb
b56b6a7ad7
add support for alignment attributes on load/store instructions
...
llvm-svn: 36301
2007-04-21 08:16:25 +00:00
Chris Lattner
5ed58fc4a9
add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method.
...
Writing it twice in the same day was too much for me.
llvm-svn: 35978
2007-04-14 00:12:57 +00:00
Reid Spencer
93a57ef458
For PR1146:
...
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory
leaks. This will change when ParamAttrsList is uniquified but needs to
be correct until then.
llvm-svn: 35824
2007-04-09 18:00:57 +00:00
Reid Spencer
d2380cfb76
For PR1146:
...
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp
llvm-svn: 35818
2007-04-09 15:01:12 +00:00
Reid Spencer
f632e1cd14
Provide an ICmpInst::makeConstantRange to generate a ConstantRange value
...
from a predicate and an APInt. This is removed from ConstantRange class
so that ConstantRange doesn't have to depend on lib/VMCore.
llvm-svn: 34760
2007-02-28 22:00:54 +00:00
Chris Lattner
0eb72353e4
Refactor the setName stuff, moving it down the inheritance hierarchy, to
...
solve a crash in -instcombine -debug that was hit while investigating PR1217
llvm-svn: 34544
2007-02-24 00:55:48 +00:00
Chris Lattner
134ae17654
make mayWriteToMemory a non-virtual function
...
llvm-svn: 34334
2007-02-15 23:15:00 +00:00
Reid Spencer
e7ff3305d6
For PR1195:
...
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.
llvm-svn: 34300
2007-02-15 03:39:18 +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
Chris Lattner
4534d3fc6e
Switch UnaryOperators to default to passing names up by const char* when possible.
...
This speeds up bcreading by 1.5%.
llvm-svn: 34233
2007-02-13 07:54:42 +00:00
Chris Lattner
326271ee46
eliminate instruction ctors that take vectors.
...
llvm-svn: 34228
2007-02-13 06:22:32 +00:00
Chris Lattner
bc384d8d50
Add invokeinst and callinst ctors that don't take vectors.
...
llvm-svn: 34214
2007-02-13 01:04:01 +00:00
Chris Lattner
94ce3e4550
remove some dead methods.
...
llvm-svn: 34213
2007-02-13 00:58:44 +00:00
Chris Lattner
f94d4a17a7
add #include
...
llvm-svn: 34190
2007-02-12 05:00:35 +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
55e5440018
implement the new GEP instruction ctors.
...
llvm-svn: 33708
2007-01-31 19:47:18 +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
Chris Lattner
018d873ce8
add accessors
...
llvm-svn: 33207
2007-01-14 19:41:24 +00:00
Reid Spencer
964e311d09
Doxygenify a comment.
...
llvm-svn: 32765
2006-12-29 04:10:59 +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
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
6e34ef887b
For PR950:
...
First in a series of patches to convert SetCondInst into ICmpInst and
FCmpInst using only two opcodes and having the instructions contain their
predicate value. Nothing uses these classes yet. More patches to follow.
llvm-svn: 31867
2006-11-20 01:22:35 +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
Chris Lattner
14ad447136
Add insertelement/extractelement helper ctors.
...
llvm-svn: 30750
2006-10-05 06:24:58 +00:00
Chris Lattner
4b7c9854bf
clean up use of 'explicit'. This is PR934.
...
Patch contributed by Kevin Sopp!
llvm-svn: 30701
2006-10-03 17:09:12 +00:00
Nick Lewycky
ad4eb4f0de
Fix findCaseDest to return null when BB is both the default dest and one
...
of the numeric cases.
llvm-svn: 30468
2006-09-18 20:44:37 +00:00
Nick Lewycky
87f79d5d69
Add a new helper method to SwitchInst. Useful when you've got a BB from
...
somewhere (like the dominator graph) and would like to know which case it
came from.
llvm-svn: 30466
2006-09-18 19:03:59 +00:00
Chris Lattner
be102d68c2
add a helper method
...
llvm-svn: 30452
2006-09-18 04:54:57 +00:00
Chris Lattner
547b62a967
Add ShiftInst::isLogical/ArithmeticShift methods.
...
llvm-svn: 30445
2006-09-17 19:29:56 +00:00
Chris Lattner
8aa718b0ed
Add new SetCondInst::isRelational/isEquality methods. Rename
...
Instruction::isRelational to Instruction::isComparison.
llvm-svn: 30444
2006-09-17 19:14:47 +00:00
Chris Lattner
a396e6d9ba
Add some out-of-line virtual dtors so that the class has a "home", preventing
...
vtables for (e.g.) Instruction from being emitted into every .o file.
llvm-svn: 28898
2006-06-21 16:53:47 +00:00
Reid Spencer
55df120f95
Fix some doxygen usage in these headers.
...
llvm-svn: 28394
2006-05-19 19:07:54 +00:00
Chris Lattner
39290ea978
Add alloca/malloc ctors that don't take array sizes.
...
llvm-svn: 28211
2006-05-10 04:38:35 +00:00
Chris Lattner
5324c4f9aa
These instructions always return a packed vector. Improve the class definitions to expose this fact.
...
llvm-svn: 27712
2006-04-14 22:20:07 +00:00
Chris Lattner
80450dd773
Add methods to check insert/extract element instructions for validity
...
llvm-svn: 27522
2006-04-08 04:04:54 +00:00
Chris Lattner
e2d0c1084a
Add a new shufflevector instruction
...
llvm-svn: 27507
2006-04-08 01:15:18 +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
cfaf9f14c0
add an accessor
...
llvm-svn: 24201
2005-11-05 21:58:30 +00:00
Nate Begeman
f299b9fb03
Add support alignment of allocation instructions.
...
Add support for specifying alignment and size of setjmp jmpbufs.
No targets currently do anything with this information, nor is it presrved
in the bytecode representation. That's coming up next.
llvm-svn: 24196
2005-11-05 09:21:28 +00:00
Chris Lattner
752c3e7b35
Mark hasConstantValue as a const method
...
llvm-svn: 22666
2005-08-05 00:49:06 +00:00
Nate Begeman
7547f4085b
Add an extra parameter that Chris requested
...
llvm-svn: 22665
2005-08-04 23:50:43 +00:00
Nate Begeman
ef41400067
Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into
...
BasicBlock's removePredecessor routine. This requires shuffling around
the definition and implementation of hasContantValue from Utils.h,cpp into
Instructions.h,cpp
llvm-svn: 22664
2005-08-04 23:24:19 +00:00
Andrew Lenharth
ce40ab3077
fix DCE + va_arg problem
...
llvm-svn: 22264
2005-06-19 14:46:20 +00:00
Andrew Lenharth
108f509fb5
header file changes for varargs
...
llvm-svn: 22253
2005-06-18 18:31:30 +00:00
Reid Spencer
ba222e3e99
Some cleanups for compilation with GCC 4.0.0 to remove warnings:
...
* Use C++ style casts, not C style casts
* Abstract base classes should have virtual destructor.
llvm-svn: 22057
2005-05-15 16:13:11 +00:00
Jeff Cohen
eafa15885e
Silence VC++ warnings about unsafe mixing of ints and bools with the | operator.
...
llvm-svn: 21758
2005-05-07 02:44:04 +00:00
Chris Lattner
d2dfcb3c0e
Add support for explicit calling conventions
...
llvm-svn: 21745
2005-05-06 20:26:26 +00:00
Chris Lattner
027639a16c
add a default arg
...
llvm-svn: 21733
2005-05-06 06:22:10 +00:00
Chris Lattner
72ffd7e7d5
Add a 'tail' marker for call instructions, patch contributed by
...
Alexander Friedman.
llvm-svn: 21722
2005-05-06 05:51:46 +00:00
Chris Lattner
e53a188512
add direct support for making GEP instrs with one index
...
llvm-svn: 21665
2005-05-03 05:43:30 +00:00
Misha Brukman
3f0aa3dbf8
Remove trailing whitespace
...
llvm-svn: 21408
2005-04-21 20:19:05 +00:00
Misha Brukman
d5e8033d4a
Convert tabs to spaces
...
llvm-svn: 20634
2005-03-16 03:46:55 +00:00
Chris Lattner
902d9dc660
switch instructions only allow constantints for their values, be more specific.
...
llvm-svn: 20298
2005-02-24 05:32:09 +00:00
Chris Lattner
7eb45f89a5
Eliminate the explicit volatile fields in LoadInst and StoreInst. This shrinks
...
LoadInst from 60 -> 56 bytes and StoreInst from 76 -> 72 bytes.
Note however, that this doesn't actually save any memory on common systems
where 'malloc' returns 8-byte aligned memory, as the saved space is replaced
by useless alignment padding. :(
llvm-svn: 20046
2005-02-05 01:44:18 +00:00
Chris Lattner
6e2367383d
Many changes to cope with the User.h changes. Instructions now generally
...
directly embed their operands.
llvm-svn: 19885
2005-01-29 00:31:36 +00:00
Chris Lattner
d104c10aa5
Add missing accessor.
...
llvm-svn: 18775
2004-12-10 20:35:47 +00:00
Chris Lattner
6adc42af75
Remove dead field
...
llvm-svn: 18412
2004-12-02 02:35:38 +00:00
Chris Lattner
37651b157b
Update comments, now that CPR's are gone, inline the methods
...
llvm-svn: 17957
2004-11-18 17:46:57 +00:00
Alkis Evlogimenos
b9e38d3cc5
Make ReturnInst accept a value of type void as the return value. The
...
ReturnInst constructed is the same as if NULL was passed instead of
the void value.
llvm-svn: 17923
2004-11-17 21:02:25 +00:00
Chris Lattner
60e159a806
Warning fixes for VC++, contributed by Morten Ofstad!
...
llvm-svn: 17831
2004-11-15 19:02:35 +00:00
Chris Lattner
dd0094e4ed
Convert 'struct' to 'class' in various places to adhere to the coding standards
...
and work better with VC++. Patch contributed by Morten Ofstad!
llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Chris Lattner
423a692a5b
Add new UnreachableInst class
...
llvm-svn: 17037
2004-10-16 18:05:54 +00:00
Chris Lattner
b222ad66ef
Move the implementation of the clone method for these classes to
...
Instructions.cpp, so that a vtable is not emitted into every translation unit
that uses the classes.
llvm-svn: 17025
2004-10-15 23:52:05 +00:00
Alkis Evlogimenos
fb27f702ca
Merge i*.h headers into Instructions.h as part of bug403.
...
llvm-svn: 15325
2004-07-29 12:17:34 +00:00
John Criswell
16c6cda9d5
Added LLVM copyright header (for lack of a better term).
...
llvm-svn: 9304
2003-10-20 20:19:47 +00:00
Chris Lattner
37a2301f9e
New helper header
...
llvm-svn: 5423
2003-01-27 22:08:52 +00:00