Michael Zolotukhin [Tue, 2 Dec 2014 22:59:02 +0000 (22:59 +0000)]
Apply loop-rotate to several vectorizer tests.
Such loops shouldn't be vectorized due to the loops form.
After applying loop-rotate (+simplifycfg) the tests again start to check
what they are intended to check.
llvm-svn: 223170
Fariborz Jahanian [Tue, 2 Dec 2014 22:42:52 +0000 (22:42 +0000)]
Another warning with no group name bites the dust.
rdar://
19116886
llvm-svn: 223168
Justin Bogner [Tue, 2 Dec 2014 22:38:52 +0000 (22:38 +0000)]
InstrProf: Remove some pointless indirection (NFC)
It doesn't make much sense to have std::unique_ptrs of std::string and
std::vector. Avoid some useless indirection by using these types
directly.
llvm-svn: 223166
Simon Pilgrim [Tue, 2 Dec 2014 22:31:23 +0000 (22:31 +0000)]
[X86][SSE] Keep 4i32 vector insertions in integer domain on SSE4.1 targets
4i32 shuffles for single insertions into zero vectors lowers to X86vzmovl which was using (v)blendps - causing domain switch stalls. This patch fixes this by using (v)pblendw instead.
The updated tests on test/CodeGen/X86/sse41.ll still contain a domain stall due to the use of insertps - I'm looking at fixing this in a future patch.
Differential Revision: http://reviews.llvm.org/D6458
llvm-svn: 223165
Alexey Samsonov [Tue, 2 Dec 2014 22:20:11 +0000 (22:20 +0000)]
Replace InternalScopedBuffer<char> with InternalScopedString where applicable.
Summary: No functionality change.
Test Plan: make check-all
Reviewers: kcc
Reviewed By: kcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6472
llvm-svn: 223164
Chris Matthews [Tue, 2 Dec 2014 22:19:21 +0000 (22:19 +0000)]
Give lit a --xunit-xml-output option for saving results in xunit format
--xunit-xml-output saves test results to disk in JUnit's xml format. This will allow Jenkins to report the details of a lit run.
Based on a patch by David Chisnall.
llvm-svn: 223163
Kaelyn Takata [Tue, 2 Dec 2014 22:05:35 +0000 (22:05 +0000)]
Diagnose TypoExprs in a couple of error cases in ParsePostfixExpressionSuffix.
Also have CorrectDelayedTyposInExpr check that the Expr* isn't null
before trying to access its members. Fixes PR21679.
llvm-svn: 223162
Hal Finkel [Tue, 2 Dec 2014 22:01:00 +0000 (22:01 +0000)]
[PowerPC] Implement readcyclecounter for PPC32
We've long supported readcyclecounter on PPC64, but it is easier there (the
read of the 64-bit time-base register can be accomplished via a single
instruction). This now provides an implementation for PPC32 as well. On PPC32,
the time-base register is still 64 bits, but can only be read 32 bits at a time
via two separate SPRs. The ISA manual explains how to do this properly (it
involves re-reading the upper bits and looping if the counter has wrapped while
being read).
This requires PPC to implement a custom integer splitting legalization for the
READCYCLECOUNTER node, turning it into a target-specific SDAG node, which then
gets turned into a pseudo-instruction, which is then expanded to the necessary
sequence (which has three SPR reads, the comparison and the branch).
Thanks to Paul Hargrove for pointing out to me that this was still unimplemented.
llvm-svn: 223161
Tom Stellard [Tue, 2 Dec 2014 22:00:07 +0000 (22:00 +0000)]
R600/SI: Emit amd_kernel_code_t header for AMDGPU environment
llvm-svn: 223160
Eric Christopher [Tue, 2 Dec 2014 21:57:15 +0000 (21:57 +0000)]
Make sure that the TargetOptions operator== is checking the
full contents of the class.
llvm-svn: 223159
Alexey Samsonov [Tue, 2 Dec 2014 21:40:41 +0000 (21:40 +0000)]
Add missing #include to fix Android build.
llvm-svn: 223157
Lang Hames [Tue, 2 Dec 2014 21:36:24 +0000 (21:36 +0000)]
[AArch64][Stackmaps] Optimize stackmap shadows on AArch64.
Reduce the number of nops emitted for stackmap shadows on AArch64 by counting
non-stackmap instructions up to the next branch target towards the requested
shadow.
<rdar://problem/
14959522>
llvm-svn: 223156
Zachary Turner [Tue, 2 Dec 2014 21:32:44 +0000 (21:32 +0000)]
Fix broken test suite on Windows after r223091.
Differential Revision: http://reviews.llvm.org/D6484
Reviewed by: Oleksiy Vyalov
llvm-svn: 223155
Tom Stellard [Tue, 2 Dec 2014 21:28:53 +0000 (21:28 +0000)]
R600/SI: Move more information into SIProgramInfo struct
llvm-svn: 223154
Eric Christopher [Tue, 2 Dec 2014 21:09:01 +0000 (21:09 +0000)]
Add bindings for the rest of the MCJIT options that we previously
had support for. We're still missing a binding for an MCJIT
memory manager.
llvm-svn: 223153
Tobias Grosser [Tue, 2 Dec 2014 21:04:20 +0000 (21:04 +0000)]
checkout_isl: Do not fail in presence of an old CLooG checkout
This should help our buildbots and may also simplify life for other people.
llvm-svn: 223152
Matt Arsenault [Tue, 2 Dec 2014 21:02:20 +0000 (21:02 +0000)]
R600: Cleanup some tests and add missing testcases
llvm-svn: 223151
Philip Reames [Tue, 2 Dec 2014 21:01:48 +0000 (21:01 +0000)]
Restructure some assertion checking based on post commit feedback by Aaron and Tom.
llvm-svn: 223150
Nico Weber [Tue, 2 Dec 2014 20:41:18 +0000 (20:41 +0000)]
Wrap to 80 columns. No behavior change.
llvm-svn: 223149
Daniel Sanders [Tue, 2 Dec 2014 20:40:27 +0000 (20:40 +0000)]
[mips] Fix passing of small structures for big-endian O32.
Summary:
Like N32/N64, they must be passed in the upper bits of the register.
The new code could be merged with the existing if-statements but I've
refrained from doing this since it will make porting the O32 implementation
to tablegen harder later.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6463
llvm-svn: 223148
Roman Divacky [Tue, 2 Dec 2014 20:03:22 +0000 (20:03 +0000)]
Introduce CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing.
Previously .cpu directive in ARM assembler didnt switch to the new CPU and
therefore acted as a nop. This implemented real action for .cpu and eg.
allows to assembler FreeBSD kernel with -integrated-as.
llvm-svn: 223147
Tobias Grosser [Tue, 2 Dec 2014 19:49:40 +0000 (19:49 +0000)]
Make checkout isl script executable
llvm-svn: 223146
Alexey Samsonov [Tue, 2 Dec 2014 19:48:40 +0000 (19:48 +0000)]
Simplify Symbolizer::SymbolizePC() interface.
Return a linked list of AddressInfo objects, instead of using an array of
these objects as an output parameter. This simplifies the code in callers
of this function (especially TSan).
Fix a few memory leaks from internal allocator, when the returned
AddressInfo objects were not properly cleared.
llvm-svn: 223145
Tom Stellard [Tue, 2 Dec 2014 19:45:05 +0000 (19:45 +0000)]
R600/SI: Refactor AMDGPUAsmPrinter::EmitProgramInfoSI()
llvm-svn: 223144
Philip Reames [Tue, 2 Dec 2014 19:37:00 +0000 (19:37 +0000)]
[Statepoints 4/4] Statepoint infrastructure for garbage collection: Documentation
This is the fourth and final patch in the statepoint series. It contains the documentation for the statepoint intrinsics and their usage.
There's definitely still room to improve the documentation here, but I wanted to get this landed so it was available for others. There will likely be a series of small cleanup changes over the next few weeks as we work to clarify and revise the documentation. If you have comments or questions, please feel free to discuss them either in this commit thread, the original review thread, or on llvmdev. Comments are more than welcome.
Reviewed by: atrick, ributzka
Differential Revision: http://reviews.llvm.org/D5683
llvm-svn: 223143
Philip Reames [Tue, 2 Dec 2014 19:28:57 +0000 (19:28 +0000)]
Appease a build bot complaining about an unused variable that's used in an assertion.
llvm-svn: 223142
Johannes Doerfert [Tue, 2 Dec 2014 19:26:58 +0000 (19:26 +0000)]
Drop Cloog support
This commit drops the Cloog support for Polly. The scripts and
documentation are changed to only use isl as prerequisity. In the code
all Cloog specific parts have been removed and all relevant tests have
been ported to the isl backend when it was created.
llvm-svn: 223141
JF Bastien [Tue, 2 Dec 2014 19:19:59 +0000 (19:19 +0000)]
Make le64 DescriptionString consistent with other targets.
Summary:
In particular, remove the defaults and reorder fields so it matches the result of DataLayout::getStringDescription().
Change by David Neto.
Reviewers: dschuff, sdt
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6482
llvm-svn: 223140
Reid Kleckner [Tue, 2 Dec 2014 18:59:08 +0000 (18:59 +0000)]
cmake: Remove MAXPATHLEN define as autoconf does not provide it
Presumably it was added to the CMake system when MAXPATHLEN was still
used by code built for Windows. Currently only lib/Support/Path.inc uses
MAXPATHLEN, and it should be available on all Unices.
llvm-svn: 223139
Reid Kleckner [Tue, 2 Dec 2014 18:58:38 +0000 (18:58 +0000)]
Remove '#undef const' from config.h.cmake to sync with autoconf
This define was removed from config.h.in when Rafael removed our use of
libtool.
llvm-svn: 223138
Philip Reames [Tue, 2 Dec 2014 18:50:36 +0000 (18:50 +0000)]
[Statepoints 3/4] Statepoint infrastructure for garbage collection: SelectionDAGBuilder
This is the third patch in a small series. It contains the CodeGen support for lowering the gc.statepoint intrinsic sequences (223078) to the STATEPOINT pseudo machine instruction (223085). The change also includes the set of helper routines and classes for working with gc.statepoints, gc.relocates, and gc.results since the lowering code uses them.
With this change, gc.statepoints should be functionally complete. The documentation will follow in the fourth change, and there will likely be some cleanup changes, but interested parties can start experimenting now.
I'm not particularly happy with the amount of code or complexity involved with the lowering step, but at least it's fairly well isolated. The statepoint lowering code is split into it's own files and anyone not working on the statepoint support itself should be able to ignore it.
During the lowering process, we currently spill aggressively to stack. This is not entirely ideal (and we have plans to do better), but it's functional, relatively straight forward, and matches closely the implementations of the patchpoint intrinsics. Most of the complexity comes from trying to keep relocated copies of values in the same stack slots across statepoints. Doing so avoids the insertion of pointless load and store instructions to reshuffle the stack. The current implementation isn't as effective as I'd like, but it is functional and 'good enough' for many common use cases.
In the long term, I'd like to figure out how to integrate the statepoint lowering with the register allocator. In principal, we shouldn't need to eagerly spill at all. The register allocator should do any spilling required and the statepoint should simply record that fact. Depending on how challenging that turns out to be, we may invest in a smarter global stack slot assignment mechanism as a stop gap measure.
Reviewed by: atrick, ributzka
llvm-svn: 223137
Fariborz Jahanian [Tue, 2 Dec 2014 18:42:51 +0000 (18:42 +0000)]
This patch fixes a crash involving use of predefined
expressions. It fixes crash when mangling name for block's helper
function used inside a constructor/destructor.
rdar://
19065361.
llvm-svn: 223136
Bruno Cardoso Lopes [Tue, 2 Dec 2014 18:31:53 +0000 (18:31 +0000)]
[SwitchLowering] Handle destinations on multiple phi instructions
Follow up from r222926. Also handle multiple destinations from merged
cases on multiple and subsequent phi instructions.
rdar://problem/
19106978
llvm-svn: 223135
Samuel Benzaquen [Tue, 2 Dec 2014 18:29:00 +0000 (18:29 +0000)]
Skip some unnecessary type checks.
Summary:
Skip some unnecessary type checks wrt DynTypedNodes.
Add DynTypedNode::getUnchecked() to skip the runtime check when the type
is known.
Speed up DynTypedNode::operator== by using isSame() instead of
isBaseOf().
Skip the type check in MatcherInterface<T>::matches(). All calls come
from DynTypedMatcher::matches(), which already did the type check.
This change speeds up our clang-tidy benchmark by ~4%.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6468
llvm-svn: 223134
Ahmed Bougacha [Tue, 2 Dec 2014 18:09:51 +0000 (18:09 +0000)]
[MachineCSE] Clear kill-flag on registers imp-def'd by the CSE'd instruction.
Go through implicit defs of CSMI and MI, and clear the kill flags on
their uses in all the instructions between CSMI and MI.
We might have made some of the kill flags redundant, consider:
subs ... %NZCV<imp-def> <- CSMI
csinc ... %NZCV<imp-use,kill> <- this kill flag isn't valid anymore
subs ... %NZCV<imp-def> <- MI, to be eliminated
csinc ... %NZCV<imp-use,kill>
Since we eliminated MI, and reused a register imp-def'd by CSMI
(here %NZCV), that register, if it was killed before MI, should have
that kill flag removed, because it's lifetime was extended.
Also, add an exhaustive testcase for the motivating example.
Reviewed by: Juergen Ributzka <juergen@apple.com>
llvm-svn: 223133
Philip Reames [Tue, 2 Dec 2014 18:06:10 +0000 (18:06 +0000)]
Remove unneccessary code introduced with 223101.
llvm-svn: 223132
Zachary Turner [Tue, 2 Dec 2014 17:57:54 +0000 (17:57 +0000)]
Disable warning 4530 for MSVC builds.
We compile with exceptions off for LLVM and all other LLVM
subprojects, so this brings parity to LLD and disables this
warning.
Reviewed by: Rui Ueyama
llvm-svn: 223131
Tom Stellard [Tue, 2 Dec 2014 17:41:43 +0000 (17:41 +0000)]
R600/SI: Set correct number of user sgprs for HSA runtime
We don't support scratch buffers yet with HSA.
llvm-svn: 223130
Peter Zotov [Tue, 2 Dec 2014 17:35:26 +0000 (17:35 +0000)]
[OCaml] Add Llvm.mdnull.
Patch by Gideon Smeding <gideon.smeding@3ds.com>.
llvm-svn: 223129
JF Bastien [Tue, 2 Dec 2014 17:30:19 +0000 (17:30 +0000)]
libc++: support NaCl when building thread.cpp
Summary: NaCl shouldn't include sysctl.h when trying to determine std::thread::hardware_concurrency, it should instead use sysconf(_SC_NPROCESSORS_ONLN) through unistd.h. No test needs to be changed, since hardware_concurrency.pass.cpp already tests that std::thread::hardware_concurrency > 0.
Test Plan: make check-libcxx
Reviewers: dschuff, danalbert
Subscribers: jfb, cfe-commits
Differential Revision: http://reviews.llvm.org/D6470
llvm-svn: 223128
Sanjay Patel [Tue, 2 Dec 2014 17:25:27 +0000 (17:25 +0000)]
fix typo in comment
llvm-svn: 223127
Tim Northover [Tue, 2 Dec 2014 17:15:22 +0000 (17:15 +0000)]
AArch64: make register block rules apply to vector types too.
The blocking code originated in ARM, which is more aggressive about casting
types to a canonical representative before doing anything else, so I missed out
most vector HFAs and broke the ABI. This should fix it.
llvm-svn: 223126
Tom Stellard [Tue, 2 Dec 2014 17:05:41 +0000 (17:05 +0000)]
R600/SI: Set the ATC bit on all resource descriptors for the HSA runtime
llvm-svn: 223125
Tom Stellard [Tue, 2 Dec 2014 16:45:47 +0000 (16:45 +0000)]
Triple: Add AMDHSA operating system type
This operating system type represents the AMD HSA runtime,
and will be required by the R600 backend in order to generate
correct code for this runtime.
llvm-svn: 223124
Anton Korobeynikov [Tue, 2 Dec 2014 16:04:58 +0000 (16:04 +0000)]
Fix invalid calling convention used for libcalls on ARM.
ARM ABI specifies that all the libcalls use soft FP ABI
(even hard FP binaries). These days clang emits _mulsc3 / _muldc3
calls with default (C) calling convention which would be translated
into AAPCS_VFP LLVM calling and thus the result of complex
multiplication will be bogus.
Introduce a way for a target to specify explicitly calling
convention for libcalls. Right now this is temporary correctness
fix. Ultimately, we'll end with intrinsic for complex
multiplication and all calling convention decisions for libcalls
will be put into backend.
llvm-svn: 223123
Viktor Kutuzov [Tue, 2 Dec 2014 15:04:39 +0000 (15:04 +0000)]
[Tsan] Fix the atomic_race.cc test to pass on systems with high loads
Differential Revision: http://reviews.llvm.org/D6478
llvm-svn: 223122
Viktor Kutuzov [Tue, 2 Dec 2014 14:59:51 +0000 (14:59 +0000)]
[Tsan] Do not flush all streams on exit
Differential Revision: http://reviews.llvm.org/D6462
llvm-svn: 223121
Serge Pavlov [Tue, 2 Dec 2014 14:52:20 +0000 (14:52 +0000)]
Reverted r223114, it caused failure on on clang-native-arm-cortex-a9.
llvm-svn: 223120
Bruno Cardoso Lopes [Tue, 2 Dec 2014 14:22:34 +0000 (14:22 +0000)]
[LICM] Avoind store sinking if no preheader is available
Load instructions are inserted into loop preheaders when sinking stores
and later removed if not used by the SSA updater. Avoid sinking if the
loop has no preheader and avoid crashes. This fixes one more side effect
of not handling indirectbr instructions properly on LoopSimplify.
llvm-svn: 223119
Daniel Jasper [Tue, 2 Dec 2014 14:21:16 +0000 (14:21 +0000)]
clang-format: Escape '*' in generated flag documentation.
llvm-svn: 223118
Daniel Jasper [Tue, 2 Dec 2014 13:24:51 +0000 (13:24 +0000)]
clang-format: Add option to suppress operator alignment.
With alignment:
int aaaaaa = aa
+
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
*
cccccccccccccccccccccccccccccccc;
Without alignment:
int aaaaaa = aa
+
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
*
cccccccccccccccccccccccccccccccc;
This fixes llvm.org/PR21666.
llvm-svn: 223117
Justin Holewinski [Tue, 2 Dec 2014 12:58:24 +0000 (12:58 +0000)]
[NVPTX] Fix type error for some builtins in BuiltinsNVPTX.def
llvm-svn: 223116
Asiri Rathnayake [Tue, 2 Dec 2014 12:09:55 +0000 (12:09 +0000)]
Remove unused function.
Removing an unused function which is causing one of the build bots to fail.
This was introduced in the commit r223113. A proper cleanup of the so_imm
tblgen defintion (made redundant by the mod_imm definition) needs to happen
soon.
llvm-svn: 223115
Serge Pavlov [Tue, 2 Dec 2014 11:06:09 +0000 (11:06 +0000)]
Emit warning if define or undef reserved identifier or keyword.
Summary:
This change implements warnings if macro name is identical to a keyword or
reserved identifier. The warnings are different depending on the "danger"
of the operation. Defining macro that replaces a keyword is on by default.
Other cases produce warning that is off by default but can be turned on
using option -Wreserved-id-macro.
This change fixes PR11488.
Reviewers: rnk
Reviewed By: rnk
Subscribers: rnk, cfe-commits
Differential Revision: http://reviews.llvm.org/D6194
llvm-svn: 223114
Asiri Rathnayake [Tue, 2 Dec 2014 10:53:20 +0000 (10:53 +0000)]
Add support for ARM modified-immediate assembly syntax.
Certain ARM instructions accept 32-bit immediate operands encoded as a 8-bit
integer value (0-255) and a 4-bit rotation (0-30, even). Current ARM assembly
syntax support in LLVM allows the decoded (32-bit) immediate to be specified
as a single immediate operand for such instructions:
mov r0, #
4278190080
The ARMARM defines an extended assembly syntax allowing the encoding to be made
more explicit, as in:
mov r0, #255, #8 ; (same 32-bit value as above)
The behaviour of the two instructions can be different w.r.t flags, which is
documented under "Modified immediate constants" in ARMARM. This patch enables
support for this extended syntax at the MC layer.
llvm-svn: 223113
Will Newton [Tue, 2 Dec 2014 09:49:09 +0000 (09:49 +0000)]
Add ARM relocations to ELFYAML
Tested with check-all with no regressions.
llvm-svn: 223112
Daniel Jasper [Tue, 2 Dec 2014 09:46:56 +0000 (09:46 +0000)]
clang-format: precedence-based indentation when breaking before operators.
Before:
bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
== aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
*
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
&& aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
*
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> ccccccccccccccccccccccccccccccccccccccccc;
After:
bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
== aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
*
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
&& aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
*
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> ccccccccccccccccccccccccccccccccccccccccc;
Not particularly pretty, but can probably help to uncover bugs. And if this
bugs somebody, parentheses can help.
llvm-svn: 223111
Charlie Turner [Tue, 2 Dec 2014 08:22:29 +0000 (08:22 +0000)]
Emit Tag_ABI_FP_denormal correctly in fast-math mode.
The default ARM floating-point mode does not support IEEE 754 mode exactly. Of
relevance to this patch is that input denormals are flushed to zero. The way in
which they're flushed to zero depends on the architecture,
* For VFPv2, it is implementation defined as to whether the sign of zero is
preserved.
* For VFPv3 and above, the sign of zero is always preserved when a denormal
is flushed to zero.
When FP support has been disabled, the strategy taken by this patch is to
assume the software support will mirror the behaviour of the hardware support
for the target *if it existed*. That is, for architectures which can only have
VFPv2, it is assumed the software will flush to positive zero. For later
architectures it is assumed the software will flush to zero preserving sign.
Change-Id: Icc5928633ba222a4ba3ca8c0df44a440445865fd
llvm-svn: 223110
Sonam Kumari [Tue, 2 Dec 2014 05:29:47 +0000 (05:29 +0000)]
[signext.ll] Removal Of Duplicate Test Cases
Removed the duplicate test case existing in signext.ll file.
llvm-svn: 223109
Bob Wilson [Tue, 2 Dec 2014 05:17:21 +0000 (05:17 +0000)]
Re-apply "Revert r166370 and r166540 now that Xcode 4.6 has been available for a while."
This reverts commit r176892.
I had reverted this a while back to give Chromium more time to update, and
Nico says it should be OK now.
llvm-svn: 223108
NAKAMURA Takumi [Tue, 2 Dec 2014 03:55:16 +0000 (03:55 +0000)]
clang/test/Modules/malformed.cpp REQUIRES shell due to "cd".
llvm-svn: 223107
Hans Wennborg [Tue, 2 Dec 2014 03:08:38 +0000 (03:08 +0000)]
CMake: make the regexes used for setting HOST_LINK_VERSION more forgiving (PR21268)
If the output of 'ld -v' didn't match the regexes, CMake would previously error
with a message like:
CMake Error at tools/clang/CMakeLists.txt:269 (string):
string sub-command REGEX, mode REPLACE regex "[^0-9]*([0-9.]*).*" matched
an empty string.
llvm-svn: 223106
Hans Wennborg [Tue, 2 Dec 2014 02:13:09 +0000 (02:13 +0000)]
Try to fix the MSVC build.
llvm-svn: 223105
Nick Kledzik [Tue, 2 Dec 2014 01:50:44 +0000 (01:50 +0000)]
[mach-o] Fix TrieEdge leak
In PR21682 Jean-Daliel Dupas found a leak in the trie builder and suggested
a fix was to use a list instead of SmallVector so that the list elements
could be allocated in the BumpPtrAllocator.
llvm-svn: 223104
Nick Kledzik [Tue, 2 Dec 2014 01:50:38 +0000 (01:50 +0000)]
[mach-o] add support for arm64 compact unwind info
Tim previously added generic compact unwind processing and x86_64 support.
This patch adds arm64 support.
llvm-svn: 223103
Chandler Carruth [Tue, 2 Dec 2014 01:24:52 +0000 (01:24 +0000)]
Rely on fewer features of the 'env' command. Darwin only supports '-i'.
I'm explicitly setting LC_ALL=C somewhat for documentation, but
hopefully this also removes some host variation from the test results.
llvm-svn: 223102
Nick Lewycky [Tue, 2 Dec 2014 01:09:56 +0000 (01:09 +0000)]
Fix variable used only in assertion.
llvm-svn: 223101
Chandler Carruth [Tue, 2 Dec 2014 00:53:20 +0000 (00:53 +0000)]
Add a test that ensures the Clang driver behaves itself when the PATH
environment variable is changed to strange things out from under it.
Prior to r223099 in LLVM, these test cases would crash in various ways
(assert fails, stack exhaustion, etc.).
llvm-svn: 223100
Chandler Carruth [Tue, 2 Dec 2014 00:52:01 +0000 (00:52 +0000)]
Fix several bugs in r221220's new program finding code.
In both the Unix and Windows variants, std::getenv was called and the
result passed directly to a function accepting a StringRef. This isn't
OK because it might return a null pointer and that causes the StringRef
constructor to assert (and generally produces crash-prone code if
asserts are disabled). Fix this by independently testing the result as
non-null prior to splitting things.
This in turn uncovered another bug in the Unix variant where it would
infinitely recurse if PATH="", or after this fix if PATH isn't set.
There is no need to recurse at all. Slightly re-arrange the code to make
it clear that we can just fixup the Paths argument based on the
environment if we find anything.
I don't know of a particularly useful way to test these routines in
LLVM. I'll commit a test to Clang that ensures that its driver correctly
handles various settings of PATH. However, I have no idea how to
correctly write a Windows test for the PATHEXT change. Any Windows
developers who could provide such a test, please have at. =D
Many thanks to Nick Lewycky and others for helping debug this. =/ It was
quite nasty for us to track down.
llvm-svn: 223099
Richard Smith [Tue, 2 Dec 2014 00:32:02 +0000 (00:32 +0000)]
Update and simplify to match Clang r223095.
llvm-svn: 223098
Bob Wilson [Tue, 2 Dec 2014 00:27:35 +0000 (00:27 +0000)]
Remove special case for aarch64 static vs. PIC code in iOS kernel code.
I added this check a while back but then made a note to myself that it
should be completely unnecessary since iOS always uses PIC code-gen for
aarch64. Since I could never come up with any reason why it would be
necessary, I'm just going to remove it and we'll see if anything breaks.
rdar://problem/
13627985
llvm-svn: 223097
Jason Molenda [Tue, 2 Dec 2014 00:26:21 +0000 (00:26 +0000)]
Fix the behavior of ${current-pc-arrow} in the default disassembly
format for the not-current-stack-frame. This was causing
test/functionalities/inferior-assert to fail.
Also document the new additions to the format specifications used
in the disassembly-format changes to formats.html.
<rdar://problem/
19102757>
llvm-svn: 223096
Richard Smith [Tue, 2 Dec 2014 00:08:08 +0000 (00:08 +0000)]
[modules] Track how 'header' directives were written in module map files,
rather than trying to extract this information from the FileEntry after the
fact.
This has a number of beneficial effects. For instance, diagnostic messages for
failed module builds give a path relative to the "module root" rather than an
absolute file path, and the contents of the module includes file is no longer
dependent on what files the including TU happened to inspect prior to
triggering the module build.
llvm-svn: 223095
Alexey Samsonov [Mon, 1 Dec 2014 23:47:51 +0000 (23:47 +0000)]
Add override specifiers to Symbolizer methods. NFC.
llvm-svn: 223094
Hal Finkel [Mon, 1 Dec 2014 23:38:06 +0000 (23:38 +0000)]
Simplify pointer comparisons involving memory allocation functions
System memory allocation functions, which are identified at the IR level by the
noalias attribute on the return value, must return a pointer into a memory region
disjoint from any other memory accessible to the caller. We can use this
property to simplify pointer comparisons between allocated memory and local
stack addresses and the addresses of global variables. Neither the stack nor
global variables can overlap with the region used by the memory allocator.
Fixes PR21556.
llvm-svn: 223093
Philip Reames [Mon, 1 Dec 2014 23:27:45 +0000 (23:27 +0000)]
Try to fix a bot failure due to a variable used only in an assert.
Specifically, bot lld-x86_64-darwin13. Resulting from change 223085.
llvm-svn: 223092
Oleksiy Vyalov [Mon, 1 Dec 2014 23:21:18 +0000 (23:21 +0000)]
Fix several test failures on Linux/FreeBSD caused by compiler configuration and invalid environment - make lldbtest.registerSharedLibrariesWithTarget to support multiple platforms.
http://reviews.llvm.org/D6392
llvm-svn: 223091
Nikola Smiljanic [Mon, 1 Dec 2014 23:15:01 +0000 (23:15 +0000)]
Perform correct lookup when '__super' is used in class with dependent base.
llvm-svn: 223090
Zachary Turner [Mon, 1 Dec 2014 23:13:52 +0000 (23:13 +0000)]
Enable enabling and disabling breakpoints on Windows.
llvm-svn: 223089
Zachary Turner [Mon, 1 Dec 2014 23:13:41 +0000 (23:13 +0000)]
Link test executables with LLD on Windows.
Clang generates DWARF debug info with section names longer
than 8 characters. This is only supported by an extension
to PE/COFF which the MSVC linker doesn't implement. So
trying to link DWARF-enabled object files with MSVC will
lead to corrupt debug information in the executable.
llvm-svn: 223088
Zachary Turner [Mon, 1 Dec 2014 23:13:32 +0000 (23:13 +0000)]
Only normalize FileSpec paths *after* resolving them.
Normalizing paths before resolving them can cause the path to
become denormalized after resolution.
llvm-svn: 223087
Zachary Turner [Mon, 1 Dec 2014 23:06:47 +0000 (23:06 +0000)]
Make -fuse-ld=lld work properly on Windows.
Using lld on Windows requires calling link-lld.exe instead of
lld.exe. This patch puts this knowledge into clang so that when
using the GCC style clang driver, it can properly delegate to
lld.
Differential Revision: http://reviews.llvm.org/D6428
Reviewed by: Reid Kleckner, Rui Ueyama
llvm-svn: 223086
Philip Reames [Mon, 1 Dec 2014 22:52:56 +0000 (22:52 +0000)]
[Statepoints 2/4] Statepoint infrastructure for garbage collection: MI & x86-64 Backend
This is the second patch in a small series. This patch contains the MachineInstruction and x86-64 backend pieces required to lower Statepoints. It does not include the code to actually generate the STATEPOINT machine instruction and as a result, the entire patch is currently dead code. I will be submitting the SelectionDAG parts within the next 24-48 hours. Since those pieces are by far the most complicated, I wanted to minimize the size of that patch. That patch will include the tests which exercise the functionality in this patch. The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683.
The STATEPOINT psuedo node is generated after all gc values are explicitly spilled to stack slots. The purpose of this node is to wrap an actual call instruction while recording the spill locations of the meta arguments used for garbage collection and other purposes. The STATEPOINT is modeled as modifing all of those locations to prevent backend optimizations from forwarding the value from before the STATEPOINT to after the STATEPOINT. (Doing so would break relocation semantics for collectors which wish to relocate roots.)
The implementation of STATEPOINT is closely modeled on PATCHPOINT. Eventually, much of the code in this patch will be removed. The long term plan is to merge the functionality provided by statepoints and patchpoints. Merging their implementations in the backend is likely to be a good starting point.
Reviewed by: atrick, ributzka
llvm-svn: 223085
Enrico Granata [Mon, 1 Dec 2014 22:51:03 +0000 (22:51 +0000)]
The register keyword is deprecated in C++11, so clang complains strongly about swig generating register declarations. Abuse the preprocessor to define the keyword away
llvm-svn: 223084
Greg Clayton [Mon, 1 Dec 2014 22:41:27 +0000 (22:41 +0000)]
lldb can deadlock when launched with an non-existing executable:
% lldb /bin/nonono
(lldb) target create "/bin/nonono"
error: unable to find executable for '/usr/bin/nonono'
<deadlock>
The problem was the initial commands 'target create "/bin/nonono"' were put into a pipe and the command interpreter was being run with:
void
CommandInterpreter::RunCommandInterpreter(bool auto_handle_events,
bool spawn_thread,
CommandInterpreterRunOptions &options)
{
// Always re-create the command intepreter when we run it in case
// any file handles have changed.
bool force_create = true;
m_debugger.PushIOHandler(GetIOHandler(force_create, &options));
m_stopped_for_crash = false;
if (auto_handle_events)
m_debugger.StartEventHandlerThread();
if (spawn_thread)
{
m_debugger.StartIOHandlerThread();
}
else
{
m_debugger.ExecuteIOHanders();
if (auto_handle_events)
m_debugger.StopEventHandlerThread();
}
}
If "auto_handle_events" was set to true and "spawn_thread" was false, we would execute:
m_debugger.StartEventHandlerThread();
m_debugger.ExecuteIOHanders();
m_debugger.StopEventHandlerThread();
The problem was there was no synchonization in Debugger::StartEventHandlerThread() to ensure the event handler was listening to events and the the call to "m_debugger.StopEventHandlerThread()" would do:
void
Debugger::StopEventHandlerThread()
{
if (m_event_handler_thread.IsJoinable())
{
GetCommandInterpreter().BroadcastEvent(CommandInterpreter::eBroadcastBitQuitCommandReceived);
m_event_handler_thread.Join(nullptr);
}
}
The problem was that the event thread might not be listening for the CommandInterpreter::eBroadcastBitQuitCommandReceived event yet.
The solution is to make sure the Debugger::DefaultEventHandler() is listening to events before we return from Debugger::StartEventHandlerThread(). Once we have this synchonization we remove the race condition.
This fixes radar:
<rdar://problem/
19041192>
llvm-svn: 223083
Greg Clayton [Mon, 1 Dec 2014 22:34:03 +0000 (22:34 +0000)]
Added a new regular expression to the "_regexp-break" command ("b" by default):
(lldb) b /break here/
This will set a source level regular expression breakpoint on any text between the first '/' and the last '/'. The equivalent command will be:
(lldb) breakpoint set --source-pattern-regexp 'break here'
llvm-svn: 223082
Vince Harron [Mon, 1 Dec 2014 22:19:33 +0000 (22:19 +0000)]
Added StringExtractor::DecodeHexU8 && GetHexBytesAvail
DecodeHexU8 returns a decoded hex character pair, returns -1 if a
valid hex pair is not available.
GetHexBytesAvail decodes all available hex pairs.
llvm-svn: 223081
Vince Harron [Mon, 1 Dec 2014 22:10:15 +0000 (22:10 +0000)]
StringExtractor unit tests
Unit tests to cover StringExtractor in advance of minor new
functionality & minor refactor
llvm-svn: 223080
Reid Kleckner [Mon, 1 Dec 2014 22:02:27 +0000 (22:02 +0000)]
Use nullptr to silence -Wsentinel when self-hosting on Windows
Richard rejected my Sema change to interpret an integer literal zero in
a varargs context as a null pointer, so -Wsentinel sees an integer
literal zero and fires off a warning. Only CodeGen currently knows that
it promotes integer literal zeroes in this context to pointer size on
Windows. I didn't want to teach -Wsentinel about that compatibility
hack. Therefore, I'm migrating to C++11 nullptr.
llvm-svn: 223079
Philip Reames [Mon, 1 Dec 2014 21:18:12 +0000 (21:18 +0000)]
[Statepoints 1/4] Statepoint infrastructure for garbage collection: IR Intrinsics
The statepoint intrinsics are intended to enable precise root tracking through the compiler as to support garbage collectors of all types. The addition of the statepoint intrinsics to LLVM should have no impact on the compilation of any program which does not contain them. There are no side tables created, no extra metadata, and no inhibited optimizations.
A statepoint works by transforming a call site (or safepoint poll site) into an explicit relocation operation. It is the frontend's responsibility (or eventually the safepoint insertion pass we've developed, but that's not part of this patch series) to ensure that any live pointer to a GC object is correctly added to the statepoint and explicitly relocated. The relocated value is just a normal SSA value (as seen by the optimizer), so merges of relocated and unrelocated values are just normal phis. The explicit relocation operation, the fact the statepoint is assumed to clobber all memory, and the optimizers standard semantics ensure that the relocations flow through IR optimizations correctly.
This is the first patch in a small series. This patch contains only the IR parts; the documentation and backend support will be following separately. The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683.
Reviewed by: atrick, ributzka
llvm-svn: 223078
Jingyue Wu [Mon, 1 Dec 2014 21:16:17 +0000 (21:16 +0000)]
[NVPTX] Do not emit .weak symbols for NVPTX
Summary:
".weak" symbols cannot be consumed by ptxas (PR21685). This patch makes the
weak directive in MCAsmPrinter customizable, and disables emitting ".weak"
symbols for NVPTX.
Test Plan: weak-linkage.ll
Reviewers: jholewinski
Reviewed By: jholewinski
Subscribers: majnemer, jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D6455
llvm-svn: 223077
Reid Kleckner [Mon, 1 Dec 2014 21:04:44 +0000 (21:04 +0000)]
Parse 'ghccc' in .ll files as the GHC convention (cc 10)
Previously we just used "cc 10" in the .ll files, but that isn't very
human readable.
llvm-svn: 223076
Ahmed Bougacha [Mon, 1 Dec 2014 20:59:00 +0000 (20:59 +0000)]
[AArch64] Don't combine "select (setcc i1 LHS, RHS), vL, vR".
r208210 introduced an optimization that improves the vector select
codegen by doing the setcc on vectors directly.
This is a problem they the setcc operands are i1s, because the
optimization would create vectors of i1, which aren't legal.
Part of PR21549.
Differential Revision: http://reviews.llvm.org/D6308
llvm-svn: 223075
Ahmed Bougacha [Mon, 1 Dec 2014 20:52:32 +0000 (20:52 +0000)]
[AArch64] Fix v2i8->i16 bitcast legalization.
r213378 improved f16 bitcasts, so that they go directly through subregs,
instead of through the stack. That code now causes an assertion failure
for bitcasts from other 16-bits types (most importantly v2i8).
Correct that by doing the custom lowering for i16 bitcasts only when the
input is an f16.
Part of PR21549.
Differential Revision: http://reviews.llvm.org/D6307
llvm-svn: 223074
Shankar Easwaran [Mon, 1 Dec 2014 20:28:54 +0000 (20:28 +0000)]
[Core] Remove function to not override RoundTripPasses.
RoundTripPasses should always be called in DEBUG mode if the environment
variable "LLD_RUN_ROUNDTRIP_TEST" is set.
Flavors should not be able to override this behavior.
llvm-svn: 223073
Peter Zotov [Mon, 1 Dec 2014 19:50:39 +0000 (19:50 +0000)]
[OCaml] Move Llvm.clone_module to its own Llvm_transform_utils module.
This way most code won't link this (substantially large) library,
if compiled statically with LLVM.
llvm-svn: 223072
Peter Zotov [Mon, 1 Dec 2014 19:50:23 +0000 (19:50 +0000)]
[OCaml] [cmake] Add CMake buildsystem for OCaml.
Closes PR15325.
llvm-svn: 223071
JF Bastien [Mon, 1 Dec 2014 19:19:55 +0000 (19:19 +0000)]
libc++: add NaCl and PNaCl support for std::random_device
Summary:
The NaCl sandbox doesn't allow opening files under /dev, but it offers an API which provides the same capabilities. This is the same random device emulation that nacl_io performs for POSIX support, but nacl_io is an optional library so libc++ can't assume that device emulation will be performed. Note that NaCl only supports /dev/urandom, not /dev/random.
This patch also cleans up some of the preprocessor #endif, and fixes the test for Win32 (it accepts any token, and would therefore never throw regardless of the token provided).
Test Plan: ninja check-libcxx
Reviewers: dschuff, mclow.lists, danalbert
Subscribers: jfb, cfe-commits
Differential Revision: http://reviews.llvm.org/D6442
llvm-svn: 223068
Rafael Espindola [Mon, 1 Dec 2014 19:17:46 +0000 (19:17 +0000)]
Use a continue to reduce indentation and clang-format. NFC.
llvm-svn: 223067
Rafael Espindola [Mon, 1 Dec 2014 19:08:07 +0000 (19:08 +0000)]
Use a range loop. NFC.
llvm-svn: 223066