Commit Graph

44026 Commits

Author SHA1 Message Date
Michael J. Spencer
ee271d8758 Support/PathV2: Move make_absolute from path to fs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:57:17 +00:00
Rafael Espindola
bf60dad984 Fix pcrel relocations that cross sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121107 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:50:14 +00:00
NAKAMURA Takumi
63fbb52163 lib/Target/X86/X86MCAsmInfo.cpp: [PR8741] On Win64, specify explicit PrivateGlobalPrefix as ".L".
Or, global symbols @Lxxxx might be treated as temporal symbol by MCSymbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 02:43:45 +00:00
Eric Christopher
6a3e305326 Temporarily revert r121100 as it's causing clang to fail
CodeGenCXX/virtual-base-ctor.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 02:41:11 +00:00
Chris Lattner
fb431099c5 fix PR8710 - teach global opt that some constantexprs are too complex to
put in a global variable's initializer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:59:32 +00:00
Jakob Stoklund Olesen
1fe045279b Remove unused member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:32:45 +00:00
Michael J. Spencer
69cbbbf005 Support/Unix/PathV2: Return the real error from realpath instead of any error
that close or unlink set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:39 +00:00
Michael J. Spencer
79c3c3a1de Support/Unix/PathV2: Use 0770 instead of 0700 when creating a directory. Also use
the standard macros instead of octal notation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:29 +00:00
Michael J. Spencer
fbd1bbd7fa Support/PathV2: Use SmallVector::clear instead of set_size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:19 +00:00
Michael J. Spencer
ad8a14f24e Support/PathV2: Clarify and correct documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:08 +00:00
Michael J. Spencer
1522fce477 Support/PathV2: Move current_path from path to fs and fix the Unix implementation.
Unix bug spotted by Dan Gohman.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:22:31 +00:00
Rafael Espindola
f10d2be573 Fix a crash reduced from gcc produced assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:09:54 +00:00
Owen Anderson
eb6779c5b9 Second attempt at converting Thumb2's LDRpci, including updating the gazillion places that need to know about it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 00:45:21 +00:00
Rafael Espindola
85f2ecc697 Sorry for such a large commit. The summary is that only MachO cares about the
actuall addresses in a .o file, so it is better to let the MachO writer compute
it.

This is good for two reasons. First, areas that shouldn't care about
addresses now don't have access to it. Second, the layout of each section
is independent. I should use this in a subsequent commit to speed it up.

Most of the patch is just removing the section address computation. The two
interesting parts are the change on how we handle padding in the end
of sections and how MachO can get the address of a-b when a and b are in
different sections.

Since now the expression evaluation normally doesn't know the section address,
it will think that a-b needs relocation and let the MachO writer know. Once
it has computed the section addresses, it calls back the expression evaluation
with the section addresses to resolve these expressions.

The remaining problem is the handling of padding. Currently it will create
a special alignment fragment at the end. Since that fragment doesn't update
the alignment of the section, it needs the real address to be computed.

Since now the layout will not compute a-b with a and b in different sections,
the only effect that the special alignment fragment has is update the
address size of the section. This can also be done by the MachO writer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121076 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 00:27:36 +00:00
Jim Grosbach
662a816e89 Add fixup for Thumb1 BL/BLX instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 23:57:07 +00:00
Frits van Bommel
6033b346e2 Implement jump threading of 'indirectbr' by keeping track of whether we're looking for ConstantInt*s or BlockAddress*s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121066 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 23:36:56 +00:00
Devang Patel
b7313e274c Undefined value in reg 0 may need a marker to identify end of source range.
This will be used to truncate live range of DBG_VALUE instruction by register allocator and friends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 22:48:22 +00:00
Devang Patel
afeaae7a94 If dbg_declare() or dbg_value() is not lowered by isel then emit DEBUG message instead of creating DBG_VALUE for undefined value in reg0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 22:39:26 +00:00
Rafael Espindola
22373b230a Use references to simplify the code a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 22:30:54 +00:00
Wesley Peck
a3b2200472 Adding bug fix that was suppose to be part of 121044.
patch contributed by Jack Whitham!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121049 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 22:19:28 +00:00
Wesley Peck
dc80380de8 Fixed reversed operands for IDIV and CMP instructions in MBlaze backend.
Use BRAD instead of BRD for indirect branches in MBlaze backend.

patch contributed by Jack Whitham!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 22:06:49 +00:00
Jason W Kim
56a399023a Refactor ELFObjectWriter.
+ ARM/X86/MBlaze now share a common RecordRelocation
+ ARM/X86/MBlaze arch specific routines are limited to GetRelocType()



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:57:34 +00:00
Chris Lattner
f51a6cc5bf replace a linear scan with a symtab lookup, reduce indentation.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:53:07 +00:00
Rafael Espindola
1dda29bdff use getSymbolOffset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121041 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:51:55 +00:00
Chris Lattner
29d8d6b039 Use a stronger predicate here, pointed out by Duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:48:10 +00:00
Chris Lattner
a9d4da85d6 add some DEBUG statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:13:51 +00:00
Wesley Peck
1e8cdd599c Fix a 16-bit immediate value detection bug in the MBlaze delay slot filler.
Address more hazards in the MBlaze delay slot filler.

patch contributed by Jack Whitham!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:11:01 +00:00
Rafael Espindola
f96d17b886 Another use of getSymbolOffset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 19:55:05 +00:00
Rafael Espindola
179821ac1f Remove the instruction fragment to data fragment lowering since it was causing
freed data to be read. I will open a bug to track it being reenabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 19:08:48 +00:00
Owen Anderson
c76c59840b Revert r121021, which broke the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:57:40 +00:00
Jim Grosbach
ba3368ceae Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:47:44 +00:00
Owen Anderson
4c386fc754 Improve handling of Thumb2 PC-relative loads by converting LDRpci (and friends) to Pseudos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:35:51 +00:00
Jim Grosbach
04f74942f2 Encode the register operand of ARM CondCode operands correctly. ARM::CPSR if
the instruction is predicated, reg0 otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:30:57 +00:00
Jim Grosbach
d67641b6f8 The ARM AsmMatcher needs to know that the CCOut operand is a register value,
not an immediate. It stores either ARM::CPSR or reg0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121018 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:21:12 +00:00
Rafael Espindola
0bbe0b440e 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 17:27:56 +00:00
Rafael Espindola
6d86492f5e Revert previous two patches while I try to find out how to make both
linux and darwin assemblers happy :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 15:35:15 +00:00
Rafael Espindola
2303c9dd69 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 14:53:14 +00:00
Chris Lattner
6c3ee0f3c9 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 07:52:42 +00:00
Chris Lattner
39add23dc5 improve comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 07:43:04 +00:00
Chris Lattner
7d32b8032d improve -debug output and comments a little.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120993 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 07:38:40 +00:00
Michael J. Spencer
476d2f769e Support/Windows: Make MinGW happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 06:02:07 +00:00
Michael J. Spencer
753cbbbd3c Support/FileSystem: Add directory_iterator implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:42 +00:00
Michael J. Spencer
f150e7695e Support/PathV2: Fix append to not add a slash to empty or root paths.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:23 +00:00
Michael J. Spencer
7eec50bf4f Support/Windows: Add ScopedHandle and move some clients over to it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:13 +00:00
Che-Liang Chiou
f964486771 ptx: add shift instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:00:03 +00:00
Rafael Espindola
f8803fe417 Remove the getAddress getter, initialize Ordinal in the constructor and use
that on the ELF writer to detect a section we created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 03:48:09 +00:00
Rafael Espindola
f3faf92636 Simplify a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 03:36:43 +00:00
Rafael Espindola
81d8ea5bd2 Use getSymbolOffset on the COFF writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120979 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 03:24:04 +00:00
Rafael Espindola
340a7a1c8f Don't use PadSectionToAlignment on windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120978 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 03:03:44 +00:00
Rafael Espindola
ffd902bfb7 Add a getSymbolOffset method and use it in the ELF writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 02:57:26 +00:00
Chris Lattner
cc10244d77 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!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120974 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 01:48:06 +00:00
Evan Cheng
04e2b639c1 Eliminate unneeded #include's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 23:41:43 +00:00
NAKAMURA Takumi
714e07f75d ARM/CMakeLists.txt: Add missing MLxExpansionPass.cpp since r120960.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 23:08:57 +00:00
Evan Cheng
167be80ee7 Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120965 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 23:03:45 +00:00
Evan Cheng
f79ed109ec Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120964 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 23:03:35 +00:00
Cameron Zwarich
9eaf49b320 Some cleanup before I start committing some incremental progress on
StrongPHIElimination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120961 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 22:34:08 +00:00
Evan Cheng
48575f6ea7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120960 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 22:04:16 +00:00
Cameron Zwarich
0a3fdd6e11 Remove the PHIElimination.h header, as it is no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 21:39:42 +00:00
Frits van Bommel
a4805cf6ef 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 20:50:26 +00:00
Cameron Zwarich
120188605f I forgot to actually remove the FindCopyInsertPoint() declaration from
PHIElimination.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 19:58:57 +00:00
Cameron Zwarich
2225dd81e9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 19:54:23 +00:00
Cameron Zwarich
a474685d06 Move the FindCopyInsertPoint method of PHIElimination to a new standalone
function so that it can be shared with StrongPHIElimination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120951 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 19:51:05 +00:00
Frits van Bommel
ea388f217b Refactor jump threading.
Should have no functional change other than the order of two transformations that are mutually-exclusive and the exact formatting of debug output.
Internally, it now stores the ConstantInt*s as Constant*s, and actual undef values instead of nulls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 19:06:41 +00:00
Frits van Bommel
6f9a8307e0 Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 19:02:47 +00:00
Frits van Bommel
7ac40c3ffa Teach SimplifyCFG to turn
(indirectbr (select cond, blockaddress(@fn, BlockA),
                            blockaddress(@fn, BlockB)))
into
  (br cond, BlockA, BlockB).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 18:29:03 +00:00
Chris Lattner
9637d5b22e Teach X86ISelLowering that the second result of X86ISD::UMUL is a flags
result.  This allows us to compile:

void *test12(long count) {
      return new int[count];
}

into:

test12:
	movl	$4, %ecx
	movq	%rdi, %rax
	mulq	%rcx
	movq	$-1, %rdi
	cmovnoq	%rax, %rdi
	jmp	__Znam                  ## TAILCALL

instead of:

test12:
	movl	$4, %ecx
	movq	%rdi, %rax
	mulq	%rcx
	seto	%cl
	testb	%cl, %cl
	movq	$-1, %rdi
	cmoveq	%rax, %rdi
	jmp	__Znam

Of course it would be even better if the regalloc inverted the cmov to 'cmovoq',
which would eliminate the need for the 'movq %rdi, %rax'.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120936 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 07:49:54 +00:00
Chris Lattner
b20e0b1fdd it turns out that when ".with.overflow" intrinsics were added to the X86
backend that they were all implemented except umul.  This one fell back
to the default implementation that did a hi/lo multiply and compared the
top.  Fix this to check the overflow flag that the 'mul' instruction
sets, so we can avoid an explicit test.  Now we compile:

void *func(long count) {
      return new int[count];
}

into:

__Z4funcl:                              ## @_Z4funcl
	movl	$4, %ecx                ## encoding: [0xb9,0x04,0x00,0x00,0x00]
	movq	%rdi, %rax              ## encoding: [0x48,0x89,0xf8]
	mulq	%rcx                    ## encoding: [0x48,0xf7,0xe1]
	seto	%cl                     ## encoding: [0x0f,0x90,0xc1]
	testb	%cl, %cl                ## encoding: [0x84,0xc9]
	movq	$-1, %rdi               ## encoding: [0x48,0xc7,0xc7,0xff,0xff,0xff,0xff]
	cmoveq	%rax, %rdi              ## encoding: [0x48,0x0f,0x44,0xf8]
	jmp	__Znam                  ## TAILCALL

instead of:

__Z4funcl:                              ## @_Z4funcl
	movl	$4, %ecx                ## encoding: [0xb9,0x04,0x00,0x00,0x00]
	movq	%rdi, %rax              ## encoding: [0x48,0x89,0xf8]
	mulq	%rcx                    ## encoding: [0x48,0xf7,0xe1]
	testq	%rdx, %rdx              ## encoding: [0x48,0x85,0xd2]
	movq	$-1, %rdi               ## encoding: [0x48,0xc7,0xc7,0xff,0xff,0xff,0xff]
	cmoveq	%rax, %rdi              ## encoding: [0x48,0x0f,0x44,0xf8]
	jmp	__Znam                  ## TAILCALL

Other than the silly seto+test, this is using the o bit directly, so it's going in the right
direction.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 07:30:36 +00:00
Chris Lattner
96908b17ae generalize the previous check to handle -1 on either side of the
select, inserting a not to compensate.  Add a missing isZero check
that I lost somehow.

This improves codegen of:

void *func(long count) {
      return new int[count];
}

from:

__Z4funcl:                              ## @_Z4funcl
	movl	$4, %ecx                ## encoding: [0xb9,0x04,0x00,0x00,0x00]
	movq	%rdi, %rax              ## encoding: [0x48,0x89,0xf8]
	mulq	%rcx                    ## encoding: [0x48,0xf7,0xe1]
	testq	%rdx, %rdx              ## encoding: [0x48,0x85,0xd2]
	movq	$-1, %rdi               ## encoding: [0x48,0xc7,0xc7,0xff,0xff,0xff,0xff]
	cmoveq	%rax, %rdi              ## encoding: [0x48,0x0f,0x44,0xf8]
	jmp	__Znam                  ## TAILCALL
                                        ## encoding: [0xeb,A]

to:

__Z4funcl:                              ## @_Z4funcl
	movl	$4, %ecx                ## encoding: [0xb9,0x04,0x00,0x00,0x00]
	movq	%rdi, %rax              ## encoding: [0x48,0x89,0xf8]
	mulq	%rcx                    ## encoding: [0x48,0xf7,0xe1]
	cmpq	$1, %rdx                ## encoding: [0x48,0x83,0xfa,0x01]
	sbbq	%rdi, %rdi              ## encoding: [0x48,0x19,0xff]
	notq	%rdi                    ## encoding: [0x48,0xf7,0xd7]
	orq	%rax, %rdi              ## encoding: [0x48,0x09,0xc7]
	jmp	__Znam                  ## TAILCALL
                                        ## encoding: [0xeb,A]



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120932 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 02:00:51 +00:00
Chris Lattner
a2b5600e61 Improve an integer select optimization in two ways:
1. generalize 
    (select (x == 0), -1, 0) -> (sign_bit (x - 1))
to:
    (select (x == 0), -1, y) -> (sign_bit (x - 1)) | y

2. Handle the identical pattern that happens with !=:
   (select (x != 0), y, -1) -> (sign_bit (x - 1)) | y

cmov is often high latency and can't fold immediates or
memory operands.  For example for (x == 0) ? -1 : 1, before 
we got:

< 	testb	%sil, %sil
< 	movl	$-1, %ecx
< 	movl	$1, %eax
< 	cmovel	%ecx, %eax

now we get:

> 	cmpb	$1, %sil
> 	sbbl	%eax, %eax
> 	orl	$1, %eax




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120929 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 01:23:24 +00:00
Bill Wendling
d643486058 Initialize HasPOPCNT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 23:57:24 +00:00
Rafael Espindola
b4172fa729 Once the layout is done we don't need to keep updating which fragments are
valid. Addresses will not change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120921 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 22:47:22 +00:00
Rafael Espindola
db74aeadcd Remember the contents of leb and dwarfline fragments when relaxing. This avoids
having to evaluate the expression again when writing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 21:58:52 +00:00
Cameron Zwarich
2a7942926b Remove PHIElimination's private copy of SkipPHIsAndLabels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 20:40:15 +00:00
Benjamin Kramer
1292c22645 Add patterns for the x86 popcnt instruction.
- Also adds a new POPCNT subtarget feature that is currently enabled if the target
  supports SSE4.2 (nehalem) or SSE4A (barcelona).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 20:32:23 +00:00
Bill Wendling
a6091be84c Silence 'may be used uninitialized in this function' warnings. Static analysis
may determine that they cannot be used uninitialized. But that might be a bit
too much for the compiler to determine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 20:20:34 +00:00
Michael J. Spencer
9d425e7687 Support/PathV2: Remove redundant calls to make_error_code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120913 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 18:45:32 +00:00
Benjamin Kramer
fd6d53fbad APInt: microoptimize a few methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120912 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 18:05:36 +00:00
Benjamin Kramer
3069cbf7b3 Remove unneeded zero arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 15:28:22 +00:00
Benjamin Kramer
299ee184f4 Apparently APFloat::getZero doesn't like PPCDoubleDoubles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 14:43:08 +00:00
Benjamin Kramer
983839609f Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 14:22:24 +00:00
Bob Wilson
c24130bade The Thumb tADDrSPi instruction is not valid when the destination is SP.
Check for that and try narrowing it to tADDspi instead.  Radar 8724703.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120892 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 04:40:19 +00:00
Rafael Espindola
5d4918dbd1 There are two reasons why we might want to use
foo = a - b
.long foo
instead of just
.long a - b

First, on darwin9 64 bits the assembler produces the wrong result. Second,
if "a" is the end of the section all darwin assemblers (9, 10 and mc) will not
consider a - b to be a constant but will if the dummy foo is created.

Split how we handle these cases. The first one is something MC should take care
of. The second one has to be handled by the caller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 03:21:47 +00:00
Michael J. Spencer
470ae13be8 Support/FileSystem: Add status implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 00:32:40 +00:00
Michael J. Spencer
4958466f9f Support/Windows/FileSystem: Fix MinGW warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 00:32:14 +00:00
Michael J. Spencer
01a87c413d Support/FileSystem: Add file_size implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 00:31:48 +00:00
Rafael Espindola
767b1be390 Next step: Only pad debug_line when the target is darwin. Add a FIXME to avoid
doing that if the target is darwin10 or newer.

This fixes
*) Direct object emission was producing objects without the workaround on
   darwin9.
*) Assembly printing was producing objects with the workaround on linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120866 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 00:31:13 +00:00
Jim Grosbach
ceab50198e Encode condition code for Thumb1 conditional branch instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 00:20:40 +00:00
Jim Grosbach
ed09087dd3 Correctly size-reduce the t2CMPzrr instruction to tCMPzr when possible.
tCMPzhir has undefined behavior when both source registers are low registers.
rdar://8728577

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 23:54:18 +00:00
Bill Wendling
fb62d550de Use correct variable names to match the patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 23:44:24 +00:00
Jakob Stoklund Olesen
5b3f779f33 Also inore '()' while creating mdnode name from ObjC symbol name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120856 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 23:40:45 +00:00
Rafael Espindola
a8de83c68a First step in fixing MC. Make it clear that we are avoiding a bug in the
darwin9 linker, what is needed to avoid it and where to get more information.

Also make the workaround simpler. Just the regular end_sequence we normally
create is more than 4 bytes.

Tested by building cctools and ld64 from darwin9 on a darwin10 system and using
those. I checked that I was able to reproduce the bootstrap failure when
the the workaround was disabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 23:36:59 +00:00
Devang Patel
ddb85acdbe Ignore '+' while creating mdnode name from ObjC symbol name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 23:29:30 +00:00
Jim Grosbach
1b555d9f96 Match pattern operand names to expected encoding field names. This corrects the
operand encoding ordering of the instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 23:21:25 +00:00
Jim Grosbach
4fa102b84e Remove incorrect BL target encoding (it's similar to, but not the same as the
ARM instruction). Add encoding of bits 13 and 11.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 22:33:42 +00:00
Jim Grosbach
d91f4e40e6 Encode the 32-bit wide Thumb (and Thumb2) instructions with the high order
halfword being emitted to the stream first. rdar://8728174

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 22:31:40 +00:00
Nate Begeman
5812b10adb Revert this change since it breaks a couple of the AVX tests.
I'm unclear if the tests are actually correct or not, but reverting for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 22:29:15 +00:00
Jakob Stoklund Olesen
6ed4c6af97 Rename virtRegMap to avoid confusion with the VirtRegMap that it isn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 22:25:09 +00:00
Jakob Stoklund Olesen
5daec2215b Coalesce debug locations when possible, causing less DBG_VALUE instructions to
be emitted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 22:25:07 +00:00
Nate Begeman
07c21d85b4 Scalar f32/f64 are also subregs of ymm regs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120844 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 21:54:39 +00:00
Nate Begeman
163e83d69a Remove SSE1-4 disable when AVX is enabled. While this may be useful for development,
it completely breaks scalar fp in xmm regs when AVX is enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 21:54:14 +00:00
Jakob Stoklund Olesen
42acf069c9 Emit DBG_VALUE instructions from LiveDebugVariables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 21:47:10 +00:00
Jakob Stoklund Olesen
8d2584a1d9 Also update virtRegMap when renaming virtual registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120841 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 21:47:08 +00:00
Jim Grosbach
41ad0c4c73 When using the 'push' mnemonic for Thumb2 stmdb, be explicit when it's the
32-bit wide version by adding the .w suffix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 20:33:01 +00:00
Benjamin Kramer
b3a04d46e8 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120836 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 19:55:37 +00:00
Jim Grosbach
6e57298127 Reduce t2 ldr/str instructions to the correct t1 versions when there's an
immediate offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 19:47:11 +00:00
Jason W Kim
2ccf148fba fix ARM::fixup_arm_branch, cleanup, and share more code between ELF and Darwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 19:40:23 +00:00
Jim Grosbach
0b951ceb02 No need to declare EncoderMethod property anymore; just assign to it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120831 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 19:31:00 +00:00
Jakob Stoklund Olesen
68be956fff Delete the StrongPHIElimination pass, leaving only a shell.
The StrongPHIElimination pass did not work, and nobody has worked on it for two
years.

A rewrite is underway, so I am leaving this shell pass instead of deleting it
completely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 19:21:53 +00:00
Jakob Stoklund Olesen
7a26aca73f Add IntervalMap::iterator::set{Start,Stop,Value} methods that allow limited
editing of the current interval.

These methods may cause coalescing, there are corresponding set*Unchecked
methods for editing without coalescing. The non-coalescing methods are useful
for applying monotonic transforms to all keys or values in a map without
accidentally coalescing transformed and untransformed intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 19:02:00 +00:00
Michael J. Spencer
b531f45a9d Support/FileSystem: Add equivalent implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120827 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:49:13 +00:00
Michael J. Spencer
db04b39dad Support/FileSystem: Fix MinGW build. It doesn't have _chsize_s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120826 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:48:56 +00:00
Jim Grosbach
d253545c17 Add FIXMEs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120824 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:37:17 +00:00
Jim Grosbach
2c971ab9d9 Size reduction for tPUSH come from t2STMDB_UPD, not t2STMIA_UPD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120822 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:31:03 +00:00
Michael J. Spencer
b39e33f39b And I really hate line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120821 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:04:11 +00:00
Michael J. Spencer
af45fc005b Support/Windows/FileSystem: Fix MinGW build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:03:28 +00:00
Michael J. Spencer
3920d3b4f4 Support/FileSystem: Add resize_file implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:54:07 +00:00
Michael J. Spencer
a50b98c517 Support/FileSystem: Add rename implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:53:55 +00:00
Michael J. Spencer
106aa731bf Support/FileSystem: Add remove implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:53:43 +00:00
Michael J. Spencer
998b4709cb Fix line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:53:23 +00:00
Eric Christopher
481d402ab0 Apparently OS X 10.4 doesn't have __crashreporter_info__.
Try to fix building on the wayback machine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 07:45:22 +00:00
Michael J. Spencer
9b391c513e Support/FileSystem: Add create_symlink implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 07:41:25 +00:00
Michael J. Spencer
d7b305f13e Support/FileSystem: Add create_hard_link implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120792 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 05:58:41 +00:00
Michael J. Spencer
0dda5437f8 Support/ADT/Twine: Make toNullTerminatedStringRef not rely on UB :(.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 05:42:25 +00:00
Michael J. Spencer
b83769f36a Support/FileSystem: Add create_director{y,ies} implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 05:42:11 +00:00
Rafael Espindola
2df042cb32 Make EmitIntValue more efficient and more like what we do for leb128. The
difference is much smaller (about 0.3s) but significant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 02:54:21 +00:00
Bill Wendling
278b6e81c8 Don't overwrite the opcode passed into the T1Special pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 02:02:58 +00:00
Bill Wendling
534a5e4305 Add Thumb encoding for some more instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:55:47 +00:00
Michael J. Spencer
2dbdeee87a Support/Windows/FileSystem: Remove unneeded toNullTerminatedStringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:21:38 +00:00
Michael J. Spencer
3cb84ef65d Support/FileSystem: Add unique_file and exists implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:21:28 +00:00
Rafael Espindola
660b5fc4d0 Do with uleb the same trick we now do with dwarf line/address advances. This
avoids creating leb128 fragments and speeds up the test in PR8711 to 33s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:19:49 +00:00
Rafael Espindola
32a006e606 Try to resolve symbol differences early, and if successful create a plain
data fragment. This reduces the time to assemble the test in 8711 from 60s to
54s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 00:55:40 +00:00
Bill Wendling
0bdf0c05b9 The tLDR instruction wasn't encoded properly:
<MCInst 2251 <MCOperand Reg:70> <MCOperand Reg:66> <MCOperand Imm:0> <MCOperand Reg:0> <MCOperand Imm:14> <MCOperand Reg:0>>

Notice that the "reg" here is 0, which is an invalid register. Put a check in
the code for this to prevent crashing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 00:53:22 +00:00
Devang Patel
5113cdbfff It may not be an option to skip .debug_line if there are file reference in already emitted debug info. So, for now, emit dummy line table entry to make older linker and assemblers happy. This is not a new behavior, original AsmPrinter emitted similar line table entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 00:10:48 +00:00
Jim Grosbach
7721e7f279 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120748 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 23:05:38 +00:00
Devang Patel
ee4854faf3 Use set directive for StartMinusEndExpr.
This is a fix for llvm-gcc-i386-darwin9 buildbot failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 21:32:30 +00:00
Jakob Stoklund Olesen
30e2128a73 Update LiveDebugVariables during coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 18:15:44 +00:00
Jim Grosbach
1ab4b211ea When expanding the MOVCCi32imm, make sure to use the ARM movt/movw opcodes,
not thumb2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120711 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 16:42:25 +00:00
Jim Grosbach
ce4fadf884 Fix copy/pasto in vmin.f32 encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 16:30:58 +00:00
Wesley Peck
2e06398405 Teaching MBlaze backend how to reverse branch conditions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120707 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 16:17:11 +00:00
Rafael Espindola
76507f14ed Add a fast path to EvaluateSymbolicAdd. This avoids computing symbol addresses
which then avoids running EnsureValid.
This cuts the assembly time of the testcase in PR8711 from 2:50 minutes to 1
minute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120697 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 07:53:12 +00:00
Rafael Espindola
e23930543c Move EmitValueToOffset to the ObjectStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 05:59:38 +00:00
Rafael Espindola
dedb045c32 Add EmitInstToFragment to the generic object streamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120690 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 05:44:06 +00:00
Rafael Espindola
6db8a9f3fa The sections that the ELF object writer has to create are very simple and
contain only data. Handle them specially instead of using AddSectionToTheEnd.
This moves a hack from the generic assembler to the elf writer. It is also
a bit faster and should make other improvements easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120683 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 03:09:06 +00:00
Devang Patel
6a13ddbd9b If tehre are not any line entry then do not try to emit .debug_line section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 01:17:51 +00:00
Jakob Stoklund Olesen
0613516b16 Implement the first half of LiveDebugVariables.
Scan the MachineFunction for DBG_VALUE instructions, and replace them with a
data structure similar to LiveIntervals. The live range of a DBG_VALUE is
determined by propagating it down the dominator tree until a new DBG_VALUE is
found. When a DBG_VALUE lives in a register, its live range is confined to the
live range of the register's value.

LiveDebugVariables runs before coalescing, so DBG_VALUEs are not artificially
extended when registers are joined.

The missing half will recreate DBG_VALUE instructions from the intervals when
register allocation is complete.

The pass is disabled by default. It can be enabled with the temporary command
line option -live-debug-variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 00:37:37 +00:00
Jim Grosbach
dff84b0325 Add support for binary encoding of ARM 'adr' instructions referencing constant
pool entries (LEApcrel pseudo). Ongoing saga of rdar://8542291.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 00:28:45 +00:00
Devang Patel
0be938e389 Revert r120580.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 00:22:29 +00:00
Evan Cheng
1bf891ae6e Fix and re-enable tail call optimization of expanded libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 22:59:46 +00:00
Rafael Espindola
6566e0a55e Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 22:48:11 +00:00
Jason W Kim
0c628c2617 fixing style nit: move class static to global static
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120619 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 22:46:50 +00:00