Nuno Lopes
0460bb27e0
fix memory leak in pass manager when adding an analysis pass that already existed. as pass manager takes ownership of the added passes, it has to delete the pass if it isnt added to the pass list
...
tweak the opt tool so that it doesnt access a Pass after the ownership was taken by the pass manager
llvm-svn: 58730
2008-11-04 23:03:58 +00:00
Bill Wendling
2f40956c68
- Add a "getOrInsertGlobal" method to the Module class. This acts similarly to
...
"getOrInsertFunction" in that it either adds a new declaration of the global
and returns it, or returns the current one -- optionally casting it to the
correct type.
- Use the new getOrInsertGlobal in the stack protector code.
- Use "splitBasicBlock" in the stack protector code.
llvm-svn: 58727
2008-11-04 22:51:24 +00:00
Dan Gohman
20687e99b7
Duncan pointed out that the Extended case in getTypeForMVT could
...
be considerably simplified.
llvm-svn: 58703
2008-11-04 16:19:44 +00:00
Dan Gohman
72d10ab9ad
Add a return statement to suppress warnings in NDEBUG builds.
...
llvm-svn: 58702
2008-11-04 16:08:57 +00:00
Dan Gohman
ade09cd9d3
Add some asserts to verify MVT invariant assumptions.
...
llvm-svn: 58701
2008-11-04 16:03:56 +00:00
Devang Patel
d26344d252
Fix unused variable warnings.
...
llvm-svn: 58653
2008-11-03 23:20:04 +00:00
Dan Gohman
d5104a5de6
Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel!
...
llvm-svn: 58650
2008-11-03 22:55:43 +00:00
Dan Gohman
d7546abb8a
Change how extended types are represented in MVTs. Instead of fiddling
...
bits, use a union of a SimpleValueType enum and a regular Type*.
This increases the size of MVT on 64-bit hosts from 32 bits to 64 bits.
In most cases, this doesn't add significant overhead. There are places
in codegen that use arrays of MVTs, so these are now larger, but
they're small in common cases.
This eliminates restrictions on the size of integer types and vector
types that can be represented in codegen. As the included testcase
demonstrates, it's now possible to codegen very large add operations.
There are still some complications with using very large types. PR2880
is still open so they can't be used as return values on normal targets,
there are no libcalls defined for very large integers so operations
like multiply and divide aren't supported.
This also introduces a minimal tablgen Type library, capable of
handling IntegerType and VectorType. This will allow parts of
TableGen that don't depend on using SimpleValueType values to handle
arbitrary integer and vector types.
llvm-svn: 58623
2008-11-03 17:56:27 +00:00
Sanjiv Gupta
20b9687450
Reverting back 58505. Will commit it once I have the bc reader/writer/docs
...
ready.
llvm-svn: 58547
2008-11-01 10:57:12 +00:00
Sanjiv Gupta
e3ba47b71b
For some targets pointer and int are 16-bits. Allow 16-bits as a valid index
...
in such cases.
llvm-svn: 58505
2008-10-31 10:26:20 +00:00
Daniel Dunbar
db0b70a937
Reuse PrintEscapedString for printing names in .ll
...
- One functionality change, '\\' in a name is now printed as a hex
escape instead of "\\\\". This is consistent with other users of
PrintEscapedString.
llvm-svn: 58343
2008-10-28 19:33:02 +00:00
Nick Lewycky
c5a68d26d9
Fix an obvious copy/pasto.
...
llvm-svn: 58231
2008-10-27 07:28:44 +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
Gordon Henriksen
bf40eee91a
Related to PR2911, reject as invalid non-pointer GC roots.
...
llvm-svn: 58143
2008-10-25 16:28:35 +00:00
Daniel Dunbar
81b5fa5620
Move Print*Pass to use raw_ostream.
...
llvm-svn: 57946
2008-10-22 03:25:22 +00:00
Oscar Fuentes
f3c03b02dc
CMake: Turned some libraries into partially linked objects. Corrected
...
names of LLVMCore and ARMCodeGen.
llvm-svn: 57943
2008-10-22 02:51:53 +00:00
Oscar Fuentes
7089213eec
CMake: updated lib/VMCore/CMakeLists.txt
...
llvm-svn: 57937
2008-10-21 23:52:03 +00:00
Daniel Dunbar
54d5b9ea2c
Privatize PrintModulePass and PrintFunctionPass and add
...
createPrintModulePass and createPrintFunctionPass.
- So clients who compile w/o RTTI can use them.
llvm-svn: 57933
2008-10-21 23:33:38 +00:00
Chris Lattner
860df6e84c
Keep track of *which* input constraint matches an output
...
constraint. Reject asms where an output has multiple
input constraints tied to it.
llvm-svn: 57687
2008-10-17 16:47:46 +00:00
Gabor Greif
0bd120e817
Introduce a typing refinenement on tagged data
...
using the 'volatile' qualifier. This should not have any operational consequences
on code, because tags should always be stripped off (giving a non-volatile pointer)
before dereferencing. The new qualification is there to catch some attempts to use
tagged pointers in a context where an untagged pointer is appropriate.
Notably this approach does not catch dereferencing of tagged pointers, but helps
in separating the two concepts a bit.
llvm-svn: 57641
2008-10-16 15:33:02 +00:00
Chris Lattner
229f765dbe
Verify prefetch arguments, PR2576.
...
llvm-svn: 57626
2008-10-16 06:00:36 +00:00
Chris Lattner
1baace07c4
apply Eli's patch for PR2165 and provide a testcase.
...
llvm-svn: 57625
2008-10-16 05:26:51 +00:00
Dan Gohman
fc27e25a6e
Fix Instruction::isIdenticalTo and isSameOperationAs to recognize
...
additional information in Loads, Stores, Calls, Invokes,
InsertValueInsts, and ExtractValueInsts.
llvm-svn: 57620
2008-10-16 01:24:45 +00:00
Dan Gohman
7847142f26
Correct the name of isTrapping in comments.
...
llvm-svn: 57606
2008-10-15 22:56:21 +00:00
Dan Gohman
c7e00ba60f
Fix a missing space after the return type in invoke statements.
...
This fixes PR2894.
llvm-svn: 57589
2008-10-15 18:02:08 +00:00
Daniel Dunbar
0f8155ae4e
Prevent assert when using '"' in names (via hexadecimal).
...
Update LangRef to mention \xx quoting in names.
llvm-svn: 57538
2008-10-14 23:51:43 +00:00
Daniel Dunbar
389529a7df
Change getLLVMName to use raw_ostream & PrintLLVMName.
...
- Avoids duplicated quotification code.
- Remove QuoteNameIfNeeded.
- No functionality change.
llvm-svn: 57537
2008-10-14 23:28:09 +00:00
Daniel Dunbar
d94184395f
Unbreak DbgStopPointInst::getFileName().
...
llvm-svn: 57373
2008-10-11 06:40: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
Dale Johannesen
54306fe499
Rename APFloat::convertToAPInt to bitcastToAPInt to
...
make it clearer what the function does. No functional
change.
llvm-svn: 57325
2008-10-09 18:53:47 +00:00
Duncan Sands
26ff6f9c54
Add <cstdio> include where needed by gcc-4.4.
...
Patch by Samuel Tardieu.
llvm-svn: 57291
2008-10-08 07:23:46 +00:00
Devang Patel
c3e3ca9a45
Remove interfaces implemented by dead pass from the list of available passes.
...
Patch By Matthijs Kooijman.
llvm-svn: 57202
2008-10-06 20:36:36 +00:00
Chris Lattner
851e72cd22
fix an incorrect and extremely confusing error message
...
llvm-svn: 57123
2008-10-05 18:24:03 +00:00
Devang Patel
e4924e1026
Fix function attribute verification check.
...
Thanks Duncan!
llvm-svn: 57029
2008-10-03 21:11:02 +00:00
Devang Patel
37165b13e5
Verify function attributes.
...
llvm-svn: 57020
2008-10-03 17:50:00 +00:00
Devang Patel
0db9d67f9a
Remove redundant check.
...
llvm-svn: 56960
2008-10-02 18:38:23 +00:00
Devang Patel
9cc9812653
Attributes noinline alwaysinline are incompatible
...
llvm-svn: 56939
2008-10-01 23:41:25 +00:00
Chris Lattner
41a83d99e6
add a new form of Type::dump that takes a module for type names,
...
patch provided by Tomas Lindquist Olsen!
llvm-svn: 56929
2008-10-01 20:16:19 +00:00
Dan Gohman
1dd27578dd
Make some implicit conversions explicit, to avoid compiler warnings.
...
llvm-svn: 56927
2008-10-01 19:58:59 +00:00
Duncan Sands
d65a4daeea
Factorize code: remove variants of "strip off
...
pointer bitcasts and GEP's", and centralize the
logic in Value::getUnderlyingObject. The
difference with stripPointerCasts is that
stripPointerCasts only strips GEPs if all
indices are zero, while getUnderlyingObject
strips GEPs no matter what the indices are.
llvm-svn: 56922
2008-10-01 15:25:41 +00:00
Dan Gohman
fbd67be50e
Don't prepend a space character for constants in Value::print.
...
llvm-svn: 56920
2008-10-01 15:09:37 +00:00
Devang Patel
221fe42006
Support inreg, zext and sext as return value attributes.
...
llvm-svn: 56801
2008-09-29 20:49:50 +00:00
Devang Patel
9eb525d4f9
Implement function notes as function attributes.
...
llvm-svn: 56716
2008-09-26 23:51:19 +00:00
Devang Patel
a05633e105
Now Attributes are divided in three groups
...
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn
Return attributes use 0 as the index.
Function attributes use ~0U as the index.
This patch requires corresponding changes in llvm-gcc and clang.
llvm-svn: 56704
2008-09-26 22:53:05 +00:00
Dan Gohman
5628f642ad
Fix missing whitespace in the printing of function notes.
...
llvm-svn: 56702
2008-09-26 22:02:59 +00:00
Dale Johannesen
a7dd8bfaa5
Another file I forgot.
...
llvm-svn: 56678
2008-09-26 19:31:53 +00:00
Dale Johannesen
0e32a2c935
Add "inreg" field to CallSDNode (doesn't increase
...
its size). Adjust various lowering functions to
pass this info through from CallInst. Use it to
implement sseregparm returns on X86. Remove
X86_ssecall calling convention.
llvm-svn: 56677
2008-09-26 19:31:26 +00:00
Bill Wendling
0c37421623
Make pointer parameter const for isUsedInBasicBlock.
...
llvm-svn: 56625
2008-09-25 22:42:01 +00:00
Devang Patel
4c758ea3e0
Large mechanical patch.
...
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g
This sets the stage
- to implement function notes as function attributes and
- to distinguish between function attributes and return value attributes.
This requires corresponding changes in llvm-gcc and clang.
llvm-svn: 56622
2008-09-25 21:00:45 +00:00
Dan Gohman
bb9a211530
Avoid a spurious extra space character when printing empty structs.
...
llvm-svn: 56616
2008-09-25 17:37:20 +00:00
Oscar Fuentes
ace327af3e
CMake: Lists of source files updated. Removed bogus dependency from
...
lib/VMCore/CMakeLists.txt
llvm-svn: 56541
2008-09-24 01:58:12 +00:00
Devang Patel
6402c7236f
s/ParamAttrsWithIndex/FnAttributeWithIndex/g
...
llvm-svn: 56535
2008-09-24 00:55:02 +00:00
Devang Patel
0009505a25
s/ParamAttributeListImpl/AttributeListImpl/g
...
llvm-svn: 56532
2008-09-24 00:29:49 +00:00
Devang Patel
e15607b7bb
Put FN_NOTE_AlwaysInline and others in FnAttr namespace.
...
llvm-svn: 56527
2008-09-24 00:06:15 +00:00
Devang Patel
e87abd26ba
Move FN_NOTE_AlwaysInline and other out of ParamAttrs namespace.
...
Do not check isDeclaration() in hasNote(). It is clients' responsibility.
llvm-svn: 56524
2008-09-23 23:52:03 +00:00
Devang Patel
f405b5e532
80 cols
...
llvm-svn: 56521
2008-09-23 23:32:15 +00:00
Devang Patel
ba3fa6c6e1
s/ParameterAttributes/Attributes/g
...
llvm-svn: 56513
2008-09-23 23:03:40 +00:00
Devang Patel
82fed6702b
Use parameter attribute store (soon to be renamed) for
...
Function Notes also. Function notes are stored at index ~0.
llvm-svn: 56511
2008-09-23 22:35:17 +00:00
Duncan Sands
9c40c28926
Rationalize the names of passes that print information:
...
-callgraph => print-callgraph
-callscc => print-callgraph-sccs
-cfgscc => print-cfg-sccs
-externalfnconstants => print-externalfnconstants
-print => print-function
-print-alias-sets (no change)
-print-callgraph => dot-callgraph
-print-cfg => dot-cfg
-print-cfg-only => dot-cfg-only
-print-dom-info (no change)
-printm => print-module
-printusedtypes => print-used-types
llvm-svn: 56487
2008-09-23 12:47:39 +00:00
Devang Patel
329fe728b5
Add hasNote() to check note associated with a function.
...
llvm-svn: 56477
2008-09-22 22:32:29 +00:00
Oscar Fuentes
a229b3c9a7
Initial support for the CMake build system.
...
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Gabor Greif
715b9d2403
backing out my last commit, it was not intended to go on the trunk
...
llvm-svn: 56349
2008-09-19 15:13:20 +00:00
Gabor Greif
92f17070e7
first shot at removing Use::Val
...
untested, Use::swap() is definitely not done yet
llvm-svn: 56348
2008-09-19 15:03:57 +00:00
Dan Gohman
81313fd8d1
Fix WriteAsOperand to not emit a leading space character. Adjust
...
its callers to emit a space character before calling it when a
space is needed.
This fixes several spurious whitespace issues in
ScalarEvolution's debug dumps. See the test changes for
examples.
This also fixes odd space-after-tab indentation in the output
for switch statements, and changes calls from being printed like
this:
call void @foo( i32 %x )
to this:
call void @foo(i32 %x)
llvm-svn: 56196
2008-09-14 17:21:12 +00:00
Devang Patel
18ff6367f7
Add assertion check.
...
llvm-svn: 56016
2008-09-09 21:38:40 +00:00
Anton Korobeynikov
1a1140429e
Make safer variant of alias resolution routine to be default
...
llvm-svn: 56005
2008-09-09 20:05:04 +00:00
Anton Korobeynikov
4e518041d3
Fix typo
...
llvm-svn: 55998
2008-09-09 18:24:07 +00:00
Anton Korobeynikov
ac2c655808
Fix incorrect linker behaviour: we shouldn't resolve weak aliases.
...
llvm-svn: 55997
2008-09-09 18:23:48 +00:00
Devang Patel
a328690ed3
Simplify.
...
Fix outdated comment.
llvm-svn: 55993
2008-09-09 17:56:50 +00:00
Dan Gohman
c579d978a3
Extend the vcmp/fcmp LLVM IR instructions to take vectors as arguments
...
and, if so, to return a vector of boolean as a result;
Extend the select LLVM IR instruction to allow you to specify a result
type which is a vector of boolean, in which case the result will be an
element-wise selection instead of choosing one vector or the other; and
Update LangRef.html to describe these changes.
This patch was contributed by Preston Gurd!
llvm-svn: 55969
2008-09-09 01:02:47 +00:00
Dan Gohman
c05dca95a2
Bitcasting two or from aggregate types is not permitted. Update
...
LangRef.html, and teach the verifier to check bitcast instructions.
llvm-svn: 55921
2008-09-08 16:45:59 +00:00
Dan Gohman
a79db30d28
Tidy up several unbeseeming casts from pointer to intptr_t.
...
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Devang Patel
397d895bb8
Avoid extra comma.
...
llvm-svn: 55742
2008-09-03 22:55:40 +00:00
Devang Patel
3771a1281f
Parse and print opt_size note.
...
llvm-svn: 55740
2008-09-03 22:10:21 +00:00
Nick Lewycky
ac5c7d514f
Try to fold each element of a vector. This is needed to maintain structural
...
equivalence.
llvm-svn: 55694
2008-09-03 06:48:55 +00:00
Nick Lewycky
f023db6444
Don't crash when trying to constant fold a vector with some elements that can't
...
be folded. Instead, fail to fold the entire vector.
We could also return a vector with some elements folded and some not. If anyone
thinks that's a better approach, please speak up!
llvm-svn: 55689
2008-09-03 05:54:33 +00:00
Devang Patel
7e59270272
s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
...
llvm-svn: 55676
2008-09-02 22:43:57 +00:00
Devang Patel
805b37ca43
Use bitwise AND.
...
llvm-svn: 55656
2008-09-02 21:46:44 +00:00
Devang Patel
600879c8e8
Print function notes.
...
llvm-svn: 55647
2008-09-02 20:56:33 +00:00
Devang Patel
d334a43a86
Initialize function notes.
...
llvm-svn: 55645
2008-09-02 20:51:15 +00:00
Nuno Lopes
99341f2d9d
plug a little memleak in verifyFunction()
...
# first commit to llvm, so whatch out :)
llvm-svn: 55631
2008-09-02 11:30:10 +00:00
Gordon Henriksen
eeb6537abb
PR2731: C and Ocaml bindings for setTailCall and isTailCall.
...
Based on patch by Giorgos Korfiatis.
llvm-svn: 55570
2008-08-30 16:34:54 +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
b25e5eab23
Asmprint nameless instructions as:
...
%4 = add ...
instead of:
add ... ; 4
This makes opt -print-cfg output actually usable and makes .ll files
generally easier to read. This fixes PR2480
llvm-svn: 55541
2008-08-29 17:19:30 +00:00
Chris Lattner
e5a22c06c5
Make the verifier reject instructions which have null pointers
...
for operands: rdar://6179606. no testcase, because I can't write
a .ll file that is this broken ;-)
llvm-svn: 55460
2008-08-28 04:02:44 +00:00
Bill Wendling
25b4cad510
Put file scoped constants in an anonymous namespace. Use the "using namespace
...
llvm" for consistency.
llvm-svn: 55435
2008-08-27 21:10:13 +00:00
Chris Lattner
81e23091d9
Minor cleanup.
...
llvm-svn: 55423
2008-08-27 17:36:58 +00:00
Dan Gohman
6d618724b5
Diagnose uses of unsized types with the byval attribute in the
...
verifier. See PR2711 for details.
llvm-svn: 55414
2008-08-27 14:48:06 +00:00
Dan Gohman
4051bf47ec
Update wording, as aggregates are now first-class.
...
llvm-svn: 55413
2008-08-27 14:44:57 +00:00
Evan Cheng
183edfdd86
Add DebugInfoBuilder. Patch by Talin!
...
llvm-svn: 55409
2008-08-27 06:51:14 +00:00
Chris Lattner
dab9425547
Fix pasto (values -> types) noticed by Josh Conner
...
llvm-svn: 55315
2008-08-25 17:03:15 +00:00
Chris Lattner
820eebc5a8
flush stream after dumping.
...
llvm-svn: 55301
2008-08-25 04:55:46 +00:00
Chris Lattner
25852069ed
remove the type checking logic already done by tblgen, just keep the
...
parts tblgen doesn't do (checking for constant, alloca, enclosing
function has gc marker). This passes dj! :)
llvm-svn: 55294
2008-08-24 20:46:13 +00:00
Chris Lattner
d758625083
add a hack to temporarily allow pseudo source values.
...
llvm-svn: 55289
2008-08-24 18:33:17 +00:00
Chris Lattner
82ff923091
minor cleanups.
...
llvm-svn: 55267
2008-08-23 22:52:27 +00:00
Chris Lattner
0c19df4871
Switch the asmprinter (.ll) and all the stuff it requires over to
...
use raw_ostream instead of std::ostream. Among other goodness,
this speeds up llvm-dis of kc++ with a release build from 0.85s
to 0.49s (88% faster).
Other interesting changes:
1) This makes Value::print be non-virtual.
2) AP[S]Int and ConstantRange can no longer print to ostream directly,
use raw_ostream instead.
3) This fixes a bug in raw_os_ostream where it didn't flush itself
when destroyed.
4) This adds a new SDNode::print method, instead of only allowing "dump".
A lot of APIs have both std::ostream and raw_ostream versions, it would
be useful to go through and systematically anihilate the std::ostream
versions.
This passes dejagnu, but there may be minor fallout, plz let me know if
so and I'll fix it.
llvm-svn: 55263
2008-08-23 22:23:09 +00:00
Bill Wendling
05604e0515
Reverting r55227. This was causing the following failures in the regression
...
tests:
Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcread-ptrptr.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcread-ptrptr.ll >& /dev/null
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-alloca.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-alloca.ll >& /dev/null
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-meta.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-meta.ll >& /dev/null
child process exited abnormally
FAIL: ndbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-ptrptr.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-ptrptr.ll >& /dev/null
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcwrite-ptrptr.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcwrite-ptrptr.ll >& /dev/null
child process exited abnormally
=== Summary ===
# of expected passes 3021
# of unexpected failures 6
# of expected failures 16
make[1]: *** [check-local] Error 1
make: *** [check] Error 2
llvm-svn: 55233
2008-08-23 09:46:46 +00:00
Chris Lattner
ecded9a22b
Verify that the alignment argument to llvm.memcpy is a constant
...
integer, PR2318.
llvm-svn: 55228
2008-08-23 05:31:10 +00:00
Chris Lattner
4fe10837c3
remove verification for gc intrinsic argument types. it was indented wrong
...
and tblgen now knows intrinsic prototypes.
llvm-svn: 55227
2008-08-23 05:26:35 +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
Chris Lattner
585297e851
more cleanups, random methods shouldn't return ostreams.
...
llvm-svn: 54984
2008-08-19 05:26:17 +00:00
Chris Lattner
1508d3f0fc
more cleanup, eliminate getLLVMName when printing out
...
type names at the top of the file.
llvm-svn: 54983
2008-08-19 05:16:28 +00:00
Chris Lattner
3a36d2ce81
random cleanups, factor some printing code for linkage and visibility
...
llvm-svn: 54982
2008-08-19 05:06:27 +00:00
Chris Lattner
604e351456
Change WriteTypeSymbolic/WriteAsOperand to return void instead of
...
an ostream, which is just weird.
Rename SC_DEBUG -> ST_DEBUG
Remove static indentation strangeness from WriteConstantInt. This makes it
so that large structs are not broken down and printed on multiple lines. If
there is demand for this to return, there are better ways to implement this.
llvm-svn: 54981
2008-08-19 04:47:09 +00:00
Chris Lattner
85ac9b1e4a
whitespace cleanup
...
llvm-svn: 54980
2008-08-19 04:45:47 +00:00
Chris Lattner
3eee99c322
rearrange code and make more legible.
...
llvm-svn: 54976
2008-08-19 04:36:02 +00:00
Chris Lattner
3ee5876a7b
put SlotTracker in an anon namespace since it is private.
...
llvm-svn: 54975
2008-08-19 04:28:07 +00:00
Chris Lattner
e36fd8a2ff
Reid had to call this class "slot machine" out of some strange reference
...
to the gambling device. Name it something more meaningful.
llvm-svn: 54974
2008-08-19 04:26:57 +00:00
Chris Lattner
30fc0583b3
Fix a bug daniel pointed out to me, where asmprinter started
...
printing ascii code for hex numbers instead of the hex numbers
themselves.
llvm-svn: 54936
2008-08-18 19:41:26 +00:00
Gordon Henriksen
d930f913e6
Rename some GC classes so that their roll will hopefully be clearer.
...
In particular, Collector was confusing to implementors. Several
thought that this compile-time class was the place to implement
their runtime GC heap. Of course, it doesn't even exist at runtime.
Specifically, the renames are:
Collector -> GCStrategy
CollectorMetadata -> GCFunctionInfo
CollectorModuleMetadata -> GCModuleInfo
CollectorRegistry -> GCRegistry
Function::getCollector -> getGC (setGC, hasGC, clearGC)
Several accessors and nested types have also been renamed to be
consistent. These changes should be obvious.
llvm-svn: 54899
2008-08-17 18:44:35 +00:00
Chris Lattner
663d292430
getLLVMName is only used for types now, which always pass in LocalPrefix. Specialize on it.
...
llvm-svn: 54897
2008-08-17 17:28:37 +00:00
Chris Lattner
a204d41ac7
switch valuemap's from std::map to densemap. This speeds up llvm-dis
...
on a stripped kc++ .bc file from 0.83 to 0.77s (8%)
llvm-svn: 54896
2008-08-17 17:25:25 +00:00
Chris Lattner
edceac3861
avoid an extraneous std::string construction
...
llvm-svn: 54875
2008-08-17 07:24:08 +00:00
Chris Lattner
17f7165f84
Rework the routines that convert AP[S]Int into a string. Now, instead of
...
returning an std::string by value, it fills in a SmallString/SmallVector
passed in. This significantly reduces string thrashing in some cases.
More specifically, this:
- Adds an operator<< and a print method for APInt that allows you to
directly send them to an ostream.
- Reimplements APInt::toString to be much simpler and more efficient
algorithmically in addition to not thrashing strings quite as much.
This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the
asmprinter. This also fixes a bug I introduced into the asmwriter in a
previous patch w.r.t. alias printing.
llvm-svn: 54873
2008-08-17 07:19:36 +00:00
Chris Lattner
033935df55
avoid string thrashing when formatting names in output. This
...
speeds up release-asserts llvm-dis on kc++ from 1.86s to 1.04s (~79%)
llvm-svn: 54868
2008-08-17 04:40:13 +00:00
Chris Lattner
393b7cd821
random cleanups.
...
llvm-svn: 54866
2008-08-17 04:17:45 +00:00
Chris Lattner
2fdbcfb576
Inline the fastpath of PATypeHolder::get(). This is a small speedup in
...
instcombine among other things.
llvm-svn: 54814
2008-08-15 15:16:50 +00:00
Devang Patel
fdee7034b3
The pass manager is not able to schedule -loop-deletion -loop-index-split.
...
The loop-deletion pass does not preserve dom frontier, which is required by
loop-index-split. When the PM checks dom frontier for loop-index-split, it has
already verified that lcssa is availalble. However, new dom frontier forces new
loop pass manager, which does not have lcssa yet.
The PM should recheck availability of required analysis passes in such cases.
llvm-svn: 54805
2008-08-14 23:07:48 +00:00
Owen Anderson
d09fe9d922
Have LeakDetector use a SmallPtrSet instead of an std::set.
...
llvm-svn: 54785
2008-08-14 20:40:10 +00:00
Dan Gohman
550c9af91f
Improve support for vector casts in LLVM IR and CodeGen.
...
llvm-svn: 54784
2008-08-14 20:04:46 +00:00
Dale Johannesen
332dd535e0
Add read/write support for X86's sseregparm.
...
llvm-svn: 54744
2008-08-13 18:40:23 +00:00
Devang Patel
0d29ae085b
Use SmallVector instead of std::vector
...
llvm-svn: 54685
2008-08-12 15:44:31 +00:00
Devang Patel
c68a0b6244
Use DenseMap to keep track of last users.
...
Use inversed map for faster queries.
llvm-svn: 54662
2008-08-12 00:26:16 +00:00
Devang Patel
ec9e1a60ad
Keep track of analysis usage information for passes. Avoid invoking
...
getAnalysisUsage() repeatedly.
llvm-svn: 54650
2008-08-11 21:13:39 +00:00
Gordon Henriksen
72c1c7d694
Delete a redundant binding, LLVMHasInitializer.
...
Please use !LLVMIsDeclaration instead.
llvm-svn: 54572
2008-08-09 02:13:58 +00:00
Eric Christopher
5927883970
Have IRBuilder take a template argument on whether or not to preserve
...
names. This can save a lot of allocations if you aren't going to be
looking at the output.
llvm-svn: 54546
2008-08-08 19:39:37 +00:00
Chris Lattner
4c493d9a58
Don't call getAnalysisUsage unless -debug-pass is enabled. This speeds
...
up the passmgr by avoiding useless work.
llvm-svn: 54528
2008-08-08 15:14:09 +00:00
Chris Lattner
cbd160f447
Speed up the passmgr by avoiding heap thrashing on vectors.
...
llvm-svn: 54515
2008-08-08 05:33:04 +00:00
Chris Lattner
02eb94c2d7
Don't verify passes when assertions are disabled.
...
llvm-svn: 54446
2008-08-07 07:34:50 +00:00
Dan Gohman
1a70bcc388
Fix the AsmWriter to not print extra spaces after parameter attributes.
...
llvm-svn: 54351
2008-08-05 15:51:44 +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
Duncan Sands
c1e48b582d
Fix comment typos.
...
llvm-svn: 54266
2008-08-01 12:23:49 +00:00
Mon P Wang
2c839d4b1e
Added support for overloading intrinsics (atomics) based on pointers
...
to different address spaces. This alters the naming scheme for those
intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32
llvm-svn: 54195
2008-07-30 04:36:53 +00:00
Nate Begeman
fecbc8cff1
Add vector shifts to the IR, patch by Eli Friedman.
...
CodeGen & Clang work coming next.
llvm-svn: 54161
2008-07-29 15:49:41 +00:00
Matthijs Kooijman
0446862796
Add a GetElementPtrInst::getIndexedType that accepts uint64_t's instead of just Value*'s.
...
llvm-svn: 54157
2008-07-29 08:46:11 +00:00
Dan Gohman
804c95df52
Fold the useful features of alist and alist_node into ilist, and
...
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.
Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.
Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.
llvm-svn: 54146
2008-07-28 21:51:04 +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
Nate Begeman
fd7b2be8e3
Allow verifier to be run on partially materialized modules.
...
llvm-svn: 54028
2008-07-25 17:28:23 +00:00
Nate Begeman
8a4afd921e
Tab removal
...
llvm-svn: 54025
2008-07-25 17:24:13 +00:00
Evan Cheng
a05c07eb62
Rename instance variables, parameter argument names to eliminate a bunch of compilation warnings with -Wshadow.
...
llvm-svn: 53970
2008-07-24 00:08:56 +00:00
Dan Gohman
fa1211f69b
Enable first-class aggregates support.
...
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.
The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.
llvm-svn: 53941
2008-07-23 00:34:11 +00:00
Dan Gohman
cf971f0513
Fix multiple-return-value-to-first-class-aggregates autoupgrade to
...
correctly handle the case where multiple-return-value constructs
were used to return one or zero values.
llvm-svn: 53890
2008-07-22 00:36:48 +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
eee1f57cea
verify limits-fndefn.c from the GCC testsuite before the
...
heat death of the universe, fixing an O(N^2) problem in the
size of a basic block.
llvm-svn: 53749
2008-07-18 05:23:39 +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
67136cff7b
Fix a case where vector comparison constant folding would cause an
...
infinite recursion. part of PR2529
llvm-svn: 53383
2008-07-10 00:29:28 +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
Chris Lattner
b69689e18b
elementwise comparison of vector constants was completely wrong. Fix
...
it for PR2529
llvm-svn: 53380
2008-07-10 00:08:17 +00:00
Evan Cheng
0e6973442d
- Replace use of std::map<std::string, ..> with StringMap. Replace use of std::map with DenseMap, std::set with SmallPtrSet. This results in minor speed up.
...
- Some code clean up.
llvm-svn: 53379
2008-07-10 00:04:23 +00:00
Dan Gohman
1526985bac
Consistently put quotes around pass names in debugging output.
...
llvm-svn: 53268
2008-07-09 00:50:40 +00:00
Chris Lattner
350e41760a
improve comment
...
llvm-svn: 53243
2008-07-08 18:47:38 +00:00
Duncan Sands
66336db096
Add some helpers for manipulating function
...
parameter attributes.
llvm-svn: 53228
2008-07-08 09:41:30 +00:00
Duncan Sands
78c8872d87
Add some convenience methods for manipulating
...
call attributes.
llvm-svn: 53223
2008-07-08 08:38:44 +00:00
Chris Lattner
d137a08b0d
Fix three bugs:
...
1) evaluate [v]fcmp true/false with undefs to true or false instead
of undef.
2) fix vector comparisons with undef to return a vector result instead
of i1
3) fix vector comparisons with evaluatable results to return vector
true/false instead of i1 true/false (PR2529)
llvm-svn: 53220
2008-07-08 05:46:34 +00:00
Dan Gohman
56e3f63ec5
Add explicit keywords.
...
llvm-svn: 53179
2008-07-07 18:00:37 +00:00
Bill Wendling
2e50689435
Revert my previous check-in that split up MachineModuleInfo. It turns out to
...
slow the compiler down at -O0 some 30% or more. Ooops.
llvm-svn: 53120
2008-07-03 22:53:42 +00:00
Matthijs Kooijman
ba5d7efc6c
Add newline at the end of Constants.cpp.
...
llvm-svn: 53092
2008-07-03 07:46:41 +00:00
Dan Gohman
7722f791f6
Use operator new instead of new char[].
...
llvm-svn: 53066
2008-07-03 00:53:09 +00:00
Devang Patel
99ad4ba227
Disable dom info verifier by default.
...
llvm-svn: 52983
2008-07-01 21:36:11 +00:00
Devang Patel
67c79a4992
Fix typos in comments.
...
Thanks for the feedback!
llvm-svn: 52978
2008-07-01 19:50:56 +00:00
Devang Patel
9dbe4d15ec
Add dom info verifier.
...
llvm-svn: 52967
2008-07-01 17:44:24 +00:00
Devang Patel
81ea3bb55c
Move dominator info printer into tool/opt/GraphPrinters.cpp
...
llvm-svn: 52907
2008-06-30 17:32:58 +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
Chris Lattner
36b4e8f2fe
implement some fixme's by making "autorenaming" in the value symbol table not
...
thrash the heap with string stuff (e.g. utostr).
llvm-svn: 52838
2008-06-27 21:26:26 +00:00
Chris Lattner
42e983e5a9
simplify some code to avoid string thrashing.
...
llvm-svn: 52837
2008-06-27 21:25:24 +00:00
Chris Lattner
e43649fa62
Add a new version of Module::getFunction that takes a const char* instead
...
of a std::string. This avoids copying the string to the heap in common
cases. Patch by Pratik Solanki!
llvm-svn: 52834
2008-06-27 21:09:10 +00:00
Devang Patel
abc6e6ab9f
Add dominator info printer pass.
...
llvm-svn: 52829
2008-06-27 16:43:21 +00:00
Bill Wendling
c758698d2c
Refactor the DebugInfoDesc stuff out of the MachineModuleInfo file. Clean up
...
some uses of std::vector, where it's return std::vector by value. Yuck!
llvm-svn: 52800
2008-06-27 00:09:40 +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
Mon P Wang
6a490371c9
Added MemOperands to Atomic operations since Atomics touches memory.
...
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub
llvm-svn: 52706
2008-06-25 08:15:39 +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
61163850af
Use const_cast instead of a C-style cast.
...
llvm-svn: 52684
2008-06-24 17:47:37 +00:00
Dan Gohman
210e6c1876
Remove two convenience constructors because they're now private, and the
...
private implementation doesn't really need the convenience.
llvm-svn: 52629
2008-06-23 16:48:17 +00:00
Dan Gohman
031f0bba15
Use std::copy instead of a loop.
...
llvm-svn: 52628
2008-06-23 16:45:24 +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
c7076914ac
Use Function's arg_size() and size() methods.
...
llvm-svn: 52605
2008-06-21 22:06:54 +00:00
Chris Lattner
106b046d83
fix some warnings when assertions are disabled.
...
llvm-svn: 52587
2008-06-21 19:47:03 +00:00
Dan Gohman
d87e813e41
Simplify this code. Thanks Chris!
...
llvm-svn: 52514
2008-06-20 00:47:44 +00:00
Dan Gohman
7cc14c55da
Auto-upgrade code for multiple-value return statements. This code
...
isn't actually called yet.
llvm-svn: 52435
2008-06-17 23:38:43 +00:00
Dan Gohman
d8ca05f4ee
In InsertValueInst's copy ctor, actually copy the operands.
...
llvm-svn: 52434
2008-06-17 23:25:49 +00:00
Dan Gohman
4a3125ba29
Implement the ExtractValueInst::getIndexedType that accepts one
...
index value.
llvm-svn: 52432
2008-06-17 21:07:55 +00:00
Owen Anderson
2505e0c36b
Add an insertBefore method for attaching previously unattached instructions,
...
such as those created by clone(), to a basic block.
llvm-svn: 52424
2008-06-17 18:29:27 +00:00
Chris Lattner
caefb0b5c7
switch TypeHasCycleThroughItself from using an std::set to using a SmallPtrSet,
...
this speeds up the linking testcase in PR1860 by 44% (.379 -> 0.263)
llvm-svn: 52365
2008-06-16 21:20:58 +00:00
Chris Lattner
7d6aac85c4
fix pr2460
...
llvm-svn: 52294
2008-06-16 04:02:40 +00:00
Evan Cheng
89553cc42e
Do not speculatively execute an instruction by hoisting it to its predecessor BB if any of its operands are defined but not used in BB. The transformation will prevent the operand from being sunk into the use block.
...
llvm-svn: 52244
2008-06-12 21:15:59 +00:00
Dan Gohman
27ae953278
Re-apply 52002, allowing the verifier to accept non-MRV struct return
...
types on functions, with adjustments so that it accepts both
new-style aggregate returns and old-style MRV returns, including those
with only a single member.
llvm-svn: 52157
2008-06-09 21:26:13 +00:00
Gabor Greif
cbcc495c1b
get rid of ExtractValueInst::init's Value argument, it is already passed to the UnaryInstruction ctor
...
llvm-svn: 52064
2008-06-06 21:06:32 +00:00
Gabor Greif
21ba184b27
make ExtractValueInst derived from UnaryInstruction
...
llvm-svn: 52061
2008-06-06 20:28:12 +00:00
Devang Patel
656a917ad9
Print debug message only if there are dead passes.
...
llvm-svn: 52052
2008-06-06 17:50:36 +00:00
Duncan Sands
13237ac3b9
Wrap MVT::ValueType in a struct to get type safety
...
and better control the abstraction. Rename the type
to MVT. To update out-of-tree patches, the main
thing to do is to rename MVT::ValueType to MVT, and
rewrite expressions like MVT::getSizeInBits(VT) in
the form VT.getSizeInBits(). Use VT.getSimpleVT()
to extract a MVT::SimpleValueType for use in switch
statements (you will get an assert failure if VT is
an extended value type - these shouldn't exist after
type legalization).
This results in a small speedup of codegen and no
new testsuite failures (x86-64 linux).
llvm-svn: 52044
2008-06-06 12:08:01 +00:00
Dan Gohman
1d304a99d7
Revert 52002.
...
llvm-svn: 52030
2008-06-05 23:57:06 +00:00
Matthijs Kooijman
5eef32ba94
Change the Verifier to support returning first class aggregrates.
...
Add a testcase for functions returning first class aggregrates.
llvm-svn: 52002
2008-06-05 14:00:36 +00:00
Matthijs Kooijman
b0dffd691c
* Make CallSite::hasArgument const and let it take a const parameter.
...
llvm-svn: 51989
2008-06-05 08:04:58 +00:00
Matthijs Kooijman
d901e5842f
Add CallSite::hasArgument to allow for seeing if a call passes a certain value as an argument quickly.
...
llvm-svn: 51946
2008-06-04 16:31:12 +00:00
Matthijs Kooijman
76d8dec5db
Add a Name parameter to two of the init methods of GetElementPointer to make the name setting more consistent.
...
llvm-svn: 51945
2008-06-04 16:14:12 +00:00
Matthijs Kooijman
cfd41dbd5e
Implement the two constructors in InsertValueInst and ExtractValueInst.
...
Add a Name argment to two init methods in these classes as well to make things
a bit more consistent.
llvm-svn: 51937
2008-06-04 14:40:55 +00:00
Evan Cheng
93af6ce129
More pass manager debugging outputs.
...
llvm-svn: 51930
2008-06-04 09:13:31 +00:00
Dale Johannesen
83e468ae23
Prevent a crash in debug dumps.
...
llvm-svn: 51910
2008-06-03 18:14:29 +00:00
Devang Patel
ab85d6b6af
"Unable to schedule <A> required by <B>" is more helpful then
...
"Unable to handle Pass that requires lower level Analysis pass"
llvm-svn: 51892
2008-06-03 01:20:02 +00:00
Devang Patel
bb4720c43f
Add debugging aid.
...
llvm-svn: 51891
2008-06-03 01:02:16 +00:00
Dan Gohman
3db11c2bd9
Constant folding for insertvalue and extractvalue.
...
llvm-svn: 51889
2008-06-03 00:15:20 +00:00
Dan Gohman
a76f0f7031
AsmWriter support for insertvalue/extractvalue. These instructions can
...
now round-trip through assembly and bitcode.
llvm-svn: 51823
2008-05-31 19:12:39 +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
4e72438ef1
Factor several methods, including getInversePredicate and
...
getSwappedPredicate, from ICmpInst and FCmpInst into common
methods in CmpInst. This allows CmpInsts to be manipulated
generically.
llvm-svn: 51810
2008-05-31 02:47:54 +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
Matthijs Kooijman
bf8d6cefde
Let Instruction::getOpcodeName() return something useful for the new
...
insertvalue / extractvalue instructions.
llvm-svn: 51766
2008-05-30 10:31:54 +00:00
Gabor Greif
a3de9e4576
back out last commit: The .cpp file for a module should include its corresponding header first, even if redundant.
...
llvm-svn: 51598
2008-05-27 17:26:02 +00:00
Gabor Greif
6974e1d380
prune unneeded #includes
...
llvm-svn: 51590
2008-05-27 11:06:03 +00:00
Gabor Greif
e9408e6e96
remove unneeded reinterpret_casts
...
llvm-svn: 51589
2008-05-27 11:03:29 +00:00
Gabor Greif
0a0f2c1dcb
We have the correct headers included to know that BB isa Value. No reinterpret_cast necessary.
...
llvm-svn: 51588
2008-05-27 10:48:39 +00:00
Gabor Greif
2d3024d838
eliminate calls to deprecated Use::init() interface
...
llvm-svn: 51570
2008-05-26 21:33:52 +00:00
Duncan Sands
dd7daee850
Factor code to copy global value attributes like
...
the section or the visibility from one global
value to another: copyAttributesFrom. This is
particularly useful for duplicating functions:
previously this was done by explicitly copying
each attribute in turn at each place where a
new function was created out of an old one, with
the result that obscure attributes were regularly
forgotten (like the collector or the section).
Hopefully now everything is uniform and nothing
is forgotten.
llvm-svn: 51567
2008-05-26 19:58:59 +00:00
Evan Cheng
91a2e56b06
Eliminate x86.sse2.punpckh.qdq and x86.sse2.punpckl.qdq.
...
llvm-svn: 51533
2008-05-24 02:56:30 +00:00
Evan Cheng
2146270c9b
Eliminate x86.sse2.movs.d, x86.sse2.shuf.pd, x86.sse2.unpckh.pd, and x86.sse2.unpckl.pd intrinsics. These will be lowered into shuffles.
...
llvm-svn: 51531
2008-05-24 02:14:05 +00:00
Evan Cheng
5065932276
Autoupgrade x86.sse2.loadh.pd and x86.sse2.loadl.pd.
...
llvm-svn: 51523
2008-05-24 00:08:39 +00:00
Dan Gohman
f96e1371e8
Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
...
use it instead of duplicating its functionality.
llvm-svn: 51499
2008-05-23 21:05:58 +00:00
Dan Gohman
643b3a0581
Add #includes to make some dependencies explicit.
...
llvm-svn: 51496
2008-05-23 20:40:06 +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
Chris Lattner
ee00d04da0
Fix PR2267, by allowing indirect outputs to be intermixed
...
with normal outputs. Testcase here:
test/CodeGen/X86/asm-indirect-mem.ll
llvm-svn: 51409
2008-05-22 04:46:38 +00:00
Gordon Henriksen
00889ccfca
Remove a duplicative binding. Patch by Mahadevan R.
...
llvm-svn: 51238
2008-05-19 05:47:10 +00:00
Nick Lewycky
eb185ca5e9
Revert constant-folding change that will miscompile in some cases.
...
llvm-svn: 51223
2008-05-17 19:00:05 +00:00
Nick Lewycky
79d681dddd
Unbreak the build.
...
llvm-svn: 51217
2008-05-17 09:05:22 +00:00
Nick Lewycky
1ba90bb69b
Constant fold inttoptr and ptrtoint.
...
llvm-svn: 51216
2008-05-17 09:03:26 +00:00
Eric Christopher
901b1a75c9
Add functions to enable adding a single attribute to a function and
...
its associated call site.
llvm-svn: 51204
2008-05-16 20:39:43 +00:00
Gabor Greif
e1f6e4b21d
API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
...
llvm-svn: 51200
2008-05-16 19:29:10 +00:00
Dan Gohman
2f156ae850
Revert the change from r51157 in
...
test/Verifier/2002-11-05-GetelementptrPointers.ll, which was incorrect.
Instead, fix getIndexedType to not follow pointer types, as
PointerType is a subclass of CompositeType.
llvm-svn: 51171
2008-05-16 00:16:32 +00:00
Dan Gohman
12fce7751b
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
Gabor Greif
697e94cc22
Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.
...
llvm-svn: 51143
2008-05-15 10:04:30 +00:00
Nate Begeman
60f9320fc5
Move the operator new and operator delete out of line. This fixes an issue with
...
operator new() referring to the static initTags function, which has to be in the
same linkage unit as any file including User.h.
llvm-svn: 51136
2008-05-15 01:23:11 +00:00
Dale Johannesen
ce4396bc92
Add CommonLinkage; currently tentative definitions
...
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both. The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.
llvm-svn: 51118
2008-05-14 20:12:51 +00:00
Dan Gohman
4e974ab933
Make PreVerifyID, IntSigsEnd, and KillSigsEnd const.
...
llvm-svn: 51088
2008-05-14 00:42:30 +00:00
Gabor Greif
5ef7404dc7
Merge of r51073-51074 from use-diet branch.
...
Do not rely on std::swap<Use>, provide a (faster) member function instead.
This change is primarily necessitated by MSVC++'s incompatibility with
declaring std::swap<Use> to be a friend of Use.
Also contains some minor tweaks to Use inline functions,
to undo pointless changes that sneaked in with the last merge.
llvm-svn: 51078
2008-05-13 22:51:52 +00:00
Devang Patel
a9fcf009a3
Dominance Frontier is cfg only pass.
...
llvm-svn: 51075
2008-05-13 22:43:21 +00:00
Gabor Greif
0d42adf65b
Derive GetResultInst from UnaryInstruction, this simplifies code and removes a FIXME.
...
llvm-svn: 51023
2008-05-13 07:09:08 +00:00
Dan Gohman
0479aa5c0b
Change class' public PassInfo variables to by initialized with the
...
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.
Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.
llvm-svn: 51022
2008-05-13 02:05:11 +00:00
Dan Gohman
d78c400b5b
Clean up the use of static and anonymous namespaces. This turned up
...
several things that were neither in an anonymous namespace nor static
but not intended to be global.
llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Nate Begeman
66d0a0e8f4
Pointer comparisons should be handled by icmp, not vicmp :)
...
llvm-svn: 50994
2008-05-12 20:11:05 +00:00
Nate Begeman
1196287522
Hard code CmpInst back to i1 for now while I go track down what in the bitcode reader/writer is assuming i1
...
This was breaking a bunch of tests
llvm-svn: 50992
2008-05-12 20:01:56 +00:00
Nate Begeman
ac7f3d99dd
Fix build breakage
...
llvm-svn: 50986
2008-05-12 19:23:22 +00:00
Nate Begeman
d21957002a
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
Dan Gohman
e9bc2ba256
Update comments.
...
llvm-svn: 50974
2008-05-12 16:34:30 +00:00
Gabor Greif
f6caff66a1
merge of use-diet branch to trunk
...
llvm-svn: 50943
2008-05-10 08:32:32 +00:00
Anton Korobeynikov
a50eed4af9
Check for validity of aliasee pointer before dereference.
...
llvm-svn: 50878
2008-05-08 23:11:06 +00:00
Chris Lattner
954907aa6f
conservatively say that volatile stores read memory.
...
llvm-svn: 50872
2008-05-08 21:58:49 +00:00
Chris Lattner
c2e108430f
store can't read from memory.
...
llvm-svn: 50869
2008-05-08 21:47:43 +00:00
Chris Lattner
8462711ce8
add a new Instruction::mayReadFromMemory predicate, make
...
Instruction::mayWriteToMemory stronger for invokes.
llvm-svn: 50858
2008-05-08 17:16:51 +00:00
Anton Korobeynikov
fc2edad4ae
Turn StripPointerCast() into a method
...
llvm-svn: 50836
2008-05-07 22:54:15 +00:00
Anton Korobeynikov
82c02b28f3
Make StripPointerCast a common function (should we mak it method of Value instead?)
...
llvm-svn: 50775
2008-05-06 22:52:30 +00:00
Dan Gohman
a8b7e78f54
Remove uses of llvm/System/IncludeFile.h that are no longer needed.
...
llvm-svn: 50695
2008-05-06 01:32:53 +00:00
Gordon Henriksen
a735a9c481
Use (void) instead of () in C code.
...
llvm-svn: 50620
2008-05-04 12:55:34 +00:00
Evan Cheng
cdf22f2953
Add separate intrinsics for MMX / SSE shifts with i32 integer operands. This allow us to simplify the horribly complicated matching code.
...
llvm-svn: 50601
2008-05-03 00:52:09 +00:00
Chris Lattner
78769f0223
fix a bug in my previous patch, a classic =/== bug.
...
llvm-svn: 50483
2008-04-30 15:27:09 +00:00
Chris Lattner
a1d850ee1c
add a method for comparing to see if a value has a specified name.
...
llvm-svn: 50465
2008-04-30 03:55:40 +00:00
Gordon Henriksen
2d9cc2197a
Expose parameter attributes via C bindings.
...
Patch by Anders Johnsen!
llvm-svn: 50360
2008-04-28 17:37:06 +00:00
Chris Lattner
10748d8edd
Allow asms to return multiple results by value.
...
llvm-svn: 50328
2008-04-27 23:33:55 +00:00
Nick Lewycky
4d43d3c72c
Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
...
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.
llvm-svn: 50265
2008-04-25 16:53:59 +00:00
Chris Lattner
1e31bf5b19
tighten up verifier checks which missed cases where
...
return instrs operands didn't match up with function results.
llvm-svn: 50182
2008-04-23 20:33:41 +00:00
Chris Lattner
b6917d2acc
Enforce that multiple return values have to have at least one result.
...
llvm-svn: 50137
2008-04-23 05:36:34 +00:00
Chris Lattner
31abd54e33
Verify that the operand of a getresult instruction is a
...
call/invoke or undef.
llvm-svn: 50129
2008-04-23 04:06:15 +00:00
Chris Lattner
ff834c0ca3
more fallout from Nicholas' asmprinter patch.
...
llvm-svn: 50078
2008-04-22 02:45:44 +00:00
Chris Lattner
00cab5b9a6
don't print dominators every time it is computed with -debug.
...
llvm-svn: 50032
2008-04-21 06:19:02 +00:00
Chris Lattner
d5fbc8f0af
another bug introduced in r47802 by nicholas, for no apparent reason.
...
llvm-svn: 50031
2008-04-21 06:12:55 +00:00
Chris Lattner
67bec133b2
fix a bug introduced by Nicholas' "unwinds to" stuff: we
...
lost newlines between blocks.
llvm-svn: 50024
2008-04-21 04:20:33 +00:00
Chris Lattner
8ec6e8af60
add a handy helper method to instruction, useful for determining
...
whether it is used outside of some block. This can be used to see
if there are any non-local references, for example.
llvm-svn: 50004
2008-04-20 22:11:30 +00:00
Chris Lattner
912bec79ca
hopefully resolve PR2240
...
llvm-svn: 49999
2008-04-20 19:59:12 +00:00
Chris Lattner
6b05605829
rearrange some code, simplify handling of shifts.
...
llvm-svn: 49995
2008-04-20 18:24:14 +00:00
Chris Lattner
d3018e6a0e
Use simplified ConstantFP::get method, fix a bug handling frem x, 0 with long doubles.
...
llvm-svn: 49976
2008-04-20 00:26:06 +00:00
Chris Lattner
bc26e1bb8a
Implement PR2206.
...
llvm-svn: 49967
2008-04-19 22:17:26 +00:00
Chris Lattner
334d33cad1
refactor handling of symbolic constant folding, picking up
...
a few new cases( see Integer/a1.ll), but not anything that
would happen in practice.
llvm-svn: 49965
2008-04-19 21:58:19 +00:00
Chris Lattner
6072ead8e2
indentation fix.
...
llvm-svn: 49964
2008-04-19 21:13:00 +00:00
Dale Johannesen
4675c4e7e7
Don't read off end of the input array.
...
llvm-svn: 49799
2008-04-16 17:31:41 +00:00
Owen Anderson
57236b58f7
Major repairs to the post-dominators implementation. Patch from Florian Brandner!
...
llvm-svn: 49768
2008-04-16 04:21:16 +00:00
Dan Gohman
19bce7f18c
VAArg may trap.
...
llvm-svn: 49646
2008-04-14 15:07:08 +00:00
Duncan Sands
a07136ee2d
Merge LLVMBuilder and FoldingBuilder, calling
...
the result IRBuilder. Patch by Dominic Hamon.
llvm-svn: 49604
2008-04-13 06:22:09 +00:00
Dan Gohman
f4bc782495
Make several symbols static.
...
llvm-svn: 49496
2008-04-10 21:11:47 +00:00
Chris Lattner
98bd939af8
add a simplified accessor for creating an fp constant of a
...
particular value but variable type.
llvm-svn: 49416
2008-04-09 06:38:30 +00:00
Chris Lattner
b5b3e3136b
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
Duncan Sands
57d3a36386
Convenience method for setting the nounwind
...
attribute for a function.
llvm-svn: 49373
2008-04-08 07:23:58 +00:00
Duncan Sands
a8ff6ca2e3
Make sure that intrinsics automagically get the
...
right parameter attributes no matter how they
are obtained.
llvm-svn: 49335
2008-04-07 13:39:11 +00:00
Gabor Greif
dd8b7a0a47
fix a warning
...
llvm-svn: 49282
2008-04-06 21:42:13 +00:00
Gabor Greif
e9ecc68d8f
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
Chris Lattner
6f2ffdb73f
Change the MemoryBuffer::getFile* methods to take just a pointer to the
...
start of a filename, not a filename+length. All clients can produce a
null terminated name, and the system api's require null terminated
strings anyway.
llvm-svn: 49041
2008-04-01 18:04:03 +00:00
Nate Begeman
f2b0b0eb17
Don't eliminate bitcast instructions that change the type of a pointer
...
llvm-svn: 48971
2008-03-31 00:22:16 +00:00
Duncan Sands
7d6c8ae488
Fix comment typo.
...
llvm-svn: 48967
2008-03-30 19:38:55 +00:00
Nick Lewycky
f88c84f690
Update example to new syntax.
...
llvm-svn: 48910
2008-03-28 06:46:51 +00:00
Dan Gohman
c60c67fc37
Add explicit keywords.
...
llvm-svn: 48801
2008-03-25 22:06:05 +00:00
Evan Cheng
df1690dc7c
Handle a special case xor undef, undef -> 0. Technically this should be transformed to undef. But this is such a common idiom (misuse) we are going to handle it.
...
llvm-svn: 48792
2008-03-25 20:08:07 +00:00
Bill Wendling
0ee1bd9588
Fix PR2062: Don't build Intrinsics.gen in the source directory. Do it in the
...
object directory.
llvm-svn: 48766
2008-03-25 09:12:48 +00:00
Dan Gohman
aa583d75b1
Shrink the size of AllocationInst by using its SubclassData
...
field to store the alignment value instead of haing a
separate field.
llvm-svn: 48727
2008-03-24 16:55:58 +00:00
Gordon Henriksen
07a45f4edb
Objective Caml bindings for basic block, function, global, and arg iterators.
...
llvm-svn: 48711
2008-03-23 22:21:29 +00:00
Anton Korobeynikov
dd8c695746
Fix merge error
...
llvm-svn: 48687
2008-03-22 08:50:08 +00:00
Anton Korobeynikov
3f7fab913d
Add testcase for prev. commit. Minor fixes
...
llvm-svn: 48686
2008-03-22 08:37:05 +00:00
Anton Korobeynikov
25b2e8203a
Aliasing chains cleanups: update langref, add check into verifier
...
llvm-svn: 48685
2008-03-22 08:36:14 +00:00
Anton Korobeynikov
72d5d42dbc
Support chained aliases for LLVM IR printing. This fixes PR2145
...
llvm-svn: 48684
2008-03-22 08:17:17 +00:00
Anton Korobeynikov
2fb3897f1b
Slightly increase default set size. It's cheap and won't hurt.
...
llvm-svn: 48682
2008-03-22 07:48:40 +00:00
Dan Gohman
9988569af8
Don't include <map> in Pass.h, which doesn't need it. This requires
...
adding <map> to many files that actually do need it.
llvm-svn: 48667
2008-03-21 23:51:57 +00:00
Duncan Sands
dec270a6db
Make it possible to get an empty struct using
...
the new StructType::get method. The second NULL
is to pacify the gcc warning mechanism. This
patch compiles but is otherwise untested.
llvm-svn: 48645
2008-03-21 15:53:17 +00:00
Evan Cheng
92b4488202
Undo 48570. Correctly match mmx shift instructions with an immediate operand.
...
llvm-svn: 48627
2008-03-21 00:40:09 +00:00
Devang Patel
4d638f1a42
These passes preserve CFG.
...
This patch fixes Benchmarks/Trimaran/enc-pc1/enc-pc1 failure reported by Grawp-PIC i386 nightly tester
llvm-svn: 48623
2008-03-20 23:27:18 +00:00
Devang Patel
80e43fa744
Restore isCFGOnly property of various analysis passes.
...
llvm-svn: 48579
2008-03-20 02:25:21 +00:00
Devang Patel
cbbf291f34
Keep track of analysis information inherited from Module pass manager.
...
llvm-svn: 48576
2008-03-20 01:09:53 +00:00
Evan Cheng
bbba76fc99
Add intrinsics to match mmx shift builtin's with immediate operand.
...
llvm-svn: 48569
2008-03-19 23:38:52 +00:00
Devang Patel
fbf53a4d1d
#if 1 .. #endif markers do not add any value.
...
llvm-svn: 48560
2008-03-19 22:24:25 +00:00
Devang Patel
718da668ab
PassInfo keep tracks whether a pass is an analysis pass or not.
...
llvm-svn: 48554
2008-03-19 21:56:59 +00:00
Chris Lattner
f5ec84c4f3
add some convenience methods for creating GEP instructions and
...
struct types. Patch by David Chisnall, with some tweaks.
llvm-svn: 48531
2008-03-19 05:06:05 +00:00
Gordon Henriksen
054817ce06
C bindings for Module-, Function-, and BasicBlock::iterator.
...
llvm-svn: 48528
2008-03-19 03:47:18 +00:00
Gordon Henriksen
265f780c22
C and Objective Caml bindings for the various getParent methods of the IR.
...
Based on Erick Tryzelaar's patch.
llvm-svn: 48523
2008-03-19 01:11:35 +00:00
Devang Patel
af75ab8130
Do not use virtual function to identify an analysis pass.
...
llvm-svn: 48520
2008-03-19 00:48:41 +00:00
Devang Patel
864970e9b6
Identify Analysis pass.
...
Do not run analysis pass again if analysis info is still available.
This fixes PR1441.
llvm-svn: 48476
2008-03-18 00:39:19 +00:00
Gordon Henriksen
878114bf16
C and Objective Caml bindings for PassManagers.
...
llvm-svn: 48413
2008-03-16 04:20:44 +00:00
Gordon Henriksen
6c6075e326
Expose Module::dump via C and Ocaml.
...
Patch by Erick Tryzelaar.
llvm-svn: 48379
2008-03-14 23:58:56 +00:00
Dan Gohman
94f57c56f9
Update comments; getPassName no longer uses RTTI.
...
llvm-svn: 48369
2008-03-14 18:27:04 +00:00
Chris Lattner
c994c0295a
move a bunch of trivial methods to be inline.
...
llvm-svn: 48326
2008-03-13 05:00:21 +00:00
Chris Lattner
4d650c4bee
Various improvements suggested by Duncan
...
llvm-svn: 48325
2008-03-13 04:33:03 +00:00
Dan Gohman
565df95a36
Eliminate a few unnecessary uses of dynamic_cast.
...
llvm-svn: 48318
2008-03-13 02:08:36 +00:00
Dan Gohman
1e9860a2ed
Fix a typo.
...
llvm-svn: 48317
2008-03-13 01:58:48 +00:00
Dan Gohman
1412f515c3
Don't redundantly clear std::vector members in destructors.
...
llvm-svn: 48316
2008-03-13 01:57:34 +00:00
Dan Gohman
73caf5ff10
Change PMTopLevelManager's PassManagers vector element type from
...
Pass* to PMDataManager*. PMDataManager is more specific than Pass,
so this more accurately describes the objects that are being stored.
This eliminates the need for several dynamic_casts to PMDataManager*.
It does introduce one dynamic_cast though, in dumpPasses(). Give
this one a comment describing why a dynamic_cast is being used.
llvm-svn: 48315
2008-03-13 01:48:32 +00:00
Dan Gohman
11eecd635c
Change PMStack::push to accept a PMDataManager* instead of
...
a Pass*. PMDataManager* is what it actually holds, so this
makes it clearer.
llvm-svn: 48314
2008-03-13 01:21:31 +00:00
Chris Lattner
8a923e7c28
Reimplement the parameter attributes support, phase #1 . hilights:
...
1. There is now a "PAListPtr" class, which is a smart pointer around
the underlying uniqued parameter attribute list object, and manages
its refcount. It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
ParamAttrsWithIndex's, no need to make a SmallVector of a specific
size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
dereferencing the pointer is simplified to just access the
PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
bit simpler.
Phase #2 will rename some stuff (e.g. PAListPtr) and do other less
invasive changes.
llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Anton Korobeynikov
da7db7d9a1
Add helper for ultimate aliasee resoltion
...
llvm-svn: 48255
2008-03-11 22:28:56 +00:00
Dan Gohman
d3a20c9e1e
Give PassManager and FunctionPassManager a common base class, with
...
add(Pass *) as a pure virtual member function. This will allow all
the various addPassesTo* functions in LLVM to avoid hard-coding what
type of PassManager is used.
llvm-svn: 48226
2008-03-11 16:41:42 +00:00
Dan Gohman
dfdf2c0633
Fix typos in comments.
...
llvm-svn: 48225
2008-03-11 16:18:48 +00:00
Dan Gohman
fc42961f18
Use utostr instead of a stringstream.
...
llvm-svn: 48198
2008-03-10 23:55:07 +00:00
Dan Gohman
2f3648b261
Initialize ArgTypes directly instead of manually copying in the elements.
...
llvm-svn: 48195
2008-03-10 23:41:23 +00:00
Dan Gohman
de66dc88cd
Remove an unnecessary #include
...
llvm-svn: 48193
2008-03-10 23:37:12 +00:00
Nick Lewycky
fb2c1a999a
Turn unwind_to into "unwinds to".
...
llvm-svn: 48123
2008-03-10 02:20:00 +00:00
Nick Lewycky
cc24104703
Two things. Preserve the unwind_to when splitting a BB.
...
Add the ability to remove just one instance of a BB from a phi node. This fixes
the compile error in the tree now.
llvm-svn: 48085
2008-03-09 05:04:48 +00:00
Dan Gohman
39b0ac4e59
Remove unused runPass methods.
...
llvm-svn: 48044
2008-03-08 01:43:56 +00:00
Devang Patel
b3ca38c1d5
Check struct return type first.
...
llvm-svn: 47922
2008-03-05 00:27:05 +00:00
Devang Patel
ce556d908b
Print types for all ret operands.
...
llvm-svn: 47911
2008-03-04 22:05:14 +00:00
Devang Patel
b2fae1d13f
Revert SmallVector ctor variants.
...
llvm-svn: 47908
2008-03-04 21:54:56 +00:00
Devang Patel
5dc63480db
Add FunctionType ctor variant that takes SmallVector params.
...
llvm-svn: 47895
2008-03-04 18:57:05 +00:00
Devang Patel
9d91785987
s/isReturnStruct()/hasStructRetAttr()/g
...
llvm-svn: 47857
2008-03-03 21:46:28 +00:00
Devang Patel
c6b56c79aa
If a function uses multive values in ret instruction then it
...
is returning a struct value.
llvm-svn: 47848
2008-03-03 18:58:16 +00:00
Chris Lattner
f724e34ddc
Add a new ShuffleVectorInst::getMaskValue method.
...
llvm-svn: 47813
2008-03-02 05:28:33 +00:00
Nick Lewycky
3cc9be0b59
Add an unwind_to field to basic blocks, making them Users instead of Values.
...
This is the first checkin for PR1269, the new EH infrastructure.
llvm-svn: 47802
2008-03-02 02:48:09 +00:00
Nick Lewycky
7f6e95a973
Print the name, not a pointer.
...
llvm-svn: 47796
2008-03-01 17:20:55 +00:00
Chris Lattner
ffe0da0eb2
Fix PR2113 by verifying allocations.
...
llvm-svn: 47792
2008-03-01 09:01:57 +00:00
Dan Gohman
06c45d516d
Use the new convertFromAPInt instead of convertFromZeroExtendedInteger.
...
llvm-svn: 47744
2008-02-29 01:42:52 +00:00
Devang Patel
a1a6882519
Remove dead code.
...
llvm-svn: 47700
2008-02-27 23:33:51 +00:00
Devang Patel
5bc621c680
Add comment.
...
llvm-svn: 47653
2008-02-27 01:20:54 +00:00
Devang Patel
f287e7dcc6
Add assert to check return type.
...
llvm-svn: 47637
2008-02-26 22:55:21 +00:00
Devang Patel
a58b1c9b6b
Remove unncessary ReturnInst constructors.
...
llvm-svn: 47633
2008-02-26 22:12:58 +00:00
Devang Patel
a736c001b6
Use SmallVector while constructing ReturnInst.
...
llvm-svn: 47619
2008-02-26 19:38:17 +00:00
Devang Patel
060e79c729
Avoid const_casts
...
llvm-svn: 47616
2008-02-26 19:15:26 +00:00
Devang Patel
85e38bfb2e
Remove unnecessary getOperand/setOperand overriders.
...
Simplify getReturnValue()
llvm-svn: 47614
2008-02-26 19:08:13 +00:00
Devang Patel
c38eb52787
Unify to ReturnInst::init() member functions.
...
llvm-svn: 47611
2008-02-26 18:49:29 +00:00
Devang Patel
ae682fb940
Optimize most common case by using single RetVal in ReturnInst.
...
llvm-svn: 47607
2008-02-26 17:56:20 +00:00
Devang Patel
767338ccec
Pass const vectors by reference.
...
llvm-svn: 47577
2008-02-26 00:12:13 +00:00
Devang Patel
d995551261
print getresult operand and its type directly.
...
llvm-svn: 47514
2008-02-23 01:04:26 +00:00
Devang Patel
2f2ff159a5
Use dyn_cast instead of isa + cast.
...
llvm-svn: 47511
2008-02-23 00:47:00 +00:00
Devang Patel
59643e575f
To support multiple return values, now ret instruction supports multiple operands instead of one aggregate operand.
...
llvm-svn: 47508
2008-02-23 00:35:18 +00:00
Dale Johannesen
09f410b6d7
Split ParameterAttributes.h, putting the complicated
...
stuff into ParamAttrsList.h. Per feedback from
ParamAttrs changes.
llvm-svn: 47504
2008-02-22 22:17:59 +00:00
Dale Johannesen
eabc5f39af
Pass alignment on ByVal parameters, from FE, all
...
the way through. It is now used for codegen.
llvm-svn: 47484
2008-02-22 17:49:45 +00:00
Devang Patel
e665095da1
Print getresult instruction properly.
...
llvm-svn: 47473
2008-02-22 03:10:23 +00:00
Devang Patel
b5f5073a1a
Print ret instruction that returns aggregates.
...
llvm-svn: 47472
2008-02-22 02:50:49 +00:00
Devang Patel
35519d51d6
print getresult instruction.
...
llvm-svn: 47461
2008-02-21 23:02:20 +00:00
Devang Patel
9fea019759
Use isa<> instead of getTypeID() to check StructType.
...
llvm-svn: 47460
2008-02-21 22:24:17 +00:00
Devang Patel
ad582fc34b
Let invoke return aggregate value.
...
llvm-svn: 47425
2008-02-21 02:14:01 +00:00
Devang Patel
1f00b535e1
Let function call return aggregate.
...
Now, we have very first multiple return value testcase!
llvm-svn: 47424
2008-02-21 01:54:02 +00:00
Devang Patel
616f0e02be
What if functions can return aggregate values ?
...
One small step towards multiple return value support.
llvm-svn: 47406
2008-02-20 22:36:03 +00:00
Devang Patel
cf193b8320
getresult does not support nested aggregates.
...
llvm-svn: 47396
2008-02-20 19:39:41 +00:00
Devang Patel
6b30fd310d
Verifier should use Assert1 instead of assert.
...
llvm-svn: 47394
2008-02-20 19:32:20 +00:00
Devang Patel
dcad9da0bc
getresult type is the type of indexed aggregate element
...
llvm-svn: 47392
2008-02-20 19:26:55 +00:00
Devang Patel
666d45195a
Specify GetResultInst index as an unsigned.
...
llvm-svn: 47390
2008-02-20 19:10:47 +00:00
Devang Patel
3ef1b793c1
Use isValidOperands() to verify GetResultInst.
...
llvm-svn: 47387
2008-02-20 18:36:46 +00:00
Anton Korobeynikov
18991d78fa
Fix newly-introduced 4.3 warnings
...
llvm-svn: 47375
2008-02-20 12:07:57 +00:00
Anton Korobeynikov
579f07135a
Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
...
llvm-svn: 47367
2008-02-20 11:08:44 +00:00
Dale Johannesen
11a555e94a
Add Alignment field to ParameterAttributes and
...
treat more or less rationally in interface
functions, subject to change. No functional change.
llvm-svn: 47352
2008-02-19 23:51:49 +00:00
Devang Patel
295711f583
Add GetResultInst. First step for multiple return value support.
...
llvm-svn: 47348
2008-02-19 22:15:16 +00:00
Dale Johannesen
89268bc6e2
Expand ParameterAttributes to 32 bits (in preparation
...
for adding alignment info, not there yet). Clean up
interfaces to reference ParameterAttributes consistently.
llvm-svn: 47342
2008-02-19 21:38:47 +00:00
Chris Lattner
b4c6cc9587
Fix some minor issues folding undef, PR2052
...
llvm-svn: 47314
2008-02-19 06:22:12 +00:00
Duncan Sands
85fab3a3ad
Simplify caller updating using a CallSite, as
...
requested by Chris. While there, do the same
for an existing function committed by someone
called "lattner" :)
llvm-svn: 47273
2008-02-18 17:32:13 +00:00
Owen Anderson
a54570d2d2
I got the predicate backwards in my last patch. The comment is correct, the code was not.
...
llvm-svn: 47264
2008-02-18 09:22:21 +00:00
Owen Anderson
c66655e14c
Duncan pointed out that we can fast fail here, because the sret parameter of
...
a function must be the first parameter.
llvm-svn: 47254
2008-02-18 04:06:26 +00:00
Owen Anderson
c64dfb4317
Add a predicate to Argument to check for the StructRet attribute.
...
llvm-svn: 47248
2008-02-17 23:22:28 +00:00
Duncan Sands
2efbc7f9e8
Some micro-optimizations.
...
llvm-svn: 47219
2008-02-16 20:53:06 +00:00
Chris Lattner
536ddedea3
targets that support quotes for mangled names still need to escape newlines
...
when they occur in the name, just like " is escaped.
llvm-svn: 47169
2008-02-15 18:54:56 +00:00
Chris Lattner
7f5c2553c7
check that terminators only occur at the end of a block. This catches the
...
common problem of putting two terminators in the same block. I can't write
a testcase for this because the .ll parser rejects this before the verifier
can, but this can occur when generating IR.
llvm-svn: 46900
2008-02-09 01:06:01 +00:00
Dan Gohman
b3efe03672
Fix a typo in a comment.
...
llvm-svn: 46836
2008-02-07 02:30:40 +00:00
Devang Patel
8df7cc1119
Add comment explaining what is lower level analysis pass.
...
llvm-svn: 46658
2008-02-02 01:43:30 +00:00
Gordon Henriksen
931e121ad1
Fixing a bug creating floating point constants of type other
...
than double through the C bindings. Thanks to Tomas Lindquist
Olsen for reporting it.
llvm-svn: 46656
2008-02-02 01:07:50 +00:00
Dan Gohman
929391a19a
Fix 80-col violations.
...
llvm-svn: 46510
2008-01-29 12:09:55 +00:00
Dan Gohman
242223abd5
Add explicit keywords.
...
llvm-svn: 46506
2008-01-29 11:36:12 +00:00
Nick Lewycky
8ea81e8ba4
Handle some more combinations of extend and icmp. Fixes PR1940.
...
llvm-svn: 46431
2008-01-28 03:48:02 +00:00
Chris Lattner
e30f09d0c5
Add hasByValAttr() and hasNoAliasAttr() methods to the Argument class.
...
llvm-svn: 46314
2008-01-24 17:47:11 +00:00
Duncan Sands
92a56b5499
It turns out that in C++ it is legal to declare functions
...
that return an opaque type by value, as long as you don't
call it or provide a body (you can take the address of it).
So it is wrong to insist that sret parameters not be an
opaque*. And I guess it is really up to codegen to complain
if someone tries to call such a function. I'm also removing
the analogous check from byval parameters, since I don't
see why we shouldn't allow them as long as no-one tries to
call the function or give it a body.
llvm-svn: 46216
2008-01-21 21:37:41 +00:00
Duncan Sands
262e54eb7b
Check that sret is only used on pointers to types
...
with a size, like byval.
llvm-svn: 46207
2008-01-21 11:28:49 +00:00
Duncan Sands
a59f396cba
Be consistent with other attribute methods, and
...
check the callee also if it is known.
llvm-svn: 46206
2008-01-21 11:27:55 +00:00
Chris Lattner
cc7ff8c1dd
improve compatibility with mingw, patch by Alain Frisch
...
llvm-svn: 46026
2008-01-15 22:50:50 +00:00
Bill Wendling
d21d90cf98
Reformatted. It was confusing the other way. No functionality change.
...
llvm-svn: 46009
2008-01-15 21:16:32 +00:00
Duncan Sands
38987c1dcc
Simplify CallInst::hasByValArgument using a new method.
...
llvm-svn: 45974
2008-01-14 19:57:00 +00:00
Duncan Sands
b5ca2e9fcb
I noticed that the trampoline straightening transformation could
...
drop attributes on varargs call arguments. Also, it could generate
invalid IR if the transformed call already had the 'nest' attribute
somewhere (this can never happen for code coming from llvm-gcc,
but it's a theoretical possibility). Fix both problems.
llvm-svn: 45973
2008-01-14 19:52:09 +00:00
Evan Cheng
b9293c51bd
Simplify code.
...
llvm-svn: 45950
2008-01-14 02:38:45 +00:00
Duncan Sands
2796740ad6
Allow the byval attribute for pointers to any type with
...
a size, not just structs.
llvm-svn: 45938
2008-01-13 21:19:12 +00:00
Evan Cheng
09dde6001d
Add hasByValArgument() to test if a call instruction has byval argument(s).
...
llvm-svn: 45913
2008-01-12 18:57:32 +00:00
Duncan Sands
0009c44464
Be more liberal in what parameter attributes are
...
allowed on the vararg arguments of a call.
llvm-svn: 45909
2008-01-12 16:42:01 +00:00
Duncan Sands
b99f44aa5e
Do not allow attributes beyond a function's last
...
parameter, even if it is a varargs function. Do
allow attributes on the varargs part of a call,
but not beyond the last argument. Only allow
selected attributes to be on the varargs part of
a call (currently only 'byval' is allowed). The
reasoning here is that most attributes, eg inreg,
simply make no sense here.
llvm-svn: 45887
2008-01-11 22:36:48 +00:00
Evan Cheng
4cc275c3fb
Allow parameter attributes on varargs function parameters.
...
llvm-svn: 45850
2008-01-11 02:13:09 +00:00
Duncan Sands
b18c30acec
Small cleanup for handling of type/parameter attribute
...
incompatibility.
llvm-svn: 45704
2008-01-07 17:16:06 +00:00
Duncan Sands
404eb05247
The transform that tries to turn calls to bitcast functions into
...
direct calls bails out unless caller and callee have essentially
equivalent parameter attributes. This is illogical - the callee's
attributes should be of no relevance here. Rework the logic, which
incidentally fixes a crash when removed arguments have attributes.
llvm-svn: 45658
2008-01-06 18:27:01 +00:00
Duncan Sands
55e5090fe8
When transforming a call to a bitcast function into
...
a direct call with cast parameters and cast return
value (if any), instcombine was prepared to cast any
non-void return value into any other, whether castable
or not. Add a new predicate for testing whether casting
is valid, and check it both for the return value and
(as a cleanup) for the parameters.
llvm-svn: 45657
2008-01-06 10:12:28 +00:00
Gordon Henriksen
7c87884ec3
Trying that again.
...
llvm-svn: 45529
2008-01-03 03:32:33 +00:00
Gordon Henriksen
8624d7b72e
Fix a compile error on Windows.
...
llvm-svn: 45528
2008-01-03 03:21:18 +00:00
Chris Lattner
76719ba5f1
Remove the function attr cache for intrinsics. This does not maintain the
...
refcount on these correctly, and can end up referring to deleted
attributes. This fixes PR1881.
llvm-svn: 45525
2008-01-03 01:20:12 +00:00
Chris Lattner
b18b0b99c6
Don't create a new ParamAttrsList (which copies the vector) just to
...
get a profile.
llvm-svn: 45524
2008-01-03 00:29:27 +00:00
Chris Lattner
d0e1f10078
move some code out of line, rearrange a bit.
...
llvm-svn: 45519
2008-01-03 00:10:22 +00:00
Chris Lattner
3e13b8c173
Split param attr implementation out from Function.cpp into its
...
own file. Don't #include ParameterAttributes.h into any major
public header files: just move methods out of line as appropriate.
llvm-svn: 45517
2008-01-02 23:42:30 +00:00
Chris Lattner
04cd35f88b
remove blob of #if'd out code.
...
llvm-svn: 45512
2008-01-02 23:10:45 +00:00
Chris Lattner
0acc15c470
Fix a build issue on cygwin
...
llvm-svn: 45506
2008-01-02 22:03:27 +00:00
Gordon Henriksen
097102c32a
Adding C bindings for SwitchInst::addCase.
...
Patch by Bryan O'Sullivan!
llvm-svn: 45481
2008-01-01 05:50:53 +00:00
Gordon Henriksen
4a4d73519e
Add some doxygen comments to llvm-c/Core.h.
...
llvm-svn: 45450
2007-12-30 17:46:33 +00:00
Chris Lattner
f3ebc3f3d2
Remove attribution from file headers, per discussion on llvmdev.
...
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Chris Lattner
a087a8d2ce
remove attribution from lib Makefiles.
...
llvm-svn: 45415
2007-12-29 20:09:26 +00:00
Gordon Henriksen
05568bbd98
Adding bindings for target triple and data layout.
...
llvm-svn: 45369
2007-12-27 20:13:47 +00:00
Gordon Henriksen
823f9730d7
Switch the bindings to use LLVMFoldingBuilder.
...
llvm-svn: 45367
2007-12-27 18:25:59 +00:00
Gordon Henriksen
fb56bde933
Noting and enforcing that GC intrinsics are valid only within a
...
function with GC.
This will catch the error when the inliner inlines a function with
GC into a caller with no GC.
llvm-svn: 45350
2007-12-25 02:31:26 +00:00
Gordon Henriksen
9157c499fc
Adjusting verification of "llvm.gc*" intrinsic prototypes to match
...
LangRef.
llvm-svn: 45349
2007-12-25 02:02:10 +00:00
Duncan Sands
8c5822802e
Get the verifier to check attributes on calls as well
...
as on functions. Make it verify invokes and not just
ordinary calls. As a (desired) side-effect, it is no
longer legal to have call attributes on arguments that
are being passed to the varargs part of a varargs
function (llvm-as drops them on the floor anyway).
llvm-svn: 45286
2007-12-21 19:19:01 +00:00
Gordon Henriksen
34eb6d877e
Adding bindings for memory buffers and module providers. Switching
...
to exceptions rather than variants for error handling in Ocaml.
llvm-svn: 45226
2007-12-19 22:30:40 +00:00
Duncan Sands
aa31b92508
When inlining through an 'nounwind' call, mark inlined
...
calls 'nounwind'. It is important for correct C++
exception handling that nounwind markings do not get
lost, so this transformation is actually needed for
correctness.
llvm-svn: 45218
2007-12-19 21:13:37 +00:00
Chris Lattner
d92e71cf9a
remove a dead annotation
...
llvm-svn: 45163
2007-12-18 19:04:24 +00:00
Duncan Sands
3353ed09ac
Rename isNoReturn to doesNotReturn, and isNoUnwind to
...
doesNotThrow.
llvm-svn: 45160
2007-12-18 09:59:50 +00:00
Christopher Lamb
ac7d631ed2
Don't forget to print address space qualifiers when printing out the type table! Thanks to Gordon Henriksen for pointing this out.
...
llvm-svn: 45147
2007-12-18 03:49:35 +00:00
Evan Cheng
a8288f4294
Remove int_x86_sse2_movl_dq. It's replaced with a string compare.
...
llvm-svn: 45140
2007-12-18 01:04:25 +00:00
Evan Cheng
0e179d015f
Bring back int_x86_sse2_movl_dq intrinsic for backward compatibility. Make sure
...
it's auto-upgraded to a shufflevector instruction.
llvm-svn: 45131
2007-12-17 22:33:23 +00:00
Duncan Sands
b5a79d0eaa
Make invokes of inline asm legal. Teach codegen
...
how to lower them (with no attempt made to be
efficient, since they should only occur for
unoptimized code).
llvm-svn: 45108
2007-12-17 18:08:19 +00:00
Gordon Henriksen
5a3fe03784
C and Ocaml bindings for address spaces, for that burgeoning market
...
for Ocaml-based compilers targeting embedded devices. :)
llvm-svn: 45096
2007-12-17 16:08:32 +00:00
Christopher Lamb
edf0788758
Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.
...
llvm-svn: 45082
2007-12-17 01:12:55 +00:00
Christopher Lamb
55c6d4f22f
Make it clear in the LangRef that allocation instructions only operated on the generic address space. Implement support in the verifier for ensuring this is true.
...
llvm-svn: 45080
2007-12-17 01:00:21 +00:00
Duncan Sands
8e4847ee95
Make instcombine promote inline asm calls to 'nounwind'
...
calls. Remove special casing of inline asm from the
inliner. There is a potential problem: the verifier
rejects invokes of inline asm (not sure why). If an
asm call is not marked "nounwind" in some .ll, and
instcombine is not run, but the inliner is run, then
an illegal module will be created. This is bad but
I'm not sure what the best approach is. I'm tempted
to remove the check in the verifier...
llvm-svn: 45073
2007-12-16 15:51:49 +00:00
Anders Carlsson
f924f34b6b
All MMX shift instructions took a <2 x i32> vector as the shift amount parameter. Change this to be <1 x i64> instead, which matches the assembler instruction.
...
llvm-svn: 45027
2007-12-14 06:38:54 +00:00
Duncan Sands
9ab0943b86
Revert r44626, which turned off the use of readonly
...
and readnone for functions with bodies because it
broke llvm-gcc-4.2 bootstrap. It turns out that,
because of LLVM's array_ref hack, gcc was computing
pure/const attributes wrong (now fixed by turning
off the gcc ipa-pure-const pass).
llvm-svn: 44937
2007-12-12 16:01:40 +00:00
Gordon Henriksen
0a68fe2ffc
Add (very basic) bindings for ModuleProvider.
...
llvm-svn: 44899
2007-12-12 01:04:30 +00:00
Christopher Lamb
54dd24c2a7
Implement address space attribute for LLVM pointer types. Address spaces are
...
regions of memory that have a target specific relationship, as described in the
Embedded C Technical Report.
This also implements the 2007-12-11-AddressSpaces test,
which demonstrates how address space attributes can be used in LLVM IR.
In addition, this patch changes the bitcode signature for stores (in a backwards
compatible manner), such that the pointer type, rather than the pointee type, is
encoded. This permits type information in the pointer (e.g. address space) to be
preserved for stores.
LangRef updates are forthcoming.
llvm-svn: 44858
2007-12-11 08:59:05 +00:00
Chris Lattner
8e6a8f984c
Teach VMCore to constant fold shufflevectors with constant operands.
...
This allows us to compile:
#include <emmintrin.h>
typedef __m128i VSInt16;
typedef short vSInt16 __attribute__ ((__vector_size__ (16)));
VSInt16 t3() {
return (VSInt16)((vSInt16)_mm_set1_epi16(6518));
}
into:
_t3:
movaps LCPI1_0, %xmm0
ret
instead of:
_t3:
movl $6518, %eax
movd %eax, %xmm0
pextrw $0, %xmm0, %eax
xorps %xmm0, %xmm0
pinsrw $0, %eax, %xmm0
punpcklwd %xmm0, %xmm0
pshufd $0, %xmm0, %xmm0
ret
llvm-svn: 44856
2007-12-11 07:49:37 +00:00
Chris Lattner
5c6399eee6
significantly simplify some code, no functionality change.
...
llvm-svn: 44850
2007-12-11 06:07:39 +00:00
Chris Lattner
e8ea0374ac
refactor some code, no functionality change.
...
llvm-svn: 44849
2007-12-11 05:55:02 +00:00
Chris Lattner
d2265b45ae
Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.
...
Reimplement the xform in Analysis/ConstantFolding.cpp where we can use
targetdata to validate that it is safe. While I'm in there, fix some const
correctness issues and generalize the interface to the "operand folder".
llvm-svn: 44817
2007-12-10 22:53:04 +00:00
Gordon Henriksen
4b904b9627
Delete the CollectorNamePool if it should become empty.
...
llvm-svn: 44775
2007-12-10 03:35:18 +00:00
Gordon Henriksen
71183b6739
Adding a collector name attribute to Function in the IR. These
...
methods are new to Function:
bool hasCollector() const;
const std::string &getCollector() const;
void setCollector(const std::string &);
void clearCollector();
The assembly representation is as such:
define void @f() gc "shadow-stack" { ...
The implementation uses an on-the-side table to map Functions to
collector names, such that there is no overhead. A StringPool is
further used to unique collector names, which are extremely
likely to be unique per process.
llvm-svn: 44769
2007-12-10 03:18:06 +00:00