1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

1909 Commits

Author SHA1 Message Date
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
Dan Gohman
298f3fd9b7 Move the GET_SIDE_EFFECT_INFO logic from isInstructionTriviallyDead
to Instruction::mayWriteToMemory, fixing a FIXME, and helping
various places that call mayWriteToMemory directly.

llvm-svn: 40533
2007-07-26 16:06:08 +00:00
Dan Gohman
c63ddf2f57 DummyInst's member functions don't need to be virtual.
llvm-svn: 40530
2007-07-26 15:25:08 +00:00
Christopher Lamb
f3881994a7 Add support for 3 element 32-bit vector ValueTypes.
llvm-svn: 40506
2007-07-26 01:46:52 +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
Chris Lattner
c157b172c1 zext(undef) = 0 and sext(undef) = 0, not undef.
This hopefully fixes a miscompilation of TargetData.cpp when self hosting.

llvm-svn: 40125
2007-07-20 22:09:02 +00:00
Devang Patel
133b5cb6b6 Use SmallVector instead of std::vector.
llvm-svn: 40109
2007-07-20 18:04:54 +00:00
Reid Spencer
44d34e9b61 For PR1553:
Change the keywords for the zext and sext parameter attributes to be 
zeroext and signext so they don't conflict with the keywords for the
instructions of the same name. This gets around the ambiguity.

llvm-svn: 40069
2007-07-19 23:13:04 +00:00
Devang Patel
45675e56ad Verify loop info.
llvm-svn: 40062
2007-07-19 18:02:32 +00:00
Devang Patel
9c100bc7e9 Set up ground work to verify preserved analysis info.
llvm-svn: 40039
2007-07-19 05:36:09 +00:00
Dan Gohman
4d64f82ab5 Add constructor overloads for LoadInst and StoreInst that insert at the
end of a BasicBlock and have an alignment parameter.

llvm-svn: 40016
2007-07-18 20:51:11 +00:00
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
Devang Patel
f1b6294e80 Fix memory leak.
llvm-svn: 38469
2007-07-09 20:52:39 +00:00
Rafael Espindola
7b3de98989 Add the byval attribute
llvm-svn: 37940
2007-07-06 10:57:03 +00:00
Chris Lattner
e1541b7c18 This enum is dead
llvm-svn: 37920
2007-07-05 17:28:01 +00:00
Gabor Greif
5f705671e4 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.

llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Devang Patel
28d2851f39 Remove ETForest.
llvm-svn: 37765
2007-06-27 20:53:52 +00:00
Dan Gohman
cb89e19a6d Rename ("shrinkify") MVT::isExtendedValueType to MVT::isExtendedVT.
llvm-svn: 37758
2007-06-27 16:08:04 +00:00
Dan Gohman
94432fe813 Use utostr from StringExtras.h instead of ostringstream from <sstream>.
llvm-svn: 37731
2007-06-26 15:14:48 +00:00
Dan Gohman
354f02e03d Generalize MVT::ValueType and associated functions to be able to represent
extended vector types. Remove the special SDNode opcodes used for pre-legalize
vector operations, and the special MVT::Vector type used with them. Adjust
lowering and legalize to work with the normal SDNode kinds instead, and to
use the normal MVT functions to work with vector types instead of using the
two special operands that the pre-legalize nodes held.

This allows pre-legalize and post-legalize DAGs, and the code that operates
on them, to be more consistent. Pre-legalize vector operators can be handled
more consistently with scalar operators. And, -view-dag-combine1-dags and
-view-legalize-dags now look prettier for vector code.

llvm-svn: 37719
2007-06-25 16:23:39 +00:00
Devang Patel
bfb1c7192e Move code to update dominator information after basic block is split
from LoopSimplify.cpp to Dominator.cpp

llvm-svn: 37689
2007-06-21 17:23:45 +00:00
Devang Patel
f57b9f4d5d Fix quotes in debug messages.
llvm-svn: 37630
2007-06-18 21:32:29 +00:00
Chris Lattner
145fdc7e2a add a Constant::getAllOnesValue helper function, which works on integers
AND vectors.

llvm-svn: 37586
2007-06-15 06:10:53 +00:00
Chris Lattner
c2985cea59 Enhance BinaryOperator::isNot to support vector not.
llvm-svn: 37585
2007-06-15 06:04:24 +00:00
Devang Patel
fbde93ba1f isReachableFromEntry() is not suitable for post dominator.
llvm-svn: 37562
2007-06-12 17:50:25 +00:00
Devang Patel
b4e2a776cb Remove redundant check.
llvm-svn: 37561
2007-06-12 17:35:20 +00:00
Devang Patel
8c07212a59 Check A dominates B and vise versa first while searching for nearest
common dominator.

llvm-svn: 37559
2007-06-12 17:17:57 +00:00
Devang Patel
ab4cb51479 Break DominatorTree from ETNode.
Remove unused PostETForest.

llvm-svn: 37551
2007-06-12 00:54:38 +00:00
Devang Patel
520e92a7f4 Use SmallPtrSet instaed of std::set
llvm-svn: 37548
2007-06-12 00:40:51 +00:00
Devang Patel
31da507473 Check immediate dominators first while searching for nearset common dominator.
Fix 80 col violations.

llvm-svn: 37547
2007-06-12 00:35:38 +00:00
Devang Patel
73d23a5f70 Maintain DFS number in DomTreeNode itself.
This means now ETNodes are not useful anymore.

llvm-svn: 37546
2007-06-12 00:14:41 +00:00
Devang Patel
bc3887310b Add and use DominatorTreeBase::findNearestCommonDominator().
llvm-svn: 37545
2007-06-11 23:31:22 +00:00
Devang Patel
a8e236cab7 Use DominatorTree instead of ETForest.
llvm-svn: 37538
2007-06-11 15:40:48 +00:00
Devang Patel
cfb3a761ae Update LoopSimplify to require and preserve DominatorTree only.
Now LoopSimplify does not require nor preserve ETForest.

llvm-svn: 37512
2007-06-08 01:50:32 +00:00
Devang Patel
9772222f41 Add instruction level dominates(A,B) interface.
llvm-svn: 37504
2007-06-07 23:52:40 +00:00
Devang Patel
babcd06827 Maintain ETNode as part of DomTreeNode.
This adds redundancy for now.

llvm-svn: 37492
2007-06-07 17:47:21 +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
ace719b5fd Add new dominator tree node into dominator tree node map.
llvm-svn: 37475
2007-06-06 20:08:11 +00:00
Chris Lattner
9a57dc1923 Fix a user-reported error building with GCC 3.4.4 on Cygwin.
llvm-svn: 37445
2007-06-05 23:49:06 +00:00
Zhou Sheng
09b12fef98 Commit first round work of PR1373. "noalias" is now fully supported in
VMCore, BitCode, and Assembly. Documentation and test case paramattrs.ll
updated also.

llvm-svn: 37432
2007-06-05 05:28:26 +00:00
Devang Patel
3ad9b9f927 Add FIXMEs.
llvm-svn: 37417
2007-06-04 17:38:00 +00:00
Devang Patel
2ef6caf14f s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
llvm-svn: 37407
2007-06-04 00:32:22 +00:00
Devang Patel
d58b82f83a s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
llvm-svn: 37403
2007-06-03 06:26:14 +00:00
Dan Gohman
2c5d31ee81 Minor comment cleanups.
llvm-svn: 37321
2007-05-24 14:36:04 +00:00
Dan Gohman
a98a5763f9 Add cases for v2f32.
llvm-svn: 37319
2007-05-24 14:29:12 +00:00
Devang Patel
bf5c49f62c Add dump() routines for debugging assistance.
llvm-svn: 37314
2007-05-23 19:55:36 +00:00
Devang Patel
c81283a894 If user wants to run instcombine twice, do not block it.
llvm-svn: 37301
2007-05-23 05:08:52 +00:00
Reid Spencer
c60a73917d Reinstate the patch for escaping non-printing characters and allow for
\\ to escape \. All these cases are now handled by the AsmParser.

llvm-svn: 37295
2007-05-22 19:27:35 +00:00
Chris Lattner
1509e17e6c temporarily revert reid's asmwriter patch, it is missing the asmparser piece
that decodes the escape sequences, thus breaking all cases that use them.

This fixes test/Assembler/2007-05-21-Escape.ll

llvm-svn: 37284
2007-05-22 07:00:50 +00:00
Reid Spencer
dbc381aedd Get the order of the hext digits right!
llvm-svn: 37261
2007-05-19 14:44:42 +00:00
Reid Spencer
7170d7ab1b Adjust how LLVM names are produced:
1. Always use % for local and @ for global.
2. Replace NameNeedsQuotes with QuoteNameIfNeeded so that any adjustments
   to the name can be done in one pass.
3. Implement generation of hex escapes so we don't get "wonky" characters
   in the output.

llvm-svn: 37260
2007-05-19 07:25:21 +00:00
Dan Gohman
03114bee5f Update comments to say "vector" instead of "packed".
llvm-svn: 36995
2007-05-11 21:43:24 +00:00
Chris Lattner
8070a25149 handle gep aliasee
llvm-svn: 36815
2007-05-05 23:49:02 +00:00
Chris Lattner
da3b0264f7 if functiontype is going to have a pointer to a paramattr object, it better
be const.  The only way to get a pointer to these returns a const pointer.

llvm-svn: 36734
2007-05-04 03:39:28 +00:00
Jeff Cohen
d59084b6f6 Unbreak VC++ build.
llvm-svn: 36700
2007-05-03 22:09:21 +00:00
Devang Patel
e0b9bd0e49 Use iterative while loop instead of recursive function call.
llvm-svn: 36694
2007-05-03 20:55:18 +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
32786f1037 Re-install patch to enable use of PassID.
I am preparing another patch to address the failure that prompted
Chris to revert this patch earlier.

llvm-svn: 36649
2007-05-02 20:38:25 +00:00
Chris Lattner
055c13234b revert enough of devang's recent patches to get the tree basically working again
llvm-svn: 36638
2007-05-02 04:25:31 +00:00
Chris Lattner
6a176b8f47 disable this assertion as a hack to get the build more unbroken :(
llvm-svn: 36637
2007-05-02 04:01:44 +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
202b9dff0e Fix typo. Interesting, but old variant worked too :)
llvm-svn: 36588
2007-04-30 10:28:40 +00:00
Anton Korobeynikov
3d95e52ea2 Implement protected visibility. This partly implements PR1363. Linker
should be taught to deal with protected symbols.

llvm-svn: 36565
2007-04-29 18:35:00 +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
Chris Lattner
ab3ae8dd2f add a way to make this less brittle
llvm-svn: 36528
2007-04-28 05:38:52 +00:00
Chris Lattner
0b40f6db6c represent indirect operands explicitly in inline asm strings.
llvm-svn: 36522
2007-04-28 01:02:58 +00:00
Chris Lattner
9bfe8f4517 add a GEP helper function
llvm-svn: 36515
2007-04-27 20:35:56 +00:00
Devang Patel
e7e2cb2826 Move ~Pass() from Pass.h into Pass.cpp
llvm-svn: 36498
2007-04-26 21:33:42 +00:00
Devang Patel
8d4025a924 Use toplevel function pass manager as OnTheFly manager.
llvm-svn: 36481
2007-04-26 17:50:19 +00:00
Chris Lattner
bb09b15fe3 print aliases before functions
llvm-svn: 36459
2007-04-26 02:24:10 +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
cb6020a638 simplify some code
llvm-svn: 36427
2007-04-25 05:49:09 +00:00
Jeff Cohen
726786aa76 Have compiler enforce this.
llvm-svn: 36353
2007-04-22 22:16:55 +00:00
Christopher Lamb
5606cd66e2 PR400 work phase 1. Add attributed load/store instructions for volatile/align to LLVM.
llvm-svn: 36349
2007-04-22 19:24:39 +00:00
Reid Spencer
4169952dab For PR1136:
Add reference counting to ParamAttrsList and make use of it in Function,
CallInst and InvokeInst classes.

llvm-svn: 36346
2007-04-22 17:28:03 +00:00
Reid Spencer
4721577334 For PR1146:
Make ParamAttrsList objects unique. You can no longer directly create or
destroy them but instead must go through the ParamAttrsList::get()
interface.

llvm-svn: 36327
2007-04-22 05:46:44 +00:00
Reid Spencer
81070d52da Revert Christopher Lamb's load/store alignment changes.
llvm-svn: 36309
2007-04-21 18:36:27 +00:00
Christopher Lamb
b56b6a7ad7 add support for alignment attributes on load/store instructions
llvm-svn: 36301
2007-04-21 08:16:25 +00:00
Devang Patel
3e8b6494fb Reset vertex.
Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/048092.html

llvm-svn: 36294
2007-04-21 00:36:45 +00:00
Chris Lattner
a1e3b9487f Fix a bug that prevented the JIT from working correctly after llvm_shutdown.
Pass info objects are initialized by static ctors, so deleting them at
llvm_shutdown time prevents resurrection from working.

llvm-svn: 36292
2007-04-21 00:12:18 +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
4928ec0460 Fix a problem where primitive types lose their name after llvm_shutdown is called.
This also reduces the amount of work done at static construction time.

llvm-svn: 36285
2007-04-20 22:33:47 +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
0ee78670b8 don't access argument list of prototypes
llvm-svn: 36238
2007-04-18 00:57:22 +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
Chris Lattner
db7de8e497 merge several fields in GlobalValue to use the same word, move CallingConv
field into SubclassData in Value.  This shrinks GlobalVAlue from 48->40
bytes, Function from 88->76, and GlobalVariable from 76->68.  This trims
4640 bytes off my testcase, reading a bc file without materializing any
functions.

llvm-svn: 36192
2007-04-17 04:31:29 +00:00
Chris Lattner
cc56e116fe The (negative) offset from a SymbolTableListTraits-using ilist to its container
object is always constant.  As such, evaluate it at compile time instead of storing
it as an ivar in SymbolTableListTraits.  This shrinks every SymbolTableListTraits
ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes,
and Module from 60->52 bytes.

llvm-svn: 36189
2007-04-17 04:04:14 +00:00
Chris Lattner
71a21677f4 Refactor SymbolTableListTraits to only have a single pointer in it, instead
of two.  This shrinkifies Function by 8 bytes (104->96) and Module by 8
bytes (68->60).  On a testcase of mine, this reduces the memory used to
read a module header from 565680b to 561024, a little over 4K.

llvm-svn: 36188
2007-04-17 03:26:42 +00:00
Devang Patel
af0b4b4191 Proivde getAnalysis<FPAnalysis>(Func) support.
llvm-svn: 36159
2007-04-16 20:56:24 +00:00
Devang Patel
4bf452b5e4 Do not assert during analysis implementation initialization.
llvm-svn: 36158
2007-04-16 20:44:16 +00:00
Devang Patel
814d1deba8 Print and delete on the fly pass managers.
llvm-svn: 36157
2007-04-16 20:39:59 +00:00