Commit Graph

47638 Commits

Author SHA1 Message Date
Dan Gohman ec270fb640 Change ConstantSDNode and ConstantFPSDNode to use ConstantInt* and
ConstantFP* instead of APInt and APFloat directly.

This reduces the amount of time to create ConstantSDNode
and ConstantFPSDNode nodes when ConstantInt* and ConstantFP*
respectively are already available, as is the case in
SelectionDAGBuild.cpp. Also, it reduces the amount of time
to legalize constants into constant pools, and the amount of
time to add ConstantFP operands to MachineInstrs, due to
eliminating ConstantInt::get and ConstantFP::get calls.

It increases the amount of work needed to create new constants
in cases where the client doesn't already have a ConstantInt*
or ConstantFP*, such as legalize expanding 64-bit integer constants
to 32-bit constants. And it adds a layer of indirection for the
accessor methods. But these appear to be outweight by the benefits
in most cases.

It will also make it easier to make ConstantSDNode and
ConstantFPNode more consistent with ConstantInt and ConstantFP.

llvm-svn: 56162
2008-09-12 18:08:03 +00:00
Dale Johannesen 1f3ab86804 Pass "earlyclobber" bit through to machine
representation; coalescer and RA need to know
about it.  No functional change.

llvm-svn: 56161
2008-09-12 17:49:03 +00:00
Dan Gohman effb894453 Rename ConstantSDNode::getValue to getZExtValue, for consistency
with ConstantInt. This led to fixing a bug in TargetLowering.cpp
using getValue instead of getAPIntValue.

llvm-svn: 56159
2008-09-12 16:56:44 +00:00
Duncan Sands fa1472fd55 Give GlobalsModRef a whirl in the nightly testers.
I placed it just before GVN because that it is the
pass most likely to benefit from it.  Some quick
and dirty testing confirms that this is a decent
place for it.

llvm-svn: 56144
2008-09-12 08:23:37 +00:00
Duncan Sands 06dbb126e6 Rather than marking all internal globals "Ref"
when a readonly declaration is called, set a
flag.  This is faster and uses less memory.
In theory it is less accurate, because before
only those internal globals that were read
by someone were being marked "Ref", but now
all are.  But in practice, thanks to other
passes, all internal globals of the kind
considered here will be both read and stored
to: those only read will have been turned
into constants, and those only stored to will
have been deleted.

llvm-svn: 56143
2008-09-12 07:29:58 +00:00
Ted Kremenek d3f0d9b07c Updated checker build.
llvm-svn: 56142
2008-09-12 04:56:58 +00:00
Douglas Gregor aa1e21dcbd Give string literals const element typesin C++, and cope with the deprecated C++ conversion from a string literal to a pointer-to-non-const-character
llvm-svn: 56137
2008-09-12 00:47:35 +00:00
Dale Johannesen baf6762e26 The sequence for ppcf128 compares was not IEEE
safe in the presence of NaNs.

llvm-svn: 56136
2008-09-12 00:30:56 +00:00
Daniel Dunbar 484603be40 Iterate on sema for :? in Objective-C:
- Follow C99 behavior of using other operand type when one of
   operands is a null pointer constant.
 - Fix overenthusiastic devolving of any Objective-C types to id:
   o If either operand has an Objective-C object type then:
     - If both operands are interfaces and either operand can be
       assigned to the other, use that type as the composite type.
     - Otherwise, if either type is id, use id as the composite type.
     - Otherwise, warn about incompatible types and use id as the
       composite type.
 - Return handling of qualified idea to separate test following
   general pointer type checking.
   o Upgraded from old code to allow devolving to id (without warning,
     which matches GCC).
 - <rdar://problem/6212771>

Add test case for issues fixed above, XFAIL though because it exposed
a new issue in property handling.

llvm-svn: 56135
2008-09-11 23:12:46 +00:00
Argyrios Kyrtzidis 47f9865182 Add comments about C++ clause 3.3.2p4 that mentions that the condition declaration should be local to an if/switch/while/for statement.
llvm-svn: 56134
2008-09-11 23:08:39 +00:00
Dan Gohman eff71f2953 On 64-bit targets, change 32-bit getelementptr indices to be 64-bit
getelementptr indices, inserting an explicit cast if necessary.
This helps expose the sign-extension operation to other optimizations.

llvm-svn: 56133
2008-09-11 23:06:38 +00:00
Ted Kremenek 4ab81cbe2f Echo stderr/stdout from clang subprocess to both the stderr of ccc-analyzer and
to an output file. This way users can both see the output of 'clang' as well as
enable background logging of files that clang encounters problems on.

llvm-svn: 56130
2008-09-11 23:05:26 +00:00
Dan Gohman 7d01c0654c Fix a vectorshuffle instcombine bug introduced by r55995.
Patch by Nicolas Capens!

llvm-svn: 56129
2008-09-11 22:47:57 +00:00
Arnold Schwaighofer 33ad850d93 Add indirect tail call (function pointer) examples.
llvm-svn: 56127
2008-09-11 22:24:28 +00:00
Jim Grosbach a7cd7bc353 udpate header comment: s/VP/VFP/
llvm-svn: 56126
2008-09-11 21:41:29 +00:00
Ted Kremenek 28d1dc50b8 Bug fix: <rdar://problem/6164367>
scan-build now correctly processes path prefixes that contain multiple '+'
characters or other regex control characters.

llvm-svn: 56121
2008-09-11 21:15:10 +00:00
Arnold Schwaighofer dd45bc25ac When tailcallopt is enabled all fastcc calls must have an aligned argument stack size. Add a test case.
llvm-svn: 56119
2008-09-11 20:28:43 +00:00
Evan Cheng 5456a37280 Fix PR2748. Avoid coalescing physical register with virtual register which would create illegal extract_subreg. e.g.
vr1024 = extract_subreg vr1025, 1
...
vr1024 = mov8rr AH
If vr1024 is coalesced with AH, the extract_subreg is now illegal since AH does not have a super-reg whose sub-register 1 is AH.

llvm-svn: 56118
2008-09-11 20:07:10 +00:00
Owen Anderson 453564bfba Fix a bug in ANY_EXTEND handling that was breaking 403.gcc on X86-64 in fast isel.
llvm-svn: 56117
2008-09-11 19:44:55 +00:00
Duncan Sands 0a6d01770f Fix comment typo.
llvm-svn: 56116
2008-09-11 19:41:10 +00:00
Duncan Sands d4133ac315 Intrinsics don't touch internal global variables
(unless passed one via a parameter), even if they
are IntrWriteMem.

llvm-svn: 56115
2008-09-11 19:35:55 +00:00
Mon P Wang 08fedcbcbb Added SSE41 pminsd, pmaxsd, roundps and a few others
llvm-svn: 56114
2008-09-11 19:22:31 +00:00
Dan Gohman 9b9d547a5c Fix a copy+paste bug that Duncan spotted. For several
cases it was still getting lucky and detecting overflow
but it was clearly incorrect.

llvm-svn: 56113
2008-09-11 18:53:02 +00:00
Evan Cheng 4c9fbbb511 Fix PR2783 - coalescer bug. Missing a TargetRegisterInfo::isVirtualRegister check.
llvm-svn: 56112
2008-09-11 18:40:32 +00:00
Ted Kremenek 81ced5c472 Check if the environment variable TERM is defined before using it.
This fixes: <rdar://problem/6164279> scan-build gives error when invoked without TERM variable

llvm-svn: 56110
2008-09-11 18:17:51 +00:00
Ted Kremenek c4488441da Update Xcode project.
llvm-svn: 56109
2008-09-11 18:14:22 +00:00
Evan Cheng fb05965d72 Eliminate some unused methods.
llvm-svn: 56108
2008-09-11 17:31:47 +00:00
Evan Cheng c5af471be5 Indentation.
llvm-svn: 56107
2008-09-11 17:31:12 +00:00
Jim Grosbach 56938af9e2 lib/Target/SubtargetFeature.cpp asserts that the FeatureKV[] table be sorted
by its first field, but TableGen doesn't actually enforce creating it that 
way. TableGen sorts the records that will be used to create it by the names 
of the records, not the Name field of those records.

This patch corrects the sort to use the "Name" field of the record as the 
sort key.

llvm-svn: 56106
2008-09-11 17:05:32 +00:00
Duncan Sands e30b36fe37 Intrinsics don't read these kinds of global
variables.

llvm-svn: 56105
2008-09-11 15:43:12 +00:00
Steve Naroff 4adbe3116e Fix <rdar://problem/6210791> clang ObjC rewriter: @try / @catch block with no @finally does not call objc_exception_try_exit.
Need a couple tweaks to RewriteObjCTryStmt(). Need to deal with implicit finally clauses (to make sure objc_exception_try_exit is called). Also fixed a related bug where we need to generate an implicit @catch else clause (to again make sure objc_exception_try_exit is called).

llvm-svn: 56104
2008-09-11 15:29:03 +00:00
Douglas Gregor 27a907eb8c bool is not an extension in C++
llvm-svn: 56103
2008-09-11 12:06:59 +00:00
Anders Carlsson 9396a89899 Make sure to store the exception in the catch parameter.
llvm-svn: 56102
2008-09-11 09:15:33 +00:00
Anders Carlsson b5130d8588 Make sure to emit the catch parameter as well as the catch body.
llvm-svn: 56101
2008-09-11 08:21:54 +00:00
Anders Carlsson 3a3c2444d6 Fix stupid mistake I made in the exception handling code
llvm-svn: 56100
2008-09-11 06:35:14 +00:00
Evan Cheng f66e1120c6 Change getSubReg semantics. It now returns zero if the specified register doesn't have a subreg of the specified index.
llvm-svn: 56099
2008-09-11 06:25:25 +00:00
Evan Cheng 783ed9ead1 Fix a 80 column violation.
llvm-svn: 56097
2008-09-11 05:58:06 +00:00
Argyrios Kyrtzidis 176edb5490 Do implicit conversion to bool for the condition in a do-while statement.
llvm-svn: 56096
2008-09-11 05:16:22 +00:00
Argyrios Kyrtzidis fea38016a9 Fix do-while scoping in C++.
llvm-svn: 56095
2008-09-11 04:46:46 +00:00
Argyrios Kyrtzidis 9321c74bd0 Allow array-to-pointer conversion for rvalues.
llvm-svn: 56094
2008-09-11 04:25:59 +00:00
Argyrios Kyrtzidis 0fdbd6cf25 CXXConditionDeclExpr expression node is an lvalue.
llvm-svn: 56093
2008-09-11 04:22:26 +00:00
Argyrios Kyrtzidis e7092bafc2 LangOptions.C99 should be false in C++.
llvm-svn: 56092
2008-09-11 04:21:06 +00:00
Dale Johannesen 58d084c05b The version of AtomicSDNode::AtomicSDNode used (only) for
cmp-and-swap reversed the Cmp and Swap arguments; comments
make it clear this is unintentional.  Unfortunately, the
x86 BE had a compensating reversal, which is removed here.
PPC is OK.

From inspection of the Alpha code I think it is OK, but
if somebody has that platform please check it out.  I
cannot test on that platform.

llvm-svn: 56091
2008-09-11 03:12:59 +00:00
Argyrios Kyrtzidis 504bb844ba Revert r56078, getLang().C99 being true in C++ is a bug that will be fixed.
llvm-svn: 56090
2008-09-11 03:06:46 +00:00
Douglas Gregor e972aa471d Add support for expected-note to Clang's -verify option
llvm-svn: 56089
2008-09-11 02:46:36 +00:00
Owen Anderson 41baf8b22a If ISD::ANY_EXTEND fails, try ISD::ZERO_EXTEND and ISD::SIGN_EXTEND before giving up. This fixes 445.gobmk on
X86-64 in fast isel.

llvm-svn: 56088
2008-09-11 02:41:37 +00:00
Dale Johannesen e5ca04e70d Succumb utterly to compatibility and implement
__sync_fetch_and_nand as ANDC, even though that's
not what nand means.

llvm-svn: 56087
2008-09-11 02:15:03 +00:00
Daniel Dunbar d3674e6f40 Use ABIArgInfo for decisions about function arguments (not just return
value).
 - Added ABIArgInfo::ByVal (mostly supported) and ABIArgInfo::Expand
   (asserted out).

 - Added classifyArgumentType which currently just uses
   ABIArgInfo::Default or ByVal. This nearly matches old behavior, but
   we now set ByVal in a few situations we may have left it off before
   (on complex, for example).

llvm-svn: 56086
2008-09-11 01:48:57 +00:00
Evan Cheng b401449ceb Propagate subreg index when promoting a load to a copy.
llvm-svn: 56085
2008-09-11 01:02:12 +00:00
Daniel Dunbar ce05c8eb49 Fix two bugs exposed by array passing assert:
(1) Additional arguments to variadic methods should have default
promotions applied.

(2) Additional arguments to non-variadic methods were allowed.

llvm-svn: 56084
2008-09-11 00:50:25 +00:00