Michael Gottesman [Sat, 6 Jul 2013 18:43:05 +0000 (18:43 +0000)]
[objc-arc] When we initialize ARCRuntimeEntryPoints, make sure we reset all references to entrypoint declarations as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185764
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Sat, 6 Jul 2013 18:08:19 +0000 (18:08 +0000)]
Proper va_arg/va_copy lowering on win64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185763
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Sat, 6 Jul 2013 17:17:31 +0000 (17:17 +0000)]
Emit personality function and Dwarf EH data for Win64 SEH.
Obviously the personality function should be emitted as language handler
instead of the hard coded _GCC_specific_handler. The language specific
data must be placed after the unwind information therefore it must not
be emitted into a separate section.
Reviewed by Charles Davis and Nico Rieck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185761
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Sat, 6 Jul 2013 17:16:50 +0000 (17:16 +0000)]
Fix alignment of unwind data.
For alignment purposes, the instruction array will always have an even
number of entries, with the final entry potentially unused (in which
case the array will be one longer than indicated by the count of unwind
codes field).
Reviewed by Charles Davis and Nico Rieck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185760
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Sat, 6 Jul 2013 17:16:12 +0000 (17:16 +0000)]
Generate IMAGE_REL_AMD64_ADDR32NB relocations for SEH
data structures.
The Win64 EH data structures must be of type IMAGE_REL_AMD64_ADDR32NB
instead of IMAGE_REL_AMD64_ADDR32. This is easiely achieved by adding
the VK_COFF_IMGREL32 modifier to the symbol reference.
Change also references to start and end of the SEH range of a function
as offsets to start of the function.
Reviewed by Charles Davis and Nico Rieck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185759
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Sat, 6 Jul 2013 17:15:36 +0000 (17:15 +0000)]
Fix wrong code offset for unwind code SET_FPREG.
The code offset for unwind code SET_FPREG is wrong because it is set
to constant 0. The fix is to do the same as for the other unwind
codes: emit a label and later the absolute difference between the
label and the begin of the prologue.
Also enables the failing test case MC/COFF/seh.s
Reviewed by Charles Davis and Nico Rieck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185758
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 6 Jul 2013 15:10:13 +0000 (15:10 +0000)]
Reassociate: Remove unnecessary default operator=.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185757
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 6 Jul 2013 14:05:09 +0000 (14:05 +0000)]
DAGCombiner: Don't drop extension behavior when shrinking a load when unsafe.
ReduceLoadWidth unconditionally drops extensions from loads. Limit it to the
case when all of the bits the extension would otherwise produce are dropped by
the shrink. It would be possible to shrink the load in more cases by merging
the extensions, but this isn't trivial and a very rare case. I left a TODO for
that case.
Fixes PR16551.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185755
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Sat, 6 Jul 2013 12:58:45 +0000 (12:58 +0000)]
Stop putting operations after a tail call.
This prevents the emission of DAG-generated vreg definitions after a
tail call be dropping them entirely (on the grounds that nothing could
use them anyway, and they interfere with O0 CodeGen).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185754
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Sat, 6 Jul 2013 12:13:10 +0000 (12:13 +0000)]
MC: Implement COFF .linkonce directive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185753
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 02:39:51 +0000 (02:39 +0000)]
[llvm-ar] Added llvm_unreachable to quiet -Wreturn-type warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185751
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 6 Jul 2013 02:24:59 +0000 (02:24 +0000)]
isKnownToBeAPowerOfTwo: Fix a typo in a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185748
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 02:18:56 +0000 (02:18 +0000)]
[objc-arc] Performed some small cleanups in ARCRuntimeEntryPoints and added an llvm_unreachable after the switch to quiet -Wreturn_type errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185746
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 01:57:32 +0000 (01:57 +0000)]
[objc-arc] Renamed Module => TheModule in ARCRuntimeEntryPoints. Also did some small cleanups.
This fixes an issue that came up due to -fpermissive on the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185744
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 01:41:35 +0000 (01:41 +0000)]
Removed trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185743
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 01:39:26 +0000 (01:39 +0000)]
[objc-arc] Updated ObjCARCContract to use ARCRuntimeEntryPoints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185742
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 01:39:23 +0000 (01:39 +0000)]
[objc-arc] Updated ObjCARCOpts to use ARCRuntimeEntryPoints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185741
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 6 Jul 2013 01:39:18 +0000 (01:39 +0000)]
[objc-arc] Refactor runtime entrypoint declaration entrypoint creation.
This is the first patch in a series of 3 patches which clean up how we create
runtime function declarations in the ARC optimizer when they do not exist
already in the IR.
Currently we have a bunch of duplicated code in ObjCARCOpts, ObjCARCContract
that does this. This patch refactors that code into a separate class called
ARCRuntimeEntryPoints which lazily creates the declarations for said
entrypoints.
The next two patches will consist of the work of refactoring
ObjCARCContract/ObjCARCOpts to use this new code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185740
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 6 Jul 2013 01:04:47 +0000 (01:04 +0000)]
Fix language.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185739
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 6 Jul 2013 00:59:28 +0000 (00:59 +0000)]
Fix annotation of unlink. Should fix builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185738
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 6 Jul 2013 00:54:07 +0000 (00:54 +0000)]
InstCombine: typo in or_icmp_eq_B_0_icmp_ult_A_B test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185737
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 6 Jul 2013 00:29:58 +0000 (00:29 +0000)]
Extend 'readonly' and 'readnone' to work on function arguments as well as
functions. Make the function attributes pass add it to known library functions
and when it can deduce it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185735
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 5 Jul 2013 23:48:07 +0000 (23:48 +0000)]
Use modern API to avoid exposing LiveInterval internals.
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185733
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 5 Jul 2013 23:04:55 +0000 (23:04 +0000)]
Remove dead function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185731
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 22:32:33 +0000 (22:32 +0000)]
Fix windows build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185730
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Fri, 5 Jul 2013 22:24:06 +0000 (22:24 +0000)]
[TRE] Combined another test into basic.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185729
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 21:19:35 +0000 (21:19 +0000)]
Remove unique_file now that it is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185728
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 21:01:08 +0000 (21:01 +0000)]
Add a createUniqueFile function and switch llvm's users of unique_file.
This function is complementary to createTemporaryFile. It handles the case were
the unique file is *not* temporary: we will rename it in the end. Since we
will rename it, the file has to be in the same filesystem as the final
destination and we don't prepend the system temporary directory.
This has a small semantic difference from unique_file: the default mode is 0666.
This matches the behavior of most unix tools. For example, with this change
lld now produces files with the same permissions as ld. I will add a test
of this change when I port clang over to createUniqueFile (next commit).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185726
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Fri, 5 Jul 2013 20:45:13 +0000 (20:45 +0000)]
[TRE] Merged several tests into the the test basic.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185723
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 20:14:52 +0000 (20:14 +0000)]
Use sys::fs::createTemporaryFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185719
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 19:56:49 +0000 (19:56 +0000)]
Add a higher level createTemporaryFile function.
This function is inspired by clang's Driver::GetTemporaryPath. It hides the
pattern used for uniquing and requires simple file names that are always
placed in the system temporary directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185716
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Fri, 5 Jul 2013 18:57:49 +0000 (18:57 +0000)]
ARM: Add a pack pattern for matching arithmetic shift right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185714
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Fri, 5 Jul 2013 18:28:39 +0000 (18:28 +0000)]
ARM: Fix incorrect pack pattern
A "pkhtb x, x, y asr #num" uses the lower 16 bits of "y asr #num" and packs them
in the bottom half of "x". An arithmetic and logic shift are only equivalent in
this context if the shift amount is 16. We would be shifting in ones into the
bottom 16bits instead of zeros if "y" is negative.
radar://
14338767
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185712
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Fri, 5 Jul 2013 15:58:12 +0000 (15:58 +0000)]
Remove a useless declarations (found by scan-build)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185709
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Fri, 5 Jul 2013 14:38:48 +0000 (14:38 +0000)]
[SystemZ] Remove no-op MVCs
The stack coloring pass has code to delete stores and loads that become
trivially dead after coloring. Extend it to cope with single instructions
that copy from one frame index to another.
The testcase happens to show an example of this kicking in at the moment.
It did occur in Real Code too though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185705
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Fri, 5 Jul 2013 14:31:24 +0000 (14:31 +0000)]
[SystemZ] Remove redundant frame MMOs
This fixes foldMemoryOperandImpl() so that it doesn't create duplicated
frame MMOs. I hadn't realized when writing r185434 that it was the caller's
responsibility to add these.
No behavioural change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185704
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Fri, 5 Jul 2013 14:24:47 +0000 (14:24 +0000)]
Fix double renaming bug in stack coloring pass
The stack coloring pass renumbered frame indexes with a loop of the form:
for each frame index FI
for each instruction I that uses FI
for each use of FI in I
rename FI to FI'
This caused problems if an instruction used two frame indexes F0 and F1
and if F0 was renamed to F1 and F1 to F2. The first time we visited the
instruction we changed F0 to F1, then we changed both F1s to F2.
In other words, the problem was that SSRefs recorded which instructions
used an FI, but not which MachineOperands and MachineMemOperands within
that instruction used it.
This is easily fixed for MachineOperands by walking the instructions
once and processing each operand in turn. There's already a loop to
do that for dead store elimination, so it seemed more efficient to
fuse the two at the block level.
MachineMemOperands are more tricky because they can be shared between
instructions. The patch handles them by making SSRefs an array of
MachineMemOperands rather than an array of MachineInstrs. We might end
up processing the same MachineMemOperand twice, but that's OK because
we always know from the SSRefs index what the original frame index was.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185703
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Fri, 5 Jul 2013 14:02:01 +0000 (14:02 +0000)]
[SystemZ] Enable the use of MVC for frame-to-frame spills
...now that the problem that prompted the restriction has been fixed.
The original spill-02.py was a compromise because at the time I couldn't
find an example that actually failed without the two scavenging slots.
The version included here did.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185701
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Fri, 5 Jul 2013 13:49:46 +0000 (13:49 +0000)]
[PowerPC] Add some special @got@tprel fixup cases
When a target@got@tprel or target@got@tprel@l symbol variant is used in
a fixup_ppc_half16 (*not* fixup_ppc_half16ds) context, we currently fail,
since the corresponding R_PPC64_GOT_TPREL16 / R_PPC64_GOT_TPREL16_LO
relocation types do not exist.
However, since such symbol variants resolve to GOT offsets which are
always 4-aligned, we can simply instead use the _DS variants of the
relocation types, which *do* exist.
The same applies for the @got@dtprel variants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185700
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Fri, 5 Jul 2013 13:11:52 +0000 (13:11 +0000)]
[SystemZ] Allocate a second register scavenging slot
This is another prerequisite for frame-to-frame MVC copies.
I'll commit the patch that makes use of the slot separately.
The downside of trying to test many corner cases with each of the
available addressing modes is that a fair few tests need to account
for the new frame layout. I do still think it's useful to have all
these tests though, since it's something that wouldn't get much coverage
otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185698
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 13:03:07 +0000 (13:03 +0000)]
Don't create an archive if, for example, we are asked to print the index.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185697
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Fri, 5 Jul 2013 12:55:00 +0000 (12:55 +0000)]
[SystemZ] Clean up register scavenging code
SystemZ wants normal register scavenging slots, as close to the stack or
frame pointer as possible. The only reason it was using custom code was
because PrologEpilogInserter assumed an x86-like layout, where the frame
pointer is at the opposite end of the frame from the stack pointer.
This meant that when frame pointer elimination was disabled,
the slots ended up being as close as possible to the incoming
stack pointer, which is the opposite of what we want on SystemZ.
This patch adds a new knob to say which layout is used and converts
SystemZ to use target-independent scavenging slots. It's one of the pieces
needed to support frame-to-frame MVCs, where two slots might be required.
The ABI requires us to allocate 160 bytes for calls, so one approach
would be to use that area as temporary spill space instead. It would need
some surgery to make sure that the slot isn't live across a call though.
I stuck to the "isFPCloseToIncomingSP - ..." style comment on the
"do what the surrounding code does" principle. The FP case is already
covered by several Systemz/frame-* tests, which fail without the
PrologueEpilogueInserter change, so no new ones are needed.
No behavioural change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185696
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 12:44:49 +0000 (12:44 +0000)]
Use simpler version of exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185695
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Fri, 5 Jul 2013 12:33:03 +0000 (12:33 +0000)]
[PowerPC] Make test case buildable with GNU as
The ppc64-fixups.s test currently fails to build with GNU as, since it
does not support plain symbols as arguments to li/lis. Rewrite the test
for R_PPC64_ADDR16 and R_PPC64_REL16 to use lwz instead.
Allowing the test case to be built with both LLVM and GNU as makes it
easier to spot unwanted difference in the output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185694
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Fri, 5 Jul 2013 12:22:36 +0000 (12:22 +0000)]
[PowerPC] Support @tls in the asm parser
This adds support for the last missing construct to parse TLS-related
assembler code:
add 3, 4, symbol@tls
The ADD8TLS currently hard-codes the @tls into the assembler string.
This cannot be handled by the asm parser, since @tls is parsed as
a symbol variant. This patch changes ADD8TLS to have the @tls suffix
printed as symbol variant on output too, which allows us to remove
the isCodeGenOnly marker from ADD8TLS. This in turn means that we
can add a AsmOperand to accept @tls marked symbols on input.
As a side effect, this means that the fixup_ppc_tlsreg fixup type
is no longer necessary and can be merged into fixup_ppc_nofixup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185692
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 12:12:43 +0000 (12:12 +0000)]
Remove NoOperation.
parseCommandLine prints and error and exists if no operation is specified, so
it never returns NoOperation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185691
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 5 Jul 2013 10:20:57 +0000 (10:20 +0000)]
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185689
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Fri, 5 Jul 2013 10:19:40 +0000 (10:19 +0000)]
PR16490: fix a crash in ARMDAGToDAGISel::SelectInlineAsm.
In the SelectionDAG immediate operands to inline asm are constructed as
two separate operands. The first is a constant of value InlineAsm::Kind_Imm
and the second is a constant with the value of the immediate.
In ARMDAGToDAGISel::SelectInlineAsm, if we reach an operand of Kind_Imm we
should skip over the next operand too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185688
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 04:19:32 +0000 (04:19 +0000)]
Don't treat bitcode files specially in llvm-ar.
We really want bitcode files to behave as regular object files in archives, so
we don't need to track that a member is bitcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185681
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 03:35:15 +0000 (03:35 +0000)]
Use the raw member names in Archive::Archive.
This a bit more efficient and avoids having a function that uses the string
table being called by a function that searches for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185680
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 02:50:03 +0000 (02:50 +0000)]
Add a --crash option to not.
Now the two possible uses of not are
* not cmd
Will return true if cmd doesn't crash and returns false.
* not --crash cmd
Will return true if cmd crashes.
It will be used/tested in a followup commit for the clang crash recovery
testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185678
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 5 Jul 2013 00:31:17 +0000 (00:31 +0000)]
InstCombine: (icmp eq B, 0) | (icmp ult A, B) -> (icmp ule A, B-1)
This transform allows us to turn IR that looks like:
%1 = icmp eq i64 %b, 0
%2 = icmp ult i64 %a, %b
%3 = or i1 %1, %2
ret i1 %3
into:
%0 = add i64 %b, -1
%1 = icmp uge i64 %0, %a
ret i1 %1
which means we go from lowering:
cmpq %rsi, %rdi
setb %cl
testq %rsi, %rsi
sete %al
orb %cl, %al
ret
to lowering:
decq %rsi
cmpq %rdi, %rsi
setae %al
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185677
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Thu, 4 Jul 2013 23:20:12 +0000 (23:20 +0000)]
Remove use of asymmetric std::lower_bound comparator.
VS 2008 doesn't like it when in debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185676
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 4 Jul 2013 23:15:18 +0000 (23:15 +0000)]
DebugInfo: Consider global variables without locations to be valid
We were being a bit too aggresive here in classifying global variables
with no global reference or constant value to be invalid - this would
cause LLVM to not emit the DWARF description of the global variable if
it had been optimized away, which isn't helpful for users who might
benefit from the global variable's description even if there's no
location information.
This also fixes a crasher issue here that I was unable to reduce a test
case for - involving a using decl (& subsequent
DW_TAG_imported_declaration ) of such a global variable that, once
optimized away, would crash when an attempt to emit the imported
declaration was made.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185675
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 22:15:33 +0000 (22:15 +0000)]
Use a OwningPtr instead of a manual delete.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185673
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Thu, 4 Jul 2013 21:37:26 +0000 (21:37 +0000)]
Initialize object file info before output streamer
r179494 switched to using the object file info to retrieve the default text
section for some MC streamers. It is possible that initializing an MC
streamer can request sections before the object file info is initialized
when the AutoInitSections flag is set on the streamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185670
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Thu, 4 Jul 2013 21:32:07 +0000 (21:32 +0000)]
MC: Add .section directive to COFF
Supports GAS flags "abdnrswxy". No support for alignment or subsections.
Fixes PR16366.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185669
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 4 Jul 2013 21:17:49 +0000 (21:17 +0000)]
InstCombine: Reimplementation of visitUDivOperand
This transform was originally added in r185257 but later removed in
r185415. The original transform would create instructions speculatively
and then discard them if the speculation was proved incorrect. This has
been replaced with a scheme that splits the transform into two parts:
preflight and fold. While we preflight, we build up fold actions that
inform the folding stage on how to act.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185667
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 19:40:23 +0000 (19:40 +0000)]
Add support for archives with no symbol table or string table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185664
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 19:20:00 +0000 (19:20 +0000)]
Fix leak. Should bring back the valgrind bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185663
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Thu, 4 Jul 2013 18:28:46 +0000 (18:28 +0000)]
[PowerPC] Implement writeNopData
This implements a proper PPCAsmBackend::writeNopData routine
that actually writes PowerPC nop instructions.
This fixes the last remaining difference in object file output
(text section) between the integrated assembler and GNU as
that I've seen anywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185662
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 17:21:01 +0000 (17:21 +0000)]
Add 'not' in front of a command that is expected to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185659
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 4 Jul 2013 17:05:21 +0000 (17:05 +0000)]
Changing long to int for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185656
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Thu, 4 Jul 2013 15:58:38 +0000 (15:58 +0000)]
Remove an unneeded call to 'UpdateThumbVFPPredicate', spotted by Amaury.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185651
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Thu, 4 Jul 2013 14:57:20 +0000 (14:57 +0000)]
Add support for MC assembling and disassembling of vsel{ge, gt, eq, vs} instructions.
This adds a new decoder table/namespace 'VFPV8', as these instructions have their
top 4 bits as 0b1111, while other Thumb instructions have 0b1110.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185642
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Thu, 4 Jul 2013 14:40:12 +0000 (14:40 +0000)]
[PowerPC] Add all trap mnemonics
This adds support for all basic and extended variants
of the trap instructions to the asm parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185638
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Thu, 4 Jul 2013 14:24:00 +0000 (14:24 +0000)]
[PowerPC] Add asm parser support for CR expressions
This adds support for specifying condition registers and
condition register fields via expressions using the symbols
defined by the PowerISA, like "4*cr2+eq".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185633
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 4 Jul 2013 14:22:02 +0000 (14:22 +0000)]
SimplifyCFG: Teach switch generation some patterns that instcombine forms.
This allows us to create switches even if instcombine has munged two of the
incombing compares into one and some bit twiddling. This was motivated by enum
compares that are common in clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185632
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 4 Jul 2013 14:12:25 +0000 (14:12 +0000)]
Supporting ssize_t on WIN64 with its proper size. Patch thanks to David Cournapeau!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185627
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 4 Jul 2013 13:54:20 +0000 (13:54 +0000)]
Remove the EXCEPTIONADDR, EHSELECTION, and LSDAADDR ISD opcodes.
These exception-related opcodes are not used any longer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185625
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Thu, 4 Jul 2013 10:04:08 +0000 (10:04 +0000)]
Add a V8FP instruction 'vcvt{b,t}' to convert between half and double precision.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185620
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 4 Jul 2013 04:53:49 +0000 (04:53 +0000)]
Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185618
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 4 Jul 2013 04:53:45 +0000 (04:53 +0000)]
Simplify landing pad lowering.
Stop using the ISD::EXCEPTIONADDR and ISD::EHSELECTION when lowering
landing pad arguments. These nodes were previously legalized into
CopyFromReg nodes, but that never worked properly because the
CopyFromReg node weren't guaranteed to be scheduled at the top of the
basic block.
This meant the exception pointer and selector registers could be
clobbered before being copied to a virtual register.
This patch copies the two physical registers to virtual registers at
the beginning of the basic block, and lowers the landingpad instruction
directly to two CopyFromReg nodes reading the *virtual* registers. This
is safe because virtual registers don't get clobbered.
A future patch will remove the ISD::EXCEPTIONADDR and ISD::EHSELECTION
nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185617
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 4 Jul 2013 04:32:39 +0000 (04:32 +0000)]
FastISel can only apend to basic blocks.
Compute the insertion point from the end of the basic block instead of
skipping labels from the front.
This caused failures in landing pads when live-in copies where inserted
before instruction selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185616
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 4 Jul 2013 04:32:35 +0000 (04:32 +0000)]
Live-in copies go *after* EH_LABELs.
This will soon be tested by exception handling working at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185615
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 4 Jul 2013 03:51:53 +0000 (03:51 +0000)]
Tabs to spaces. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185612
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 4 Jul 2013 01:43:17 +0000 (01:43 +0000)]
Add a space between closing template '>' to unbreak build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185607
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 4 Jul 2013 01:31:24 +0000 (01:31 +0000)]
Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185606
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 4 Jul 2013 01:10:38 +0000 (01:10 +0000)]
Reapply r185601 with a fix for the cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185605
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 4 Jul 2013 00:51:26 +0000 (00:51 +0000)]
Temporarily revert 185601 as it caused cmake build regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185603
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 4 Jul 2013 00:47:09 +0000 (00:47 +0000)]
Add support for futimens for platforms that don't support futimes.
Patch by pashev.igor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185601
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 4 Jul 2013 00:26:30 +0000 (00:26 +0000)]
Revert r185595-185596 which broke buildbots.
Revert "Simplify landing pad lowering."
Revert "Remove the EXCEPTIONADDR, EHSELECTION, and LSDAADDR ISD opcodes."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185600
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 3 Jul 2013 23:56:31 +0000 (23:56 +0000)]
Remove the EXCEPTIONADDR, EHSELECTION, and LSDAADDR ISD opcodes.
These exception-related opcodes are not used any longer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185596
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 3 Jul 2013 23:56:24 +0000 (23:56 +0000)]
Simplify landing pad lowering.
Stop using the ISD::EXCEPTIONADDR and ISD::EHSELECTION when lowering
landing pad arguments. These nodes were previously legalized into
CopyFromReg nodes, but that never worked properly because the
CopyFromReg node weren't guaranteed to be scheduled at the top of the
basic block.
This meant the exception pointer and selector registers could be
clobbered before being copied to a virtual register.
This patch copies the two physical registers to virtual registers at
the beginning of the basic block, and lowers the landingpad instruction
directly to two CopyFromReg nodes reading the *virtual* registers. This
is safe because virtual registers don't get clobbered.
A future patch will remove the ISD::EXCEPTIONADDR and ISD::EHSELECTION
nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185595
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 3 Jul 2013 23:56:20 +0000 (23:56 +0000)]
Add MachineBasicBlock::addLiveIn().
This function adds a live-in physical register to an MBB and ensures
that it is copied to a virtual register immediately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185594
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephen Lin [Wed, 3 Jul 2013 23:39:13 +0000 (23:39 +0000)]
Have ARMBaseRegisterInfo::getCallPreservedMask return the 'correct' mask for the GHC calling convention.
This is purely academic because GHC calls are always tail calls so the register mask will never be used; however, this change makes the code clearer and brings the ARM implementation of the GHC calling convention in line with the X86 implementation. Also, it might save someone else some time trying to figuring out what is happening...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185592
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 3 Jul 2013 22:40:21 +0000 (22:40 +0000)]
Hoist all of the Entry.getLoc() calls int a single variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185589
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 3 Jul 2013 22:40:18 +0000 (22:40 +0000)]
Make DotDebugLocEntry a class, reorder the members along with comments
for them and update all uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185588
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Wed, 3 Jul 2013 21:42:57 +0000 (21:42 +0000)]
[ARM] Improve the instruction selection of vector loads.
In the ARM back-end, build_vector nodes are lowered to a target specific
build_vector that uses floating point type.
This works well, unless the inserted bitcasts survive until instruction
selection. In that case, they incur moves between integer unit and floating
point unit that may result in inefficient code.
In other words, this conversion may introduce artificial dependencies when the
code leading to the build vector cannot be completed with a floating point type.
In particular, this happens when loads are not aligned.
Before this patch, in that case, the compiler generates general purpose loads
and creates the floating point vector from them, instead of directly using the
vector unit.
The patch uses a vector friendly sequence of code when the inserted bitcasts to
floating point survived DAGCombine.
This is done by a target specific DAGCombine that changes the target specific
build_vector into a sequence of insert_vector_elt that get rid of the bitcasts.
<rdar://problem/
14170854>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185587
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 3 Jul 2013 21:37:03 +0000 (21:37 +0000)]
Elaborate on comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185586
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 3 Jul 2013 21:23:59 +0000 (21:23 +0000)]
Add names to the header file since they help in documenting the API
(and for consistency).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185585
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 3 Jul 2013 21:03:35 +0000 (21:03 +0000)]
[PowerPC] FreeBSD does not require f128 in its data layout string.
Long double is 64 bits on FreeBSD PPC, so the f128 entry is superfluous.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185583
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Wed, 3 Jul 2013 20:56:33 +0000 (20:56 +0000)]
Add platform specific tests doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185581
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Wed, 3 Jul 2013 20:38:01 +0000 (20:38 +0000)]
ARM: Prevent ARMAsmParser::shouldOmitCCOutOperand() from misidentifying certain Thumb2 add immediate T3 encodings.
Before the fix Thumb2 instructions of type "add rD, rN, #imm" (T3 encoding, see ARM ARM A8.8.4) with rD and rN both being low registers (r0-r7) were classified as having the T4 encoding.
The T4 encoding doesn't have a cc_out operand so for above instructions the operand gets erroneously removed, corrupting the token stream and leading to parse errors later in the process.
This bug prevented "add r1, r7, #0xcbcbcbcb" from being assembled correctly.
Fixes <rdar://problem/
14224440>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185575
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 3 Jul 2013 20:36:36 +0000 (20:36 +0000)]
Move typedefs inside the class that they belong to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185573
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 3 Jul 2013 18:38:08 +0000 (18:38 +0000)]
Use an RWMutex instead of a Mutex in PassRegistry.
Patch by Alex Crichton <alex@crichton.co>. Approved by Chris Lattner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185566
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Wed, 3 Jul 2013 18:29:47 +0000 (18:29 +0000)]
[PowerPC] Support lmw/stmw in the asm parser
This adds support for the load/store multiple instructions,
currently used by the asm parser only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185564
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Wed, 3 Jul 2013 17:59:07 +0000 (17:59 +0000)]
[PowerPC] Use mtocrf when available
Just as with mfocrf, it is also preferable to use mtocrf instead of
mtcrf when only a single CR register is to be written.
Current code however always emits mtcrf. This probably does not matter
when using an external assembler, since the GNU assembler will in fact
automatically replace mtcrf with mtocrf when possible. It does create
inefficient code with the integrated assembler, however.
To fix this, this patch adds MTOCRF/MTOCRF8 instruction patterns and
uses those instead of MTCRF/MTCRF8 everything. Just as done in the
MFOCRF patch committed as 185556, these patterns will be converted
back to MTCRF if MTOCRF is not available on the machine.
As a side effect, this allows to modify the MTCRF pattern to accept
the full range of mask operands for the benefit of the asm parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185561
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Wed, 3 Jul 2013 17:05:42 +0000 (17:05 +0000)]
[PowerPC] Always use mfocrf if available
When accessing just a single CR register, it is always preferable to
use mfocrf instead of mfcr, if the former is available on the CPU.
Current code makes that distinction in many, but not all places
where a single CR register value is retrieved. One missing
location is PPCRegisterInfo::lowerCRSpilling.
To fix this and make this simpler in the future, this patch changes
the bulk of the back-end to always assume mfocrf is available and
simply generate it when needed.
On machines that actually do not support mfocrf, the instruction
is replaced by mfcr at the very end, in EmitInstruction.
This has the additional benefit that we no longer need the
MFCRpseud hack, since before EmitInstruction we always have
a MFOCRF instruction pattern, which already models data flow
as required.
The patch also adds the MFOCRF8 version of the instruction,
which was missing so far.
Except for the PPCRegisterInfo::lowerCRSpilling case, no change
in generated code intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185556
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 3 Jul 2013 16:41:29 +0000 (16:41 +0000)]
Prefix failing commands with not to make clear they are expected to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185554
91177308-0d34-0410-b5e6-
96231b3b80d8