1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

247 Commits

Author SHA1 Message Date
Duncan Sands
d05a55f03f Rename the 'const' parameter attribute to 'readnone',
and the 'pure' parameter attribute to 'readonly'.
Names suggested by DannyB.

llvm-svn: 44273
2007-11-22 20:23:04 +00:00
Nate Begeman
2a8ef3f29a Add support for vectors to int <-> float casts.
llvm-svn: 44204
2007-11-17 03:58:34 +00:00
Duncan Sands
5924300986 I discover array_lengthof, thanks to gabor on #llvm.
llvm-svn: 44139
2007-11-14 21:58:02 +00:00
Duncan Sands
805a8ba9cf Simplify the attribute verification code.
llvm-svn: 44116
2007-11-14 14:02:11 +00:00
Anton Korobeynikov
00f3ace7e9 Add pure/const attributes. Documentation will follow.
llvm-svn: 44109
2007-11-14 09:52:30 +00:00
Duncan Sands
fc061f4e20 Don't barf on empty basic blocks. Do not rely on assert
doing something - this needs to work for release builds
too.  I chose to just abort rather than following the
fancy logic of abortIfBroken, because (1) it is a pain
to do otherwise, and (2) nothing is going to work if the
module is this broken.

llvm-svn: 43611
2007-11-01 10:50:26 +00:00
Chris Lattner
4618bf2f11 remove verifier command line option: this should be part of the API, not
a command line optn.

llvm-svn: 43603
2007-11-01 04:43:13 +00:00
Owen Anderson
8eb7b6ed84 Now with less tabs!
llvm-svn: 43601
2007-11-01 03:54:23 +00:00
Owen Anderson
89dee120a1 Add a preverifier pass to check that every basic block ends in a terminator, so that we don't segfault when verifying invalid code.
llvm-svn: 43578
2007-10-31 21:04:18 +00:00
Chris Lattner
1659eb3c3f I am not sure this is a good idea to be an option, but rename the option for
now.  It conflicts with clang's -pedantic flag.

llvm-svn: 43431
2007-10-29 03:14:55 +00:00
Anton Korobeynikov
ab0c5f6d32 Add 'pedantic' mode to verifier rejecting syntactically valid, but 'bad' due to other reasons code
llvm-svn: 43424
2007-10-28 22:50:32 +00:00
Duncan Sands
5e73fe090a Check that the second parameter of init_trampoline
can be resolved to a function.  This is required
for codegen and used by instcombine.

llvm-svn: 42469
2007-09-29 16:25:54 +00:00
Chris Lattner
d1abd00b04 reject things like "declare internal @foo"
llvm-svn: 42140
2007-09-19 17:14:45 +00:00
Gordon Henriksen
765525cc71 Incorporating review feedback for GC verifier patch.
llvm-svn: 42087
2007-09-18 10:14:30 +00:00
Gordon Henriksen
fa3a5915b1 Fix for PR1633: Verifier doesn't fully verify GC intrinsics
LLVM now enforces the following prototypes for the write barriers:

<ty>* @llvm.gcread(<ty2>*, <ty>**)
void @llvm.gcwrite(<ty>*, <ty2>*, <ty>**)

And for @llvm.gcroot, the first stack slot is verified to be an alloca or a 
bitcast of an alloca.

Fixes test/CodeGen/Generic/GC/lower_gcroot.ll, which violated these.

llvm-svn: 42051
2007-09-17 20:30:04 +00:00
David Greene
8cda5af2e7 Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.

llvm-svn: 41697
2007-09-04 15:46:09 +00:00
Chris Lattner
6e6a77d83b use a nicer accessor.
llvm-svn: 41165
2007-08-18 06:13:19 +00:00
Dan Gohman
644db457f0 Fix the verification for overloaded intrinsic types. Check that they are
what they're supposed to be before using them.

llvm-svn: 41130
2007-08-16 22:06:45 +00:00
Dan Gohman
b499ea1cf6 Add MVT::fAny for overloading intrinsics on floating-point types.
llvm-svn: 41128
2007-08-16 21:57:19 +00:00
Reid Spencer
3e54e72ef1 Fix minor doxygen nits.
llvm-svn: 40854
2007-08-05 20:06:04 +00:00
Chandler Carruth
00e56b0e81 This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future.
This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported.

llvm-svn: 40807
2007-08-04 01:51:18 +00:00
Reid Spencer
c103e8add9 After a discussion with Anton, it turns out that the InReg attribute is not
permitted on function results. So, revert the last patch to make it illegal.

llvm-svn: 40632
2007-07-31 14:39:10 +00:00
Reid Spencer
b0eeb23ce8 The InReg parameter attribute is valid on function results. The llvm-gcc-4.0
front end converts regparm attribute on the gcc function into InReg attribute 
on the llvm function. This fixes test/CFrontend/2002-07-30-SubrefSetAssertion.c

llvm-svn: 40618
2007-07-31 06:33:37 +00:00
Duncan Sands
88c9f25dbc It seems logical that InReg should be incompatible
with StructReturn and ByVal, so make it so.

llvm-svn: 40554
2007-07-27 16:45:18 +00:00
Duncan Sands
b7b28dc6d0 As the number of parameter attributes increases,
Verifier::visitFunction is suffering a combinatorial
explosion due to the number of mutually incompatible
attributes.  This patch tidies the whole thing up
using attribute masks.  While there I fixed some
small bugs: (1) the ByVal attribute tests cast a
type to a pointer type, which can fail.  Yes, the
fact it is of a pointer type is checked before,
but a failing check does not cause the program
to exit, it continues on outputting further errors;
(2) Nothing was checking that an sret attribute is
on the first parameter; (3) nothing was checking that
a function for which isStructReturn() is true has a
parameter with the sret attribute and vice-versa (I
don't think it is possible for this to go wrong, but
it seems right to check it).

llvm-svn: 40553
2007-07-27 15:09:54 +00:00
Duncan Sands
e8bb2c6d32 Support for trampolines, except for X86 codegen which is
still under discussion.

llvm-svn: 40549
2007-07-27 12:58:54 +00:00
Reid Spencer
4e179b88aa Make output match actual condition tested. Thanks, Duncan.
llvm-svn: 40464
2007-07-24 14:35:44 +00:00
Reid Spencer
b9f23cc28b 1. Make sure we print the Function Value for parameter attribute errors
2. Fold an if statement into the Assert1 macro call.

llvm-svn: 40455
2007-07-23 23:46:43 +00:00
Reid Spencer
6286ca1d69 Add better verification of attributes on function types. It is not permitted
to use sret or inreg on the function. It is equally illegal to use noreturn
or nounwind on a parameter; they only go with the function. This patch
enforces these rules.

llvm-svn: 40453
2007-07-23 23:09:55 +00:00
Rafael Espindola
d70763bb0e detect invalid combination of sret and byval
llvm-svn: 39971
2007-07-17 13:34:23 +00:00
Dan Gohman
0ba554c0c8 Fix comments about vectors to use the current wording.
llvm-svn: 39921
2007-07-16 14:29:03 +00:00
Rafael Espindola
c0d9376230 check for correct usage of the byval attribute
llvm-svn: 38506
2007-07-10 19:28:12 +00:00
Rafael Espindola
7b3de98989 Add the byval attribute
llvm-svn: 37940
2007-07-06 10:57:03 +00:00
Devang Patel
a8e236cab7 Use DominatorTree instead of ETForest.
llvm-svn: 37538
2007-06-11 15:40:48 +00:00
Zhou Sheng
030400527a Add assert to check if the attributes ZExt/SExt, NoAlias are apply to the
correct type of parameters.

llvm-svn: 37486
2007-06-07 06:12:03 +00:00
Devang Patel
cd45427a87 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel
8ee9065162 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.

llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
38a66bc82e Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Anton Korobeynikov
cb2004f82c Implement review feedback
llvm-svn: 36564
2007-04-29 18:02:48 +00:00
Anton Korobeynikov
2070ca3361 Let Verifier check aliasees
llvm-svn: 36540
2007-04-28 14:35:41 +00:00
Anton Korobeynikov
45162c6dad Implement review feedback. Aliasees can be either GlobalValue's or
bitcasts of them.

llvm-svn: 36537
2007-04-28 13:45:00 +00:00
Anton Korobeynikov
25dc9a61cb Implement aliases. This fixes PR1017 and it's dependent bugs. CFE part
will follow.

llvm-svn: 36435
2007-04-25 14:27:10 +00:00
Chris Lattner
1907945816 Fix regressions introduced by my previous patch: opt calls verifier in a
way that the "Mod" ivar was not getting set.

llvm-svn: 36291
2007-04-20 23:59:29 +00:00
Chris Lattner
aff65c98a2 catch a case that was biting jeffc
llvm-svn: 36284
2007-04-20 21:48:08 +00:00
Chris Lattner
09139c7951 eliminate a use of Instruction::getPrev(), patch by Gabor Greif in 2005.
llvm-svn: 36197
2007-04-17 17:36:12 +00:00
Reid Spencer
82da0eb67c For PR1284:
Implement the "part_set" intrinsic.

llvm-svn: 35938
2007-04-12 02:48:46 +00:00
Chris Lattner
8557e71577 unbreak the build :(
llvm-svn: 35857
2007-04-10 03:18:19 +00:00
Jeff Cohen
9bc2960be6 Fix build problem.
llvm-svn: 35856
2007-04-10 03:10:46 +00:00
Reid Spencer
6eb55df794 Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Reid Spencer
1db694fe4b For PR1297:
1. Clear up confusion between "GotBits" and "ExpectBits". GotBits is the
   type actually provided. ExpectedBits is the type expected for the
   intrinsics. Before this patch, it was reversed!
2. Implement checks for overloaded intrinsics. This involves computing the
   suffix expected and making sure the suffix matches the function name. It
   also includes some intrinsic-specific checks such as ensuring that the
   bswap parameter and result are the same width and an even number of bytes.

llvm-svn: 35540
2007-04-01 07:22:57 +00:00