Chad Rosier [Wed, 11 Dec 2013 21:03:40 +0000 (21:03 +0000)]
[AArch64] Refactor the NEON scalar floating-point reciprocal estimate, floating-
point reciprocal exponent, and floating-point reciprocal square root estimate
LLVM AArch64 intrinsics to use f32/f64 types, rather than their vector
equivalents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197066
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Dec 2013 20:40:57 +0000 (20:40 +0000)]
Don't set unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197064
91177308-0d34-0410-b5e6-
96231b3b80d8
Logan Chien [Wed, 11 Dec 2013 19:38:10 +0000 (19:38 +0000)]
[arm] Pass -triple to llvm-mc for ARM ELF test cases.
Replace -arch with -triple so that we can guarantee that
ELF object files can be generated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197062
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 11 Dec 2013 17:51:51 +0000 (17:51 +0000)]
R600: Re-format Processors.td
This makes it a little easier to read.
Reviewed-by: Vincent Lejeune <vljn at ovi.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197058
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 11 Dec 2013 17:51:47 +0000 (17:51 +0000)]
R600: Register AMDGPUCFGStructurizer pass
This enables -print-before-all to dump MachineInstrs after it is run.
Reviewed-by: Vincent Lejeune <vljn at ovi.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197057
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 11 Dec 2013 17:51:41 +0000 (17:51 +0000)]
R600: Register R600EmitClauseMarkers pass
This enables -print-before-all to dump MachineInstrs after it is run.
Reviewed-by: Vincent Lejeune <vljn at ovi.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197056
91177308-0d34-0410-b5e6-
96231b3b80d8
Logan Chien [Wed, 11 Dec 2013 17:16:25 +0000 (17:16 +0000)]
[arm] Implement ARM .arch directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197052
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 11 Dec 2013 16:36:09 +0000 (16:36 +0000)]
SelectionDAG: Fix a typo.
Found by "cppcheck". PR18208.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197047
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 11 Dec 2013 16:04:57 +0000 (16:04 +0000)]
ARM: constrain register-class in fast-isel
The tests were no longer using fast-isel at all (MachO needs an "ios" rather
than "darwin" triple at the moment and Linux needs ARM mode). Once that was
corrected, the verifier complained about a t2ADDri created for the alloca.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197046
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Wed, 11 Dec 2013 15:42:33 +0000 (15:42 +0000)]
Build fix for Android NDK which has neither futimes nor futimens
Based on a patch by Neil Henning!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197045
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Wed, 11 Dec 2013 14:31:04 +0000 (14:31 +0000)]
AVX-512: Removed "z" suffix from AVX-512 instructions, since it is incompatible with GCC.
I moved a test from avx512-vbroadcast-crash.ll to avx512-vbroadcast.ll
I defined HasAVX512 predicate as AssemblerPredicate. It means that you should invoke llvm-mc with "-mcpu=knl" to get encoding for AVX-512 instructions. I need this to let AsmMatcher to set different encoding for AVX and AVX-512 instructions that have the same mnemonic and operands (all scalar instructions).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197041
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Wed, 11 Dec 2013 11:45:08 +0000 (11:45 +0000)]
[SystemZ] Optimize fcmp X, 0 in cases where X is also negated
In such cases it's often better to test the result of the negation instead,
since the negation also sets CC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197032
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Wed, 11 Dec 2013 11:37:27 +0000 (11:37 +0000)]
Extend (truncate (load)) folding
DAGCombiner could fold (truncate (load)) -> smaller load if the original
load was the width of the truncation result or wider. This patch extends
it to handle cases where the original load was narrower (and so the
extension type stays the same).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197030
91177308-0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Wed, 11 Dec 2013 08:38:42 +0000 (08:38 +0000)]
Fix XFAIL rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197017
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Dec 2013 04:10:41 +0000 (04:10 +0000)]
Make this test a bit stricter.
The extra CHECK and CHECK-NEXT are there to show that we don't print a
linker private symbol on linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197003
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 11 Dec 2013 03:40:15 +0000 (03:40 +0000)]
Add TargetRegisterInfo::reverseLocalAssignment hook.
This hook reverses the order of assignment for local live ranges. This
will generally allocate shorter local live ranges first. For targets with
many registers, this could reduce regalloc compile time by a large
factor. It should still achieve optimal coloring; however, it can change
register eviction decisions. It is disabled by default for two reasons:
(1) Top-down allocation is simpler and easier to debug for targets that
don't benefit from reversing the order.
(2) Bottom-up allocation could result in poor evicition decisions on some
targets affecting the performance of compiled code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197001
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Wed, 11 Dec 2013 03:32:44 +0000 (03:32 +0000)]
Distinguish and choose 16 or 32 bit forms of save/restore for Mips16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196999
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Wed, 11 Dec 2013 02:33:50 +0000 (02:33 +0000)]
[AArch64 NEON] Get instruction BSL matched to VSELECT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196998
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Dec 2013 01:41:10 +0000 (01:41 +0000)]
Move mips' datalayout computation out of line and add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196996
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Dec 2013 01:07:43 +0000 (01:07 +0000)]
Move Sparc's getDataLayout out of line and add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196990
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 11 Dec 2013 00:30:57 +0000 (00:30 +0000)]
Prune redundant dependencies in LLVMBuild.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196988
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 11 Dec 2013 00:09:06 +0000 (00:09 +0000)]
Move PPC's getDataLayoutString out of line and document it better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196987
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 10 Dec 2013 23:23:52 +0000 (23:23 +0000)]
Revert the backend fatal error from r196939
The combination of inline asm, stack realignment, and dynamic allocas
turns out to be too common to reject out of hand.
ASan inserts empy inline asm fragments and uses aligned allocas.
Compiling any trivial function containing a dynamic alloca with ASan is
enough to trigger the check.
XFAIL the test cases that would be miscompiled and add one that uses the
relevant functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196986
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Dec 2013 22:05:32 +0000 (22:05 +0000)]
Refactor the computation of the x86 datalayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196976
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 10 Dec 2013 21:49:28 +0000 (21:49 +0000)]
[asan] Fix the coverage.cc test broken by r196939
It was failing because ASan was adding all of the following to one
function:
- dynamic alloca
- stack realignment
- inline asm
This patch avoids making the static alloca dynamic when coverage is
used.
ASan should probably not be inserting empty inline asm blobs to inhibit
duplicate tail elimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196973
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 10 Dec 2013 21:37:42 +0000 (21:37 +0000)]
Use llvm_unreachable instead of assert(0)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196971
91177308-0d34-0410-b5e6-
96231b3b80d8
David Fang [Tue, 10 Dec 2013 21:37:41 +0000 (21:37 +0000)]
on darwin<10, fallback to .weak_definition (PPC,X86)
.weak_def_can_be_hidden was not yet supported by the system assembler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196970
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 10 Dec 2013 21:33:59 +0000 (21:33 +0000)]
[AArch64] Refactor the NEON floating-point absolute difference LLVM AArch64
intrinsic to use f32/f64 types, rather than their vector equivalents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196965
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 10 Dec 2013 21:33:56 +0000 (21:33 +0000)]
[AArch64] Refactor the NEON signed/unsigned floating-point convert to fixed-point
LLVM AArch64 intrinsics to use f32/f64, rather than their vector equivalents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196964
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 10 Dec 2013 21:33:53 +0000 (21:33 +0000)]
[AArch64] Overload NEON signed/unsigned floating-point convert to fixed-point
and fixed-point convert to floating-point LLVM AArch64 intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196963
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 10 Dec 2013 21:33:50 +0000 (21:33 +0000)]
[AArch64] Overload NEON signed/unsigned integer convert to floating-point
LLVM AArch64 intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196962
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 10 Dec 2013 21:11:55 +0000 (21:11 +0000)]
R600/SI: Add i64 cmp tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196960
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 10 Dec 2013 18:55:37 +0000 (18:55 +0000)]
Fix gcc warnings.
Unused variable and unused typedef in release build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196947
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 10 Dec 2013 18:27:32 +0000 (18:27 +0000)]
Reland "Fix miscompile of MS inline assembly with stack realignment"
This re-lands commit r196876, which was reverted in r196879.
The tests have been fixed to pass on platforms with a stack alignment
larger than 4.
Update to clang side tests will land shortly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196939
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 10 Dec 2013 16:57:43 +0000 (16:57 +0000)]
Make Triple's isOSBinFormatXXX functions partition triple-space.
Most users would be surprised if "isCOFF" and "isMachO" were simultaneously
true, unless they'd put the compiler in a box with a gun attached to a photon
detector.
This makes sure precisely one of the three formats is true for any triple and
simplifies some target logic based on that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196934
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Tue, 10 Dec 2013 16:31:09 +0000 (16:31 +0000)]
Support: Update documentation for Program functions
The docstrings were describing an older interface that has been replaced with
functions.
Also describe the performance characteristics of FindProgramByName() and
ExecuteAndWait() explaining when it's best to avoid them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196932
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 10 Dec 2013 16:11:39 +0000 (16:11 +0000)]
[AArch64] Refactor the Neon vector/scalar floating-point convert intrinsics so
that they use float/double rather than the vector equivalents when appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196930
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 10 Dec 2013 15:35:33 +0000 (15:35 +0000)]
[AArch64] Refactor the Neon vector/scalar floating-point convert implementation.
Specifically, reuse the ARM intrinsics when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196926
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Tue, 10 Dec 2013 15:22:48 +0000 (15:22 +0000)]
Ensure that the backend no longer emits unnecessary vector insert instructions
immediately after SSE scalar fp instructions like addss or mulss.
Added patterns to select SSE scalar fp arithmetic instructions from a scalar
fp operation followed by a blend.
For example, given the following code:
__m128 foo(__m128 A, __m128 B) {
A[0] += B[0];
return A;
}
previously we generated:
addss %xmm0, %xmm1
movss %xmm1, %xmm0
now we generate:
addss %xmm1, %xmm0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196925
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Dec 2013 14:53:22 +0000 (14:53 +0000)]
Use Field Lists for the types' "Overview", "Syntax" and "Examples".
Thanks to Sean Silva for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196924
91177308-0d34-0410-b5e6-
96231b3b80d8
Vincent Lejeune [Tue, 10 Dec 2013 14:43:31 +0000 (14:43 +0000)]
R600: Fix an infinite loop when trying to reorganize export/tex vector input
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196923
91177308-0d34-0410-b5e6-
96231b3b80d8
Vincent Lejeune [Tue, 10 Dec 2013 14:43:27 +0000 (14:43 +0000)]
R600: Fix input modifiers lost for Cayman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196922
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Tue, 10 Dec 2013 14:29:38 +0000 (14:29 +0000)]
Next step in Mips16 prologue/epilogue cleanup.
Save S2(reg 18) only when we are calling floating point stubs that
have a return value of float or complex. Some more work to make this
better but this is the first step.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196921
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Tue, 10 Dec 2013 13:53:10 +0000 (13:53 +0000)]
AVX-512: changed intrinsics for mask operations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196918
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Tue, 10 Dec 2013 11:58:35 +0000 (11:58 +0000)]
AVX-512: Changed intrinsics of VPCONFLICT to match GCC builtin form
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196914
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 10 Dec 2013 11:53:16 +0000 (11:53 +0000)]
Darwin: update default iOS version to 5.0
Defaulting to iOS 3.0 when LLVM has to guess the version is no longer a useful
option and can give surprising results (like tail calls being disabled).
5.0 seems like a reasonable compromise as a platform that's still interesting
to some people.
rdar://problem/
15567348
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196912
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 10 Dec 2013 11:50:34 +0000 (11:50 +0000)]
[CMake] Add MCDisassembler to tools/lto. (has been removed since r196908)
lto.exports really exports LLVM-C Disasm stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196911
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Tue, 10 Dec 2013 11:37:00 +0000 (11:37 +0000)]
[mips][msa] Correct sld and sldi builtins.
Summary: The result register of these instructions is also the first operand.
Reviewers: jacksprat, dsanders
Reviewed By: dsanders
Differential Revision: http://llvm-reviews.chandlerc.com/D2362
Differential Revision: http://llvm-reviews.chandlerc.com/D2363
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196910
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 10 Dec 2013 11:13:32 +0000 (11:13 +0000)]
[CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196908
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 10 Dec 2013 11:12:35 +0000 (11:12 +0000)]
Add JIT to LINK_COMPONENTS in MCJITTests/Makefile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196907
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Tue, 10 Dec 2013 10:49:34 +0000 (10:49 +0000)]
Add TargetLowering::prepareVolatileOrAtomicLoad
One unusual feature of the z architecture is that the result of a
previous load can be reused indefinitely for subsequent loads, even if
a cache-coherent store to that location is performed by another CPU.
A special serializing instruction must be used if you want to force
a load to be reattempted.
Since volatile loads are not supposed to be omitted in this way,
we should insert a serializing instruction before each such load.
The same goes for atomic loads.
The patch implements this at the IR->DAG boundary, in a similar way
to atomic fences. It is a no-op for targets other than SystemZ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196906
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Tue, 10 Dec 2013 10:36:34 +0000 (10:36 +0000)]
Add TargetLowering::prepareVolatileOrAtomicLoad
One unusual feature of the z architecture is that the result of a
previous load can be reused indefinitely for subsequent loads, even if
a cache-coherent store to that location is performed by another CPU.
A special serializing instruction must be used if you want to force
a load to be reattempted.
Since volatile loads are not supposed to be omitted in this way,
we should insert a serializing instruction before each such load.
The same goes for atomic loads.
The patch implements this at the IR->DAG boundary, in a similar way
to atomic fences. It is a no-op for targets other than SystemZ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196905
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 10 Dec 2013 10:30:08 +0000 (10:30 +0000)]
[CMake] lli/CMakeLists.txt: Move add_subdirectory(ChildTarget) to the front. It depends on nothing described in LLVM_LINK_COMPONENTS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196902
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Tue, 10 Dec 2013 06:51:07 +0000 (06:51 +0000)]
[AArch64 NEON] Replace fpimm with fpz32 for floating compare with zero.
This is a small change to be strict. Just want get pattern safer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196889
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Tue, 10 Dec 2013 06:48:35 +0000 (06:48 +0000)]
[AArch64 NEON] Support poly128_t and implement relevant intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196887
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 10 Dec 2013 05:39:40 +0000 (05:39 +0000)]
GCOV.cpp: Use PRIu64 instead of %lu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196882
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 10 Dec 2013 05:39:34 +0000 (05:39 +0000)]
Add proper dependencies to LLVMBuild.txt in llvm/lib.
I'll prune redundant deps in LLVMBuild.txt, later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196881
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 10 Dec 2013 05:39:12 +0000 (05:39 +0000)]
Whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196880
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 10 Dec 2013 05:31:27 +0000 (05:31 +0000)]
Revert "Fix miscompile of MS inline assembly with stack realignment"
This reverts commit r196876. Its tests failed on the bots, so I'll
figure it out tomorrow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196879
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 10 Dec 2013 05:12:23 +0000 (05:12 +0000)]
Fix miscompile of MS inline assembly with stack realignment
For stack frames requiring realignment, three pointers may be needed:
- ebp to address incoming arguments
- esi (could be any callee-saved register) to address locals
- esp to address outgoing arguments
We would use esi unconditionally without verifying that it did not
conflict with inline assembly.
This change doesn't do the verification, it simply emits a fatal error
on functions that use stack realignment, dynamic SP adjustments, and
inline assembly.
Because stack realignment is common on Windows, we also no longer assume
that MS inline assembly clobbers esp. Instead, we analyze the inline
instructions for implicit definitions and check if esp is there. If so,
we require the use of a base pointer and consider it in the condition
above.
Mostly fixes PR16830, but we could try harder to find a non-conflicting
base pointer.
Reviewers: sunfish
Differential Revision: http://llvm-reviews.chandlerc.com/D1317
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196876
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 10 Dec 2013 04:39:09 +0000 (04:39 +0000)]
Fix a crash that occurs when PWD is invalid.
MCJIT needs to be able to run in hostile environments, even when PWD
is invalid. There's no need to crash MCJIT in this case.
The obvious fix is to simply leave MCContext's CompilationDir empty
when PWD can't be determined. This way, MCJIT clients,
and other clients that link with LLVM don’t need a valid working directory.
If we do want to guarantee valid CompilationDir, that should be done
only for clients of getCompilationDir(). This is as simple as checking
for an empty string.
The only current use of getCompilationDir is EmitGenDwarfInfo, which
won’t conceivably run with an invalid working dir. However, in the
purely hypothetically and untestable case that this happens, the
AT_comp_dir will be omitted from the compilation_unit DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196874
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 10 Dec 2013 04:39:05 +0000 (04:39 +0000)]
whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196873
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 10 Dec 2013 01:13:59 +0000 (01:13 +0000)]
Fix PR18162 - Incorrect assertion assumed that the SDValue resno is zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196858
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Dec 2013 01:12:16 +0000 (01:12 +0000)]
Update testcase for previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196857
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuchen Wu [Tue, 10 Dec 2013 01:02:07 +0000 (01:02 +0000)]
llvm-cov: Added -a option for block data.
Similar to gcov, llvm-cov will now print out the block count at the end
of each block. Multiple blocks can end on the same line.
One computational difference is by using -a, llvm-cov will no longer
simply add the block counts together to form a line count. Instead, it
will take the maximum of the block counts on that line. This has a
similar effect to what gcov does, but generates more correct counts in
certain scenarios.
Also updated tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196856
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Dec 2013 00:40:03 +0000 (00:40 +0000)]
Disable emitting DW_AT_GNU_ranges_base until we actually use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196851
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Dec 2013 00:37:37 +0000 (00:37 +0000)]
Add comments documenting the ARM datalayout string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196850
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Dec 2013 00:26:10 +0000 (00:26 +0000)]
We never emit info into the macro info section, stop emitting an
empty one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196849
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 10 Dec 2013 00:26:06 +0000 (00:26 +0000)]
80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196848
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 10 Dec 2013 00:15:35 +0000 (00:15 +0000)]
Simplify further.
Thanks to Jim Grosbach for noticing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196846
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 10 Dec 2013 00:13:41 +0000 (00:13 +0000)]
Transforms: Don't create bad branch weights when folding a switch
This avoids creating branch weight metadata of length one when we fold
cases into the default of a switch instruction, which was triggering
an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196845
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 9 Dec 2013 23:57:44 +0000 (23:57 +0000)]
Rename CompileUnit->DwarfCompileUnit and TypeUnit->DwarfTypeUnit for
clarity. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196844
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Dec 2013 23:56:41 +0000 (23:56 +0000)]
Refactor the construction of the DataLayout string on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196843
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 9 Dec 2013 23:32:48 +0000 (23:32 +0000)]
Rename Unit->DwarfUnit to match the file name and make it a bit less
ambiguous. Reformat to match.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196838
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 9 Dec 2013 22:47:38 +0000 (22:47 +0000)]
[AArch64] Refactor the NEON scalar reduce pairwise intrinsics, so that they use
float/double rather than the vector equivalents when appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196833
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 9 Dec 2013 22:47:34 +0000 (22:47 +0000)]
[AArch64] Refactor NEON scalar reduce pairwise front-end codegen to remove
unnecessary patterns in tablegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196832
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 9 Dec 2013 22:47:31 +0000 (22:47 +0000)]
[AArch64] Remove q and non-q intrinsic definitions in the NEON scalar reduce
pairwise implementation, using an overloaded definition instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196831
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Mon, 9 Dec 2013 22:08:32 +0000 (22:08 +0000)]
get rid of superfluous comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196829
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Mon, 9 Dec 2013 21:19:51 +0000 (21:19 +0000)]
Delete some old code used for testing that is not needed anymore.
This is part of the mips16 epilogue/prologue cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196824
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Dec 2013 20:44:48 +0000 (20:44 +0000)]
Don't add suffixes for stdcall/fastcall on 64 coff.
This matches the behavior of both msvc and mingw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196814
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Dec 2013 20:26:40 +0000 (20:26 +0000)]
Use a more direct check for finding out the file type.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196811
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 9 Dec 2013 19:36:11 +0000 (19:36 +0000)]
Don't set a variable to its default value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196807
91177308-0d34-0410-b5e6-
96231b3b80d8
Ana Pazos [Mon, 9 Dec 2013 19:29:14 +0000 (19:29 +0000)]
Fix pattern match for movi with 0D result
Patch by Jiangning Liu.
With some test case changes:
- intrinsic test added to the existing /test/CodeGen/AArch64/neon-aba-abd.ll.
- New test cases to cover movi 1D scenario without using the intrinsic in
test/CodeGen/AArch64/neon-mov.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196806
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 9 Dec 2013 17:51:30 +0000 (17:51 +0000)]
DwarfDebug/Unit: Remove another case of label recreation by storing the gnu_ranges label in the unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196793
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Mon, 9 Dec 2013 16:27:00 +0000 (16:27 +0000)]
Improve the detection of the path
Summary:
When clang is used under GNU/Linux in a chroot without /proc mount, it falls
back on the BSD method. However, since the buf variable is used twice
and fails with snprintf to produce the correct path.
When called as relatived (ie ./clang), it was failing with:
"" -cc1 [...] -x c++ x.cc
error: unable to execute command: Executable "" doesn't exist!
I also took the opportunity to simply the code (the first arg of test_dir
was useless).
Reviewers: rafael
Reviewed By: rafael
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2361
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196791
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 9 Dec 2013 12:47:12 +0000 (12:47 +0000)]
[mips][msa] Fix invalid generated code when lowering FrameIndex involving unaligned offsets.
Summary:
The MSA ld.[bhwd] and st.[bhwd] instructions scale the immediate by the
element size before use as an offset. The offset must therefore be a
multiple of the element size to be valid in these instructions. However,
an unaligned base address is valid in MSA.
This commit causes the compiler to emit valid code when the calculated
offset is not a multiple of the element size by accounting for the offset
using addiu and using a zero offset in the load/store.
Depends on D2338
Reviewers: matheusalmeida
Reviewed By: matheusalmeida
Differential Revision: http://llvm-reviews.chandlerc.com/D2339
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196777
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 9 Dec 2013 11:50:16 +0000 (11:50 +0000)]
[mips][msa] Fix suboptimal FrameIndex lowering for ld.[hwd] and st.[hwd]
Summary:
The immediate in these instructions is scaled before use as an offset.
They therefore have a wider reach than ld.b/st.b.
Reviewers: matheusalmeida
Reviewed By: matheusalmeida
Differential Revision: http://llvm-reviews.chandlerc.com/D2338
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196775
91177308-0d34-0410-b5e6-
96231b3b80d8
Vladimir Medic [Mon, 9 Dec 2013 11:03:25 +0000 (11:03 +0000)]
Method parseSetAssignment treats every operand with '$' sign as register and the parsing is directed to set alias for register. This will result in errors reported when expressions containing label references are parsed(for example long jumps)
As we can't make a complete solution now it has been decided to enable .set directive to handle long jump expressions. This will cause parser to report errors when parsing integer based register assignments, for example:
.set r3, will be reported as error. Still, the need for expressions is higher priority as the integer based register assignments are Mips specific and can be avoided using register names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196773
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 9 Dec 2013 09:04:00 +0000 (09:04 +0000)]
ADT: Implement MutableArrayRef::reverse_iterator
This adds rbegin/rend methods to MutableArrayRef, they will be used by a
follow-on commit in clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196768
91177308-0d34-0410-b5e6-
96231b3b80d8
Venkatraman Govindaraju [Mon, 9 Dec 2013 05:13:25 +0000 (05:13 +0000)]
[SPARCV9]: Adjust the resultant pointer of DYNAMIC_STACKALLOC with the stack BIAS on sparcV9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196755
91177308-0d34-0410-b5e6-
96231b3b80d8
Venkatraman Govindaraju [Mon, 9 Dec 2013 04:02:15 +0000 (04:02 +0000)]
[Sparc]: Implement getSetCCResultType() in SparcTargetLowering so that umulo/smulo can be lowered on sparcv9 without an assertion error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196751
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Mon, 9 Dec 2013 03:51:42 +0000 (03:51 +0000)]
[AArch64]Add missing pair intrinsics such as:
int32_t vminv_s32(int32x2_t a)
which should be compiled into SMINP Vd.2S,Vn.2S,Vm.2S
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196749
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Mon, 9 Dec 2013 03:34:08 +0000 (03:34 +0000)]
[AArch64]Pattern match failures for truncate store and extend load
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196748
91177308-0d34-0410-b5e6-
96231b3b80d8
Venkatraman Govindaraju [Sun, 8 Dec 2013 22:06:07 +0000 (22:06 +0000)]
[SparcV9]: Expand MULHU/MULHS:i64 and UMUL_LOHI/SMUL_LOHI:i64 on sparcv9.
This fixes PR18150.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196735
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Sun, 8 Dec 2013 20:28:33 +0000 (20:28 +0000)]
Revert 196544 due to internal bot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196732
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Sun, 8 Dec 2013 19:21:47 +0000 (19:21 +0000)]
Make sure we mark these registers as defined. Previously was done
in the td file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196731
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Sun, 8 Dec 2013 16:51:52 +0000 (16:51 +0000)]
Cleaning up of prologue/epilogue code for Mips16. First step
here is to make save/restore into variable number of argument instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196726
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Sun, 8 Dec 2013 15:56:50 +0000 (15:56 +0000)]
ARM: fix folding of stack-adjustment (yet again).
When trying to eliminate an "sub sp, sp, #N" instruction by folding
it into an existing push/pop using dummy registers, we need to account
for the fact that this might affect precisely how "fp" gets set in the
prologue.
We were attempting this, but assuming that *whenever* we performed a
fold it would make a difference. This is false, for example, in:
push {r4, r7, lr}
add fp, sp, #4
vpush {d8}
sub sp, sp, #8
we can fold the "sub" into the "vpush", forming "vpush {d7, d8}".
However, in that case the "add fp" instruction mustn't change, which
we were getting wrong before.
Should fix PR18160.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196725
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Sun, 8 Dec 2013 12:16:20 +0000 (12:16 +0000)]
Fixed CRLF
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196719
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Sun, 8 Dec 2013 11:35:09 +0000 (11:35 +0000)]
Ensure bitcode encoding of visibility styles stays stable. Patch by Boaz Ouriel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196718
91177308-0d34-0410-b5e6-
96231b3b80d8