Commit Graph

47320 Commits

Author SHA1 Message Date
Ted Kremenek 5047f71f3e Output "ANALYZE:" diagnostics to STDOUT instead of STDERR.
llvm-svn: 55750
2008-09-04 00:02:50 +00:00
Ted Kremenek 370de84b50 ccc-analyzer:
- Capture the STDERR output of 'clang' to a file for use with crash reporting.

llvm-svn: 55749
2008-09-04 00:02:34 +00:00
Dan Gohman e039d5580e Do trivial local CSE for constants and other non-Instruction values
in FastISel.

llvm-svn: 55748
2008-09-03 23:32:19 +00:00
Dan Gohman 45df9951f5 Put RegsForValue in the llvm namespace to avoid warnings about
classes in the llvm namespace having members with types from
anonymous namespaces.

llvm-svn: 55747
2008-09-03 23:18:39 +00:00
Dan Gohman 7bda51f5a4 Create HandlePHINodesInSuccessorBlocksFast, a version of
HandlePHINodesInSuccessorBlocks that works FastISel-style. This
allows PHI nodes to be updated correctly while using FastISel.

This also involves some code reorganization; ValueMap and
MBBMap are now members of the FastISel class, so they needn't
be passed around explicitly anymore. Also, SelectInstructions
is changed to SelectInstruction, and only does one instruction
at a time.

llvm-svn: 55746
2008-09-03 23:12:08 +00:00
Devang Patel a26e2075b8 Update inline threshold for current function if the notes say, optimize for size.
llvm-svn: 55745
2008-09-03 23:06:09 +00:00
Owen Anderson 2fbfb70530 Fix a bug that prevented PRE from applying in some cases.
llvm-svn: 55744
2008-09-03 23:06:07 +00:00
Devang Patel 397d895bb8 Avoid extra comma.
llvm-svn: 55742
2008-09-03 22:55:40 +00:00
Devang Patel 3771a1281f Parse and print opt_size note.
llvm-svn: 55740
2008-09-03 22:10:21 +00:00
Daniel Dunbar 0ff4192f3a Set register storage class correctly for function parameters.
- PR2730

llvm-svn: 55739
2008-09-03 21:54:21 +00:00
Ted Kremenek b44763456c Following gcc's behavior, only enable trigraphs if '-trigraphs' or '-ansi' is
specified, or -std is set to a conforming mode.

llvm-svn: 55738
2008-09-03 21:22:16 +00:00
Daniel Dunbar 6626a2c51c Add svn:ignore on SemaObjC/Output.
llvm-svn: 55737
2008-09-03 21:18:38 +00:00
Daniel Dunbar 20e5db77a3 Add two test cases for builtins (mostly related to object size
builtins).

llvm-svn: 55736
2008-09-03 21:17:21 +00:00
Daniel Dunbar b0d34c8e4a Add __builtin_object_size support.
- Currently CodeGen always returns a conservative value for this (-1
   or 0 depending on the context).

llvm-svn: 55735
2008-09-03 21:13:56 +00:00
Andrew Lenharth 9fed8f5b9c Initial version of a Partial Specialization IPO pass. It triggers a couple hundred times on 176.gcc. I don't know the performance impact yet, the heuristic is quite simple still.
llvm-svn: 55734
2008-09-03 21:00:28 +00:00
Dale Johannesen 5c1ff11fc3 Do not emit a UsedDirective for things in the llvm.used
list that have internal linkage; the linker doesn't need
or want this.  (These objects must still be preserved
at compile time, so just removing them from the llvm.used
list doesn't work.)  Should affect only Darwin.

llvm-svn: 55722
2008-09-03 20:34:58 +00:00
Daniel Dunbar bec27e2c8b Modify object size checking builtins to lower to libc calls.
llvm-svn: 55721
2008-09-03 20:28:50 +00:00
Devang Patel a563d24e5d Fix typo in a comment.
llvm-svn: 55720
2008-09-03 20:25:40 +00:00
Devang Patel f58f96f810 Add missing decls.
llvm-svn: 55719
2008-09-03 20:24:05 +00:00
Devang Patel a4211876e5 Add parentheses to make code more readable.
llvm-svn: 55717
2008-09-03 19:57:15 +00:00
Devang Patel 50c66cdb0d Fix comments.
llvm-svn: 55716
2008-09-03 19:52:17 +00:00
Duncan Sands b86a788862 Testcase for commits 55700 and 55714.
llvm-svn: 55715
2008-09-03 19:38:41 +00:00
Duncan Sands ee088a7093 If a SCC has a node without a function, then the SCC
analysis would bail out without removing function
records for other members of the SCC (which may exist
if those functions read or wrote global variables).
Since these are initialized to "readnone", this
resulted in incorrect alias analysis results.

llvm-svn: 55714
2008-09-03 19:37:16 +00:00
Devang Patel 924d9084d8 Add custom inliner that handles only functions that are marked as always_inline.
llvm-svn: 55713
2008-09-03 18:50:53 +00:00
Devang Patel 0d442ffa2b Handle "always inline" note during inline cost analysis.
llvm-svn: 55712
2008-09-03 18:47:45 +00:00
Devang Patel 79661994b1 Check noinline note and ignore other notes.
llvm-svn: 55711
2008-09-03 18:46:35 +00:00
Steve Naroff c540d66940 Add semantic analysis for "blocks".
Highlights...

- 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr.
- Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt().

Next steps...

- hack Sema::ActOnIdentifierExpr() to deal with block decl refs.
- add attribute handler for byref decls.
- add test cases.

llvm-svn: 55710
2008-09-03 18:15:37 +00:00
Devang Patel 62be9ad270 Handle "noinline" note inside the simple inliner.
llvm-svn: 55708
2008-09-03 18:10:21 +00:00
Ted Kremenek 3060d98ad0 Fix 80 col violations.
llvm-svn: 55707
2008-09-03 18:03:35 +00:00
Ted Kremenek f4fd23f635 Added --use-cxx option to scan-build.
llvm-svn: 55706
2008-09-03 17:59:35 +00:00
Daniel Dunbar de1ec9cdcd Improve type-checking of ?: for Objective-C types.
- Allow any Objective-C object types to devolve to type id in a ?:
   expression. This matches gcc behavior more closely.

llvm-svn: 55705
2008-09-03 17:53:25 +00:00
Owen Anderson b1b9398ea7 Oops, I accidentally broke the fallback case with my last commit.
llvm-svn: 55704
2008-09-03 17:51:57 +00:00
Owen Anderson ea666816c2 Fix an issue where we were reusing materializations of constants in blocks not dominated by the materialization. This is
the simple fix, materializing the constant before every use.  It might be better to either track domination of uses or
to materialize all constants and the beginning of the function and let remat sort when to do materialization at uses.

llvm-svn: 55703
2008-09-03 17:37:03 +00:00
Devang Patel 167adebb3f Update test to check call instruction.
llvm-svn: 55702
2008-09-03 17:05:49 +00:00
Dan Gohman 575fad337c Split the SelectionDAG-building code, including the FunctionLoweringInfo
and SelectionDAGLowering classes, out of SelectionDAGISel.cpp and put
it in a separate file, SelectionDAGBuild.cpp.

llvm-svn: 55701
2008-09-03 16:12:24 +00:00
Duncan Sands e74d7502d2 Fix maxo bado thinko.
llvm-svn: 55700
2008-09-03 16:10:55 +00:00
Dan Gohman b10f1a5c60 Separate MachineInstr-emitting routines from actual scheduling
routines and move them into a separate file, ScheduleDAGEmit.cpp.

llvm-svn: 55699
2008-09-03 16:01:59 +00:00
Dan Gohman c7367b4546 Fix addRegisterDead and addRegisterKilled to be more thorough
when searching for redundant subregister dead/kill bits.

Previously it was common to see instructions marked like this:
  "RET %EAX<imp-use,kill>, %AX<imp-use,kill>"

With this change, addRegisterKilled continues scanning after
finding the %EAX operand, so it proceeds to discover the
redundant %AX kill and eliminates it, producing this:
  "RET %EAX<imp-use,kill>"

This currently has no effect on the generated code.

llvm-svn: 55698
2008-09-03 15:56:16 +00:00
Duncan Sands 0eca0571f8 Since onlyReadsMemory returns true if in fact
doesNotAccessMemory, check doesNotAccessMemory
first, since otherwise functions may be
marked readonly rather than readnone.

llvm-svn: 55697
2008-09-03 15:31:24 +00:00
Duncan Sands 42c644ef03 Cleanup GlobalsModRef a bit. When analysing the
callgraph, when one member of a SCC calls another
then the analysis would drop to mod-ref because
there is (usually) no function info for the callee
yet; fix this.  Teach the analysis about function
attributes, in particular the readonly attribute
(which requires being careful about globals).

llvm-svn: 55696
2008-09-03 12:55:42 +00:00
Duncan Sands 13ea919664 Testcase for PR1678.
llvm-svn: 55695
2008-09-03 07:52:01 +00:00
Nick Lewycky ac5c7d514f Try to fold each element of a vector. This is needed to maintain structural
equivalence.

llvm-svn: 55694
2008-09-03 06:48:55 +00:00
Evan Cheng a41ee2974b Add X86 target hook to implement load (even from GlobalAddress).
llvm-svn: 55693
2008-09-03 06:44:39 +00:00
Evan Cheng 31ddd09f4a If TargetSelectInstruction returns true, move to next instruction.
llvm-svn: 55692
2008-09-03 06:43:41 +00:00
Evan Cheng fa67546ef9 Make UpdateValueMap, createResultReg, etc. protected instead of private so they can used by target hooks.
llvm-svn: 55691
2008-09-03 06:43:10 +00:00
Nick Lewycky 2fcb26cc75 Don't apply this transform to vectors. Fixes PR2756.
llvm-svn: 55690
2008-09-03 06:24:21 +00:00
Nick Lewycky f023db6444 Don't crash when trying to constant fold a vector with some elements that can't
be folded. Instead, fail to fold the entire vector.

We could also return a vector with some elements folded and some not. If anyone
thinks that's a better approach, please speak up!

llvm-svn: 55689
2008-09-03 05:54:33 +00:00
Ted Kremenek 1b9e10390b Store: (static analyzer)
- Change definition of store::Region and store::Binding (once again) to make
  them real classes that just wrap pointers. This makes them more strictly
  typed, and allows specific implementations of Regions/Bindings to just
  subclass them.
- minor renamings to RegionExtent and its subclasses
- added a bunch of doxygen comments

StoreManager: (static analyzer)
- added 'iterBindings', an iteration method for iterating over the bindings of a
  store. It that takes a callback object (acting like a poor man's closure).
- added 'getRVal' version for store::Binding. Will potentially phase the other
  versions of GetRVal in StoreManager out.
- reimplemented 'getBindings' to be non-virtual and to use 'iterBindings'

BasicStoreManager: (static analyzer)
- implemented 'iterBindings' for BasicStoreManager

llvm-svn: 55688
2008-09-03 03:06:11 +00:00
Ted Kremenek 2175b55dc7 Fix capitalization in #include of FastISel.h. This unbreaks the build on case-sensitive filesystems.
llvm-svn: 55687
2008-09-03 02:54:11 +00:00
Daniel Dunbar ef89086c12 Restore Objective-C dot-syntax access of methods.
- Now also searches for correct setter method.
 - There are still some issues regarding validation of the setter
   method and access of read-only properties.

llvm-svn: 55686
2008-09-03 01:05:41 +00:00