Commit Graph

341 Commits

Author SHA1 Message Date
Bill Wendling d8e312d11f Verify that the second parameter of the stacprotector intrinsic is an alloca
instruction.

llvm-svn: 59563
2008-11-18 23:09:31 +00:00
Nick Lewycky 967aeeb400 Correct this error message.
llvm-svn: 59370
2008-11-15 17:50:47 +00:00
Bill Wendling 9182147f17 Modify the intrinsics pattern to separate out the "return" types from the
"parameter" types. An intrinsic can now return a multiple return values like
this:

  def add_with_overflow : Intrinsic<[llvm_i32_ty, llvm_i1_ty],
                                    [LLVMMatchType<0>, LLVMMatchType<0>]>;

llvm-svn: 59237
2008-11-13 09:08:33 +00:00
Bill Wendling 9a04b9dd8b Refactor the code that does the type checking for intrinsics.
llvm-svn: 59228
2008-11-13 07:11:27 +00:00
Mon P Wang 25f0106fd9 Added support for the following definition of shufflevector
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> 

llvm-svn: 58964
2008-11-10 04:46:22 +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
Chris Lattner 229f765dbe Verify prefetch arguments, PR2576.
llvm-svn: 57626
2008-10-16 06:00: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
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
Dale Johannesen a7dd8bfaa5 Another file I forgot.
llvm-svn: 56678
2008-09-26 19:31:53 +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
Devang Patel 6402c7236f s/ParamAttrsWithIndex/FnAttributeWithIndex/g
llvm-svn: 56535
2008-09-24 00:55:02 +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
Anton Korobeynikov 1a1140429e Make safer variant of alias resolution routine to be default
llvm-svn: 56005
2008-09-09 20:05:04 +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
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
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
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
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
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 85ac9b1e4a whitespace cleanup
llvm-svn: 54980
2008-08-19 04:45:47 +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
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
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
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
Nate Begeman fd7b2be8e3 Allow verifier to be run on partially materialized modules.
llvm-svn: 54028
2008-07-25 17:28:23 +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
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
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 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
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
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
Dan Gohman 4e974ab933 Make PreVerifyID, IntSigsEnd, and KillSigsEnd const.
llvm-svn: 51088
2008-05-14 00:42:30 +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