Duncan P. N. Exon Smith [Tue, 24 Jun 2014 00:38:09 +0000 (00:38 +0000)]
Support: Move class ScaledNumber
ScaledNumber has been cleaned up enough to pull out of BFI now. Still
work to do there (tests for shifting, bloated printing code, etc.), but
it seems clean enough for its new home.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211562
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 24 Jun 2014 00:26:13 +0000 (00:26 +0000)]
BFI: Un-floatify more language
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211561
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 24 Jun 2014 00:26:10 +0000 (00:26 +0000)]
BFI: Remove more float-like language from ScaledNumber
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211560
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 24 Jun 2014 00:26:08 +0000 (00:26 +0000)]
Support: Return ScaledNumbers::MaxScale from getQuotient()
Return MaxScale now that it's available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211559
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 24 Jun 2014 00:15:19 +0000 (00:15 +0000)]
Support: Extract ScaledNumbers::MinScale and MaxScale
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211558
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 23 Jun 2014 23:57:12 +0000 (23:57 +0000)]
BFI: Change language from "exponent" to "scale"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211557
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 23 Jun 2014 23:49:31 +0000 (23:49 +0000)]
BFI: Update ScaledNumber header docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211556
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 23 Jun 2014 23:36:17 +0000 (23:36 +0000)]
BFI: Rename UnsignedFloat => ScaledNumber
A lot of the docs and API are out of date, but I'll leave that for a
separate commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211555
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 23 Jun 2014 23:17:36 +0000 (23:17 +0000)]
Fix comments from r211553
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211554
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 23 Jun 2014 23:15:25 +0000 (23:15 +0000)]
Support: Extract ScaledNumbers::getSum() and getDifference()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211553
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 23 Jun 2014 23:14:51 +0000 (23:14 +0000)]
Support: Return scale from ScaledNumbers::matchScales()
This will be convenient when extracting `ScaledNumbers::getSum()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211552
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 23 Jun 2014 22:54:33 +0000 (22:54 +0000)]
not: Only consider exit code 3 to be a crash with --crash
This fixes Clang's test/Index/comment-xml-schema.c with Cygwin's
xmllint.exe, which uses exit(3) for XML validation failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211550
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 22:00:37 +0000 (22:00 +0000)]
Pass a std::unique_ptr& to the create??? methods is lib/Object.
This makes the buffer ownership on error conditions very natural. The buffer
is only moved out of the argument if an object is constructed that now
owns the buffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211546
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Mon, 23 Jun 2014 21:55:44 +0000 (21:55 +0000)]
[FastISel][X86] Lower unsupported selects to control-flow.
The extends the select lowering coverage by emiting pseudo cmov
instructions. These insturction will be later on lowered to control-flow to
simulate the select.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211545
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Mon, 23 Jun 2014 21:55:40 +0000 (21:55 +0000)]
[FastISel][X86] Add support for floating-point select.
This extends the select lowering to support floating-point selects. The
lowering depends on SSE instructions and that the conditon comes from a
floating-point compare. Under this conditions it is possible to emit an
optimized instruction sequence that doesn't require any branches to
simulate the select.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211544
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Mon, 23 Jun 2014 21:55:36 +0000 (21:55 +0000)]
[FastISel][X86] Optimize selects when the condition comes from a compare.
Optimize the select instructions sequence to use the EFLAGS directly from a
compare when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211543
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 21:53:12 +0000 (21:53 +0000)]
Make ObjectFile and BitcodeReader always own the MemoryBuffer.
This allows us to just use a std::unique_ptr to store the pointer to the buffer.
The flip side is that they have to support releasing the buffer back to the
caller.
Overall this looks like a more efficient and less brittle api.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211542
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 21:20:58 +0000 (21:20 +0000)]
This reverts commit r211533 and r211539.
Revert "Fix PR20056: Implement pseudo LDR <reg>, =<literal/label> for AArch64"
Revert "Fix cmake build."
It was missing a file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211540
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Mon, 23 Jun 2014 21:15:55 +0000 (21:15 +0000)]
Fix cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211539
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 21:15:27 +0000 (21:15 +0000)]
Simplify memory management with std::unique_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211538
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 23 Jun 2014 21:07:04 +0000 (21:07 +0000)]
nm-trivial-object.test requires shell since Lit internal runner isn't capable of chdir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211537
91177308-0d34-0410-b5e6-
96231b3b80d8
Weiming Zhao [Mon, 23 Jun 2014 20:44:16 +0000 (20:44 +0000)]
Fix PR20056: Implement pseudo LDR <reg>, =<literal/label> for AArch64
This patch is based on the changes from ARM target [1,2]
Based on ARM doc [3], if the literal value can be loaded with a valid MOV,
it can emit that instruction. This is implemented in this patch.
[1] Fix PR18345: ldr= pseudo instruction produces incorrect code when using in inline assembly
Author: David Peixotto <dpeixott@codeaurora.org>
commit
b92cca222898d87bbc764fa22e805adb04ef7f13 (r200777)
[2] Implement the ldr-pseudo opcode for ARM assembly
Author: David Peixotto <dpeixott@codeaurora.org>
commit
0fa193b08627927ccaa0804a34d80480894614b8 (r197708)
[3] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0802a/CJAHAIBC.html
Differential Revision: http://reviews.llvm.org/D4163
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211533
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 20:41:02 +0000 (20:41 +0000)]
Convert a few methods to use ErrorOr.
It used to be inconvenient to mix ErrorOr and UniquePtr, but with c++11
they work OK together.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211532
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 23 Jun 2014 20:40:45 +0000 (20:40 +0000)]
Support: Extract ScaledNumbers::matchScale()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211531
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Mon, 23 Jun 2014 20:27:53 +0000 (20:27 +0000)]
Change the default input for llvm-nm to be a.out instead of standard input
to match llvm-size and other UNIX systems for their nm(1).
Tweak test cases that used llvm-nm with standard input to add a "-" to
indicate that and add a test case to check the default of a.out for llvm-nm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211529
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 19:43:40 +0000 (19:43 +0000)]
[Mips] Add a target streamer when creating a null streamer.
Should fix DebugInfo/global.ll on the mips bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211527
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 23 Jun 2014 18:28:53 +0000 (18:28 +0000)]
Recommit 211309 (StringMap::insert), reverted in 211328 due to issues with private, but non-deleted, move members.
Certain versions of GCC (~4.7) couldn't handle the SFINAE on access
control, but with "= delete" (hidden behind a macro for portability)
this issue is worked around/addressed.
Patch by Agustín Bergé
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211525
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:28:31 +0000 (18:28 +0000)]
R600/SI: Verify restrictions on div_scale operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211524
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:28:28 +0000 (18:28 +0000)]
R600/SI: Fix div_scale intrinsic.
The operand that must match one of the others does matter,
and implement selecting for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211523
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:28:23 +0000 (18:28 +0000)]
R600: Fix formatting of intrinsic definitions.
It makes more sense for the GCCBuiltin name to come immediately
after the ID name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211522
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 23 Jun 2014 18:08:58 +0000 (18:08 +0000)]
Cleanup r211507
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211521
91177308-0d34-0410-b5e6-
96231b3b80d8
Christian Pirker [Mon, 23 Jun 2014 18:05:53 +0000 (18:05 +0000)]
ARMEB: Vector extend operations
Reviewed at http://reviews.llvm.org/D4043
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211520
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:55 +0000 (18:00 +0000)]
R600: Remove AMDILISelLowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211519
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:52 +0000 (18:00 +0000)]
R600: Select is not expensive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211518
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:49 +0000 (18:00 +0000)]
R600: Move add/sub with overflow out of AMDILISelLowering
Add more tests for these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211517
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:44 +0000 (18:00 +0000)]
R600: Move more out of AMDILISelLowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211516
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:41 +0000 (18:00 +0000)]
R600: Don't set fp_round_inreg action.
There's no point in setting this since it seems to only
by created in 1 place for ppcf128
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211515
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:38 +0000 (18:00 +0000)]
R600/SI: Handle i64 sub.
We can handle it the same way as add
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211514
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:34 +0000 (18:00 +0000)]
R600/SI: Move selection of i64 add to separate function.
Also don't use a SmallVector for fixed size array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211513
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:31 +0000 (18:00 +0000)]
R600: Rename AMDIL file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211512
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:26 +0000 (18:00 +0000)]
Fix missing words in sentence
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211511
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:24 +0000 (18:00 +0000)]
Use helper function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211510
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 23 Jun 2014 18:00:20 +0000 (18:00 +0000)]
Alphabetize forward declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211509
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 17:58:39 +0000 (17:58 +0000)]
Delete utils/FileUpdate.
It is unused and it looks like it was never used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211508
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 23 Jun 2014 17:47:40 +0000 (17:47 +0000)]
Support: Extract ScaledNumbers::compare()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211507
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 15:34:32 +0000 (15:34 +0000)]
Allow using .cfi_startproc without a leading symbol.
This is possible now that we don't produce .eh symbols. This fixes pr19430.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211502
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 15:17:34 +0000 (15:17 +0000)]
clang-format initializer to reduce noise in another patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211501
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 15:13:23 +0000 (15:13 +0000)]
Stop producing func.eh symbols on Darwin.
According Nick Kledzik (http://llvm.org/bugs/show_bug.cgi?id=19430#c2):
"... mach-o no longer needs names in the __eh_frame section (and has not for
years)."
Iain Sandoe confirms it is also unnecessary for their old darwin support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211500
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 23 Jun 2014 14:22:55 +0000 (14:22 +0000)]
Remove a temporary hack.
Amusingly this survived a lot longer than the CFI transition. We don't even
support non-cfi assemblers any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211498
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Mon, 23 Jun 2014 14:15:53 +0000 (14:15 +0000)]
[PowerPC] Refactor getMinCallFrameSize / getMinCallArgumentsSize
As of r211495, the only remaining users of getMinCallFrameSize are in
core ABI code (LowerFormalParameter / LowerCall). This is actually a
good thing, since the details of the parameter save area are ABI specific.
With the new ELFv2 ABI in particular, the rules defining the size of the
save area will become significantly more complex, so it wouldn't make
sense to implement those outside ABI code that has all required
information.
In preparation, this patch eliminates the getMinCallFrameSize (and
associated getMinCallArgumentsSize) routines, and inlines them into all
callers. Note that since nearly all call arguments are constant, this
allows simplifying the inlined copies to a single line everywhere.
No change in generate code expected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211497
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Mon, 23 Jun 2014 13:47:52 +0000 (13:47 +0000)]
[PowerPC] Allow stack frames without parameter save area
The PPCFrameLowering::determineFrameLayout routine currently ensures
that every function that allocates a stack frame provides space for the
parameter save area (via PPCFrameLowering::getMinCallFrameSize).
This is actually not necessary. There may be functions that never call
another routine but still allocate a frame; those do not require the
parameter save area. In the future, with the ELFv2 ABI, even some
routines that do call other functions do not need to allocate the
parameter save area.
While it is not a bug to allocate the parameter area when it is not
needed, it is better to avoid it to save stack space.
Note that when any particular function call requires the parameter save
area, this space will already have been included by ABI code in the size
the CALLSEQ_START insn is annotated with, and therefore included in the
size returned by MFI->getMaxCallFrameSize().
This means that determineFrameLayout simply does not need to care about
the parameter save area. (It still needs to ensure that every frame
provides the linkage area.) This is implemented by this patch.
Note that this exposed a bug in the new fast-isel code where the parameter
area was *not* included in the CALLSEQ_START size; this is also fixed.
A couple of test cases needed to be adapted for the new (smaller) stack
frame size those tests now see.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211495
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Mon, 23 Jun 2014 13:21:43 +0000 (13:21 +0000)]
[PowerPC] Fix IsDarwin arg in PPCFrameLowering:: calls
As remarked in the commit message to r211493, in several places
throughout the 64-bit SVR4 ABI code there are calls to
PPCFrameLowering::getLinkageSize and getMinCallFrameSize
using an incorrect IsDarwin argument of "true".
(Some of those were made explicit by the above refactoring patch, others
have been there all along.)
This patch fixes those places to pass "false" for IsDarwin.
No change in generated code expected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211494
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Mon, 23 Jun 2014 13:08:27 +0000 (13:08 +0000)]
[PowerPC] Refactor setMinReservedArea and CalculateParameterAndLinkageAreaSize
The PPCISelLowering.cpp routines PPCTargetLowering::setMinReservedArea and
CalculateParameterAndLinkageAreaSize are currently used as subroutines
from both 64-bit SVR4 and Darwin ABI code.
However, the two ABIs are already quite different w.r.t. AltiVec
conventions, and they will become more different when the ELFv2 ABI is
supported. Also, in general it seems better to disentangle ABI support
routines for different ABIs to avoid accidentally affecting one ABI when
intending to change only the other.
(Actually, the current code strictly speaking already contains a bug:
these routines call PPCFrameLowering::getMinCallFrameSize and
PPCFrameLowering::getLinkageSize with the IsDarwin parameter set to
"true" even on 64-bit SVR4. This bug currently has no adverse effect
since those routines always return the same for 64-bit SVR4 and 64-bit
Darwin, but it still seems wrong ... I'll fix this in a follow-up
commit shortly.)
To remove this code sharing, I'm simply inlining both routines into all
call sites (there are just two each, one for 64-bit SVR4 and one for
Darwin), and simplifying due to constant parameters where possible.
A small piece of code that *does* make sense to share is refactored into
the new routine EnsureStackAlignment, now also called from 32-bit SVR4
ABI code.
No change in generated code is expected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211493
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Mon, 23 Jun 2014 12:36:34 +0000 (12:36 +0000)]
[PowerPC] Fix on-stack AltiVec arguments with 64-bit SVR4
Current 64-bit SVR4 code seems to have some remnants of Darwin code
in AltiVec argument handing. This had the effect that AltiVec arguments
(or subsequent arguments) were not correctly placed in the parameter area
in some cases.
The correct behaviour with the 64-bit SVR4 ABI is:
- All AltiVec arguments take up space in the parameter area, just like
any other arguments, whether vararg or not.
- They are always 16-byte aligned, skipping a parameter area doubleword
(and the associated GPR, if any), if necessary.
This patch implements the correct behaviour and adds a test case.
(Verified against GCC behaviour via the ABI compat test suite.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211492
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 23 Jun 2014 09:20:02 +0000 (09:20 +0000)]
ARM: mark UBFX as not allowing PC.
Strictly, it's unpredictable. But we don't quite model that yet and an error is
better than ignoring the issue. This one somehow got left out before though.
rdar://problem/
15997748
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211490
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 23 Jun 2014 02:17:16 +0000 (02:17 +0000)]
MC: Cleanup parseMSInlineAsm
Utilize range based for-loops to simplify some code.
Use insert() instead of a loop for simplicity/efficiency.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211486
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sun, 22 Jun 2014 22:25:01 +0000 (22:25 +0000)]
MC: adjust text section flags for WoA
Correct the section flags for code built for Windows on ARM with
`-ffunction-sections`. Windows on ARM uses solely Thumb-2 instructions, and
indicates that the function is thumb by placing it in a text section that has
IMAGE_SCN_MEM_16BIT flag set.
When we encounter a .section directive, a new section is constructed. This may
be a text segment. In order to identify that we need the additional flag,
expose the target triple through the ObjectFileInfo as this information is lost
otherwise.
Since any modern ARM targeting environment on Windows would be Thumb-2 (Windows
ARM NT or Windows Embedded Compact), introducing a new flag to indicate the
section attribute seems to be a bit overkill. Simply depend on the target
triple. Since there is one location that this information is currently needed,
creating a target specific assembly parser and delegating the parsing of section
switches also feels a bit heavy handed. If it turns out that this information
ends up changing additional behaviour, then it may be worth considering that
alternative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211481
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 22 Jun 2014 22:00:56 +0000 (22:00 +0000)]
Revert r211399, "Generate native unwind info on Win64"
It broke Legacy JIT Tests on x86_64-{mingw32|msvc}, aka Windows x64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211480
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Sun, 22 Jun 2014 21:43:01 +0000 (21:43 +0000)]
R600: Use LowerSDIVREM for i64 node replace
v2: move div/rem node replacement to R600ISelLowering
make lowerSDIVREM protected
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211478
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Sun, 22 Jun 2014 21:43:00 +0000 (21:43 +0000)]
R600: Implement custom SDIVREM.
Instead of separate SDIV/SREM. SDIV used UDIV which in turn used UDIVREM anyway.
SREM used SDIV(UDIV->UDIVREM)+MUL+SUB, using UDIVREM directly is more efficient.
v2: Don't use all caps names
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211477
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Sun, 22 Jun 2014 21:42:58 +0000 (21:42 +0000)]
R600: Add udivrem test
v2: move < %s to the end of the line
space after ;
add v4i32 test
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211476
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Sun, 22 Jun 2014 17:21:37 +0000 (17:21 +0000)]
Fix PR20087 by using the source index when changing the vector load
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211472
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 22 Jun 2014 12:35:39 +0000 (12:35 +0000)]
Introduce a Lit feature "debug_frame" and apply it to llvm/test/MC/ELF/cfi-version.ll.
.debug_frame is not emitted for targeting Windows x64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211466
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 22 Jun 2014 12:22:04 +0000 (12:22 +0000)]
Add a description to the test from r211433 explaining why it's written that way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211465
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Sun, 22 Jun 2014 03:38:59 +0000 (03:38 +0000)]
LoopVectorizer: Fix a dominance issue
The induction variables start value needs to be defined before we branch
(overflow check) to the scalar preheader where we used it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211460
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Sun, 22 Jun 2014 01:53:30 +0000 (01:53 +0000)]
MergeFunctions Pass, removed DenseMap helpers.
Patch removes rest part of code related to old implementation.
This patch belongs to patch series that improves MergeFunctions
performance time from O(N*N) to O(N*log(N)).
This one was the final patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211457
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Sun, 22 Jun 2014 00:57:09 +0000 (00:57 +0000)]
MergeFunctions Pass, updated header comments.
Added short description for new comparison algorithm, that introduces
total ordering among functions set.
This patch belongs to patch series that improves MergeFunctions
performance time from O(N*N) to O(N*log(N)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211456
91177308-0d34-0410-b5e6-
96231b3b80d8
Weiming Zhao [Sun, 22 Jun 2014 00:33:44 +0000 (00:33 +0000)]
Report error for non-zero data in .bss
User may initialize a var with non-zero value and specify .bss section.
E.g. : int a __attribute__((section(".bss"))) = 2;
This patch converts an assertion to error report for better user
experience.
Differential Revision: http://reviews.llvm.org/D4199
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211455
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Sat, 21 Jun 2014 20:54:36 +0000 (20:54 +0000)]
MergeFunctions Pass, FnSet has been replaced with FnTree.
Patch activates new implementation.
So from now, merging process should take time O(N*log(N)).
Where N size of module (we are free to measure it in
functions or in instructions). Internally FnTree represents
binary tree. So every lookup operation takes O(log(N)) time.
It is still not the last patch in series, we also have to
clean-up pass from old code, and update pass comments.
This patch belongs to patch series that improves MergeFunctions
performance time from O(N*N) to O(N*log(N)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211445
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Sat, 21 Jun 2014 20:13:24 +0000 (20:13 +0000)]
MergeFunctions Pass, removed unused methods from old implementation.
Patch removed next old FunctionComparator methods:
* enumerate
* isEquivalentOperation
* isEquivalentGEP
* isEquivalentType
This patch belongs to patch series that improves MergeFunctions
performance time from O(N*N) to O(N*log(N)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211444
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Sat, 21 Jun 2014 19:07:51 +0000 (19:07 +0000)]
MergeFunctions, doSanityCheck: fixed body comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211443
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Sat, 21 Jun 2014 18:58:11 +0000 (18:58 +0000)]
MergeFunctions Pass, introduced sanity check, that checks order relation,
introduced among functions set.
This patch belongs to patch series that improves MergeFunctions
performance time from O(N*N) to O(N*log(N)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211442
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Sat, 21 Jun 2014 17:55:51 +0000 (17:55 +0000)]
MergeFunctions Pass, introduced total ordering among top-level comparison
methods.
Patch changes return type of FunctionComparator::compare() and
FunctionComparator::compare(const BasicBlock*, const BasicBlock*)
methods from bool (equal or not) to {-1, 0, 1} (less, equal, great).
This patch belongs to patch series that improves MergeFunctions
performance time from O(N*N) to O(N*log(N)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211437
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 21 Jun 2014 13:46:25 +0000 (13:46 +0000)]
LoopUnrollRuntime: Check for overflow in the trip count calculation.
Fixes PR19823.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211436
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 21 Jun 2014 12:56:42 +0000 (12:56 +0000)]
Legalizer: Add support for splitting insert_subvectors.
We handle this by spilling the whole thing to the stack and doing the
insertion as a store.
PR19492. This happens in real code because the vectorizer creates v2i128 when AVX is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211435
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 21 Jun 2014 11:47:18 +0000 (11:47 +0000)]
SCEVExpander: Fold constant PHIs harder. The logic below only understands proper IVs.
PR20093.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211433
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Sat, 21 Jun 2014 02:43:02 +0000 (02:43 +0000)]
Add back functionality removed in r210497.
Instead of asserting, output a message stating that a null pointer was found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211430
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Sat, 21 Jun 2014 01:31:15 +0000 (01:31 +0000)]
[X86] Add ISel patterns to select SSE3/AVX ADDSUB instructions.
This patch adds ISel patterns to select SSE3/AVX ADDSUB instructions
from a sequence of "vadd + vsub + blend".
Example:
///
typedef float float4 __attribute__((ext_vector_type(4)));
float4 foo(float4 A, float4 B) {
float4 X = A - B;
float4 Y = A + B;
return (float4){X[0], Y[1], X[2], Y[3]};
}
///
Before this patch, (with flag -mcpu=corei7) llc produced the following
assembly sequence:
movaps %xmm0, %xmm2
addps %xmm1, %xmm2
subps %xmm1, %xmm0
blendps $10, %xmm2, %xmm0
With this patch, we now get a single
addsubps %xmm1, %xmm0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211427
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sat, 21 Jun 2014 00:24:51 +0000 (00:24 +0000)]
Fix the MinGW builder. Apparently std::call_once and
std::recursive_mutex are not available on MinGW and breaks the
builder. Revert to using a function local static and sys::Mutex
just to get the tree green until we figure out a better solution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211424
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 20 Jun 2014 23:54:32 +0000 (23:54 +0000)]
Always use a temp symbol for CIE.
Fixes pr19185.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211423
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 20 Jun 2014 22:40:55 +0000 (22:40 +0000)]
Use compact unwind for the iOS simulator.
Another step in fixing pr19185.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211416
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 20 Jun 2014 22:37:01 +0000 (22:37 +0000)]
Use a helper function and clang-format.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211415
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 22:36:09 +0000 (22:36 +0000)]
Support: ScaledNumber: Fix inconsistent test names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211414
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 22:33:40 +0000 (22:33 +0000)]
Support: Write ScaledNumbers::getLg{,Floor,Ceiling}()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211413
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 20 Jun 2014 22:30:31 +0000 (22:30 +0000)]
Delete dead code.
The compact unwind info is only used by code that knows it is supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211412
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 21:47:47 +0000 (21:47 +0000)]
Support: Write ScaledNumber::getQuotient() and getProduct()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211409
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 21:44:36 +0000 (21:44 +0000)]
Support: Cleanup ScaledNumber::getAdjusted() doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211407
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 21:43:20 +0000 (21:43 +0000)]
Support: Mark end of namespaces
This convinces clang-format to leave a newline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211406
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Fri, 20 Jun 2014 21:29:27 +0000 (21:29 +0000)]
Fix some double printing of filenames for archives in llvm-nm when
the tool is given multiple files. Also fix the same issue with Mach-O
universal files. And fix the newline spacing to separate the output
in these cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211405
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 20 Jun 2014 21:15:27 +0000 (21:15 +0000)]
Don't produce eh_frame relocations when targeting the IOS simulator.
First step for fixing pr19185.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211404
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 20 Jun 2014 21:07:14 +0000 (21:07 +0000)]
Revert "Replace Execution Engine's mutex with std::recursive_mutex."
This reverts commit
1f502bd9d7d2c1f98ad93a09ffe435e11a95aedd, due to
GCC / MinGW's lack of support for C++11 threading.
It's possible this will go back in after we come up with a
reasonable solution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211401
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 20 Jun 2014 20:35:47 +0000 (20:35 +0000)]
Generate native unwind info on Win64
This patch enables LLVM to emit Win64-native unwind info rather than
DWARF CFI. It handles all corner cases (I hope), including stack
realignment.
Because the unwind info is not flexible enough to describe stack frames
with a gap of unknown size in the middle, such as the one caused by
stack realignment, I modified register spilling code to place all spills
into the fixed frame slots, so that they can be accessed relative to the
frame pointer.
Patch by Vadim Chugunov!
Reviewed By: rnk
Differential Revision: http://reviews.llvm.org/D4081
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211399
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 20 Jun 2014 19:54:13 +0000 (19:54 +0000)]
Fix some -Wsign-compare fallout from changing container count member functions to return unsigned instead of bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211393
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Fri, 20 Jun 2014 19:11:56 +0000 (19:11 +0000)]
Commited patch from Björn Steinbrink:
Summary:
Different range metadata can lead to different optimizations in later
passes, possibly breaking the semantics of the merged function. So range
metadata must be taken into consideration when comparing Load
instructions.
Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211391
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Fri, 20 Jun 2014 19:00:41 +0000 (19:00 +0000)]
[Make] Fix dependencies for td.expanded
Depend on all the .td files not just the main one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211390
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Fri, 20 Jun 2014 18:17:56 +0000 (18:17 +0000)]
[RuntimeDyld] Fix ppc64 stub relocations on little-endian
When RuntimeDyldELF creates stub functions, it needs to install
relocations that will resolve to the final address of the target
routine. Since those are 16-bit relocs, they need to be applied to the
least-significant halfword of the instruction. On big-endian ppc64,
this means that addresses have to be adjusted by 2, which is what the
code currently does.
However, on a little-endian system, the address must *not* be adjusted;
the least-significant halfword is the first one. This patch updates the
RuntimeDyldELF code to take the target byte order into account.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211384
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Fri, 20 Jun 2014 18:07:34 +0000 (18:07 +0000)]
Fix a warning about the use of const being ignored with a cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211383
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Fri, 20 Jun 2014 17:51:47 +0000 (17:51 +0000)]
[RuntimeDyld] Support more PPC64 relocations
This adds support for several missing PPC64 relocations in the
straight-forward manner to RuntimeDyldELF.cpp.
Note that this actually fixes a failure of a large-model test case on
PowerPC, allowing the XFAIL to be removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211382
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 20 Jun 2014 17:06:11 +0000 (17:06 +0000)]
R600/SI: Add patterns for ctpop inside a branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211378
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 20 Jun 2014 17:06:09 +0000 (17:06 +0000)]
R600/SI: Add a pattern for f32 ftrunc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211377
91177308-0d34-0410-b5e6-
96231b3b80d8