Commit Graph

34710 Commits

Author SHA1 Message Date
Chris Lattner ec6480e235 new testcase
llvm-svn: 39882
2007-07-15 22:30:34 +00:00
Chris Lattner d4fef8dbca Implement shift-simplify.ll:test[45].
First teach instcombine that sign bit checks only demand the 
sign bit, this allows simplify demanded bits to hack on 
expressions better.

Second, teach instcombine that ashr is useless if only the
sign bit is demanded.

llvm-svn: 39880
2007-07-15 20:54:51 +00:00
Chris Lattner 06205d5567 Implement shift-simplify.ll:test3, turning:
(X << 31) <s 0  --> (X&1) != 0

This happens dozens of times in the CFE.

llvm-svn: 39879
2007-07-15 20:42:37 +00:00
Chris Lattner b1711e8485 remove obsolete comment.
llvm-svn: 39868
2007-07-15 06:46:25 +00:00
Chris Lattner 3fc74e2468 Change SourceManager::getInstantiationLoc to take virtual locations, doing its
virtual->physical mapping explicitly.

llvm-svn: 39867
2007-07-15 06:35:27 +00:00
Steve Naroff 81569d2044 This is the final step/commit for implementing exlicit implicit casts. Unlike the
previous two checkins, which involved lot's of tedious refactoring, this checkin is nice and clean:-)

- Hacked UsualUnaryConversions, UsualArithmeticConversions, and DefaultFunctionArrayConversion
to create the AST node (using a helper function promoteExprToType).
- Added a setType method to Expr.
- Changed Expr::isIntegerConstantExpr to allow for the new node.

llvm-svn: 39866
2007-07-15 02:02:06 +00:00
Chris Lattner 598305dfbd non-apple targets should be like i386, not the mythical, bogus, linux target.
llvm-svn: 39865
2007-07-15 01:37:36 +00:00
Chris Lattner c02c4abe5b Cache macro expander objects to avoid thrashing malloc in heavy expansion situations.
This doesn't significantly improve carbon.h, but it does speed up
INPUTS/macro_pounder_obj.c by 48%

llvm-svn: 39864
2007-07-15 00:25:26 +00:00
Chris Lattner 03928c7f9a Make parser scope cache be a member of the parser instead of a global,
which makes it multithread clean.

llvm-svn: 39863
2007-07-15 00:04:39 +00:00
Chris Lattner 564f478595 switch function-like macros from using a vector for their arguments to an
explicitly new'd array.  The array never mutates once created, so a vector
is overkill.

llvm-svn: 39862
2007-07-14 22:46:43 +00:00
Chris Lattner 819f2ef77b switch from using a vector to a smallvector for macro replacement tokens
This speeds up parsing carbon.h by 3.3% by avoiding some malloc traffic for 
small macros.

llvm-svn: 39861
2007-07-14 22:15:50 +00:00
Chris Lattner f40fe99118 expose an iterator interface to getReplacementTokens instead of the datastructure itself.
llvm-svn: 39860
2007-07-14 22:11:41 +00:00
Chris Lattner a3834341c5 split function-like and object-like macro body parsing to make the
code more obvious.

llvm-svn: 39859
2007-07-14 21:54:03 +00:00
Gabor Greif e97cd7e65c add FIXME and un-XFAIL test
llvm-svn: 39858
2007-07-14 20:05:18 +00:00
Nick Lewycky ddc2f9ba57 Clarify the language. Pointed out by Duncan Sands.
llvm-svn: 39857
2007-07-14 17:41:03 +00:00
Nick Lewycky d20f485866 Fix the build. Patch from Holger Schurig.
llvm-svn: 39856
2007-07-14 15:11:14 +00:00
Anton Korobeynikov 383a324735 Long live the exception handling!
This patch fills the last necessary bits to enable exceptions
handling in LLVM. Currently only on x86-32/linux.

In fact, this patch adds necessary intrinsics (and their lowering) which
represent really weird target-specific gcc builtins used inside unwinder.

After corresponding llvm-gcc patch will land (easy) exceptions should be
more or less workable. However, exceptions handling support should not be 
thought as 'finished': I expect many small and not so small glitches
everywhere.

llvm-svn: 39855
2007-07-14 14:06:15 +00:00
Bill Wendling 657a203adf Add missing directory
llvm-svn: 39853
2007-07-14 09:37:10 +00:00
Nick Lewycky 39519f5c41 Use maximal intersection algorithm exclusively. Fixes miscompile bug.
llvm-svn: 39852
2007-07-14 04:28:04 +00:00
Nick Lewycky 61b4a265ee Add alternate ConstantRange intersection algorithm.
llvm-svn: 39851
2007-07-14 02:51:34 +00:00
Chris Lattner 4481b428db A significant refactoring of the type size stuff to also
compute type alignment.  This info is needed for struct layout.

llvm-svn: 39850
2007-07-14 01:29:45 +00:00
Chris Lattner 9d3b0e0001 Implement trivial integer initializers, like 'int X = 4;' for global
vars.  Approach suggested by Keith.

llvm-svn: 39849
2007-07-14 00:23:28 +00:00
Chris Lattner 6ee31f5df8 In "int X,Y;", compile both X and Y.
llvm-svn: 39848
2007-07-14 00:16:50 +00:00
Chris Lattner 027f21dd72 add a fixme
llvm-svn: 39847
2007-07-14 00:01:01 +00:00
Chris Lattner 666115c848 Improve char literal pretty printing, patch by Keith Bauer!
llvm-svn: 39846
2007-07-13 23:58:20 +00:00
Evan Cheng 07bc082891 Added test case from PR1540.
llvm-svn: 39845
2007-07-13 23:57:33 +00:00
Devang Patel 4cd1413f15 Make LCSSA a loop pass.
llvm-svn: 39844
2007-07-13 23:57:11 +00:00
Evan Cheng 1fae1cd3e1 Fix for PR1540: Specify F0, F1 are sub-registers of D0, etc.
llvm-svn: 39843
2007-07-13 23:55:50 +00:00
Gabor Greif 03a0073b36 fix type of main, use !=
llvm-svn: 39842
2007-07-13 23:40:27 +00:00
Gabor Greif d4606aa36e implement _Complex * == and !=
llvm-svn: 39841
2007-07-13 23:33:18 +00:00
Steve Naroff b8ea4fb8db More changes related to implementing ImplicitCastExpr.
- Fixed a recent regression discovered by Keith Bauer (thanks!). 
The fix involved adding (back) two arguments to UsualArithmeticConversions.
Without the reference arguments, no unary conversions were being passed back
to the caller. This had the effect of turning off the UsualUnaryConversions.
- Refactored CheckAssignmentConstraints into 3 functions. CheckAssignmentConstraints,
CheckSingleAssignmentConstraints, and CheckCompoundAssignmentConstraints. 
- Changed the argument type of DefaultFunctionArrayConversion from QualType->Expr*&.
- Removed a bunch of casts in routines I was working on (cleanup).
- Fixed the visitor for ImplicitCastExpr (oops).

llvm-svn: 39840
2007-07-13 23:32:42 +00:00
Owen Anderson d975efab16 Handle GEPs with all-zero indices in the same way we handle pointer-pointer bitcasts. Also, fix a potentia infinite loop.
This brings FastDSE to parity with old DSE on 175.vpr.

llvm-svn: 39839
2007-07-13 22:50:48 +00:00
Chris Lattner 355332d3f3 Use target info to decide the sizes of basic types.
llvm-svn: 39838
2007-07-13 22:27:08 +00:00
Chris Lattner 0523dc94c8 Add missing citation.
llvm-svn: 39837
2007-07-13 22:16:13 +00:00
Gabor Greif f7b1f667d4 a simple _Complex testcase
llvm-svn: 39836
2007-07-13 22:15:44 +00:00
Chris Lattner 983a8bbbb2 Move getSize() out of type, into ASTContext, where it has target info, and
where ASTContext can manage caches for struct layout, etc.

llvm-svn: 39835
2007-07-13 22:13:22 +00:00
Devang Patel 29ccf8ba52 Disable claims to preserve analysis until open issues are resolved.
llvm-svn: 39834
2007-07-13 21:53:42 +00:00
Chris Lattner 35ed92817a Unspecified type specs default to int. This fixes a crash
on test/Sema/implicit-int.c

llvm-svn: 39833
2007-07-13 21:02:29 +00:00
Chris Lattner 2ce5dd4c98 remove some extraneous spaces, no functionality change.
llvm-svn: 39832
2007-07-13 21:01:17 +00:00
Chris Lattner 388cf760e2 implement codegen support for implicit casts.
llvm-svn: 39831
2007-07-13 20:25:53 +00:00
Chris Lattner 5c2f76b395 eliminate extraneous type, add accessors.
llvm-svn: 39830
2007-07-13 20:25:36 +00:00
Chris Lattner 91dacfec85 Check in these testcases.
llvm-svn: 39829
2007-07-13 20:18:44 +00:00
Dan Gohman 10835d9c67 Eliminate an unused parameter.
llvm-svn: 39828
2007-07-13 20:16:50 +00:00
Dan Gohman ff72788863 Fix the comment for LegalizeOp to more accurately reflect what it does.
llvm-svn: 39827
2007-07-13 20:14:11 +00:00
Chris Lattner effb7a350f new testcase that crashes the cfe due to implicit conversion fun
llvm-svn: 39826
2007-07-13 20:11:01 +00:00
Chris Lattner 0946f04236 remove obsolete note
llvm-svn: 39825
2007-07-13 20:08:19 +00:00
Chris Lattner a5ba0cb772 silence a bogus gcc warning.
llvm-svn: 39824
2007-07-13 20:07:11 +00:00
Dan Gohman 80f9f077e3 Don't call SimplifyVBinOp for non-vector operations, following earlier review
feedback. This theoretically makes the common (scalar) case more efficient.

llvm-svn: 39823
2007-07-13 20:03:40 +00:00
Chris Lattner 0a2d099792 fix some bugs in the manual
llvm-svn: 39822
2007-07-13 20:01:46 +00:00
Owen Anderson 9c9ef21432 Be more aggressive in removing dead stores, and in removing instructions trivially dead after DSE.
This drastically improves the effect of FastDSE on kimwitu++.

llvm-svn: 39819
2007-07-13 18:26:26 +00:00