oota-llvm.git
11 years agoFormatting.
Eric Christopher [Thu, 30 May 2013 00:43:32 +0000 (00:43 +0000)]
Formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182902 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReformat comments here.
Eric Christopher [Thu, 30 May 2013 00:43:30 +0000 (00:43 +0000)]
Reformat comments here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182901 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a comment and some tests including the NULL byte.
Eric Christopher [Thu, 30 May 2013 00:43:26 +0000 (00:43 +0000)]
Add a comment and some tests including the NULL byte.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182900 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis testcase tests command line attributes which we don't yet support.
Bill Wendling [Thu, 30 May 2013 00:32:04 +0000 (00:32 +0000)]
This testcase tests command line attributes which we don't yet support.

In fact, we're probably going to support these flags in completely different
ways. So this test is no longer valid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182899 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove dead return.
Rafael Espindola [Thu, 30 May 2013 00:29:46 +0000 (00:29 +0000)]
Remove dead return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182898 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded a unittest for APFloat::getSmallestNormalized.
Michael Gottesman [Thu, 30 May 2013 00:18:47 +0000 (00:18 +0000)]
Added a unittest for APFloat::getSmallestNormalized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182897 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded code to the unittest for APFloat::getSmallest to double check that we consider...
Michael Gottesman [Thu, 30 May 2013 00:18:44 +0000 (00:18 +0000)]
Added code to the unittest for APFloat::getSmallest to double check that we consider the result to be denormal.

I additionally changed certain checks to use EXPECT_FALSE instead of a boolean
complement with EXPECT_TRUE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182896 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a unittest for APFloat::getSmallest.
Michael Gottesman [Wed, 29 May 2013 23:58:29 +0000 (23:58 +0000)]
Add a unittest for APFloat::getSmallest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182894 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoOrder CALLSEQ_START and CALLSEQ_END nodes.
Andrew Trick [Wed, 29 May 2013 22:03:55 +0000 (22:03 +0000)]
Order CALLSEQ_START and CALLSEQ_END nodes.

Fixes PR16146: gdb.base__call-ar-st.exp fails after
pre-RA-sched=source fixes.

Patch by Xiaoyi Guo!

This also fixes an unsupported dbg.value test case. Codegen was
previously incorrect but the test was passing by luck.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182885 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86: Fix Defs/Uses for insts that imp-def/imp-use both an A-register and EFLAGS.
Ahmed Bougacha [Wed, 29 May 2013 21:13:57 +0000 (21:13 +0000)]
X86: Fix Defs/Uses for insts that imp-def/imp-use both an A-register and EFLAGS.

This corrects a problem where x86 instructions that implicitly define/use both
an A-register (RAX, EAX, ..) and EFLAGS were declared as only defining/using
EFLAGS, because the outer "let Defs/Uses = [EFLAGS]" in the various multiclasses
overrides the "let Defs/Uses = [areg]" in BinOpAI.

The instructions deriving from BinOpAI were moved out of the "let Defs", and a
BinOpAI_FF class was created, for instructions that implicitly define and use
EFLAGS and the A-register (SBC, ADC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182883 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't assume the registers will be enumerated sequentially.
Chad Rosier [Wed, 29 May 2013 20:42:21 +0000 (20:42 +0000)]
Don't assume the registers will be enumerated sequentially.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182879 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd colored diagnostics when building LLVM with cmake + ninja + clang
Arnaud A. de Grandmaison [Wed, 29 May 2013 20:41:35 +0000 (20:41 +0000)]
Add colored diagnostics when building LLVM with cmake + ninja + clang

When invoked from Ninja, clang does not detect that it can use colors : see https://github.com/martine/ninja/issues/174

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182878 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable FastISel on ARM for Linux and NaCl
JF Bastien [Wed, 29 May 2013 20:38:10 +0000 (20:38 +0000)]
Enable FastISel on ARM for Linux and NaCl

FastISel was only enabled for iOS ARM and Thumb2, this patch enables it
for ARM (not Thumb2) on Linux and NaCl.

Thumb2 support needs a bit more work, mainly around register class
restrictions.

The patch punts to SelectionDAG when doing TLS relocation on non-Darwin
targets. I will fix this and other FastISel-to-SelectionDAG failures in
a separate patch.

The patch also forces FastISel to retain frame pointers: iOS always
keeps them for backtracking (so emitted code won't change because of
this), but Linux was getting much worse code that was incorrect when
using big frames (such as test-suite's lencod). I'll also fix this in a
later patch, it will probably require a peephole so that FastISel
doesn't rematerialize frame pointers back-to-back.

The test changes are straightforward, similar to:
  http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130513/174279.html
They also add a vararg test that got dropped in that change.

I ran all of test-suite on A15 hardware with --optimize-option=-O0 and
all the tests pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182877 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't reach into the middle of TargetMachine and cache one of its ivars.
Bill Wendling [Wed, 29 May 2013 20:37:19 +0000 (20:37 +0000)]
Don't reach into the middle of TargetMachine and cache one of its ivars.
Not only does this break encapsulation, it's gross.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182876 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach ReMaterialization to be more cunning about subregisters
Tim Northover [Wed, 29 May 2013 19:32:06 +0000 (19:32 +0000)]
Teach ReMaterialization to be more cunning about subregisters

This allows rematerialization during register coalescing to handle
more cases involving operations like SUBREG_TO_REG which might need to
be rematerialized using sub-register indices.

For example, code like:
    v1(GPR64):sub_32 = MOVZ something
    v2(GPR64) = COPY v1(GPR64)
should be convertable to:
    v2(GPR64):sub_32 = MOVZ something

but previously we just gave up in places like this

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182872 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify logic by using the appropriate functions.
Adrian Prantl [Wed, 29 May 2013 17:33:31 +0000 (17:33 +0000)]
Simplify logic by using the appropriate functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182869 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLTO+Debug Info: revert r182791.
Manman Ren [Wed, 29 May 2013 17:16:59 +0000 (17:16 +0000)]
LTO+Debug Info: revert r182791.

Since the testing case uses ref_addr, which requires version 3+ to work,
we will solve the dwarf version issue first.

This patch also causes failures in one of the bots. I will update the patch
accordingly in my next attempt.

rdar://13926659

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182867 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTidy some register classes for ARM and Thumb
JF Bastien [Wed, 29 May 2013 15:45:47 +0000 (15:45 +0000)]
Tidy some register classes for ARM and Thumb

Tidy up three places where the register class for ARM and Thumb wasn't
restrictive enough:
 - No PC dest for reg-reg add/orr/sub.
 - No PC dest for shifts.
 - No PC or SP for Thumb2 reg-imm add.

I encountered this while combining FastISel with
-verify-machineinstrs. These instructions defined registers whose
classes weren't restrictive enough, and the uses failed
verification. They're also undefined in the ISA, or would produce code
that FastISel wouldn't want. This doesn't fix the register class
narrowing issue (where uses should restrict definitions), and isn't
thorough, but it's a small step in the right direction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182863 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSparcFrameLowering.cpp: Mark verifyLeafProcRegUse() as UNUSED. [-Wunused-function]
NAKAMURA Takumi [Wed, 29 May 2013 12:10:42 +0000 (12:10 +0000)]
SparcFrameLowering.cpp: Mark verifyLeafProcRegUse() as UNUSED. [-Wunused-function]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182850 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[SystemZ] Two tests missing from previous commit
Richard Sandiford [Wed, 29 May 2013 11:59:26 +0000 (11:59 +0000)]
[SystemZ] Two tests missing from previous commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182847 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[SystemZ] Immediate compare-and-branch support
Richard Sandiford [Wed, 29 May 2013 11:58:52 +0000 (11:58 +0000)]
[SystemZ] Immediate compare-and-branch support

This patch adds support for the CIJ and CGIJ instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182846 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove test that depends on the X86 backend into the right subdirectory.
Benjamin Kramer [Wed, 29 May 2013 08:40:49 +0000 (08:40 +0000)]
Move test that depends on the X86 backend into the right subdirectory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182834 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTemporary fix to get rid of gcc warning.
Patrik Hagglund [Wed, 29 May 2013 07:32:08 +0000 (07:32 +0000)]
Temporary fix to get rid of gcc warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182832 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAllow overriding the location of C/C++ compilers in Android CMake build.
Evgeniy Stepanov [Wed, 29 May 2013 07:23:20 +0000 (07:23 +0000)]
Allow overriding the location of C/C++ compilers in Android CMake build.

Patch by Greg Fitzgerald.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182831 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Sparc] Add support for leaf functions in sparc backend.
Venkatraman Govindaraju [Wed, 29 May 2013 04:46:31 +0000 (04:46 +0000)]
[Sparc] Add support for leaf functions in sparc backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182822 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopVectorize.cpp: Fix abuse of StringRef on Twine. Twine captures the pointer of...
NAKAMURA Takumi [Wed, 29 May 2013 03:13:47 +0000 (03:13 +0000)]
LoopVectorize.cpp: Fix abuse of StringRef on Twine. Twine captures the pointer of StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182820 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhitespace.
NAKAMURA Takumi [Wed, 29 May 2013 03:13:41 +0000 (03:13 +0000)]
Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182819 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDebug Info: Update documentation to match recent (& not so recent) schema changes
David Blaikie [Wed, 29 May 2013 02:05:13 +0000 (02:05 +0000)]
Debug Info: Update documentation to match recent (& not so recent) schema changes

This updates the debug info metadata schema documentation for various
schema changes made recently surrounding filename information for
scopes and the representation of imported entities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182817 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDebug Info: Reorder accessor to match field order.
David Blaikie [Wed, 29 May 2013 02:05:07 +0000 (02:05 +0000)]
Debug Info: Reorder accessor to match field order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182816 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMips assembler: Improve set register alias handling
Jack Carter [Tue, 28 May 2013 22:21:05 +0000 (22:21 +0000)]
Mips assembler: Improve set register alias handling

This patch solves the problem of numeric register values not being accepted:

../set_alias.s:1:11: error: expected valid expression after comma
        .set    r4,$4
                    ^
The parsing of .set directive is changed and handling of symbols in code
as well to enable this feature.

The test example is added.

Patch by Vladimir Medic

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182807 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAArch64: clarify -help message
Tim Northover [Tue, 28 May 2013 21:09:39 +0000 (21:09 +0000)]
AArch64: clarify -help message

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182804 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Mips] Add Mips specific dynamic table entry tags.
Simon Atanasyan [Tue, 28 May 2013 20:48:56 +0000 (20:48 +0000)]
[Mips] Add Mips specific dynamic table entry tags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182803 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for llvm.vectorizer metadata
Paul Redmond [Tue, 28 May 2013 20:00:34 +0000 (20:00 +0000)]
Add support for llvm.vectorizer metadata

- llvm.loop.parallel metadata has been renamed to llvm.loop to be more generic
  by making the root of additional loop metadata.
  - Loop::isAnnotatedParallel now looks for llvm.loop and associated
    llvm.mem.parallel_loop_access
  - document llvm.loop and update llvm.mem.parallel_loop_access
- add support for llvm.vectorizer.width and llvm.vectorizer.unroll
  - document llvm.vectorizer.* metadata
  - add utility class LoopVectorizerHints for getting/setting loop metadata
  - use llvm.vectorizer.width=1 to indicate already vectorized instead of
    already_vectorized
- update existing tests that used llvm.loop.parallel and
  llvm.vectorizer.already_vectorized

Reviewed by: Nadav Rotem

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182802 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[APInt] Implement tcDecrement as a counterpart to tcIncrement. This is for use in...
Michael Gottesman [Tue, 28 May 2013 19:50:20 +0000 (19:50 +0000)]
[APInt] Implement tcDecrement as a counterpart to tcIncrement. This is for use in APFloat IEEE-754R 2008 nextUp/nextDown function.

rdar://13852078

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182801 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: use pristine object file while processing relocations
Tim Northover [Tue, 28 May 2013 19:48:19 +0000 (19:48 +0000)]
ARM: use pristine object file while processing relocations

Previously we would read-modify-write the target bits when processing
relocations for the MCJIT. This had the problem that when relocations
were processed multiple times for the same object file (as they can
be), the result is not idempotent and the values became corrupted.

The solution to this is to take any bits used in the destination from
the pristine object file as LLVM emitted it.

This should fix PR16013 and remote MCJIT on ARM ELF targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182800 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLTO+Debug Info: correctly emit inlined_subroutine when the inlined callee is
Manman Ren [Tue, 28 May 2013 19:01:58 +0000 (19:01 +0000)]
LTO+Debug Info: correctly emit inlined_subroutine when the inlined callee is
from a different CU.

We used to print out an error message and fail to generate inlined_subroutine.

If we use ref_addr in the generated DWARF, the DWARF version should be 3 or
above.
rdar://13926659

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182791 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHexagon: Typo fix.
Jyotsna Verma [Tue, 28 May 2013 19:01:45 +0000 (19:01 +0000)]
Hexagon: Typo fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182790 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove the MCRegAliasIterator tables and compute the aliases dynamically.
Chad Rosier [Tue, 28 May 2013 18:08:48 +0000 (18:08 +0000)]
Remove the MCRegAliasIterator tables and compute the aliases dynamically.

The size reduction in the RegDiffLists are rather dramatic.  Here are a few
size differences for MCTargetDesc.o files (before and after) in bytes:
R600 - 36160B - 11184B - 69% reduction
ARM - 28480B - 8368B - 71% reduction
Mips - 816B - 576B - 29% reduction

One side effect of dynamically computing the aliases is that the iterator does
not guarantee that the entries are ordered or that duplicates have been removed.
The documentation implies this is a safe assumption and I found no clients that
requires these attributes (i.e., strict ordering and uniqueness).

My local LNT tester results showed no execution-time failures or significant
compile-time regressions (i.e., beyond what I would consider noise) for -O0g,
-O2 and -O3 runs on x86_64 and i386 configurations.
rdar://12906217

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182783 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify code. No functionality change.
Benjamin Kramer [Tue, 28 May 2013 16:39:36 +0000 (16:39 +0000)]
Simplify code. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182779 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove double semicolons.
Benjamin Kramer [Tue, 28 May 2013 16:31:26 +0000 (16:31 +0000)]
Remove double semicolons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182778 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoExtend RemapInstruction and friends to take an optional new parameter, a ValueMateria...
James Molloy [Tue, 28 May 2013 15:17:05 +0000 (15:17 +0000)]
Extend RemapInstruction and friends to take an optional new parameter, a ValueMaterializer.

Extend LinkModules to pass a ValueMaterializer to RemapInstruction and friends to lazily create Functions for lazily linked globals. This is a big win when linking small modules with large (mostly unused) library modules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182776 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[msan] Fix argument shadow alignment.
Evgeniy Stepanov [Tue, 28 May 2013 13:07:43 +0000 (13:07 +0000)]
[msan] Fix argument shadow alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182771 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTypo
Renato Golin [Tue, 28 May 2013 11:28:37 +0000 (11:28 +0000)]
Typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182766 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[SystemZ] Register compare-and-branch support
Richard Sandiford [Tue, 28 May 2013 10:41:11 +0000 (10:41 +0000)]
[SystemZ] Register compare-and-branch support

This patch adds support for the CRJ and CGRJ instructions.  Support for
the immediate forms will be a separate patch.

The architecture has a large number of comparison instructions.  I think
it's generally better to concentrate on using the "best" comparison
instruction first and foremost, then only use something like CRJ if
CR really was the natual choice of comparison instruction.  The patch
therefore opportunistically converts separate CR and BRC instructions
into a single CRJ while emitting instructions in ISelLowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182764 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLinking ReleaseProcess doc with the world
Renato Golin [Tue, 28 May 2013 10:32:55 +0000 (10:32 +0000)]
Linking ReleaseProcess doc with the world

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182763 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[SystemZ] Tweak SystemZInstrInfo::isBranch() interface
Richard Sandiford [Tue, 28 May 2013 10:13:54 +0000 (10:13 +0000)]
[SystemZ] Tweak SystemZInstrInfo::isBranch() interface

This is needed for the upcoming compare-and-branch patch.  No functional
change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182762 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r182715 and r182758
Alexey Samsonov [Tue, 28 May 2013 10:08:08 +0000 (10:08 +0000)]
Revert r182715 and r182758

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182761 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdding ReleaseProcess doc
Renato Golin [Tue, 28 May 2013 09:48:52 +0000 (09:48 +0000)]
Adding ReleaseProcess doc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182759 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixup for r182715: provide correct arg to --gtest-filter
Alexey Samsonov [Tue, 28 May 2013 09:40:42 +0000 (09:40 +0000)]
Fixup for r182715: provide correct arg to --gtest-filter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182758 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake BasicAliasAnalysis recognize the fact a noalias argument cannot alias another...
Michael Kuperstein [Tue, 28 May 2013 08:17:48 +0000 (08:17 +0000)]
Make BasicAliasAnalysis recognize the fact a noalias argument cannot alias another argument, even if the other argument is not itself marked noalias.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182755 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake it explicit that GlobalAlias are ok in llvm.used.
Rafael Espindola [Mon, 27 May 2013 22:47:09 +0000 (22:47 +0000)]
Make it explicit that GlobalAlias are ok in llvm.used.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182747 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake helper functions static.
Rafael Espindola [Mon, 27 May 2013 22:34:59 +0000 (22:34 +0000)]
Make helper functions static.

And remove header and cpp file that are empty after that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182746 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConvert sqrt functions into sqrt instructions when -ffast-math is in effect.
Preston Gurd [Mon, 27 May 2013 15:44:35 +0000 (15:44 +0000)]
Convert sqrt functions into sqrt instructions when -ffast-math is in effect.

When -ffast-math is in effect (on Linux, at least), clang defines
__FINITE_MATH_ONLY__ > 0 when including <math.h>. This causes the
preprocessor to include <bits/math-finite.h>, which renames the sqrt functions.
For instance, "sqrt" is renamed as "__sqrt_finite".

This patch adds the 3 new names in such a way that they will be treated
as equivalent to their respective original names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182739 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a cpu to try to bring back the atom bots.
Rafael Espindola [Mon, 27 May 2013 13:22:52 +0000 (13:22 +0000)]
Add a cpu to try to bring back the atom bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182734 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPPC: Add a isConsecutiveLS utility function
Hal Finkel [Mon, 27 May 2013 02:06:39 +0000 (02:06 +0000)]
PPC: Add a isConsecutiveLS utility function

isConsecutiveLS is a slightly more general form of
SelectionDAG::isConsecutiveLoad. Aside from also handling stores, it also does
not assume equality of the chain operands is necessary. In the case of the PPC
backend, this chain condition is checked in a more general way by the
surrounding code.

Mostly, this part of the refactoring in preparation for supporting optimized
unaligned stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182723 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm-objdump.cpp: Appease MSC16 x64. utostr(n++) causes internal compiler error.
NAKAMURA Takumi [Mon, 27 May 2013 00:02:48 +0000 (00:02 +0000)]
llvm-objdump.cpp: Appease MSC16 x64. utostr(n++) causes internal compiler error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182722 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPrefer to duplicate PPC Altivec loads when expanding unaligned loads
Hal Finkel [Sun, 26 May 2013 18:08:30 +0000 (18:08 +0000)]
Prefer to duplicate PPC Altivec loads when expanding unaligned loads

When expanding unaligned Altivec loads, we use the decremented offset trick to
prevent page faults. Unfortunately, if we have a sequence of consecutive
unaligned loads, this leads to suboptimal code generation because the 'extra'
load from the first unaligned load can be combined with the base load from the
second (but only if the decremented offset trick is not used for the first).
Search up and down the chain, through loads and token factors, looking for
consecutive loads, and if one is found, don't use the offset reduction trick.
These duplicate loads are later combined to yield the desired sequence (in the
future, we might want a more-powerful chain search, but that will require some
changes to allow the combiner routines to access the AA object).

This should complete the initial implementation of the optimized unaligned
Altivec load expansion. There is some refactoring that should be done, but
that will happen when the unaligned store expansion is added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182719 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd LDC compiler to list of external OS projects using LLVM 3.3
Kai Nacke [Sun, 26 May 2013 17:37:43 +0000 (17:37 +0000)]
Add LDC compiler to list of external OS projects using LLVM 3.3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182718 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix PR16143: Insert DEBUG_VALUE before terminator.
Andrew Trick [Sun, 26 May 2013 08:58:50 +0000 (08:58 +0000)]
Fix PR16143: Insert DEBUG_VALUE before terminator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182717 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed bug when tests in executable partially used absolute paths.
Galina Kistanova [Sun, 26 May 2013 03:58:41 +0000 (03:58 +0000)]
Fixed bug when tests in executable partially used absolute paths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182715 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDisable the StringMapEntry copy constructor, to make sure we
Chris Lattner [Sat, 25 May 2013 22:28:22 +0000 (22:28 +0000)]
Disable the StringMapEntry copy constructor, to make sure we
reject things like: "for (auto Entry : SomeStringMap)".  Previously
this would copy the value but not the tail allocated string data
(the key).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182713 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for DWARF line number table entries for values in the instruction
Cameron Zwarich [Sat, 25 May 2013 21:56:53 +0000 (21:56 +0000)]
Add support for DWARF line number table entries for values in the instruction
stream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182712 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd some comments to the stringify function.
Eric Christopher [Sat, 25 May 2013 05:13:17 +0000 (05:13 +0000)]
Add some comments to the stringify function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182710 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPPC: Combine duplicate (offset) lvsl Altivec intrinsics
Hal Finkel [Sat, 25 May 2013 04:05:05 +0000 (04:05 +0000)]
PPC: Combine duplicate (offset) lvsl Altivec intrinsics

The lvsl permutation control instruction is a function only of the alignment of
the pointer operand (relative to the 16-byte natural alignment of Altivec
vectors). As a result, multiple lvsl intrinsics where the operands differ by a
multiple of 16 can be combined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182708 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTrack IR ordering of SelectionDAG nodes 4/4.
Andrew Trick [Sat, 25 May 2013 03:26:51 +0000 (03:26 +0000)]
Track IR ordering of SelectionDAG nodes 4/4.

Unit test cases for -pre-RA-sched=source.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182706 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTrack IR ordering of SelectionDAG nodes 3/4.
Andrew Trick [Sat, 25 May 2013 03:08:10 +0000 (03:08 +0000)]
Track IR ordering of SelectionDAG nodes 3/4.

Remove the old IR ordering mechanism and switch to new one.  Fix unit
test failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182704 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTrack IR ordering of SelectionDAG nodes 2/4.
Andrew Trick [Sat, 25 May 2013 02:42:55 +0000 (02:42 +0000)]
Track IR ordering of SelectionDAG nodes 2/4.

Change SelectionDAG::getXXXNode() interfaces as well as call sites of
these functions to pass in SDLoc instead of DebugLoc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182703 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTrack IR ordering of SelectionDAG nodes 1/4.
Andrew Trick [Sat, 25 May 2013 02:20:36 +0000 (02:20 +0000)]
Track IR ordering of SelectionDAG nodes 1/4.

Use a field in the SelectionDAGNode object to track its IR ordering.
This adds fields and utility classes without changing existing
interfaces or functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182701 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix RecyclingAllocator::PrintStats to print the underlying allocator's stats.
Andrew Trick [Sat, 25 May 2013 01:47:42 +0000 (01:47 +0000)]
Fix RecyclingAllocator::PrintStats to print the underlying allocator's stats.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182700 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd to testsuite.
Eric Christopher [Fri, 24 May 2013 23:20:16 +0000 (23:20 +0000)]
Add to testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182693 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoArrayRef-ize MD5 and clean up a few variable names.
Eric Christopher [Fri, 24 May 2013 23:08:17 +0000 (23:08 +0000)]
ArrayRef-ize MD5 and clean up a few variable names.
Add a stringize method to make dumping a bit easier, and add a testcase
exercising a few different paths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182692 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPPC: Initial support for permutation-based unaligned Altivec loads
Hal Finkel [Fri, 24 May 2013 23:00:14 +0000 (23:00 +0000)]
PPC: Initial support for permutation-based unaligned Altivec loads

Altivec only directly supports aligned loads, but the loads have a strange
property: If given an unaligned address, they truncate the address to the next
lower aligned address, and load from there.  This property, along with an extra
load and some special-purpose permutation-control instructions that generate
the appropriate permutations from the original unaligned address, allow
efficient lowering of aligned loads. This code uses the trick explained in the
Apple Velocity Engine optimization overview document to prevent the needed
extra load from possibly causing a page fault if the original address happens
to be aligned.

As noted in the FIXMEs, there are several additional optimizations that can be
performed to reduce the cost of these loads even more. These will be
implemented in future commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182691 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Support] Remove Count{Leading,Trailing}Zeros_{32,64}.
Michael J. Spencer [Fri, 24 May 2013 22:58:37 +0000 (22:58 +0000)]
[Support] Remove Count{Leading,Trailing}Zeros_{32,64}.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182690 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTidy up. Whitespace.
Jim Grosbach [Fri, 24 May 2013 22:53:06 +0000 (22:53 +0000)]
Tidy up. Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182689 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFollow up of the introduction of MCSymbolizer.
Quentin Colombet [Fri, 24 May 2013 22:51:52 +0000 (22:51 +0000)]
Follow up of the introduction of MCSymbolizer.
- Ressurect old MCDisassemble API to soften transition.
- Extend MCTargetDesc to set target specific symbolizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182688 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang formatted APFloat.h
Michael Gottesman [Fri, 24 May 2013 22:40:37 +0000 (22:40 +0000)]
clang formatted APFloat.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182686 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang-formatted APInt.h
Michael Gottesman [Fri, 24 May 2013 22:38:49 +0000 (22:38 +0000)]
clang-formatted APInt.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182685 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMathExtras: Return the result of find(First|Last)Set in the input type.
Benjamin Kramer [Fri, 24 May 2013 22:25:20 +0000 (22:25 +0000)]
MathExtras: Return the result of find(First|Last)Set in the input type.

Otherwise ZB_Max returns a wrong result when sizeof(T) > sizeof(size_t).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182684 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReplace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.
Michael J. Spencer [Fri, 24 May 2013 22:23:49 +0000 (22:23 +0000)]
Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182680 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Support][MathExtras] Fix literal type issues.
Michael J. Spencer [Fri, 24 May 2013 22:19:05 +0000 (22:19 +0000)]
[Support][MathExtras] Fix literal type issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182679 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd missing header for atexit.
Michael J. Spencer [Fri, 24 May 2013 20:54:11 +0000 (20:54 +0000)]
Add missing header for atexit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182672 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Support][MathExtras] Add missing include and disable _BitScan{Forward,Reverse}64...
Michael J. Spencer [Fri, 24 May 2013 20:51:59 +0000 (20:51 +0000)]
[Support][MathExtras] Add missing include and disable _BitScan{Forward,Reverse}64 on non x64 MSVC systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182671 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[objc-arc] KnownSafe does not imply that it is safe to perform code motion across...
Michael Gottesman [Fri, 24 May 2013 20:44:05 +0000 (20:44 +0000)]
[objc-arc] KnownSafe does not imply that it is safe to perform code motion across CFG edges since even if it is safe to remove RR pairs, we may still be able to move a retain/release into a loop.

rdar://13949644

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182670 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[objc-arc] Make sure that multiple owners is propogated correctly through the pass...
Michael Gottesman [Fri, 24 May 2013 20:44:02 +0000 (20:44 +0000)]
[objc-arc] Make sure that multiple owners is propogated correctly through the pass via the usage of a global data structure.

rdar://13750319

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182669 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Support] Add type generic bit utilities to MathExtras.h
Michael J. Spencer [Fri, 24 May 2013 20:29:47 +0000 (20:29 +0000)]
[Support] Add type generic bit utilities to MathExtras.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182667 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don...
Benjamin Kramer [Fri, 24 May 2013 18:05:35 +0000 (18:05 +0000)]
LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases.

Fixes PR16139.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182656 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDo not reserve space for the ColdEdges and NormalEdges vectors.
Diego Novillo [Fri, 24 May 2013 17:00:22 +0000 (17:00 +0000)]
Do not reserve space for the ColdEdges and NormalEdges vectors.
Discussion and rationale at
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130520/175698.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182653 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[SystemZ] Improve AsmParser handling of invalid instructions
Richard Sandiford [Fri, 24 May 2013 14:26:46 +0000 (14:26 +0000)]
[SystemZ] Improve AsmParser handling of invalid instructions

Previously, an invalid instruction like:

foo     %r1, %r0

would generate the rather odd error message:

....: error: unknown token in expression
foo     %r1, %r0
^

We now get the more informative:

....: error: invalid instruction
foo     %r1, %r0
^

The same would happen if an address were used where a register was expected.
We now get "invalid operand for instruction" instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182644 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[SystemZ] Improve AsmParser register parsing
Richard Sandiford [Fri, 24 May 2013 14:14:38 +0000 (14:14 +0000)]
[SystemZ] Improve AsmParser register parsing

The idea is to make sure that:

(1) "register expected" is restricted to cases where ParseRegister()
    is called and the token obviously isn't a register.

(2) "invalid register" is restricted to cases where a register-like "%..."
    sequence is found, but the "..." makes no sense.

(3) the generic "invalid operand for instruction" is used in cases where
    the wrong register type is used (GPR instead of FPR, etc.).

(4) the new "invalid register pair" is used if the register has the right type,
    but is not a valid register pair.

Testing of (1)-(3) is now restricted to regs-bad.s.  It uses a representative
instruction for each register class to make sure that only registers from
that class are accepted.

(4) is tested by both regs-bad.s (which checks all invalid register pairs)
and insn-bad.s (which tests one invalid pair for each instruction that
requires a pair).

While there, I changed "Number" to "Num" for consistency with the
operand class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182643 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRun clang-format over the scalarizePHI function.
Joey Gouly [Fri, 24 May 2013 12:33:28 +0000 (12:33 +0000)]
Run clang-format over the scalarizePHI function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182640 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoscalarizePHI needs to insert the next ExtractElement in the same block
Joey Gouly [Fri, 24 May 2013 12:29:54 +0000 (12:29 +0000)]
scalarizePHI needs to insert the next ExtractElement in the same block
as the BinaryOperator, *not* in the block where the IRBuilder is currently
inserting into. Fixes a bug where scalarizePHI would create instructions
that would not dominate all uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182639 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a new function attribute 'cold' to functions.
Diego Novillo [Fri, 24 May 2013 12:26:52 +0000 (12:26 +0000)]
Add a new function attribute 'cold' to functions.

Other than recognizing the attribute, the patch does little else.
It changes the branch probability analyzer so that edges into
blocks postdominated by a cold function are given low weight.

Added analysis and code generation tests.  Added documentation for the
new attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182638 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove the Copied parameter from MemoryObject::readBytes.
Benjamin Kramer [Fri, 24 May 2013 10:54:58 +0000 (10:54 +0000)]
Remove the Copied parameter from MemoryObject::readBytes.

There was exactly one caller using this API right, the others were relying on
specific behavior of the default implementation. Since it's too hard to use it
right just remove it and standardize on the default behavior.

Defines away PR16132.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182636 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix unused warning in opt builds.
Daniel Jasper [Fri, 24 May 2013 06:26:18 +0000 (06:26 +0000)]
Fix unused warning in opt builds.

In these builds, the asserts() are completely compiled out of the code
leaving "End" unused. Directly accessing it, should not have a
performance impact, as it is just a data member.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182634 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMC: Disassembled CFG reconstruction.
Ahmed Bougacha [Fri, 24 May 2013 01:07:04 +0000 (01:07 +0000)]
MC: Disassembled CFG reconstruction.

This patch builds on some existing code to do CFG reconstruction from
a disassembled binary:
- MCModule represents the binary, and has a list of MCAtoms.
- MCAtom represents either disassembled instructions (MCTextAtom), or
  contiguous data (MCDataAtom), and covers a specific range of addresses.
- MCBasicBlock and MCFunction form the reconstructed CFG. An MCBB is
  backed by an MCTextAtom, and has the usual successors/predecessors.
- MCObjectDisassembler creates a module from an ObjectFile using a
  disassembler. It first builds an atom for each section. It can also
  construct the CFG, and this splits the text atoms into basic blocks.

MCModule and MCAtom were only sketched out; MCFunction and MCBB were
implemented under the experimental "-cfg" llvm-objdump -macho option.
This cleans them up for further use; llvm-objdump -d -cfg now generates
graphviz files for each function found in the binary.

In the future, MCObjectDisassembler may be the right place to do
"intelligent" disassembly: for example, handling constant islands is just
a matter of splitting the atom, using information that may be available
in the ObjectFile. Also, better initial atom formation than just using
sections is possible using symbols (and things like Mach-O's
function_starts load command).

This brings two minor regressions in llvm-objdump -macho -cfg:
- The printing of a relocation's referenced symbol.
- An annotation on loop BBs, i.e., which are their own successor.

Relocation printing is replaced by the MCSymbolizer; the basic CFG
annotation will be superseded by more related functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182628 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd MCSymbolizer for symbolic/annotated disassembly.
Ahmed Bougacha [Fri, 24 May 2013 00:39:57 +0000 (00:39 +0000)]
Add MCSymbolizer for symbolic/annotated disassembly.

This is a basic first step towards symbolization of disassembled
instructions. This used to be done using externally provided (C API)
callbacks. This patch introduces:
- the MCSymbolizer class, that mimics the same functions that were used
  in the X86 and ARM disassemblers to symbolize immediate operands and
  to annotate loads based off PC (for things like c string literals).
- the MCExternalSymbolizer class, which implements the old C API.
- the MCRelocationInfo class, which provides a way for targets to
  translate relocations (either object::RelocationRef, or disassembler
  C API VariantKinds) to MCExprs.
- the MCObjectSymbolizer class, which does symbolization using what it
  finds in an object::ObjectFile. This makes simple symbolization (with
  no fancy relocation stuff) work for all object formats!
- x86-64 Mach-O and ELF MCRelocationInfos.
- A basic ARM Mach-O MCRelocationInfo, that provides just enough to
  support the C API VariantKinds.

Most of what works in otool (the only user of the old symbolization API
that I know of) for x86-64 symbolic disassembly (-tvV) works, namely:
- symbol references: call _foo; jmp 15 <_foo+50>
- relocations:       call _foo-_bar; call _foo-4
- __cf?string:       leaq 193(%rip), %rax ## literal pool for "hello"
Stub support is the main missing part (because libObject doesn't know,
among other things, about mach-o indirect symbols).

As for the MCSymbolizer API, instead of relying on the disassemblers
to call the tryAdding* methods, maybe this could be done automagically
using InstrInfo? For instance, even though PC-relative LEAs are used
to get the address of string literals in a typical Mach-O file, a MOV
would be used in an ELF file. And right now, the explicit symbolization
only recognizes PC-relative LEAs. InstrInfo should have already have
most of what is needed to know what to symbolize, so this can
definitely be improved.

I'd also like to remove object::RelocationRef::getValueString (it seems
only used by relocation printing in objdump), as simply printing the
created MCExpr is definitely enough (and cleaner than string concats).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182625 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[PowerPC] Remove symbolLo/symbolHi instruction operand types
Ulrich Weigand [Thu, 23 May 2013 22:48:06 +0000 (22:48 +0000)]
[PowerPC] Remove symbolLo/symbolHi instruction operand types

Now that there is no longer any distinction between symbolLo
and symbolHi operands in either printing, encoding, or parsing,
the operand types can be removed in favor of simply using
s16imm.

This completes the patch series to decouple lo/hi operand part
processing from the particular instruction whose operand it is.

No change in code generation expected from this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182618 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRe-implement DebugIR in a way that does not subclass AssemblyWriter:
Daniel Malea [Thu, 23 May 2013 22:34:33 +0000 (22:34 +0000)]
Re-implement DebugIR in a way that does not subclass AssemblyWriter:
- move AsmWriter.h from public headers into lib
- marked all AssemblyWriter functions as non-virtual; no need to override them
- DebugIR now "plugs into" AssemblyWriter with an AssemblyAnnotationWriter helper
- exposed flags to control hiding of a) debug metadata b) debug intrinsic calls

C/R: Paul Redmond

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182617 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[PowerPC] Clean up generation of ha16() / lo16() markers
Ulrich Weigand [Thu, 23 May 2013 22:26:41 +0000 (22:26 +0000)]
[PowerPC] Clean up generation of ha16() / lo16() markers

When targeting the Darwin assembler, we need to generate markers ha16() and
lo16() to designate the high and low parts of a (symbolic) immediate.  This
is necessary not just for plain symbols, but also for certain symbolic
expression, typically along the lines of ha16(A - B).  The latter doesn't
work when simply using VariantKind flags on the symbol reference.
This is why the current back-end uses hacks (explicitly called out as such
via multiple FIXMEs) in the symbolLo/symbolHi print methods.

This patch uses target-defined MCExpr codes to represent the Darwin
ha16/lo16 constructs, following along the lines of the equivalent solution
used by the ARM back end to handle their :upper16: / :lower16: markers.
This allows us to get rid of special handling both in the symbolLo/symbolHi
print method and in the common code MCExpr::print routine.  Instead, the
ha16 / lo16 markers are printed simply in a custom print routine for the
target MCExpr types.  (As a result, the symbolLo/symbolHi print methods
can now replaced by a single printS16ImmOperand routine that also handles
symbolic operands.)

The patch also provides a EvaluateAsRelocatableImpl routine to handle
ha16/lo16 constructs.  This is not actually used at the moment by any
in-tree code, but is provided as it makes merging into David Fang's
out-of-tree Mach-O object writer simpler.

Since there is no longer any need to treat VK_PPC_GAS_HA16 and
VK_PPC_DARWIN_HA16 differently, they are merged into a single
VK_PPC_ADDR16_HA (and likewise for the _LO16 types).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182616 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThe command line options need to be processed before we create the TargetMachine.
Bill Wendling [Thu, 23 May 2013 21:21:50 +0000 (21:21 +0000)]
The command line options need to be processed before we create the TargetMachine.

Move the processing of the command line options to right before we create the
TargetMachine instead of after.
<rdar://problem/13468287>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182611 91177308-0d34-0410-b5e6-96231b3b80d8