Davide Italiano [Tue, 6 Dec 2016 21:52:47 +0000 (21:52 +0000)]
[BDCE/DebugInfo] Preserve llvm.dbg.value's argument.
BDCE has two phases:
1. It asks SimplifyDemandedBits if all the bits of an instruction are dead, and if so,
replaces all its uses with the constant zero.
2. Then, it asks SimplifyDemandedBits again if the instruction is really dead
(no side effects etc..) and if so, eliminates it.
Now, in 1) if all the bits of an instruction are dead, we may end up replacing a dbg use:
%call = tail call i32 (...) @g() #4, !dbg !15
tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !8, metadata !16), !dbg !17
->
%call = tail call i32 (...) @g() #4, !dbg !15
tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !8, metadata !16), !dbg !17
but not eliminating the call because it may have arbitrary side effects.
In other words, we lose some debug informations.
This patch fixes the problem making sure that BDCE does nothing with the instruction if
it has side effects and no non-dbg uses.
Differential Revision: https://reviews.llvm.org/D27471
llvm-svn: 288851
Reid Kleckner [Tue, 6 Dec 2016 21:44:41 +0000 (21:44 +0000)]
Disable -Wweak-vtables when there are no key functions
Our -Wweak-vtables diagnostic is powered by our key function
calculation, which checks if key functions are enabled. We won't find
any key functions in C++ ABIs that lack key functions, so -Wweak-vtables
was warning on every dynamic class before this change. So, turn off this
warning in ABIs without key functions.
Addresses PR31220
llvm-svn: 288850
Tom Stellard [Tue, 6 Dec 2016 21:13:30 +0000 (21:13 +0000)]
AMDGPU/SI: Don't move copies of immediates to the VALU
Summary:
If we write an immediate to a VGPR and then copy the VGPR to an
SGPR, we can replace the copy with a S_MOV_B32 sgpr, imm, rather than
moving the copy to the SALU.
Reviewers: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye
Differential Revision: https://reviews.llvm.org/D27272
llvm-svn: 288849
Tim Northover [Tue, 6 Dec 2016 21:02:19 +0000 (21:02 +0000)]
GlobalISel: correctly handle small args via memory.
We were rounding size in bits down rather than up, leading to 0-sized slots for
i1 (assert!) and bugs for other types not byte-aligned.
llvm-svn: 288848
Zvi Rackover [Tue, 6 Dec 2016 19:35:20 +0000 (19:35 +0000)]
[X86] Prefer reduced width multiplication over pmulld on Silvermont
Summary:
Prefer expansions such as: pmullw,pmulhw,unpacklwd,unpackhwd over pmulld.
On Silvermont [source: Optimization Reference Manual]:
PMULLD has a throughput of 1/11 [instruction/cycles].
PMULHUW/PMULHW/PMULLW have a throughput of 1/2 [instruction/cycles].
Fixes pr31202.
Analysis of this issue was done by Fahana Aleen.
Reviewers: wmi, delena, mkuper
Subscribers: RKSimon, llvm-commits
Differential Revision: https://reviews.llvm.org/D27203
llvm-svn: 288844
Meador Inge [Tue, 6 Dec 2016 19:22:04 +0000 (19:22 +0000)]
[llgo] Remove support for LLVM attributes
llgo supports the application of LLVM attributes to global objects
and functions. This "feature" is undocumented and untested. As
discusses in D27442, it should be removed.
Differential Revision: https://reviews.llvm.org/D27474
llvm-svn: 288843
Simon Pilgrim [Tue, 6 Dec 2016 19:09:37 +0000 (19:09 +0000)]
[DAGCombine] Add (sext_in_reg (zext x)) -> (sext x) combine
Handle the case where a sign extension has ended up being split into separate stages (typically to get around vector legal ops) and a zext + sext_in_reg gets inserted.
Differential Revision: https://reviews.llvm.org/D27461
llvm-svn: 288842
Sanjay Patel [Tue, 6 Dec 2016 19:05:46 +0000 (19:05 +0000)]
[InstSimplify] add folds for and-of-icmps with same operands
All of these (and a few more) are already handled by InstCombine,
but we shouldn't have to wait until then to simplify these because
they're cheap to deal with here in InstSimplify.
This is the 'and' sibling of the earlier 'or' patch:
https://reviews.llvm.org/rL288833
llvm-svn: 288841
Tim Northover [Tue, 6 Dec 2016 19:02:15 +0000 (19:02 +0000)]
GlobalISel: fall back gracefully when we hit unhandled legalizer default.
llvm-svn: 288840
Simon Pilgrim [Tue, 6 Dec 2016 18:58:25 +0000 (18:58 +0000)]
[SelectionDAG] We can ignore knownbits from an undef shuffle vector index if we don't actually demand that element
llvm-svn: 288839
Kelvin Li [Tue, 6 Dec 2016 18:50:20 +0000 (18:50 +0000)]
[OpenMP] Fix typo in the test case. NFC.
llvm-svn: 288838
Sanjay Patel [Tue, 6 Dec 2016 18:46:54 +0000 (18:46 +0000)]
[InstSimplify] add tests for and-of-icmps; NFC
llvm-svn: 288837
Tim Northover [Tue, 6 Dec 2016 18:38:38 +0000 (18:38 +0000)]
GlobalISel: handle G_SEQUENCE fallbacks gracefully.
There were two problems:
+ AArch64 was reusing random data from its binary op tables, which is
complete nonsense for G_SEQUENCE.
+ Even when AArch64 gave up and said it couldn't handle G_SEQUENCE,
the generic code asserted.
llvm-svn: 288836
Tim Northover [Tue, 6 Dec 2016 18:38:34 +0000 (18:38 +0000)]
GlobalISel: allow G_SELECT instructions for pointers.
llvm-svn: 288835
Tim Northover [Tue, 6 Dec 2016 18:38:29 +0000 (18:38 +0000)]
GlobalISel: stop the legalizer from trying to handle oddly-sized types.
It'll almost immediately fail because it always tries to half/double the size
until it finds a legal one. Unfortunately, this triggers an assertion
preventing the DAG fallback from being possible.
llvm-svn: 288834
Sanjay Patel [Tue, 6 Dec 2016 18:09:37 +0000 (18:09 +0000)]
[InstSimplify] add folds for or-of-icmps with same operands
All of these (and a few more) are already handled by InstCombine,
but we shouldn't have to wait until then to simplify these because
they're cheap to deal with here in InstSimplify.
llvm-svn: 288833
George Rimar [Tue, 6 Dec 2016 17:57:42 +0000 (17:57 +0000)]
[ELF] - Teach LLD to recognize PT_OPENBSD_BOOTDATA
Minor patch to fix PR31288
OpenBSD commit:
https://github.com/openbsd/src/commit/
d39116912b9536bd77326260dc5c6e593fd4ee24
Differential revision: https://reviews.llvm.org/D27458
llvm-svn: 288832
George Rimar [Tue, 6 Dec 2016 17:55:52 +0000 (17:55 +0000)]
[llvm-readobj] - Teach readobj to print PT_OPENBSD_BOOTDATA header
These are OpenBSD specific program headers.
OpenBSD commit:
https://github.com/openbsd/src/commit/
d39116912b9536bd77326260dc5c6e593fd4ee24
It is required for fixing PR31288.
Differential revision: https://reviews.llvm.org/D27456
llvm-svn: 288831
Sanjay Patel [Tue, 6 Dec 2016 17:49:10 +0000 (17:49 +0000)]
[InstSimplify] add tests for or-of-icmps; NFC
llvm-svn: 288830
Chris Bieneman [Tue, 6 Dec 2016 17:09:29 +0000 (17:09 +0000)]
[CMake] Fixing clang standalone build
I broke this in r288770.
llvm-svn: 288829
Joerg Sonnenberger [Tue, 6 Dec 2016 17:06:33 +0000 (17:06 +0000)]
Fix FileCheck pattern.
llvm-svn: 288828
Joerg Sonnenberger [Tue, 6 Dec 2016 17:02:41 +0000 (17:02 +0000)]
Allow additional output since e.g. OSX appends flags like
"-mlinker-version=264.3.102" automatically. Wiring down a target on the
other hand is problematic as this actually needs to run codegen and
doesn't work with -###.
llvm-svn: 288827
David Majnemer [Tue, 6 Dec 2016 17:01:02 +0000 (17:01 +0000)]
[MS ABI] Implement more of the Itanium mangling rules
We didn't implement handle corner cases like:
- lambdas used to initialize a field
- lambdas in default argument initializers
This fixes PR31197.
Differential Revision: https://reviews.llvm.org/D27226
llvm-svn: 288826
Simon Pilgrim [Tue, 6 Dec 2016 17:00:47 +0000 (17:00 +0000)]
[X86][SSE] Add knownbits test demonstrating demandedelts not ignoring undef shuffle elements
llvm-svn: 288825
Joerg Sonnenberger [Tue, 6 Dec 2016 16:47:00 +0000 (16:47 +0000)]
Make test case slightly more robust by explicitly passing --sysroot.
Otherwise it would change when DEFAULT_SYSROOT is provided.
llvm-svn: 288823
Joerg Sonnenberger [Tue, 6 Dec 2016 16:40:57 +0000 (16:40 +0000)]
If clang was configured for a DEFAULT_SYSROOT and no --sysroot argument
is seen, record one with the implicit default.
llvm-svn: 288822
Joerg Sonnenberger [Tue, 6 Dec 2016 16:33:22 +0000 (16:33 +0000)]
Allow clang to write compilation database records.
When integrating compilation database output into existing build
systems, two approaches dominate so far. Ad-hoc implementation of the
JSON output rules or using compiler wrappers. This patch adds a new
option "-MJ foo.json" which gives a slightly cleaned up compilation
record. The output is a fragment, i.e. you still need to add the array
markers, but it allows multiple files to be easy merged.
This way the only change in a build system is adding the option with
potentially a per-target output file and merging the files with
something like
(echo '['; cat *.o.json; echo ']' > compilation_database.json
or some additional filtering to remove the trailing comma for strict
JSON compliance.
Differential Revision: https://reviews.llvm.org/D27140
llvm-svn: 288821
Simon Pilgrim [Tue, 6 Dec 2016 15:57:26 +0000 (15:57 +0000)]
[X86][SSE] Added vector sext_in_reg combine tests
llvm-svn: 288819
Jonathan Roelofs [Tue, 6 Dec 2016 15:45:41 +0000 (15:45 +0000)]
Fix doc string typo: s/@__yes/@__objc_yes/
llvm-svn: 288818
George Rimar [Tue, 6 Dec 2016 15:40:02 +0000 (15:40 +0000)]
Removed trailing whitespaces. NFC.
llvm-svn: 288817
George Rimar [Tue, 6 Dec 2016 15:38:15 +0000 (15:38 +0000)]
[Support/ELF] - Add OpenBSD PT_OPENBSD_BOOTDATA constant.
OpenBSD commit for reference:
https://github.com/openbsd/src/commit/
d39116912b9536bd77326260dc5c6e593fd4ee24
llvm-svn: 288816
Simon Pilgrim [Tue, 6 Dec 2016 15:17:50 +0000 (15:17 +0000)]
[X86] Improve UMAX/UMIN knownbits test
Test the sequential effect of each op
llvm-svn: 288815
Simon Pilgrim [Tue, 6 Dec 2016 14:50:09 +0000 (14:50 +0000)]
Avoid repeated calls to Op.getOpcode(). NFCI.
llvm-svn: 288814
Malcolm Parsons [Tue, 6 Dec 2016 14:49:18 +0000 (14:49 +0000)]
Fix two clang-tidy misc-move-forwarding-reference warnings
Patch by Michael Sharpe.
llvm-svn: 288813
Daniel Sanders [Tue, 6 Dec 2016 14:39:57 +0000 (14:39 +0000)]
[globalisel][aarch64] Fix unintended assumptions about PartialMappingIdx. NFC.
Summary:
This is NFC but prevents assertions when PartialMappingIdx is tablegen-erated.
The assumptions were:
1) FirstGPR is 0
2) FirstGPR is the first of the First* enumerators.
GPR32 is changed to 1 to demonstrate that assumption #1 is fixed. #2 will
be covered by a subsequent patch that tablegen-erates information and swaps
the order of GPR and FPR as a side effect.
Depends on D27336
Reviewers: ab, t.p.northover, qcolombet
Subscribers: aemerson, rengolin, vkalintiris, dberris, rovka, llvm-commits
Differential Revision: https://reviews.llvm.org/D27337
llvm-svn: 288812
Michael Kruse [Tue, 6 Dec 2016 14:37:39 +0000 (14:37 +0000)]
Update to isl-0.17.1-314-g3106e8d
This version includes an update for imath (isl-0.17.1-49-g2f1c129). It fixes
the compilation under windows, which does not know ssize_t.
In addition, isl-0.17.1-288-g0500299 changed the way isl_test finds the source
directory. It now generates a file isl_srcdir.c at configure-time, containing
the source path, to not require setting the environment variable "srcdir" at
test-time. The cmake build system had to be modified to also generate that file.
llvm-svn: 288811
Daniel Sanders [Tue, 6 Dec 2016 13:55:01 +0000 (13:55 +0000)]
[globalisel][aarch64] Replace magic numbers with corresponding enumerators in ValMappings. NFC
Reviewers: ab, t.p.northover, qcolombet
Subscribers: aemerson, rengolin, vkalintiris, dberris, llvm-commits, rovka
Differential Revision: https://reviews.llvm.org/D27336
llvm-svn: 288810
Daniel Sanders [Tue, 6 Dec 2016 13:48:58 +0000 (13:48 +0000)]
[globalisel][aarch64] Correct argument names in comments.
llvm-svn: 288809
Rafael Espindola [Tue, 6 Dec 2016 13:43:34 +0000 (13:43 +0000)]
Don't print empty PT_LOAD.
If we do, the freebsd dynamic linker tries to call mmap with a size 0,
which fails.
It is hard to avoid creating them when linker scripts are used, so we
just delete empty PT_LOADs at the end.
llvm-svn: 288808
Simon Pilgrim [Tue, 6 Dec 2016 13:29:55 +0000 (13:29 +0000)]
[SLPVectorizer][X86] Tests to show missed buildvector sitofp/fptosi vectorizations
e.g.
buildvector(sitofp(i32), sitofp(i32), sitofp(i32), sitofp(i32)) --> sitofp(buildvector(i32, i32, i32, i32))
llvm-svn: 288807
Oliver Stannard [Tue, 6 Dec 2016 12:59:08 +0000 (12:59 +0000)]
[ARM] Better error message for invalid flag-preserving Thumb1 insts
When we see a non flag-setting instruction for which only the flag-setting
version is available in Thumb1, we should give a better error message than
"invalid instruction".
Differential Revision: https://reviews.llvm.org/D27414
llvm-svn: 288805
Ayman Musa [Tue, 6 Dec 2016 12:24:14 +0000 (12:24 +0000)]
[X86][AVX512] Detect repeated constant patterns in BUILD_VECTOR suitable for broadcasting.
Check if a build_vector node includes a repeated constant pattern and replace it with a broadcast of that pattern.
For example:
"build_vector <0, 1, 2, 3, 0, 1, 2, 3>" would be replaced by "broadcast <0, 1, 2, 3>"
Differential Revision: https://reviews.llvm.org/D26802
llvm-svn: 288804
Rafael Espindola [Tue, 6 Dec 2016 12:19:24 +0000 (12:19 +0000)]
Don't crash trying to write an 0 addend.
For preemptable symbols the dynamic linker does all the work. Trying
to compute the addend is at best wasteful and can also lead to crashes
in cases of programs that uses tls but doesn't define any tls
variables.
llvm-svn: 288803
Rafael Espindola [Tue, 6 Dec 2016 12:15:12 +0000 (12:15 +0000)]
Make the test a bit more strict. NFC.
llvm-svn: 288802
Simon Pilgrim [Tue, 6 Dec 2016 12:12:20 +0000 (12:12 +0000)]
[X86] Add tests to show missed opportunities to calculate knownbits in SMAX/SMIN/UMAX/UMIN
llvm-svn: 288801
Nemanja Ivanovic [Tue, 6 Dec 2016 11:47:14 +0000 (11:47 +0000)]
[PowerPC] Improvements for BUILD_VECTOR Vol. 4
This is the final patch in the series of patches that improves
BUILD_VECTOR handling on PowerPC. This adds a few peephole optimizations
to remove redundant instructions. It also adds a large test case which
encompasses a large set of code patterns that build vectors - this test
case was the motivator for this series of patches.
Differential Revision: https://reviews.llvm.org/D26066
llvm-svn: 288800
Daniel Sanders [Tue, 6 Dec 2016 11:33:04 +0000 (11:33 +0000)]
[globalisel][aarch64] Prefix PartialMappingIdx enumerators with 'PMI_' to fit coding standards.
This also stops things like 'None' polluting the llvm::AArch64 namespace.
llvm-svn: 288799
Simon Pilgrim [Tue, 6 Dec 2016 11:27:19 +0000 (11:27 +0000)]
Fix MSVC -Wmicrosoft-enum-value 'enumerator value is not representable' warning
llvm-svn: 288798
Pavel Labath [Tue, 6 Dec 2016 11:24:51 +0000 (11:24 +0000)]
Use Timeout<> in EvaluateExpressionOptions class
llvm-svn: 288797
Simon Pilgrim [Tue, 6 Dec 2016 11:12:53 +0000 (11:12 +0000)]
Fix MSVC bool to uint64_t promotion warning
llvm-svn: 288796
Chandler Carruth [Tue, 6 Dec 2016 10:29:23 +0000 (10:29 +0000)]
[LCG] Add some much needed asserts and verify runs to uncover
a hilarious bug and fix it.
We somehow were never verifying the RefSCCs newly formed when
splitting an existing one apart, and when verifying them we weren't
really checking the SCC indices mapping effectively.
If we had been, it would have been blindingly obvious that right after
putting something int `RC.SCCs` we should update `RC.SCCIndices` instead
of `SCCIndices` which we were about to clear and rebuild anyways. =[
Anyways, this is thoroughly covered by existing tests now that we
actually verify things properly.
llvm-svn: 288795
Florian Hahn [Tue, 6 Dec 2016 10:24:55 +0000 (10:24 +0000)]
[framelowering] Improve tracking of first CS pop instruction.
Summary: This patch makes sure FirstCSPop and MBBI never point to DBG_VALUE instructions, which affected the code generated.
Reviewers: mkuper, aprantl, MatzeB
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27343
llvm-svn: 288794
Benjamin Kramer [Tue, 6 Dec 2016 10:23:07 +0000 (10:23 +0000)]
Also recognize -std=iso9899:201x
It should already be handled but a typo in the LANGSTANDARD() definition
was introduced in r147220.
Patch by Alexander Richardson, test case by me.
Differential Revision:https://reviews.llvm.org/D27427
llvm-svn: 288793
Sam McCall [Tue, 6 Dec 2016 10:14:36 +0000 (10:14 +0000)]
Add missing parens in assert.
Summary: Add missing parens in assert, which warn in GCC.
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27448
llvm-svn: 288792
Eric Liu [Tue, 6 Dec 2016 10:12:23 +0000 (10:12 +0000)]
[clang-move] ignore unsupported symbol kinds when checking if all symbols are moved.
llvm-svn: 288791
Chandler Carruth [Tue, 6 Dec 2016 10:06:06 +0000 (10:06 +0000)]
[PM] Basic cleanups to CGSCC update code, NFC.
Just using InstIterator, simpler loop structures, and making better use
of the visit callback infrastructure.
llvm-svn: 288790
Eric Fiselier [Tue, 6 Dec 2016 09:48:32 +0000 (09:48 +0000)]
Revert r288787: Add missing stdbool.h module.
Reverting because I didn't properly test this patch. Although it's probably
correct to add a stdbool_h module I thought the change fixed more than it did.
I'll re-commit after more investigation.
llvm-svn: 288789
Dean Michael Berris [Tue, 6 Dec 2016 09:43:44 +0000 (09:43 +0000)]
[XRay][compiler-rt] Only add unit tests if we're building XRay.
As constructed before this patch, in case we run into case where we
don't actually build the XRay library, we really ought to not be adding
the unit test runs. This should fix the bootstrap build failures.
This is a follow-up further to D26232.
llvm-svn: 288788
Eric Fiselier [Tue, 6 Dec 2016 09:41:50 +0000 (09:41 +0000)]
Add missing stdbool.h module. The test suite now passes on OS X with modules
llvm-svn: 288787
Dean Michael Berris [Tue, 6 Dec 2016 08:40:16 +0000 (08:40 +0000)]
[XRay][compiler-rt] CMake fixes for XRay -- take 2.
The bootstrap buildbot complains about not being able to find the
unittests for XRay, when the conditionals to include or not include
tests and unit tests don't match.
This is a follow-up to D26232.
llvm-svn: 288786
Dean Michael Berris [Tue, 6 Dec 2016 08:22:31 +0000 (08:22 +0000)]
[XRay][compiler-rt] Fix unit test adding logic.
Before this change we would add the unit tests potentially even if we
don't actually include the unit tests.
This is a follow-up on D26232.
llvm-svn: 288785
Craig Topper [Tue, 6 Dec 2016 08:08:12 +0000 (08:08 +0000)]
[X86] Remove another weird scalar sqrt/rcp/rsqrt pattern.
This pattern turned a vector sqrt/rcp/rsqrt operation of sse_load_f32/f64 into the the scalar instruction for the operation and put undef into the upper bits. For correctness, the resulting code should still perform the sqrt/rcp/rsqrt on the upper bits after the load is extended since that's what the operation asked for. Particularly in the case where the upper bits are 0, in that case we need calculate the sqrt/rcp/rsqrt of the zeroes and keep the result in the upper-bits. This implies we should be using the packed instruction still.
The only test case for this pattern is one I just added so there was no coverage of this.
llvm-svn: 288784
Craig Topper [Tue, 6 Dec 2016 08:08:09 +0000 (08:08 +0000)]
[X86] Add test case demonstrating a case where a vector sqrt being passed (scalar_to_vector loadf64) uses a scalar sqrt instruction.
This occurs due to a pattern that uses sse_load_f32/f64 with vector sqrt/rcp/rsqrt operations and turns them into scalar instructions. Perhaps for the case were the upper bits come from undef this is ok. I believe a (vzmovl load64) would do the same thing but those seems to become vzload instead and selectScalarSSELoad doesn't handle that today. In that case we should be performing the vector operation on the zeros in the upper bits which is not equivalent to using a scalar instruction.
I will remove this pattern in a follow up patch. There appears to be no other test content for it.
llvm-svn: 288783
Craig Topper [Tue, 6 Dec 2016 08:08:07 +0000 (08:08 +0000)]
[X86] Regenerate a test using update_llc_test_checks.py
llvm-svn: 288782
Craig Topper [Tue, 6 Dec 2016 08:08:04 +0000 (08:08 +0000)]
[X86] Remove bad pattern that caused 128-bit loads being used by scalar sqrt/rcp/rsqrt intrinsics to select the memory form of the corresponding instruction and violate the semantics of the intrinsic.
The intrinsics are supposed to pass the upper bits straight through to their output register. This means we need to make sure we still perform the 128-bit load to get those upper bits to pass to give to the instruction since the memory form of the instruction only reads 32 or 64 bits.
llvm-svn: 288781
Craig Topper [Tue, 6 Dec 2016 08:08:01 +0000 (08:08 +0000)]
[X86] Add test case that shows a scalar sqrtsd intrinsic of a 128-bit vector load using the load form of the sqrtsd instruction which violates the intrinsic semantics.
The sqrtsd instruction only loads 64-bits and writes bits 63:0 with the sqrt result. Bits 127:64 are preserved in the destination register. The semantics of the intrinsic indicate bits 127:64 should come from the intrinsic argument which in this case is a 128-bit load. So the generated code should have a 128-bit load and use a register form of sqrtsd.
llvm-svn: 288780
Craig Topper [Tue, 6 Dec 2016 08:07:58 +0000 (08:07 +0000)]
[X86] Correct pattern for VSQRTSSr_Int, VSQRTSDr_Int, VRCPSSr_Int, and VRSQRTSSr_Int to not have an IMPLICIT_DEF on the first input. The semantics of the intrinsic are clear and not undefined.
The intrinsic takes one argument, the lower bits are affected by the operation and the upper bits should be passed through. The instruction itself takes two operands, the high bits of the first operand are passed through and the low bits of the second operand are modified by the operation. To match this to the intrinsic we should pass the single intrinsic input to both operands.
I had to remove the stack folding test for these instructions since they depended on the incorrect behavior. The same register is now used for both inputs so the load can't be folded.
llvm-svn: 288779
Eric Fiselier [Tue, 6 Dec 2016 07:40:46 +0000 (07:40 +0000)]
Fix stdio module build on OS X
llvm-svn: 288778
Weiming Zhao [Tue, 6 Dec 2016 07:13:15 +0000 (07:13 +0000)]
builtins: Add ARM Thumb1 implementation for uidiv and uidivmod
This is a resubmit of r288710 due to breakage of Darwin armv7em.
llvm-svn: 288777
Dean Michael Berris [Tue, 6 Dec 2016 06:58:15 +0000 (06:58 +0000)]
[XRay][compiler-rt] Explicitly initialise members.
Before this, the change committed in D26232 might have an uninitialised
std::atomic<bool> that may or may not have a valid state. On aarch64
this breaks consistently, while it doesn't manifest as a problem in
x86_64.
This is an attempt to un-break this in aarch64.
llvm-svn: 288776
Dean Michael Berris [Tue, 6 Dec 2016 06:24:08 +0000 (06:24 +0000)]
[XRay][compiler-rt] XRay Buffer Queue
This implements a simple buffer queue to manage a pre-allocated queue of
fixed-sized buffers to hold XRay records. We need this to support
Flight Data Recorder (FDR) mode. We also implement this as a sub-library
first to allow for development before actually using it in an
implementation.
Some important properties of the buffer queue:
- Thread-safe enqueueing/dequeueing of fixed-size buffers.
- Pre-allocation of buffers at construction.
This is a re-roll of the previous attempt to submit, because it caused
failures in arm and aarch64.
Reviewers: majnemer, echristo, rSerge
Subscribers: tberghammer, danalbert, srhines, modocache, mehdi_amini, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D26232
llvm-svn: 288775
Chris Bieneman [Tue, 6 Dec 2016 06:00:49 +0000 (06:00 +0000)]
[ObjectYAML] First bit of support for encoding DWARF in MachO
This patch adds the starting support for encoding data from the MachO __DWARF segment. The first section supported is the __debug_str section because it is the simplest.
llvm-svn: 288774
Chris Bieneman [Tue, 6 Dec 2016 05:41:32 +0000 (05:41 +0000)]
Revert "builtins: Add ARM Thumb1 implementation for uidiv and uidivmod"
This reverts commit r288710.
r288710 breaks building the builtin libraries on Darwin for armv7em.
Build logs may still be avaialable here:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/12035/console
llvm-svn: 288773
Andrew Wilkins [Tue, 6 Dec 2016 05:39:14 +0000 (05:39 +0000)]
[llgo] set debuglocs for calls in synthetic functions
Synthesized functions do not have valid locations,
and so we were not setting a debug location. Recent
changes to DI require that function call instructions
within a function having DI must have a location set.
We just set the debug location to line=0, col=0.
Reviewers: pcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D22905
llvm-svn: 288772
Craig Topper [Tue, 6 Dec 2016 04:58:39 +0000 (04:58 +0000)]
[X86] Remove scalar logical op alias instructions. Just use COPY_FROM/TO_REGCLASS and the normal packed instructions instead
Summary:
This patch removes the scalar logical operation alias instructions. We can just use reg class copies and use the normal packed instructions instead. This removes the need for putting these instructions in the execution domain fixing tables as was done recently.
I removed the loadf64_128 and loadf32_128 patterns as DAG combine creates a narrower load for (extractelt (loadv4f32)) before we ever get to isel.
I plan to add similar patterns for AVX512DQ in a future commit to allow use of the larger register class when available.
Reviewers: spatel, delena, zvi, RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27401
llvm-svn: 288771
Chris Bieneman [Tue, 6 Dec 2016 04:45:11 +0000 (04:45 +0000)]
[CMake] Cleanup TableGen include flags
It is kinda crazy to have llvm/include and llvm/lib/Target in the include path for every tablegen invocation for every tablegen-like tool.
This patch removes those flags from the tablgen function that is called everywhere by instead creating a variable LLVM_TABLEGEN_FLAGS which is setup in the LLVM source directories.
This removes TableGen.cmake's dependency on LLVM_MAIN_SRC_DIR, and LLVM_MAIN_INCLUDE_DIR.
llvm-svn: 288770
Meador Inge [Tue, 6 Dec 2016 04:01:11 +0000 (04:01 +0000)]
[llgo] Update to use the latest IR attribute bindings
A recent commit (r286087) to the LLVM Go bindings that
changed things over to use the new attribute API broke
llgo. This commit updates llgo accordingly.
llvm-svn: 288769
Meador Inge [Tue, 6 Dec 2016 04:00:12 +0000 (04:00 +0000)]
[llgo] Fix `debug` to use latest `DIBuilder` bindings
Two recent commits to the LLVM Go bindings caused breaking changes
to llgo:
1. r284707 - Moving the `AlignInBits` field from `DIBasicType` to
`DIAutoVariable`.
2. r284482 - The `AlignInBits` fields going from `uint64` to `uint32`.
This commit updates llgo accordingly.
llvm-svn: 288768
Philip Reames [Tue, 6 Dec 2016 03:34:33 +0000 (03:34 +0000)]
[LVI] Remove dead code in mergeIn
Integers are expressed in the lattice via constant ranges. They can never be represented by constants or not-constants; those are reserved for non-integer types. This code has been dead for literaly years.
llvm-svn: 288767
Philip Reames [Tue, 6 Dec 2016 03:22:03 +0000 (03:22 +0000)]
[LVI] Extract a helper function
Extracting a helper function out of solveBlockValue makes the contract around the cache much easier to understand.
llvm-svn: 288766
Philip Reames [Tue, 6 Dec 2016 03:01:08 +0000 (03:01 +0000)]
[LVI] Hide the last markX function on LVILatticeVal
This completes a small series of patches to hide the stateful updates of LVILatticeVal from the consuming code. The only remaining stateful API is mergeIn.
llvm-svn: 288765
Philip Reames [Tue, 6 Dec 2016 02:54:16 +0000 (02:54 +0000)]
[LVI] Hide a confusing internal interface
llvm-svn: 288764
Mandeep Singh Grang [Tue, 6 Dec 2016 02:49:17 +0000 (02:49 +0000)]
[llvm] Fix D26214: Move error handling out of MC and to the callers.
Summary: Related clang patch; https://reviews.llvm.org/D27360
Reviewers: t.p.northover, grosbach, compnerd, echristo
Subscribers: compnerd, mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D27359
llvm-svn: 288763
Mandeep Singh Grang [Tue, 6 Dec 2016 02:49:16 +0000 (02:49 +0000)]
[clang] Fix D26214: Move error handling out of MC and to the callers.
Summary: Related llvm patch: https://reviews.llvm.org/D27359
Reviewers: echristo, t.p.northover, rengolin, grosbach, compnerd
Subscribers: mehdi_amini, cfe-commits, llvm-commits
Tags: #clang-c
Differential Revision: https://reviews.llvm.org/D27360
llvm-svn: 288762
Philip Reames [Tue, 6 Dec 2016 02:36:58 +0000 (02:36 +0000)]
[LVI] Remove duplicate code using existing helper function
llvm-svn: 288761
Casey Carter [Tue, 6 Dec 2016 02:28:19 +0000 (02:28 +0000)]
std::get<0>([std::variant constant expression]) *is* noexcept.
Differential review: http://reviews.llvm.org/D27436
llvm-svn: 288760
Davide Italiano [Tue, 6 Dec 2016 02:26:50 +0000 (02:26 +0000)]
Revert "[SCCP] Remove manual folding of terminator instructions."
This reverts commit r288725 as it broke a bot.
llvm-svn: 288759
Zijiao Ma [Tue, 6 Dec 2016 02:22:08 +0000 (02:22 +0000)]
Refactor TargetParserTests.
The TargetParser tests are a bit redundant. Refactor them in a more
repeatable way.
llvm-svn: 288758
Rui Ueyama [Tue, 6 Dec 2016 02:19:30 +0000 (02:19 +0000)]
Inline MergeInputSection::getData().
This change seems to make LLD 0.6% faster when linking Clang with
debug info. I don't want us to have lots of local optimizations,
but this function is very hot, and the improvement is small but
not negligible, so I think it's worth doing.
llvm-svn: 288757
Richard Trieu [Tue, 6 Dec 2016 01:42:28 +0000 (01:42 +0000)]
Clean up some Sema checking code. NFC
- Rename CheckMinZero to CheckMaxUnsignedZero to reflect its actual purpose.
- Remove unused parameters from CheckAbsoluteValueFunction and
CheckMaxUnsignedZero functions.
- Refactor the function name check so both functions can use the same one.
llvm-svn: 288756
Eric Fiselier [Tue, 6 Dec 2016 01:34:24 +0000 (01:34 +0000)]
Fix C++03 modules build
llvm-svn: 288755
Mehdi Amini [Tue, 6 Dec 2016 01:23:04 +0000 (01:23 +0000)]
Introduces cmake option `LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING`
Summary:
We recently introduced a feature that enforce at link-time that the
LLVM headers used by a clients are matching the ABI setting of the
LLVM library linked to.
However for clients that are using only headers from ADT and promise
they won't call into LLVM, this is forcing to link libSupport. This
new flag is intended to provide a way to configure LLVM with this
promise for such client.
Reviewers: bob.wilson, compnerd
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D27432
llvm-svn: 288754
Stephan T. Lavavej [Tue, 6 Dec 2016 01:14:51 +0000 (01:14 +0000)]
[libcxx] [test] D27269: Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 3/4.
test/std/containers/sequences/vector.bool/copy.pass.cpp
test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp
test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
Change "unsigned s = x.size();" to "typename C::size_type s = x.size();"
because that's what it returns.
test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp
Include <cstddef>, then change "unsigned n = T::length(s);"
to "std::size_t n = T::length(s);" because that's what char_traits returns.
test/std/strings/basic.string/string.cons/substr.pass.cpp
Change unsigned to typename S::size_type because that's what str.size() returns.
test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
This was needlessly truncating std::size_t to unsigned.
It's being used to compare and initialize std::size_t.
llvm-svn: 288753
Stephan T. Lavavej [Tue, 6 Dec 2016 01:14:43 +0000 (01:14 +0000)]
[libcxx] [test] D27268: Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 2/4.
Use static_cast<int> when storing size_t in int (or passing size_t to int).
Also, remove a spurious semicolon in test/support/archetypes.hpp.
test/support/count_new.hpp
Additionally, change data members (and parameters) to size_t.
llvm-svn: 288752
Stephan T. Lavavej [Tue, 6 Dec 2016 01:14:29 +0000 (01:14 +0000)]
[libcxx] [test] D27267: Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 1/4.
Replace "int n = str_.size();" with "int n = static_cast<int>(str_.size());".
int is the correct type to use, because we're eventually calling
"base::pbump(n+1);" where base is std::basic_streambuf.
N4606 27.6.3.3.3 [streambuf.put.area]/4 declares: "void pbump(int n);"
llvm-svn: 288751
Stephan T. Lavavej [Tue, 6 Dec 2016 01:14:06 +0000 (01:14 +0000)]
[libcxx] [test] D27266: Remove spurious semicolons.
llvm-svn: 288750
Stephan T. Lavavej [Tue, 6 Dec 2016 01:13:51 +0000 (01:13 +0000)]
[libcxx] [test] D27025: Fix MSVC warning C4389 "signed/unsigned mismatch", part 12/12.
Various changes:
test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp
This is comparing value_type to unsigned. value_type is sometimes int and sometimes struct S (implicitly constructible from int).
static_cast<value_type>(unsigned) silences the warning and doesn't do anything bad (as the values in question are small).
test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
This is comparing an int remote-element to size_t. The values in question are small and non-negative,
so either type is fine. I think that converting int to size_t is marginally better here than the reverse.
test/std/containers/sequences/deque/deque.cons/size.pass.cpp
DefaultOnly::count is int (and non-negative). When comparing to unsigned, use static_cast<unsigned>.
test/std/strings/basic.string/string.access/index.pass.cpp
We're comparing char to '0' through '9', but formed with the type size_t. Add static_cast<char>.
test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
Include <cstddef> for pedantic correctness (this test was already mentioning std::size_t).
"v[i] == (i & 1)" was comparing bool to size_t. Saying "v[i] == ((i & 1) != 0)" smashes the RHS to bool.
llvm-svn: 288749
Stephan T. Lavavej [Tue, 6 Dec 2016 01:13:40 +0000 (01:13 +0000)]
[libcxx] [test] D27024: Fix MSVC warning C4389 "signed/unsigned mismatch", part 11/12.
Change "unsigned n = 0;" to "int n = 0;". It's being compared to int elements and ptrdiff_t distances.
test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
This one's a little special, but not really. "*i == n" is comparing MoveOnly to n.
MoveOnly is implicitly constructible from int, so int is the correct type to use here.
llvm-svn: 288748
Stephan T. Lavavej [Tue, 6 Dec 2016 01:13:29 +0000 (01:13 +0000)]
[libcxx] [test] D27023: Fix MSVC warning C4389 "signed/unsigned mismatch", part 10/12.
Add static_cast<int>. In these cases, the values are guaranteed to be small-ish,
and they're being compared to int elements.
test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
Use int instead of unsigned to iterate from 0 to 10.
llvm-svn: 288747
Stephan T. Lavavej [Tue, 6 Dec 2016 01:13:14 +0000 (01:13 +0000)]
[libcxx] [test] D27022: Fix MSVC warning C4389 "signed/unsigned mismatch", part 9/12.
Add static_cast<std::size_t> to more comparisons. (Performed manually, unlike part 8/12.)
Also, include <cstddef> when it wasn't already being included.
llvm-svn: 288746