Commit Graph

1860 Commits

Author SHA1 Message Date
Devang Patel 381a2a26e9 Fix edge cases in handling basic block split.
llvm-svn: 40564
2007-07-27 19:13:43 +00:00
Duncan Sands 5d49bcdce0 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 07c9066238 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 644f917358 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 6e853bc73f 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 f2af2bb6aa DummyInst's member functions don't need to be virtual.
llvm-svn: 40530
2007-07-26 15:25:08 +00:00
Christopher Lamb cd97a21064 Add support for 3 element 32-bit vector ValueTypes.
llvm-svn: 40506
2007-07-26 01:46:52 +00:00
Reid Spencer a2e618712d Make output match actual condition tested. Thanks, Duncan.
llvm-svn: 40464
2007-07-24 14:35:44 +00:00
Reid Spencer 0f8fd66a62 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 6c2b393f0c 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 363485da82 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 8adae86688 Use SmallVector instead of std::vector.
llvm-svn: 40109
2007-07-20 18:04:54 +00:00
Reid Spencer 314e1cb7ee 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 a273d1cd3a Verify loop info.
llvm-svn: 40062
2007-07-19 18:02:32 +00:00
Devang Patel ef43253e2e Set up ground work to verify preserved analysis info.
llvm-svn: 40039
2007-07-19 05:36:09 +00:00
Dan Gohman 68659280fa 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 6389ef9854 detect invalid combination of sret and byval
llvm-svn: 39971
2007-07-17 13:34:23 +00:00
Dan Gohman 06c60b6032 Fix comments about vectors to use the current wording.
llvm-svn: 39921
2007-07-16 14:29:03 +00:00
Rafael Espindola 9521a564fb check for correct usage of the byval attribute
llvm-svn: 38506
2007-07-10 19:28:12 +00:00
Devang Patel 94d0fbe1a6 Fix memory leak.
llvm-svn: 38469
2007-07-09 20:52:39 +00:00
Rafael Espindola b567e3ffb0 Add the byval attribute
llvm-svn: 37940
2007-07-06 10:57:03 +00:00
Chris Lattner fb0b269032 This enum is dead
llvm-svn: 37920
2007-07-05 17:28:01 +00:00
Gabor Greif e16561cd5d 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 c445982764 Remove ETForest.
llvm-svn: 37765
2007-06-27 20:53:52 +00:00
Dan Gohman 3b62d7265d Rename ("shrinkify") MVT::isExtendedValueType to MVT::isExtendedVT.
llvm-svn: 37758
2007-06-27 16:08:04 +00:00
Dan Gohman 3176887a73 Use utostr from StringExtras.h instead of ostringstream from <sstream>.
llvm-svn: 37731
2007-06-26 15:14:48 +00:00
Dan Gohman a866514528 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 d5258a23a5 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 d56e4919df Fix quotes in debug messages.
llvm-svn: 37630
2007-06-18 21:32:29 +00:00
Chris Lattner 72e3958003 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 1edec381a5 Enhance BinaryOperator::isNot to support vector not.
llvm-svn: 37585
2007-06-15 06:04:24 +00:00
Devang Patel 149a7616dc isReachableFromEntry() is not suitable for post dominator.
llvm-svn: 37562
2007-06-12 17:50:25 +00:00
Devang Patel 47419ee142 Remove redundant check.
llvm-svn: 37561
2007-06-12 17:35:20 +00:00
Devang Patel dcf0c03ff7 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 a6ff5bf9ba Break DominatorTree from ETNode.
Remove unused PostETForest.

llvm-svn: 37551
2007-06-12 00:54:38 +00:00
Devang Patel d324360352 Use SmallPtrSet instaed of std::set
llvm-svn: 37548
2007-06-12 00:40:51 +00:00
Devang Patel 9576fac800 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 88ea2dbc68 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 78b9c68164 Add and use DominatorTreeBase::findNearestCommonDominator().
llvm-svn: 37545
2007-06-11 23:31:22 +00:00
Devang Patel c43f32b935 Use DominatorTree instead of ETForest.
llvm-svn: 37538
2007-06-11 15:40:48 +00:00
Devang Patel becc466451 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 46d92cae96 Add instruction level dominates(A,B) interface.
llvm-svn: 37504
2007-06-07 23:52:40 +00:00
Devang Patel af41e4a192 Maintain ETNode as part of DomTreeNode.
This adds redundancy for now.

llvm-svn: 37492
2007-06-07 17:47:21 +00:00
Zhou Sheng 0ae22e99c8 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 def2d9790a Add new dominator tree node into dominator tree node map.
llvm-svn: 37475
2007-06-06 20:08:11 +00:00
Chris Lattner 31f82dff21 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 2444a9adeb 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 4a7c2830d4 Add FIXMEs.
llvm-svn: 37417
2007-06-04 17:38:00 +00:00
Devang Patel bdd1aaef10 s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
llvm-svn: 37407
2007-06-04 00:32:22 +00:00
Devang Patel 0e8aa7b69a s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
llvm-svn: 37403
2007-06-03 06:26:14 +00:00