Commit Graph

41285 Commits

Author SHA1 Message Date
Ted Kremenek 3a6fd9c177 Better handling of calls to functions via function pointers.
llvm-svn: 47562
2008-02-25 21:16:03 +00:00
Dan Gohman 1f372edd97 Convert MaskedValueIsZero and all its users to use APInt. Also add
a SignBitIsZero function to simplify a common use case.

llvm-svn: 47561
2008-02-25 21:11:39 +00:00
Chris Lattner eb85ab44f2 convert tabs to spaces, patch by Mike Stump!
llvm-svn: 47560
2008-02-25 21:04:36 +00:00
Chris Lattner 451aea8e81 add LSBaseSDNode::getOffset at Dan's request.
llvm-svn: 47558
2008-02-25 19:31:21 +00:00
Evan Cheng 548677022c All remat'ed loads cannot be folded into two-address code. Not just argument loads. This change doesn't really have any impact on codegen.
llvm-svn: 47557
2008-02-25 19:24:01 +00:00
Chris Lattner 8483d43749 prune #includes, fit in 80 cols.
llvm-svn: 47556
2008-02-25 19:21:38 +00:00
Chris Lattner 149a242743 make this self contained.
llvm-svn: 47555
2008-02-25 19:20:57 +00:00
Dale Johannesen 32d84b1772 Expand removal of MMX memory copies to allow 1 level
of TokenFactor underneath chain (seems to be enough)

llvm-svn: 47554
2008-02-25 19:20:14 +00:00
Lauro Ramos Venancio 4400a85ce8 Revert an incorrect part of my previuos patch.
llvm-svn: 47553
2008-02-25 19:08:51 +00:00
Dan Gohman 6610e9ec83 Add a new method to SDNode/SDOperand named getValueSizeInBits
that combines getValueType and MVT::getSizeInBits, since this
occurrs frequently.

llvm-svn: 47552
2008-02-25 19:08:02 +00:00
Lauro Ramos Venancio 8983891531 Fix PR2086.
llvm-svn: 47551
2008-02-25 19:03:15 +00:00
Ted Kremenek eb079dc502 Fixed bug in RemoveDeadBindings when performing the mark-and-sweep over the
symbolic store: VarDecl's inserted into the sweep may not always bind to
anything; handle this special case just like bindings to uninitialized values.

llvm-svn: 47550
2008-02-25 18:56:23 +00:00
Ted Kremenek 3866746569 Expanded transfer function support for divide-by-zero checking to include
"remainder-by-zero" checking (operator '%').

llvm-svn: 47549
2008-02-25 18:42:54 +00:00
Ted Kremenek b23cc7191f Added hack to transfer function logic to handle the case where a DeclRefExpr
wrapping an EnumConstantDecl evaluates to an integer type that has a different
signedness than the APSInt stored in the EnumConstantDecl. Will file a Bugzilla
report.

llvm-svn: 47548
2008-02-25 18:34:45 +00:00
Ted Kremenek 6f92e2294a Added transfer function support for checking for divide-by-zero errors.
llvm-svn: 47547
2008-02-25 17:51:31 +00:00
Duncan Sands 896c519d19 In debug builds check that the key property holds: all
result and operand types are legal.

llvm-svn: 47546
2008-02-25 16:21:21 +00:00
Evan Cheng 589a9fb6dc Correctly determine whether a argument load can be folded into its uses.
llvm-svn: 47545
2008-02-25 08:50:41 +00:00
Owen Anderson df1d2b02f9 Fix an issue where GVN was performing the return slot optimization when it was
not safe.  This is fixed by more aggressively checking that the return slot is
not used elsewhere in the function.

llvm-svn: 47544
2008-02-25 04:08:09 +00:00
Chris Lattner cb0d62c70d enable digraphs for C94, thanks to Neil for pointing this out.
llvm-svn: 47543
2008-02-25 04:01:39 +00:00
Evan Cheng 01d6257e81 Temporarily reverting 46959.
llvm-svn: 47542
2008-02-25 03:57:32 +00:00
Owen Anderson 40dca46ddb Fix an issue where GVN would try to use an instruction before its definition when performing return slot optimization.
llvm-svn: 47541
2008-02-25 00:40:41 +00:00
Chris Lattner 5329e7e5ed Fix PR2090, a typo in digraph processing.
llvm-svn: 47540
2008-02-24 19:05:57 +00:00
Chris Lattner 89a62c8fff Update comment.
llvm-svn: 47539
2008-02-24 19:04:33 +00:00
Steve Naroff f0ed31aafe Move the initialization of SEL/objc_selector from Sema::Sema() to Sema::ActOnTranslationUnitScope() and make sure the type/struct get inserted into the translation unit scope.
Bug submitted by David Chisnall (thanks!).

llvm-svn: 47538
2008-02-24 16:25:02 +00:00
Duncan Sands ba3d7e8e7d Add support to LegalizeTypes for building legal vectors
out of illegal elements (BUILD_VECTOR).  Uses and beefs
up BUILD_PAIR, though it didn't really have to.  Like
most of LegalizeTypes, does not support soft-float.
This cures all "make check" vector building failures.

llvm-svn: 47537
2008-02-24 07:36:03 +00:00
Ted Kremenek 72be068ab3 Two more Windows-related fixes:
- More enum signeness bitfield fixes (MSVC treats enums as signed).

- Fixed in Lex/HeaderSearch.cpp an unsafe copy between two
  HeaderSearch::PerFileInfo entries in a common vector. The copy involved two
  calls to getFileInfo() within the assignment; these calls could have
  side-effects that enlarged the internal vector, and with MSVC this would
  invalidate one of the values in the assignment.
  
Patch by Argiris Kirtzidis!

llvm-svn: 47536
2008-02-24 03:55:14 +00:00
Ted Kremenek d87eef89c8 In FileManager: use full paths to unique files and directories on Windows,
since inodes are bogus abstraction on that platform.

Patch by Argiris Kirtzidis!

llvm-svn: 47535
2008-02-24 03:15:25 +00:00
Bill Wendling a7d1ed4c98 Some platforms use the same name for 32-bit and 64-bit registers (like
%r3 on PPC) in their ASM files. However, it's hard for humans to read
during debugging. Adding a new field to the register data that lets you
specify a different name to be printed than the one that goes into the
ASM file -- %x3 instead of %r3, for instance.

llvm-svn: 47534
2008-02-24 00:56:13 +00:00
Evan Cheng 2f18c39720 Backing out r47521 for now. This has broken a number of tests.
llvm-svn: 47533
2008-02-23 19:32:32 +00:00
Scott Michel 7d5eaec6dd Merge current work back to tree to minimize diffs and drift. Major highlights
for CellSPU modifications:

- SPUInstrInfo.td refactoring: "multiclass" really is _your_ friend.
- Other improvements based on refactoring effort in SPUISelLowering.cpp,
  esp. in SPUISelLowering::PerformDAGCombine(), where zero amount shifts and
  rotates are now eliminiated, other scalar-to-vector-to-scalar silliness
  is also eliminated.
- 64-bit operations are being implemented, _muldi3.c gcc runtime now
  compiles and generates the right code. More work still needs to be done.

llvm-svn: 47532
2008-02-23 18:41:37 +00:00
Zhou Sheng aae582ba99 Testcase for Revision 47478.
llvm-svn: 47531
2008-02-23 10:59:51 +00:00
Eli Friedman 401675b0de Minor code cleanup.
llvm-svn: 47530
2008-02-23 07:32:49 +00:00
Evan Cheng 504c645b3e Rematerialization logic was overly conservative when it comes to loads from fixed stack slots.
llvm-svn: 47529
2008-02-23 03:38:34 +00:00
Evan Cheng 405827dc26 Update test.
llvm-svn: 47527
2008-02-23 02:57:25 +00:00
Evan Cheng 379682b0e5 If remating a machine instr with virtual register operand, make sure the vr is avaliable at all uses regardless of whether it would be folded.
llvm-svn: 47526
2008-02-23 02:14:42 +00:00
Evan Cheng 174ef9a0bb Remat of pic loads are now on by default.
llvm-svn: 47525
2008-02-23 02:08:30 +00:00
Evan Cheng 42cb72e52c Turning on remat of pic loads.
llvm-svn: 47524
2008-02-23 02:07:42 +00:00
Dan Gohman 63d2d1f554 Fix a bug that caused opt and other tools to silently ignore
invalid command-line options.

llvm-svn: 47523
2008-02-23 01:55:25 +00:00
Evan Cheng 4d17671997 No need recognize load from a fixed argument slot as re-materializable. LiveIntervalAnalysis already handles it as a special case.
llvm-svn: 47522
2008-02-23 01:47:44 +00:00
Devang Patel 6a49782d33 Properly read and write bitcodes for multiple return values.
llvm-svn: 47521
2008-02-23 01:44:55 +00:00
Evan Cheng e70afb021b Recognize loads of arguments as re-materializable first. Therefore if isReallyTriviallyReMaterializable() returns true it doesn't confuse it as a "normal" re-materializable instruction.
llvm-svn: 47520
2008-02-23 01:44:27 +00:00
Devang Patel 14f9994562 Regenerate.
llvm-svn: 47519
2008-02-23 01:17:37 +00:00
Devang Patel 6c4bc99c44 Use isa check instead of getTypeID() check.
llvm-svn: 47518
2008-02-23 01:17:17 +00:00
Ted Kremenek f28aec5261 Fixed buffer overflow reported by Argiris Kirtzidis.
llvm-svn: 47517
2008-02-23 01:11:40 +00:00
Devang Patel 690fcf68b1 Remove unnecessary "inline" keywords.
llvm-svn: 47516
2008-02-23 01:11:02 +00:00
Ted Kremenek f948d2a75f Change encoding of TokenKind in IdentifierTable to be of type "unsigned"
instead of TokenKind because of signedness issues with MSVC and enums.

Patch from Argiris Kirtzidis.

llvm-svn: 47515
2008-02-23 01:05:54 +00:00
Devang Patel d995551261 print getresult operand and its type directly.
llvm-svn: 47514
2008-02-23 01:04:26 +00:00
Evan Cheng 26e5d01ca1 Really. Why doesn't every arch support MMX?
llvm-svn: 47513
2008-02-23 00:56:14 +00:00
Ted Kremenek 652d18e37c Patch from Argiris Kirtzidis:
The patch fixes some debug assertions that the msvcrt throws:

1)
-    if (isprint(value) && value < 256) {
+    if (value < 256 && isprint(value)) {

isprint() does an assertion check of its own for value < 256; check value before calling it to prevent it.


2)
-    Stmt->Names.push_back(std::string(&data[0], data.size()));
+    if (data.size() == 0)
+      Stmt->Names.push_back(std::string());
+    else
+      Stmt->Names.push_back(std::string(&data[0], data.size()));

If data.size() == 0 then data[0] throws "out of range" assertion.

llvm-svn: 47512
2008-02-23 00:52:04 +00:00
Devang Patel 2f2ff159a5 Use dyn_cast instead of isa + cast.
llvm-svn: 47511
2008-02-23 00:47:00 +00:00