Commit Graph

97054 Commits

Author SHA1 Message Date
Rafael Espindola 44bbe36de6 Second try at making direct object emission produce the same results
as llc + llvm-mc. This time ELF is not changed and I tested that llvm-gcc
bootstrap on darwin10 using darwin9's assembler and linker.

llvm-svn: 121006
2010-12-06 17:27:56 +00:00
Rafael Espindola dee3062373 Revert previous two patches while I try to find out how to make both
linux and darwin assemblers happy :-(

llvm-svn: 121004
2010-12-06 15:35:15 +00:00
Howard Hinnant fd18df5b2e Add a couple more std-qualifers.
llvm-svn: 121002
2010-12-06 15:11:48 +00:00
Rafael Espindola 884d58a798 Update test for the extra =.
llvm-svn: 121001
2010-12-06 15:05:36 +00:00
Rafael Espindola 34a06a0802 Add an EmitAbsValue helper method and use it in cases where we want to be sure
that no relocations are used (on MochO).
Fixes llc producing different output from llc + llvm-mc.

llvm-svn: 121000
2010-12-06 14:53:14 +00:00
Frits van Bommel aa0060085d Fix clang warning: "extra ';' inside a class [-pedantic]".
llvm-svn: 120998
2010-12-06 10:48:11 +00:00
Chandler Carruth d44c3105fb Un-templatetize this method. It's definition is out of line in the .cpp file,
so that's not a valid thing to do at all. Instead, switch to a ValueDecl
argument, the template isn't really necessary here.

When handling the types explicitly in the code, it becomes awkward to cerate
the CXXBaseOrMemberInitializer object in so many places. Re-flow the code to
calculate the Init expression first, and then create the initializer. If this
is too gross, we can factor the init expression logic into helper functions,
but it's not past my threshold yet.

llvm-svn: 120997
2010-12-06 09:23:57 +00:00
John McCall 5d41378146 Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.

llvm-svn: 120996
2010-12-06 08:20:24 +00:00
Chris Lattner fb212de06d Fix PR8735, a really terrible problem in the inliner's "alloca merging"
optimization.

Consider:
static void foo() {
  A = alloca
  ...
}

static void bar() {
  B = alloca
  ...
  call foo();
}

void main() {
  bar()
}

The inliner proceeds bottom up, but lets pretend it decides not to inline foo
into bar.  When it gets to main, it inlines bar into main(), and says "hey, I
just inlined an alloca "B" into main, lets remember that.  Then it keeps going
and finds that it now contains a call to foo.  It decides to inline foo into
main, and says "hey, foo has an alloca A, and I have an alloca B from another
inlined call site, lets reuse it".  The problem with this of course, is that 
the lifetime of A and B are nested, not disjoint.

Unfortunately I can't create a reasonable testcase for this: the one in the
PR is both huge and extremely sensitive, because you minor tweaks end up
causing foo to get inlined into bar too early.  We already have tests for the
basic alloca merging optimization and this does not break them.

llvm-svn: 120995
2010-12-06 07:52:42 +00:00
Chris Lattner cd3af96a8f improve comment
llvm-svn: 120994
2010-12-06 07:43:04 +00:00
Chris Lattner 5b6a865f2e improve -debug output and comments a little.
llvm-svn: 120993
2010-12-06 07:38:40 +00:00
John McCall d0a300162e __block variables require us to evaluate the RHS of an assignment before
the LHS, or else the pointer might be invalid.  This is kindof dumb, but
go ahead and make sure we're doing that for l-value scalar assignment,
which fixes a miscompile of obj-c++.dg/block-seq.mm.

Leave a FIXME for how to solve this problem for agg __blocks.

llvm-svn: 120992
2010-12-06 06:10:02 +00:00
Michael J. Spencer 0d025b6b42 Support/Windows: Make MinGW happy.
llvm-svn: 120991
2010-12-06 06:02:07 +00:00
John McCall 622114cfe3 Clarify the logic for when to build an overloaded binop. In particular,
build one when either of the operands calls itself type-dependent;
previously we were building when one of the operand types was dependent,
which is not always the same thing and which can lead to unfortunate
inconsistencies later.  Fixes PR8739.

llvm-svn: 120990
2010-12-06 05:26:58 +00:00
Michael J. Spencer 7ecd94cc0b Support/FileSystem: Add directory_iterator implementation.
llvm-svn: 120989
2010-12-06 04:28:42 +00:00
Michael J. Spencer 95e4ac16a5 Support/PathV2: Fix append to not add a slash to empty or root paths.
llvm-svn: 120988
2010-12-06 04:28:23 +00:00
Michael J. Spencer 39c4621f42 Support/Windows: Add ScopedHandle and move some clients over to it.
llvm-svn: 120987
2010-12-06 04:28:13 +00:00
Michael J. Spencer 459a6f150a KillTheDoctor: Cleanup error_code usage.
llvm-svn: 120986
2010-12-06 04:28:01 +00:00
Michael J. Spencer 1e4f03ce9f KillTheDoctor: Fix spelling.
llvm-svn: 120985
2010-12-06 04:27:52 +00:00
Michael J. Spencer 911742c4b7 Support/ADT: Move c_str() from SmallString to SmallVectorImpl. The Windows PathV2
implementation needs it for wchar_t and SmallVectorImpl in general.

llvm-svn: 120984
2010-12-06 04:27:42 +00:00
Che-Liang Chiou 9f2af628a6 ptx: add shift instructions
llvm-svn: 120982
2010-12-06 04:00:03 +00:00
Rafael Espindola baf2f3b3eb Remove the getAddress getter, initialize Ordinal in the constructor and use
that on the ELF writer to detect a section we created.

llvm-svn: 120981
2010-12-06 03:48:09 +00:00
Rafael Espindola 46e40188f7 Simplify a bit.
llvm-svn: 120980
2010-12-06 03:36:43 +00:00
Rafael Espindola 45790b82af Use getSymbolOffset on the COFF writer.
llvm-svn: 120979
2010-12-06 03:24:04 +00:00
Rafael Espindola ac60adb38d Don't use PadSectionToAlignment on windows.
llvm-svn: 120978
2010-12-06 03:03:44 +00:00
Rafael Espindola e7284c3671 Add a getSymbolOffset method and use it in the ELF writer.
llvm-svn: 120977
2010-12-06 02:57:26 +00:00
Greg Clayton 39e746e7cf Use full command to avoid "expr" alias.
Add bug number for current expected failures.

llvm-svn: 120976
2010-12-06 02:47:48 +00:00
Greg Clayton f4b0c83e69 Added a simple test case that can be used to test out the expression parser
more completely. Example expressions are in the comments.

llvm-svn: 120975
2010-12-06 02:44:26 +00:00
Chris Lattner 94fbdf3814 Fix PR8728, a miscompilation I recently introduced. When optimizing
memcpy's like:
  memcpy(A, B)
  memcpy(A, C)

we cannot delete the first memcpy as dead if A and C might be aliases.
If so, we actually get:

  memcpy(A, B)
  memcpy(A, A)

which is not correct to transform into:

  memcpy(A, A)

This patch was heavily influenced by Jakub Staszak's patch in PR8728, thanks
Jakub!

llvm-svn: 120974
2010-12-06 01:48:06 +00:00
Chris Lattner fa64f120ad add a helper method.
llvm-svn: 120973
2010-12-06 01:01:28 +00:00
Sean Callanan 14f0b0e8d5 Fixed a problem in which non-external variables
(for example, string literals) were being flagged
erroneously as undefined external variables.

llvm-svn: 120972
2010-12-06 00:56:39 +00:00
Evan Cheng abd6d2742a Eliminate unneeded #include's.
llvm-svn: 120971
2010-12-05 23:41:43 +00:00
Ted Kremenek f19a93dd99 Mark SVal constructors 'explicit'.
llvm-svn: 120970
2010-12-05 23:36:20 +00:00
Ted Kremenek 6a1cf6f77c Rename Environment::LookupExpr() to
Environment::lookupExpr() and move its implementation
out-of-line.

llvm-svn: 120969
2010-12-05 23:36:15 +00:00
Ted Kremenek eaf1f9a4a9 Remove unused method GRState::LookupExpr().
llvm-svn: 120968
2010-12-05 23:36:01 +00:00
Greg Clayton f7d6a2a6a8 Added a less than operator that will compare the internal opaque pointer values so SBBroadcaster objects can be contained in ordered containers or sorted.
llvm-svn: 120967
2010-12-05 23:14:19 +00:00
NAKAMURA Takumi 70fbbf534b ARM/CMakeLists.txt: Add missing MLxExpansionPass.cpp since r120960.
llvm-svn: 120966
2010-12-05 23:08:57 +00:00
Evan Cheng 12f4d615ab Code clean up.
llvm-svn: 120965
2010-12-05 23:03:45 +00:00
Evan Cheng b8a662f0d1 Remove an unused variable.
llvm-svn: 120964
2010-12-05 23:03:35 +00:00
Cameron Zwarich c7223a3e37 Some cleanup before I start committing some incremental progress on
StrongPHIElimination.

llvm-svn: 120961
2010-12-05 22:34:08 +00:00
Evan Cheng 62c7b5bf76 Making use of VFP / NEON floating point multiply-accumulate / subtraction is
difficult on current ARM implementations for a few reasons.
1. Even though a single vmla has latency that is one cycle shorter than a pair
   of vmul + vadd, a RAW hazard during the first (4? on Cortex-a8) can cause
   additional pipeline stall. So it's frequently better to single codegen
   vmul + vadd.
2. A vmla folowed by a vmul, vmadd, or vsub causes the second fp instruction to
   stall for 4 cycles. We need to schedule them apart.
3. A vmla followed vmla is a special case. Obvious issuing back to back RAW
   vmla + vmla is very bad. But this isn't ideal either:
     vmul
     vadd
     vmla
   Instead, we want to expand the second vmla:
     vmla
     vmul
     vadd
   Even with the 4 cycle vmul stall, the second sequence is still 2 cycles
   faster.

Up to now, isel simply avoid codegen'ing fp vmla / vmls. This works well enough
but it isn't the optimial solution. This patch attempts to make it possible to
use vmla / vmls in cases where it is profitable.

A. Add missing isel predicates which cause vmla to be codegen'ed.
B. Make sure the fmul in (fadd (fmul)) has a single use. We don't want to
   compute a fmul and a fmla.
C. Add additional isel checks for vmla, avoid cases where vmla is feeding into
   fp instructions (except for the #3 exceptional case).
D. Add ARM hazard recognizer to model the vmla / vmls hazards.
E. Add a special pre-regalloc case to expand vmla / vmls when it's likely the
   vmla / vmls will trigger one of the special hazards.

Work in progress, only A+B are enabled.

llvm-svn: 120960
2010-12-05 22:04:16 +00:00
Cameron Zwarich a3fb8cb3d4 Remove the PHIElimination.h header, as it is no longer needed.
llvm-svn: 120959
2010-12-05 21:39:42 +00:00
Frits van Bommel 7cf63ace18 Clarify some of the differences between indexing with getelementptr and indexing with insertvalue/extractvalue.
llvm-svn: 120957
2010-12-05 20:54:38 +00:00
Frits van Bommel 16ebe77be0 Fix PR 4170 by having ExtractValueInst::getIndexedType() reject out-of-bounds indexing.
Also add asserts that the indices are valid in InsertValueInst::init(). ExtractValueInst already asserts when constructed with invalid indices.

llvm-svn: 120956
2010-12-05 20:50:26 +00:00
Greg Clayton c5f5783044 Fixed an issue where SBProcess::LoadImage(...) was not returning the image
token.

llvm-svn: 120954
2010-12-05 20:38:01 +00:00
Cameron Zwarich 6766c420a2 I forgot to actually remove the FindCopyInsertPoint() declaration from
PHIElimination.h.

llvm-svn: 120953
2010-12-05 19:58:57 +00:00
Cameron Zwarich 8d1695589c Remove the SplitCriticalEdge() method declaration from PHIElimination.h. At one
time, this method existed, but now PHIElimination uses the method of the same
name on MachineBasicBlock.

llvm-svn: 120952
2010-12-05 19:54:23 +00:00
Cameron Zwarich da592a9e41 Move the FindCopyInsertPoint method of PHIElimination to a new standalone
function so that it can be shared with StrongPHIElimination.

llvm-svn: 120951
2010-12-05 19:51:05 +00:00
Greg Clayton 1c2f283864 Added "void SBBroadcaster::Clear ();" method to SBBroadcaster.
llvm-svn: 120949
2010-12-05 19:36:39 +00:00
Greg Clayton 920c696c54 Fixed a crasher when trying to get event data flavors on events that don't
have event data.

llvm-svn: 120948
2010-12-05 19:21:02 +00:00