Commit Graph

93673 Commits

Author SHA1 Message Date
Ulrich Weigand
457571ed69 [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
2013-07-05 13:49:46 +00:00
Richard Sandiford
47734db936 [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
2013-07-05 13:11:52 +00:00
Rafael Espindola
61de142984 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
2013-07-05 13:03:07 +00:00
Richard Sandiford
7271ac2c03 [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
2013-07-05 12:55:00 +00:00
Rafael Espindola
ef2703a1fb Use simpler version of exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185695 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 12:44:49 +00:00
Ulrich Weigand
3d4427347e [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
2013-07-05 12:33:03 +00:00
Ulrich Weigand
23a72c8f7e [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
2013-07-05 12:22:36 +00:00
Rafael Espindola
87b8a7f999 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
2013-07-05 12:12:43 +00:00
Benjamin Kramer
b6566aee30 Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185689 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 10:20:57 +00:00
Joey Gouly
00d9fe2de7 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
2013-07-05 10:19:40 +00:00
Rafael Espindola
24663f69cc 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
2013-07-05 04:19:32 +00:00
Rafael Espindola
4a0bf5423c 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
2013-07-05 03:35:15 +00:00
Rafael Espindola
a5db79d514 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
2013-07-05 02:50:03 +00:00
David Majnemer
b1b738e036 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
2013-07-05 00:31:17 +00:00
Ahmed Bougacha
5679d7da01 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
2013-07-04 23:20:12 +00:00
David Blaikie
09bb56f0a0 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
2013-07-04 23:15:18 +00:00
Rafael Espindola
8be527901a 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
2013-07-04 22:15:33 +00:00
Nico Rieck
25746ddd66 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
2013-07-04 21:37:26 +00:00
Nico Rieck
a6d343a688 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
2013-07-04 21:32:07 +00:00
David Majnemer
e7006bb04b 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
2013-07-04 21:17:49 +00:00
Rafael Espindola
6d88f9b73a 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
2013-07-04 19:40:23 +00:00
Rafael Espindola
2c8ce86e7a 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
2013-07-04 19:20:00 +00:00
Ulrich Weigand
972befb3f2 [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
2013-07-04 18:28:46 +00:00
Rafael Espindola
449f64c69c 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
2013-07-04 17:21:01 +00:00
Aaron Ballman
764a3d502e Changing long to int for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185656 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 17:05:21 +00:00
Joey Gouly
1e9ddc229f 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
2013-07-04 15:58:38 +00:00
Joey Gouly
4ea250524f 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
2013-07-04 14:57:20 +00:00
Ulrich Weigand
3c99602ca8 [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
2013-07-04 14:40:12 +00:00
Ulrich Weigand
5606fcae50 [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
2013-07-04 14:24:00 +00:00
Benjamin Kramer
32d15d90c4 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
2013-07-04 14:22:02 +00:00
Aaron Ballman
98abba7b66 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
2013-07-04 14:12:25 +00:00
Jakob Stoklund Olesen
f349a6e9e6 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
2013-07-04 13:54:20 +00:00
Joey Gouly
929d9ef111 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
2013-07-04 10:04:08 +00:00
Jakob Stoklund Olesen
1ab111ed01 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185618 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 04:53:49 +00:00
Jakob Stoklund Olesen
918b7c82f8 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
2013-07-04 04:53:45 +00:00
Jakob Stoklund Olesen
ef22e0e0b5 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
2013-07-04 04:32:39 +00:00
Jakob Stoklund Olesen
c982e14458 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
2013-07-04 04:32:35 +00:00
Nick Lewycky
08bdfe26a5 Tabs to spaces. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185612 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 03:51:53 +00:00
Craig Topper
a4389b0c50 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
2013-07-04 01:43:17 +00:00
Craig Topper
6227d5c690 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
2013-07-04 01:31:24 +00:00
Eric Christopher
c589a5f284 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
2013-07-04 01:10:38 +00:00
Eric Christopher
2333a31df5 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
2013-07-04 00:51:26 +00:00
Eric Christopher
d1280c194b 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
2013-07-04 00:47:09 +00:00
Jakob Stoklund Olesen
c93822901a 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
2013-07-04 00:26:30 +00:00
Jakob Stoklund Olesen
62204220e1 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
2013-07-03 23:56:31 +00:00
Jakob Stoklund Olesen
9c0e921732 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
2013-07-03 23:56:24 +00:00
Jakob Stoklund Olesen
f647652445 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
2013-07-03 23:56:20 +00:00
Stephen Lin
62da588a2e 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
2013-07-03 23:39:13 +00:00
Eric Christopher
7c2f3e8944 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
2013-07-03 22:40:21 +00:00
Eric Christopher
0d0782ae93 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
2013-07-03 22:40:18 +00:00