Commit Graph

69796 Commits

Author SHA1 Message Date
Bob Wilson b4f2a85fe4 Fix another problem with ARM constant pools. Radar 7303551.
When ARMConstantIslandPass cannot find any good locations (i.e., "water") to
place constants, it falls back to inserting unconditional branches to make a
place to put them.  My recent change exposed a problem in this area.  We may
sometimes append to the same block more than one unconditional branch.  The
symptoms of this are that the generated assembly has a branch to an undefined
label and running llc with -debug will cause a seg fault.

This happens more easily since my change to prevent CPEs from moving from
lower to higher addresses as the algorithm iterates, but it could have
happened before.  The end of the block may be in range for various constant
pool references, but the insertion point for new CPEs is not right at the end
of the block -- it is at the end of the CPEs that have already been placed
at the end of the block.  The insertion point could be out of range.  When
that happens, the fallback code will always append another unconditional
branch if the end of the block is in range.

The fix is to only append an unconditional branch if the block does not
already end with one.  I also removed a check to see if the constant pool load
instruction is at the end of the block, since that is redundant with
checking if the end of the block is in-range.

There is more to be done here, but I think this fixes the immediate problem.

llvm-svn: 84172
2009-10-15 05:10:36 +00:00
Chris Lattner c855b45b78 only try to fold constantexpr operands when the worklist is first populated,
don't bother every time going around the main worklist.  This speeds up a 
release-asserts opt -std-compile-opts on 403.gcc by about 4% (1.5s).  It
seems to speed up the most expensive instances of instcombine by ~10%.

llvm-svn: 84171
2009-10-15 04:59:28 +00:00
Chris Lattner dd1f68a10c don't bother calling ConstantFoldInstruction unless there is a use of the
instruction (which disqualifies stores, unreachable, etc) and at least the
first operand is a constant.  This filters out a lot of obvious cases that
can't be folded.  Also, switch the IRBuilder to a TargetFolder, which tries
harder.

llvm-svn: 84170
2009-10-15 04:13:44 +00:00
John McCall 9f49103ece Complete some unfinished comments.
llvm-svn: 84169
2009-10-15 04:01:40 +00:00
John McCall 33815690af Better living through metaprogramming. Create a base class which abstracts
most of the unsafe boilerplate out of TypeLoc.  Create a QualifiedLoc class
to represent the idea that we *might* start representing source locations
of qualifiers.  Dealing with qualifiers explicitly like this also lets us
efficiently ignore them in all the concrete cases.

This should make it obvious and easy to add new TypeLoc subclasses.

llvm-svn: 84168
2009-10-15 03:50:32 +00:00
Mike Stump bf186694b0 Make this at least compile.
llvm-svn: 84167
2009-10-15 02:10:57 +00:00
Mike Stump 37dbe96a06 Track the offset to the current virtual base in CurrentVBaseOffset.
Track path information completely to ensure we get all the overrides.  WIP.

llvm-svn: 84166
2009-10-15 02:04:03 +00:00
Ted Kremenek 3abc41f45d Per an astute observation from Zhongxing Xu, remove a "special case" logic in
RegionStoreManager::Retrieve() that was intended to handle conflated uses of pointers as integers.
It turns out this isn't needed, and resulted in inconsistent behavior when creating symbolic values on the following test case in 'tests/Analysis/misc-ps.m':

  typedef struct _BStruct { void *grue; } BStruct;
  void testB_aux(void *ptr);
  void testB(BStruct *b) {
    {
      int *__gruep__ = ((int *)&((b)->grue));
      int __gruev__ = *__gruep__;
      testB_aux(__gruep__);
    }
    {
      int *__gruep__ = ((int *)&((b)->grue));
      int __gruev__ = *__gruep__;
      if (~0 != __gruev__) {}
    }
  }

When the code was analyzed with '-arch x86_64', the value assigned to '__gruev__' be would be a
symbolic integer, but for '-arch i386' the value assigned to '__gruev__' would be a symbolic region
(a blob of memory). With this change the value created is always a symbolic integer.

Since the code being removed was added to support analysis of code calling
OSAtomicCompareAndSwapXXX(), I also modified 'test/Analysis/NSString.m' to analyze the code in both
'-arch i386' and '-arch x86_64', and also added some complementary test cases to test the presence
of leaks when using OSAtomicCompareAndSwap32Barrier()/OSAtomicCompareAndSwap64Barrier() instead of
just their absence. This code change reveals that previously both RegionStore and BasicStore were
handling these cases wrong, and would never cause the analyzer to emit a leak in these cases (false
negatives). Now RegionStore gets it right, but BasicStore still gets it wrong (and hence it has been
disabled temporarily for this test case).

llvm-svn: 84163
2009-10-15 01:40:34 +00:00
Anders Carlsson 66413c29d3 Handle
struct A { };
struct B : A { };

void f() {
  const A& a = B();
}

correctly. (This now does the offset conversion if necessary and calls the destructor when a goes out of scope).

llvm-svn: 84162
2009-10-15 00:51:46 +00:00
Anders Carlsson 63dce02544 Check the return type when calling pointer to member functions.
llvm-svn: 84161
2009-10-15 00:41:48 +00:00
John Thompson 3254182bfa Removed math.h include, as Windows math.h has a compile error.
llvm-svn: 84160
2009-10-15 00:39:58 +00:00
Nick Lewycky fcb27ad54c Take advantage of TargetData when available; we know that the atomic intrinsics
only dereference the element they point to directly with no pointer arithmetic.

llvm-svn: 84159
2009-10-15 00:36:35 +00:00
Dan Gohman c9af381df8 Make CodePlacementOpt align loops, rather than loop headers. The
header is just the entry block to the loop, and it needn't be at
the top of the loop in the code layout.

Remove the code that suppressed loop alignment for outer loops,
so that outer loops are aligned.

llvm-svn: 84158
2009-10-15 00:36:22 +00:00
Ted Kremenek 8070b82d91 Remove stale comment.
llvm-svn: 84157
2009-10-14 23:58:34 +00:00
Douglas Gregor ba8e1ac3a1 CheckTemplateSpecializationScope isn't going to be used for explicit
instantiations, since the requirements are too different from those
for template specializations. Simplify it slightly.

llvm-svn: 84156
2009-10-14 23:50:59 +00:00
Douglas Gregor e47f5a76cc Additional semantic checking for explicit template instantiations,
focusing on the scope- and qualifier-related semantic requirements in
C++ [temp.explicit]p2.

llvm-svn: 84154
2009-10-14 23:41:34 +00:00
Evan Cheng 2f61e0946a When LiveVariables is adding implicit-def to model "partial dead", add the earlyclobber marker if the superreg def has it.
llvm-svn: 84153
2009-10-14 23:39:27 +00:00
Evan Cheng 70b1fa5a24 Print earlyclobber for implicit-defs as well.
llvm-svn: 84152
2009-10-14 23:37:31 +00:00
Eric Christopher ef40bd1533 One more iteration here and a yet better way to solve it.
llvm-svn: 84150
2009-10-14 22:14:18 +00:00
Douglas Gregor e266cc218a Our C++ support is far enough along now that we shouldn't be recommending the use of Elsa
llvm-svn: 84149
2009-10-14 21:54:48 +00:00
Douglas Gregor 5d85197edf Reuse some code for checking the scope of an explicit instantiation
llvm-svn: 84148
2009-10-14 21:46:58 +00:00
Eric Christopher 4abb36b946 Fix the unused argument problem here a different way - cast to void.
llvm-svn: 84147
2009-10-14 21:45:49 +00:00
Bob Wilson cfcf6bc70d Fix instruction encoding bits for NEON VPADAL.
Patch by Johnny Chen.

llvm-svn: 84146
2009-10-14 21:43:17 +00:00
Bob Wilson ad03cf02f6 Remove unused variables to fix build warning.
llvm-svn: 84144
2009-10-14 21:40:45 +00:00
Douglas Gregor 819c3ddda8 Fix a thinko that John pointed out
llvm-svn: 84142
2009-10-14 21:36:34 +00:00
Douglas Gregor b81005dffc Check the implicit instantiation of a static data member of a class
template that has no out-of-line definition.

llvm-svn: 84141
2009-10-14 21:33:19 +00:00
Douglas Gregor 3cc3cdeea9 Give explicit and implicit instantiations of static data members of
class templates the proper linkage. 

Daniel, please look over the CodeGenModule bits.

llvm-svn: 84140
2009-10-14 21:29:40 +00:00
Jim Grosbach b1d6fde13e Make loop not recalc getNumOperands() each time around
llvm-svn: 84138
2009-10-14 21:22:39 +00:00
Devang Patel 6875c5ebe4 Add support to record DbgScope as inlined scope.
llvm-svn: 84134
2009-10-14 21:08:09 +00:00
Jim Grosbach 02f5588f62 quiet compiler warning
llvm-svn: 84133
2009-10-14 21:07:11 +00:00
Dan Gohman 1396b3f368 Delete bogus semicolons.
llvm-svn: 84132
2009-10-14 20:39:01 +00:00
Jim Grosbach 94068707e1 Inst{11-8} for vshl should be 0b0101, not 0b1111.
Refs: A7-17 & A8-750.

Patch by Johnny Chen.

llvm-svn: 84131
2009-10-14 20:31:01 +00:00
Eric Christopher b980933c37 Remove a bunch of unused arguments from functions, silencing a
warning.

llvm-svn: 84130
2009-10-14 20:28:33 +00:00
Douglas Gregor 3c74d41d27 Testing and some minor fixes for explicit template instantiation.
llvm-svn: 84129
2009-10-14 20:14:33 +00:00
Nick Lewycky a39f121155 The ARM and PowerPC jits are broken in this regard.
llvm-svn: 84128
2009-10-14 20:04:41 +00:00
Duncan Sands 6f2ffcef20 There seems to be no reason for opt's -S option to be hidden.
Make it visible.

llvm-svn: 84127
2009-10-14 20:01:39 +00:00
Nick Lewycky f01ba005a7 Make use of the result of the loads even though that means adding -instcombine.
llvm-svn: 84125
2009-10-14 19:02:13 +00:00
Bob Wilson 1a791eedbf Set instruction encoding bits 4 and 7 for ARM register-register and
register-shifted-register instructions.  Patch by Johnny Chen.

llvm-svn: 84124
2009-10-14 19:00:24 +00:00
Mike Stump 84bc8bda49 Testcase for recent checkin. WIP.
llvm-svn: 84123
2009-10-14 18:38:01 +00:00
Bob Wilson c350cdf3b3 Refactor code to select NEON VST intrinsics.
llvm-svn: 84122
2009-10-14 18:32:29 +00:00
Mike Stump b21c4eede4 Shift the vcall slots for non-virtual bases of a virtual base, up into
the virtual base so they can be reused properly.  Don't reuse vcall
slots across a virtual boundary.  WIP.  I have a testcase, but there
are still things that need to be fixed before the testcase can go in.

llvm-svn: 84120
2009-10-14 18:14:51 +00:00
Douglas Gregor 568a071dd2 When mapping from an injected-class-name to its corresponding
template, make sure to get the template that corresponds to *this*
declaration of the class template or specialization, rather than the
canonical specialization. Fixes PR5187.

llvm-svn: 84119
2009-10-14 17:30:58 +00:00
Devang Patel 92f8619923 Use isVoidTy()
llvm-svn: 84118
2009-10-14 17:29:00 +00:00
Bob Wilson 12b4799787 Refactor code to select NEON VLD intrinsics.
llvm-svn: 84117
2009-10-14 17:28:52 +00:00
Rafael Espindola 0a1ac331a3 Add support for having different c++ search dirs with -m32 and -m64. So far
this is only used in darwin10, 64 bit ubuntu 9.10 and 64 bit openSUSE 11.1.

llvm-svn: 84115
2009-10-14 17:09:44 +00:00
Devang Patel f33cfaf760 Copy metadata associated with CI
llvm-svn: 84114
2009-10-14 17:03:29 +00:00
Devang Patel ebaa76ed0d Add copyMD to copy metadata from one instruction to another instruction.
llvm-svn: 84113
2009-10-14 17:02:49 +00:00
Douglas Gregor 4aa2dc41dc Implement support for overloaded operator uses that result to a call
to a member operator template. We missed updating this call site when
adding support for function templates; bug exposed by a test for
PR5072.

llvm-svn: 84111
2009-10-14 16:50:13 +00:00
Bob Wilson 93117bc499 More refactoring. NEON vst lane intrinsics can share almost all the code for
vld lane intrinsics.

llvm-svn: 84110
2009-10-14 16:46:45 +00:00
Bob Wilson 4145e3ac8d Refactor code for selecting NEON load lane intrinsics.
llvm-svn: 84109
2009-10-14 16:19:03 +00:00