Commit Graph

47229 Commits

Author SHA1 Message Date
Eli Friedman e7175d83dc Make sure to take the unqualified versions of the canonical types for
type-checking pointer subtraction; if the canonical types aren't used,
the qualifiers won't always get stripped off correctly.

llvm-svn: 55620
2008-09-02 05:09:35 +00:00
Zhongxing Xu a1035df101 Fit the comments into 80 columns.
llvm-svn: 55619
2008-09-02 03:29:51 +00:00
Ted Kremenek fd8ede33db Updated checker build.
llvm-svn: 55618
2008-09-01 22:51:34 +00:00
Nuno Lopes 4e630967fc readd test as it passes correctly. nice, but weird
llvm-svn: 55615
2008-09-01 22:28:55 +00:00
Eli Friedman 4c55e2c4ed Backing out r55607 due to logic errors and test regression.
I'll try to come up with a correct fix for the testcase sometime soon.

llvm-svn: 55614
2008-09-01 22:08:17 +00:00
Ted Kremenek 8af7e8b650 Updated checker build.
llvm-svn: 55613
2008-09-01 20:13:28 +00:00
Ted Kremenek c4f6d90ba1 Tidy up sema processing of attribute "nonull":
- warn about nonnull being applied to functions with no pointer arguments
- continue processing argument list in the attribute when we encounter a non-pointer parameter being marked as nonnull
- when no argument list is specified, only mark pointers as nonnull.  This fixes PR 2732 and radar 6188814.

llvm-svn: 55610
2008-09-01 19:57:52 +00:00
Nuno Lopes 2c5208c59f fix one more this-is-not-a-constant error. test included
llvm-svn: 55609
2008-09-01 18:42:41 +00:00
Gabor Greif 9c64e61176 Provide two overloads of AnalyzeNewNode.
The first can update the SDNode in an SDValue
while the second is called with SDNode* and
returns a possibly updated SDNode*.

This patch has no intended functional impact,
but helps eliminating ugly temporary SDValues.

llvm-svn: 55608
2008-09-01 15:10:19 +00:00
Nuno Lopes feac637074 make CheckArithmeticConstantExpression() aware of &foo and pointers
llvm-svn: 55607
2008-09-01 14:47:06 +00:00
Duncan Sands 4b31a2a7ce Even though no caller actually uses the new value
(what matters is that it is added to the worklist),
it seems more logical to return it.

llvm-svn: 55606
2008-09-01 13:11:13 +00:00
Duncan Sands fdbe925974 Turn this legalize types test on.
llvm-svn: 55605
2008-09-01 12:00:55 +00:00
Duncan Sands 130d9efec3 Add a small pass that sets the readnone/readonly
attributes on functions, based on the result of
alias analysis.  It's not hardwired to use
GlobalsModRef even though this is the only (AFAIK)
alias analysis that results in this pass actually
doing something.  Enable as follows:
  opt ... -globalsmodref-aa -markmodref ...
Advantages of this pass: (1) records the result
of globalsmodref in the bitcode, meaning it is
available for use by later passes (currently
the pass manager isn't smart enough to magically
make an advanced alias analysis available to all
later passes), which may expose more optimization
opportunities; (2) hopefully speeds up compilation
when code is optimized twice, for example when a
file is compiled to bitcode, then later LTO is done
on it: marking functions readonly/readnone when
producing the initial bitcode should speed up alias
analysis during LTO; (3) good for discovering that
globalsmodref doesn't work very well :)
Not currently turned on by default.

llvm-svn: 55604
2008-09-01 11:40:11 +00:00
Nuno Lopes f380a0de07 codegen constant data as such. add QualType::isConstant()
llvm-svn: 55603
2008-09-01 11:33:04 +00:00
Evan Cheng fa558788e7 Control flow instruction encodings.
llvm-svn: 55601
2008-09-01 08:25:56 +00:00
Evan Cheng c288cc0572 ldm / stm instruction encodings.
llvm-svn: 55599
2008-09-01 07:48:18 +00:00
Evan Cheng c37532b24a AXI2 and AXI3 instruction encodings.
llvm-svn: 55598
2008-09-01 07:34:13 +00:00
Evan Cheng a282723499 Reorganize instruction formats again; AXI1 encoding.
llvm-svn: 55597
2008-09-01 07:19:00 +00:00
Evan Cheng 169eccc24e addrmode3 instruction encodings.
llvm-svn: 55596
2008-09-01 07:00:14 +00:00
Evan Cheng 624844b4dd Reorganize some instruction format definitions. No functionality change.
llvm-svn: 55594
2008-09-01 01:51:14 +00:00
Evan Cheng cccca875b1 Rest of addrmode2 instruction encodings.
llvm-svn: 55593
2008-09-01 01:27:33 +00:00
Evan Cheng 01fd3f129a Addr2 word / byte load encodings.
llvm-svn: 55591
2008-08-31 19:02:21 +00:00
Evan Cheng 5b6c931e1f Addr1 instructions opcodes are encoded in bits 21-24; encode S bit.
llvm-svn: 55590
2008-08-31 18:32:16 +00:00
Ted Kremenek afe2a9fe77 Patch by Kovarththanan Rajaratnam!
"This minor patch adds markup of string literals with a red colour."

llvm-svn: 55589
2008-08-31 16:37:56 +00:00
Gabor Greif 81d6a38434 fix a bunch of 80-col violations
llvm-svn: 55588
2008-08-31 15:37:04 +00:00
Anders Carlsson 3f35a266da Handle mutation while enumerating correctly. Fix some bugs.
llvm-svn: 55583
2008-08-31 04:05:03 +00:00
Bill Wendling aebd2662d3 Revert the "XFAIL" for the rotate_ops.ll testcase. Instead, mark ISD::ROTR
instructions in CellSPU as "Expand" so that they won't be generated. I added a
"FIXME" so that this hack can be addressed and reverted once ISD::ROTR is
supported in the .td files.

llvm-svn: 55582
2008-08-31 02:59:23 +00:00
Bill Wendling 62cf24343c Expand for ROTR with MVT::i64.
Dale, Could you please review this?

llvm-svn: 55581
2008-08-31 02:53:19 +00:00
Anders Carlsson 756585963b Initial support for CodeGen of for ... in statements.
llvm-svn: 55580
2008-08-31 02:33:12 +00:00
Bill Wendling 91bf1e0dc5 CellSPU doesn't appear to support fully the "ISD::ROTR" operation. The DAG
combiner can now generate ROTR if the backend says that it can handle it. Cell
SPU says this, but gets an error from code gen saying that it can't select
ROTR. I'm xfailing this test until this can be fixed.

llvm-svn: 55579
2008-08-31 02:32:12 +00:00
Bill Wendling 58bb4f1bf0 Cosmetic changes to Machine LICM. No functionality change.
llvm-svn: 55578
2008-08-31 02:30:23 +00:00
Bill Wendling 11284ea499 Another situation where ROTR is cheaper than ROTL.
llvm-svn: 55577
2008-08-31 01:13:31 +00:00
Bill Wendling 4822a7ac8a For this pattern, ROTR is the cheaper option.
llvm-svn: 55576
2008-08-31 01:04:56 +00:00
Bill Wendling fc72416447 - Fix comment so that it describes how the code really works:
// fold (or (shl x, (*ext y)), (srl x, (*ext (sub 32, y)))) ->
   //   (rotl x, y)
   // fold (or (shl x, (*ext y)), (srl x, (*ext (sub 32, y)))) ->
   //   (rotr x, (sub 32, y))

Example: (x == 0xDEADBEEF and y == 4)

    (x << 4) | (x >> 28)
 => 0xEADBEEF0 | 0x0000000D
 => 0xEADBEEFD

    (rotl x, 4)
 => 0xEADBEEFD

    (rotr x, 28)
 => 0xEADBEEFD

- Fix comment and code for second version. It wasn't using the rot* propertly.

   // fold (or (shl x, (*ext (sub 32, y))), (srl x, (*ext r))) -> 
   //   (rotr x, y)
   // fold (or (shl x, (*ext (sub 32, y))), (srl x, (*ext r))) ->
   //   (rotl x, (sub 32, y))

    (x << 28) | (x >> 4)
 => 0xD0000000 | 0x0DEADBEE
 => 0xDDEADBEE

    (rotl x, 4)
 => 0xEADBEEFD

    (rotr x, 28)
 => (0xEADBEEFD)

llvm-svn: 55575
2008-08-31 00:37:27 +00:00
Gabor Greif 66ccf603a9 typo
llvm-svn: 55574
2008-08-30 22:16:05 +00:00
Anders Carlsson 2e744e8aa6 Stub out CodeGenFunction::EmitObjCForCollectionStmt.
Add CodeGenFunction::EmitMemSetToZero and make AggExprEmitter::EmitAggregateClear use it.

llvm-svn: 55573
2008-08-30 19:51:14 +00:00
Anders Carlsson d89ba7d058 Add code to create the fast enumeration state type
llvm-svn: 55572
2008-08-30 19:34:46 +00:00
Gabor Greif e12264bf41 fix some 80-col violations
llvm-svn: 55571
2008-08-30 19:29:20 +00:00
Gordon Henriksen eeb6537abb PR2731: C and Ocaml bindings for setTailCall and isTailCall.
Based on patch by Giorgos Korfiatis.

llvm-svn: 55570
2008-08-30 16:34:54 +00:00
Daniel Dunbar e0a09432cc Temporarily disable some tests which due to dot-syntax
access of methods.

llvm-svn: 55569
2008-08-30 16:22:34 +00:00
Anders Carlsson 35ba57dad7 Fix indentation on files in CodeGen and Sema.
llvm-svn: 55568
2008-08-30 16:18:10 +00:00
Anders Carlsson 7e1e57103e Simplify some calls to Builder.CreateCall
llvm-svn: 55567
2008-08-30 16:17:45 +00:00
Gordon Henriksen b52d1ed7e9 Fix ConstantExpr::getInsertElement.
Breakage was exposed in the Ocaml bindings tests after Chris
uncommented an assertion in r55084.

llvm-svn: 55566
2008-08-30 15:41:51 +00:00
Gabor Greif a719239719 fix some 80-col violations
llvm-svn: 55565
2008-08-30 10:09:02 +00:00
Evan Cheng a3771d5bd9 Re-apply 55467 with fix. If copy is being replaced by remat'ed def, transfer the implicit defs onto the remat'ed instruction.
llvm-svn: 55564
2008-08-30 09:09:33 +00:00
Evan Cheng 542ac62971 Fold isRematerializable checks into isSafeToReMat.
llvm-svn: 55563
2008-08-30 09:07:18 +00:00
Evan Cheng b8d588d89c For now, can't mark XOR64rr isAsCheapAsAMove. It's technically correct. But various passes cannot handle remating these.
llvm-svn: 55562
2008-08-30 08:54:22 +00:00
Daniel Dunbar 4b8c6db927 Add Objective-C property setter support.
- Change Obj-C runtime message API, drop the ObjCMessageExpr arg in
   favor of just result type and selector. Necessary so it can be
   reused in situations where we don't want to cons up an
   ObjCMessageExpr.
 - Update aggregate binary assignment to know about special property
   ref lvalues.
 - Add CodeGenFunction::EmitCallArg overload which takes an already
   emitted rvalue.

Add CodeGenFunction::StoreComplexIntoAddr.

Disabled logic in Sema for parsing Objective-C dot-syntax that
accesses methods. This code does not search in the correct order and
the AST node has no way of properly representing its results.

Updated StmtDumper to print a bit more information about
ObjCPropertyRefExprs.

llvm-svn: 55561
2008-08-30 05:35:15 +00:00
Daniel Dunbar c722b8565c Refactor handling of calls:
- Added CodeGenFunction::EmitCall which just takes the callee, return
   type, and a list of (Value*,QualType) pairs.
 - Added CodeGenFunction::EmitCallArg which handles emitting code for
   a call argument and turning it into an appropriate
   (Value*,QualType) pair.
 - Changed Objective-C runtime interface so that the actual emission
   of arguments for message sends is (once again) done in the code to
   emit a message send.

No intended functionality change, this is prep work for better ABI
support and for Objective-C property setter support.

llvm-svn: 55560
2008-08-30 03:02:31 +00:00
Daniel Dunbar c62cf79290 Add newline at end of file.
llvm-svn: 55559
2008-08-30 02:06:22 +00:00