Commit Graph

65686 Commits

Author SHA1 Message Date
Daniel Dunbar 919fe2bd2f Simplify ConstantExpr::getInBoundsGetElementPtr and fix a possible crash, if
constant folding eliminated the GEP instruction.
 - clang was hitting this on its test suite (for x86_64, at least).

llvm-svn: 78698
2009-08-11 18:28:09 +00:00
Daniel Dunbar 270968279b Revert 78680 until I figure out why it completely broke things.
llvm-svn: 78697
2009-08-11 18:11:15 +00:00
Devang Patel 5c310be0ff Link NamedMDNodes.
llvm-svn: 78696
2009-08-11 18:01:24 +00:00
Dan Gohman 50c09d0ca3 Add convenience functions for creating inbounds GEPs.
llvm-svn: 78695
2009-08-11 17:57:01 +00:00
David Goodwin 92492f2f8e Use DEBUG macro for debug output.
llvm-svn: 78694
2009-08-11 17:56:42 +00:00
Chris Lattner 5d47e93532 add a trivial line # cache to SourceMgr to make repeated queries to
FindLineNumber much faster when in sequence.

llvm-svn: 78693
2009-08-11 17:49:14 +00:00
Daniel Dunbar 7f8a9ebc8d llvm-mc: Fix a crash on invalid due to a typo in relocatable expression
evaluation.

llvm-svn: 78692
2009-08-11 17:47:52 +00:00
Benjamin Kramer 9cd050ab07 LLVMContext is a class now.
llvm-svn: 78691
2009-08-11 17:46:57 +00:00
Benjamin Kramer 78c3bcb582 Make LLVMContext and LLVMContextImpl classes instead of structs.
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Daniel Dunbar 5c13812e2f Remove some unnecessary LoadInst constructors, missed during Twinification.
llvm-svn: 78689
2009-08-11 17:38:47 +00:00
Chris Lattner 73e9f8c636 make owen happy by being explicit.
llvm-svn: 78688
2009-08-11 17:38:15 +00:00
David Goodwin ebd694bb0a Add some debug output.
llvm-svn: 78687
2009-08-11 17:35:23 +00:00
Benjamin Kramer 0334d91a4a Fix struct/class mismatch.
llvm-svn: 78686
2009-08-11 17:27:20 +00:00
Dan Gohman 4bdbad7ebf Use isa instead of dyn_cast when the result is only converted to bool.
llvm-svn: 78685
2009-08-11 17:20:16 +00:00
Devang Patel 6fdf5484c9 Fix cut-n-pasto in comment.
llvm-svn: 78684
2009-08-11 17:15:47 +00:00
Jim Grosbach 1d5350c08f fix GetInstSizeInBytes for eh_sjlj_setjmp
llvm-svn: 78683
2009-08-11 17:08:15 +00:00
Dan Gohman 58f4d89a10 Add convenience functions for creating exact sdiv operators, and
use them in CreatePtrDiff.

llvm-svn: 78682
2009-08-11 17:05:24 +00:00
Dan Gohman d6c611e6e8 Avoid implicitly depending on Instructions.h.
llvm-svn: 78681
2009-08-11 17:03:18 +00:00
Chris Lattner ab2460c066 move some 32-bit instrs to x86instrinfo.td
llvm-svn: 78680
2009-08-11 16:58:39 +00:00
Benjamin Kramer 7570a9ceae Revert 78662 to fix broken windows build. Add a comment which explains the problem.
llvm-svn: 78679
2009-08-11 16:41:22 +00:00
Benjamin Kramer eda08015ee This void is implicit in C++.
llvm-svn: 78678
2009-08-11 16:03:08 +00:00
Dan Gohman 7c50c9bd63 Tidy #includes.
llvm-svn: 78677
2009-08-11 16:02:12 +00:00
Dan Gohman aa3fb65349 Simplify this code. The case where one class is GR64RegClass and the
other is a subclass of it is effectively handled by the prior tests.

llvm-svn: 78676
2009-08-11 15:59:48 +00:00
Dan Gohman 557baeeae4 Add an explicit keyword.
llvm-svn: 78675
2009-08-11 15:57:42 +00:00
Douglas Gregor 2168a9f25f Fix DISABLE_SMART_POINTERS build
llvm-svn: 78674
2009-08-11 15:56:57 +00:00
Dan Gohman f5adff9c41 ConstantFolder and NoFolder no longer require their Context members.
llvm-svn: 78673
2009-08-11 15:56:12 +00:00
Chris Lattner 0c533d909a now that these are in file-check format, we can merge them together
into one bigger test (which runs faster)

llvm-svn: 78672
2009-08-11 15:54:17 +00:00
Dan Gohman 5211b0128b Fix a typo in an assertion string.
llvm-svn: 78671
2009-08-11 15:53:15 +00:00
Dan Gohman 866d263392 Use the default copy-ctor, copy-assignment, and destructor.
llvm-svn: 78670
2009-08-11 15:52:30 +00:00
Dan Gohman ce594f5d64 Add a comment about the additional meaning of setPreservesCFG() for
MachineFunctionPass passes.

llvm-svn: 78669
2009-08-11 15:50:56 +00:00
Dan Gohman a72f856aa4 Don't assume that external global variables are aligned at their preferred
alignment. Only the minimum alignment guaranteed by the ABI may be assumed.

llvm-svn: 78668
2009-08-11 15:50:03 +00:00
Dan Gohman c7c2bc9663 Remove unnecessary throw() specifications; LLVM doesn't use exceptions.
llvm-svn: 78667
2009-08-11 15:35:57 +00:00
Jim Grosbach f24f9d9cb6 Whitespace cleanup. Remove trailing whitespace.
llvm-svn: 78666
2009-08-11 15:33:49 +00:00
Jim Grosbach 74eb9e7bfd Move ~ARMConstantPoolValue() to the .cpp file to avoid needing to include <cstdlib> in the header.
llvm-svn: 78665
2009-08-11 15:26:27 +00:00
Dan Gohman 38484ceec9 Remove unnecessary casts.
llvm-svn: 78664
2009-08-11 15:15:10 +00:00
Dan Gohman e02f9ba9b1 Add const qualifiers.
llvm-svn: 78663
2009-08-11 15:13:43 +00:00
Dan Gohman b5147e845f Remove an unnecessary mutable.
llvm-svn: 78662
2009-08-11 15:03:52 +00:00
Shantonu Sen 1f90bd277b Regenerate per request of Gabor Greif (r78628)
llvm-svn: 78661
2009-08-11 13:39:52 +00:00
Benjamin Kramer 6d78d69586 Silence MSVC warning.
llvm-svn: 78660
2009-08-11 11:01:19 +00:00
Evan Cheng 806845daec Fix the previous accidental commit. Now shrinking common Thumb2 load / store instructions.
llvm-svn: 78659
2009-08-11 09:37:40 +00:00
Evan Cheng 3606467709 Fix Thumb2 load / store addressing mode matching code. Do not use so_reg form to
match base only address, i.e. [r] since Thumb2 requires a offset register field.
For those, use [r + imm12] where the immediate is zero.
Note the generated assembly code does not look any different after the patch.
But the bug would have broken the JIT (if there is Thumb2 support) and it can
break later passes which expect the address mode to be well-formed.

llvm-svn: 78658
2009-08-11 08:52:18 +00:00
Evan Cheng d4d352c663 80 column violation.
llvm-svn: 78657
2009-08-11 08:47:46 +00:00
Erick Tryzelaar 70ede4843c Change llvm-c's ordering of contexts to make it consistent.
llvm-svn: 78656
2009-08-11 07:46:16 +00:00
Evan Cheng 192d7c0752 Cosmetic changes.
llvm-svn: 78655
2009-08-11 07:36:14 +00:00
Evan Cheng 6e62e93a8d Adding a blank line back.
llvm-svn: 78654
2009-08-11 07:32:58 +00:00
John McCall d1e9d835f3 Argument-dependent lookup for friend declarations. Add a new decl type,
FriendFunctionDecl, and create instances as appropriate.

The design of FriendFunctionDecl is still somewhat up in the air;  you can
befriend arbitrary types of functions --- methods, constructors, etc. ---
and it's not clear that this representation captures that very well.
We'll have a better picture when we start consuming this data in access
control.

llvm-svn: 78653
2009-08-11 06:59:38 +00:00
Devang Patel 4d4a2e09a9 Link metadata.
llvm-svn: 78652
2009-08-11 06:46:31 +00:00
Devang Patel c5aa8c6d29 Remove dead metadata.
llvm-svn: 78651
2009-08-11 06:31:57 +00:00
Jakob Stoklund Olesen b39a5aa794 Rebuild RegScavenger::DistanceMap each time it is needed.
The register scavenger maintains a DistanceMap that maps MI pointers to their
distance from the top of the current MBB. The DistanceMap is built
incrementally in forward() and in bulk in findFirstUse(). It is used by
scavengeRegister() to determine which candidate register has the longest
unused interval.

Unfortunately the DistanceMap contents can become outdated. The first time
scavengeRegister() is called, the DistanceMap is filled to cover the MBB. If
then instructions are inserted in the MBB (as they always are following
scavengeRegister()), the recorded distances are too short. This causes bad
behaviour in the included test case where a register use /after/ the current
position is ignored because findFirstUse() thinks is is /before/ the current
position. A "using an undefined register" assertion follows promptly.

The fix is to build a fresh DistanceMap at the top of scavengeRegister(), and
discard it after use. This means that DistanceMap is no longer needed as a
RegScavenger member variable, and forward() doesn't need to update it.

The fix then discloses issue number two in the same test case: The candidate
search in scavengeRegister() finds a CSR that has been saved in the prologue,
but is currently unused. It would be both inefficient and wrong to spill such
a register in the emergency spill slot. In the present case, the emergency
slot restore is placed immediately before the normal epilogue restore, leading
to a "Redefining a live register" assertion.

Fix number two: When scavengerRegister() stumbles upon an unused register that
is overwritten later in the MBB, return that register early. It is important
to verify that the register is defined later in the MBB, otherwise it might be
an unspilled CSR.

llvm-svn: 78650
2009-08-11 06:25:12 +00:00
Daniel Dunbar 0c04f2b454 Fix a -Asserts warning.
- Since the function is never called in NDEBUG mode, just dropped the DEBUG()
   uses here.

llvm-svn: 78649
2009-08-11 06:22:47 +00:00