Alexey Samsonov [Wed, 9 Jul 2014 23:59:40 +0000 (23:59 +0000)]
[Sanitizer] Remove SANITIZER_NEEDS_SEGV from shared sanitizer_common headers.
Otherwise, it can be accidentally redefined when we build specific sanitizer
runtime. This definition should be provided only once - when we build
sanitizer_common library.
llvm-svn: 212663
Todd Fiala [Wed, 9 Jul 2014 23:10:43 +0000 (23:10 +0000)]
Skip tests that are intermittent on Linux, fix gdb-remote port-grabbing code.
Marked skipped for Linux:
TestCallStopAndContinue
TestConvenienceVariables
TestStopHookMultipleThreads
Fixed up gdb-remote port-grabbing code to use a random port in a wide range,
and to allow that to fail more gracefully. This appears to have solved some
gdb-remote intermittent failing behavior.
llvm-svn: 212662
Chandler Carruth [Wed, 9 Jul 2014 22:53:04 +0000 (22:53 +0000)]
[SDAG] Make the new zext-vector-inreg node default to expand so targets
don't need to set it manually.
This is based on feedback from Tom who pointed out that if every target
needs to handle this we need to reach out to those maintainers. In fact,
it doesn't make sense to duplicate everything when anything other than
expand seems unlikely at this stage.
llvm-svn: 212661
Todd Fiala [Wed, 9 Jul 2014 22:03:30 +0000 (22:03 +0000)]
Skip TestCallStopAndContinue and TestCallThatRestarts on Darwin.
These are failing intermittently.
See http://llvm.org/bugs/show_bug.cgi?id=19246 for TestCallThatRestarts. Also applies to Linux.
See http://llvm.org/bugs/show_bug.cgi?id=20274 for TestCallStopAndContinue.
llvm-svn: 212660
Todd Fiala [Wed, 9 Jul 2014 21:24:41 +0000 (21:24 +0000)]
Marked TestTargetAPI.test_launch_new_process_and_redirect_stdout_with_* as XFAIL on Darwin.
See http://llvm.org/bugs/show_bug.cgi?id=20273
llvm-svn: 212659
Alexander Kornienko [Wed, 9 Jul 2014 21:21:39 +0000 (21:21 +0000)]
Removed the "-fix" suffix from tests that verify both fixes and messages.
llvm-svn: 212658
Todd Fiala [Wed, 9 Jul 2014 21:21:39 +0000 (21:21 +0000)]
TestRealDefinition tests marked XFAIL on Darwin.
http://llvm.org/bugs/show_bug.cgi?id=20272
llvm-svn: 212657
Todd Fiala [Wed, 9 Jul 2014 21:19:03 +0000 (21:19 +0000)]
Marked failing TestObjCDynamicValue tests as XFAIL on Darwin.
See http://llvm.org/bugs/show_bug.cgi?id=20271
llvm-svn: 212656
Todd Fiala [Wed, 9 Jul 2014 21:15:46 +0000 (21:15 +0000)]
Marked failing TestObjCDynamicSBType tests XFAIL on Darwin.
See http://llvm.org/bugs/show_bug.cgi?id=20270
llvm-svn: 212655
Todd Fiala [Wed, 9 Jul 2014 21:10:13 +0000 (21:10 +0000)]
Marked failing TestHiddenIvars tests as XFAIL on Darwin.
See http://llvm.org/bugs/show_bug.cgi?id=20269
llvm-svn: 212654
Alexander Kornienko [Wed, 9 Jul 2014 21:09:26 +0000 (21:09 +0000)]
Check messages and fixes in the same test.
Summary: This reduces duplication of test code and improves locality of checks.
Reviewers: sbenza, djasper
Reviewed By: sbenza, djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4437
llvm-svn: 212653
Nick Kledzik [Wed, 9 Jul 2014 21:04:24 +0000 (21:04 +0000)]
Move GOTPass and StubsPass from Core to MachO
llvm-svn: 212652
Marshall Clow [Wed, 9 Jul 2014 21:04:22 +0000 (21:04 +0000)]
Add a reset method to the counting predicates in the test suite
llvm-svn: 212651
Todd Fiala [Wed, 9 Jul 2014 21:02:52 +0000 (21:02 +0000)]
Marked TestObjCMethods failing tests XFAIL, fixed cleanup code, removed now-passing expected failure markers.
All tests matching '-p TestObjCMethods' now are marked correctly for MacOSX, and some
error classes have been removed in cleanup code looking for files that
might not exist due to previous failure.
See http://llvm.org/bugs/show_bug.cgi?id=20267
llvm-svn: 212650
David Blaikie [Wed, 9 Jul 2014 21:02:41 +0000 (21:02 +0000)]
Recommit r212203: Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information.
Reverted by Eric Christopher (Thanks!) in r212203 after Bob Wilson
reported LTO issues. Duncan Exon Smith and Aditya Nandakumar helped
provide a reduced reproduction, though the failure wasn't too hard to
guess, and even easier with the example to confirm.
The assertion that the subprogram metadata associated with an
llvm::Function matches the scope data referenced by the DbgLocs on the
instructions in that function is not valid under LTO. In LTO, a C++
inline function might exist in multiple CUs and the subprogram metadata
nodes will refer to the same llvm::Function. In this case, depending on
the order of the CUs, the first intance of the subprogram metadata may
not be the one referenced by the instructions in that function and the
assertion will fail.
A test case (test/DebugInfo/cross-cu-linkonce-distinct.ll) is added, the
assertion removed and a comment added to explain this situation.
Original commit message:
If a function isn't actually in a CU's subprogram list in the debug info
metadata, ignore all the DebugLocs and don't try to build scopes, track
variables, etc.
While this is possibly a minor optimization, it's also a correctness fix
for an incoming patch that will add assertions to LexicalScopes and the
debug info verifier to ensure that all scope chains lead to debug info
for the current function.
Fix up a few test cases that had broken/incomplete debug info that could
violate this constraint.
Add a test case where this occurs by design (inlining a
debug-info-having function in an attribute nodebug function - we want
this to work because /if/ the nodebug function is then inlined into a
debug-info-having function, it should be fine (and will work fine - we
just stitch the scopes up as usual), but should the inlining not happen
we need to not assert fail either).
llvm-svn: 212649
Todd Fiala [Wed, 9 Jul 2014 20:45:09 +0000 (20:45 +0000)]
Marked failing test XFAIL for TestRegisterVariables.test_with_dsym_and_run_command on Darwin
See http://llvm.org/bugs/show_bug.cgi?id=20266
llvm-svn: 212648
Todd Fiala [Wed, 9 Jul 2014 20:42:14 +0000 (20:42 +0000)]
Marked failing Darwin TestProcessLaunch tests as XFAIL
See http://llvm.org/bugs/show_bug.cgi?id=20265
llvm-svn: 212647
Todd Fiala [Wed, 9 Jul 2014 20:38:27 +0000 (20:38 +0000)]
TestDataFormatterStdVector.test_with_dsym_and_run_command marked XFAIL on Darwin
See http://llvm.org/bugs/show_bug.cgi?id=20264
llvm-svn: 212646
Todd Fiala [Wed, 9 Jul 2014 20:33:51 +0000 (20:33 +0000)]
Disable TestDataFormatterStdMap.test_with_dsym_and_run_command on Darwin
See http://llvm.org/bugs/show_bug.cgi?id=20263
llvm-svn: 212645
Greg Clayton [Wed, 9 Jul 2014 20:18:54 +0000 (20:18 +0000)]
Make sure the "command regex add" has a unique name for editline history purposes.
llvm-svn: 212644
Alexey Samsonov [Wed, 9 Jul 2014 19:40:08 +0000 (19:40 +0000)]
Decouple llvm::SpecialCaseList text representation and its LLVM IR semantics.
Turn llvm::SpecialCaseList into a simple class that parses text files in
a specified format and knows nothing about LLVM IR. Move this class into
LLVMSupport library. Implement two users of this class:
* DFSanABIList in DFSan instrumentation pass.
* SanitizerBlacklist in Clang CodeGen library.
The latter will be modified to use actual source-level information from frontend
(source file names) instead of unstable LLVM IR things (LLVM Module identifier).
Remove dependency edge from ClangCodeGen/ClangDriver to LLVMTransformUtils.
No functionality change.
llvm-svn: 212643
Alexey Samsonov [Wed, 9 Jul 2014 19:29:10 +0000 (19:29 +0000)]
Don't check lint for SpecialCaseList.cpp
llvm-svn: 212642
Tim Northover [Wed, 9 Jul 2014 19:14:34 +0000 (19:14 +0000)]
Use simpler constructor for range adapter.
It is a good idea, it's slightly clearer and simpler. Unfortunately
the headline news is: we save one line!
llvm-svn: 212641
Matt Arsenault [Wed, 9 Jul 2014 19:12:07 +0000 (19:12 +0000)]
Add trunc (select c, a, b) -> select c (trunc a), (trunc b) combine.
Do this if the truncate is free and the select is legal.
llvm-svn: 212640
Todd Fiala [Wed, 9 Jul 2014 19:00:21 +0000 (19:00 +0000)]
Mark failing tests in TestDataFormatterObjC on Darwin as XFAIL
See http://llvm.org/bugs/show_bug.cgi?id=20260 for more details.
llvm-svn: 212639
Jim Grosbach [Wed, 9 Jul 2014 18:55:52 +0000 (18:55 +0000)]
AArch64: Better codegen for storing to __fp16.
Storing will generally be immediately preceded by rounding from an f32
or f64, so make sure to match those patterns directly to convert into the
FPR16 register class directly rather than going through the integer GPRs.
This also eliminates an extra step in the convert-from-f64 path
which was first converting to f32 and then to f16 from there.
rdar://
17594379
llvm-svn: 212638
Jim Grosbach [Wed, 9 Jul 2014 18:55:49 +0000 (18:55 +0000)]
Change an assert() to a diagnostic.
llvm-svn: 212637
Benjamin Kramer [Wed, 9 Jul 2014 18:53:57 +0000 (18:53 +0000)]
TargetRegisterInfo: Remove function that fell out of use years ago.
llvm-svn: 212636
Cameron McInally [Wed, 9 Jul 2014 18:29:55 +0000 (18:29 +0000)]
Update ReleaseNotes to mention Atomic NAND semantic changes.
llvm-svn: 212635
Adam Nemet [Wed, 9 Jul 2014 18:22:33 +0000 (18:22 +0000)]
[X86] AVX512: Enable it in the Loop Vectorizer
This lets us experiment with 512-bit vectorization without passing
force-vector-width manually.
The code generated for a simple integer memset loop is properly vectorized.
Disassembly is still broken for it though :(.
llvm-svn: 212634
Louis Gerbarg [Wed, 9 Jul 2014 17:54:32 +0000 (17:54 +0000)]
Make AArch64FastISel::EmitIntExt explicitly check its source and destination types
This is a follow up to r212492. There should be no functional difference, but
this patch makes it clear that SrcVT must be an i1/i8/16/i32 and DestVT must be
an i8/i16/i32/i64.
rdar://
17516686
llvm-svn: 212633
Sanjay Patel [Wed, 9 Jul 2014 17:49:58 +0000 (17:49 +0000)]
removed duplicate testcase
llvm-svn: 212632
David Majnemer [Wed, 9 Jul 2014 17:15:52 +0000 (17:15 +0000)]
Sema: Allow aliases to have incomplete type
gcc supports this behavior and it is pervasively used inside the Linux
kernel.
Note that both gcc and clang will reject code that attempts to do this
in a C++ language mode.
This fixes PR17998.
llvm-svn: 212631
Zachary Turner [Wed, 9 Jul 2014 16:42:27 +0000 (16:42 +0000)]
Dont' use a random probe & alloc strategy for the IRMemoryMap.
The current strategy for host allocation is to choose a random
address and attempt to allocate there, eventually failing if the
allocation cannot be satisfied.
The C standard only guarantees that RAND_MAX >= 32767, so for
platforms that use a very small RAND_MAX allocations will fail
with very high probability. On such platforms (Windows is one),
you can reproduce this trivially by running lldb, typing "expr (3)"
and then hitting enter you see a failure. Failures generally
happen with a frequency of about 1 failure every 5 evaluations.
There is no good reason that allocations need to look like "real"
pointers, so this patch changes the allocation scheme to simply
jump straight to the end and grab a free chunk of memory.
Reviewed By: Sean Callanan
Differential Revision: http://reviews.llvm.org/D4300
llvm-svn: 212630
Sanjay Patel [Wed, 9 Jul 2014 16:34:54 +0000 (16:34 +0000)]
Fix for PR20059 (instcombine reorders shufflevector after instruction that may trap)
In PR20059 ( http://llvm.org/pr20059 ), instcombine eliminates shuffles that are necessary before performing an operation that can trap (srem).
This patch calls isSafeToSpeculativelyExecute() and bails out of the optimization in SimplifyVectorOp() if needed.
Differential Revision: http://reviews.llvm.org/D4424
llvm-svn: 212629
Zachary Turner [Wed, 9 Jul 2014 16:32:07 +0000 (16:32 +0000)]
Fix tests broken by the OptionValidator changes.
The getopt library has a structure called option (lowercase). We
have a structure called Option (uppercase). previously the two
structures had exactly the same definitions, and we were doing a
C-style cast of an Option* to an option*. C-style casts don't
bother to warn you when you cast to unrelated types, but in the
original OptionValidator patch I modified the definition of Option.
This patch fixes the errors by building an array of option
structures and filling it out the correct way before passing it to
the getopt library.
This also fixes one other source of test failures: an uninitialized
read that occurs due to not initializing a field of the
OptionDefinition.
Reviewed By: Todd Fiala
Differential Revision: http://reviews.llvm.org/D4425
llvm-svn: 212628
Zachary Turner [Wed, 9 Jul 2014 16:31:49 +0000 (16:31 +0000)]
Revert "Fix broken tests due to new error output."
This reverts commit
ec7c94f8e6860968d384b578e5564a9c55c80b4a and
re-enables OptionValidators.
llvm-svn: 212627
Daniel Sanders [Wed, 9 Jul 2014 16:03:10 +0000 (16:03 +0000)]
Add Imagination Technologies to the vendors in llvm::Triple
Summary: This is a pre-requisite for supporting the mips-img-linux-gnu triple in clang.
Differential Revision: http://reviews.llvm.org/D4435
llvm-svn: 212626
Daniel Sanders [Wed, 9 Jul 2014 14:21:18 +0000 (14:21 +0000)]
[mips][mips64r6] Implement -mips32r6 and -mips64r6 aliases to -march=mips32r6 and -march=mips64r6
Differential Revision: http://reviews.llvm.org/D4434
llvm-svn: 212625
Alp Toker [Wed, 9 Jul 2014 14:12:55 +0000 (14:12 +0000)]
Prospective legacy build system fix following r212620
llvm-svn: 212624
Alp Toker [Wed, 9 Jul 2014 14:09:52 +0000 (14:09 +0000)]
Remove dead code from r212620
llvm-svn: 212622
Alp Toker [Wed, 9 Jul 2014 14:06:35 +0000 (14:06 +0000)]
Fix 'source-level' hyphenations
llvm-svn: 212621
Alp Toker [Wed, 9 Jul 2014 14:05:11 +0000 (14:05 +0000)]
cc1as: consolidate option flags with cc1 and eliminate duplication
The clang -cc1as options are nearly a strict subset of -cc1. Instead of
duplicating the definitions and documentation, let's go ahead and share the
definitions in a similar way the current handling of combined driver and
frontend flags, eliminating some of the vestigial legacy surrounding the
assembler subcommand.
llvm-svn: 212620
Daniel Sanders [Wed, 9 Jul 2014 13:56:23 +0000 (13:56 +0000)]
[mips][mips64r6] Define _MIPS_FPSET, __mips_fpr, and __mips_nan2008 correctly on MIPS32r6/MIPS64r6
Summary:
This removes the need to pass -mnan=2008 explicitly to be able to compile
the test-suite for MIPS32r6/MIPS64r6.
Differential Revision: http://reviews.llvm.org/D4433
llvm-svn: 212619
Daniel Sanders [Wed, 9 Jul 2014 13:43:19 +0000 (13:43 +0000)]
[mips] clz is defined to give 32 for zero. Similarly, dclz gives 64.
Summary:
While debugging another issue, I noticed that Mips currently specifies that the
count leading zero builtins are undefined when the input is zero. The
architecture specifications say that the clz and dclz instructions write 32 or
64 respectively when given zero.
This doesn't fix any bugs that I'm aware of but it may improve optimisation in
some cases.
Differential Revision: http://reviews.llvm.org/D4431
llvm-svn: 212618
Daniel Jasper [Wed, 9 Jul 2014 13:07:57 +0000 (13:07 +0000)]
clang-format: Fix behavior around pointer-to-member invocations.
Before:
(
aaaaaaaaaa->*
bbbbbbb)(
aaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaa));
After:
(
aaaaaaaaaa->*bbbbbbb)(
aaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaa));
llvm-svn: 212617
Tim Northover [Wed, 9 Jul 2014 13:03:54 +0000 (13:03 +0000)]
[all]: Use range-based ArgList adapter instead of filtered_begin/filtered_end
Some of those loops were pretty monstrous.
llvm-svn: 212616
Tim Northover [Wed, 9 Jul 2014 13:03:37 +0000 (13:03 +0000)]
Generic: add range-adapter for option parsing.
I want to use it in lld, but while I'm here I'll update LLVM uses.
llvm-svn: 212615
Chandler Carruth [Wed, 9 Jul 2014 12:36:54 +0000 (12:36 +0000)]
[x86] Fix a bug in my new zext-vector-inreg DAG trickery where we were
not widening the input type to the node sufficiently to let the ext take
place in a register.
This would in turn result in a mysterious bitcast assertion failure
downstream. First change here is to add back the helpful assert I had in
an earlier version of the code to catch this immediately.
Next change is to add support to the type legalization to detect when we
have widened the operand either too little or too much (for whatever
reason) and find a size-matched legal vector type to convert it to
first. This can also fail so we get a new fallback path, but that seems
OK.
With this, we no longer crash on vec_cast2.ll when using widening. I've
also added the CHECK lines for the zero-extend cases here. We still need
to support sign-extend and trunc (or something) to get plausible code
for the other two thirds of this test which is one of the regression
tests that showed the most scalarization when widening was
force-enabled. Slowly closing in on widening being a viable legalization
strategy without it resorting to scalarization at every turn. =]
llvm-svn: 212614
Simon Atanasyan [Wed, 9 Jul 2014 12:31:11 +0000 (12:31 +0000)]
[Mips] Make rel-dynamic-08.test test case independent from external input files.
llvm-svn: 212613
Chandler Carruth [Wed, 9 Jul 2014 11:13:16 +0000 (11:13 +0000)]
Sink two variables only used in an assert into the assert itself. Should
fix the release builds with Werror.
llvm-svn: 212612
Benjamin Kramer [Wed, 9 Jul 2014 11:12:39 +0000 (11:12 +0000)]
X86: When lowering v8i32 himuls use the correct shuffle masks for AVX2.
Turns out my trick of using the same masks for SSE4.1 and AVX2 didn't work out
as we have to blend two vectors. While there remove unecessary cross-lane moves
from the shuffles so the backend can lower it to palignr instead of vperm.
Fixes PR20118, a miscompilation of vector sdiv by constant on AVX2.
llvm-svn: 212611
Chandler Carruth [Wed, 9 Jul 2014 10:58:18 +0000 (10:58 +0000)]
[x86] Add a ZERO_EXTEND_VECTOR_INREG DAG node and use it when widening
vector types to be legal and a ZERO_EXTEND node is encountered.
When we use widening to legalize vector types, extend nodes are a real
challenge. Either the input or output is likely to be legal, but in many
cases not both. As a consequence, we don't really have any way to
represent this situation and the prior code in the widening legalization
framework would just scalarize the extend operation completely.
This patch introduces a new DAG node to represent doing a zero extend of
a vector "in register". The core of the idea is to allow legal but
different vector types in the input and output. The output vector must
have fewer lanes but wider elements. The operation is defined to zero
extend the low elements of the input to the size of the output elements,
and drop all of the high elements which don't have a corresponding lane
in the output vector.
It also includes generic expansion of this node in terms of blending
a zero vector into the high elements of the vector and bitcasting
across. This in turn yields extremely nice code for x86 SSE2 when we use
the new widening legalization logic in conjunction with the new shuffle
lowering logic.
There is still more to do here. We need to support sign extension, any
extension, and potentially int-to-float conversions. My current plan is
to continue using similar synthetic nodes to model each of these
transitions with generic lowering code for each one.
However, with this patch LLVM already reaches performance parity with
GCC for the core C loops of the x264 code (assuming you disable the
hand-written assembly versions) when compiling for SSE2 and SSE3
architectures and enabling the new widening and lowering logic for
vectors.
Differential Revision: http://reviews.llvm.org/D4405
llvm-svn: 212610
Tobias Grosser [Wed, 9 Jul 2014 10:50:10 +0000 (10:50 +0000)]
clang-format polly to avoid buildbot noise
llvm-svn: 212609
Daniel Sanders [Wed, 9 Jul 2014 10:47:26 +0000 (10:47 +0000)]
[mips][mips64r6] Correct select patterns that have the condition or true/false values backwards
Summary: This bug caused SingleSource/Regression/C/uint64_to_float and SingleSource/UnitTests/2002-05-02-CastTest3 to fail (among others).
Differential Revision: http://reviews.llvm.org/D4388
llvm-svn: 212608
Daniel Sanders [Wed, 9 Jul 2014 10:40:20 +0000 (10:40 +0000)]
[mips][mips64r6] Correct cond names in the cmp.cond.[ds] instructions
Summary:
It seems we accidentally read the wrong column of the table MIPS64r6 spec
and used the names for c.cond.fmt instead of cmp.cond.fmt.
Differential Revision: http://reviews.llvm.org/D4387
llvm-svn: 212607
Chandler Carruth [Wed, 9 Jul 2014 10:36:42 +0000 (10:36 +0000)]
[x86] Initialize a pointer to null to fix a bug in r212602.
This should restore GCC hosts (which happen to put the bad stuff into
the pointer) and MSan, etc.
llvm-svn: 212606
Daniel Sanders [Wed, 9 Jul 2014 10:21:59 +0000 (10:21 +0000)]
[mips][mips64r6] Use JALR for indirect branches instead of JR (which is not available on MIPS32r6/MIPS64r6)
Summary:
This completes the change to use JALR instead of JR on MIPS32r6/MIPS64r6.
Reviewers: jkolek, vmedic, zoran.jovanovic, dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D4269
llvm-svn: 212605
Daniel Sanders [Wed, 9 Jul 2014 10:16:07 +0000 (10:16 +0000)]
[mips][mips64r6] Use JALR for returns instead of JR (which is not available on MIPS32r6/MIPS64r6)
Summary:
RET, and RET_MM have been replaced by a pseudo named PseudoReturn.
In addition a version with a 64-bit GPR named PseudoReturn64 has been
added.
Instruction selection for a return matches RetRA, which is expanded post
register allocation to PseudoReturn/PseudoReturn64. During MipsAsmPrinter,
this PseudoReturn/PseudoReturn64 are emitted as:
- (JALR64 $zero, $rs) on MIPS64r6
- (JALR $zero, $rs) on MIPS32r6
- (JR_MM $rs) on microMIPS
- (JR $rs) otherwise
On MIPS32r6/MIPS64r6, 'jr $rs' is an alias for 'jalr $zero, $rs'. To aid
development and review (specifically, to ensure all cases of jr are
updated), these aliases are temporarily named 'r6.jr' instead of 'jr'.
A follow up patch will change them back to the correct mnemonic.
Added (JALR $zero, $rs) to MipsNaClELFStreamer's definition of an indirect
jump, and removed it from its definition of a call.
Note: I haven't accounted for MIPS64 in MipsNaClELFStreamer since it's
doesn't appear to account for any MIPS64-specifics.
The return instruction created as part of eh_return expansion is now expanded
using expandRetRA() so we use the right return instruction on MIPS32r6/MIPS64r6
('jalr $zero, $rs').
Also, fixed a misuse of isABI_N64() to detect 64-bit wide registers in
expandEhReturn().
Reviewers: jkolek, vmedic, mseaborn, zoran.jovanovic, dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D4268
llvm-svn: 212604
Daniel Sanders [Wed, 9 Jul 2014 10:07:36 +0000 (10:07 +0000)]
Add ability to emit internal instruction representation to CodeGen assembly output.
Summary:
This patch re-uses the implementation of 'llvm-mc -show-inst' and makes it
available to llc as 'llc -asm-show-inst'.
This is necessary to test parts of MIPS32r6/MIPS64r6 without resorting to
'llc -filetype=obj' tests. For example, on MIPS32r2 and earlier we use the
'jr $rs' instruction for indirect branches and returns. On MIPS32r6, we no
longer have 'jr $rs' and use 'jalr $zero, $rs' instead. The catch is that,
on MIPS32r6, 'jr $rs' is an alias for 'jalr $zero, $rs' and is the preferred
way of writing this instruction. As a result, all MIPS ISA's emit 'jr $rs' in
their assembly output and the assembler encodes this to different opcodes
according to the ISA.
Using this option, we can check that the MCInst really is a JR or a JALR by
matching the emitted comment. This removes the need for a 'llc -filetype=obj'
test.
Reviewers: rafael, dsanders
Reviewed By: dsanders
Subscribers: zoran.jovanovic, llvm-commits
Differential Revision: http://reviews.llvm.org/D4267
llvm-svn: 212603
Chandler Carruth [Wed, 9 Jul 2014 10:06:58 +0000 (10:06 +0000)]
[x86] Re-apply a variant of the x86 side of r212324 now that the rest
has settled without incident, removing the x86-specific and overly
strict 'isVectorSplat' routine in favor of generic and more powerful
splat detection.
The primary motivation and result of this is that the x86 backend can
now see through splats which contain undef elements. This is essential
if we are using a widening form of legalization and I've updated a test
case to also run in that mode as before this change the generated code
for the test case was completely scalarized.
This version of the patch much more carefully handles the undef lanes.
- We aren't overly conservative about them in the shift lowering
(where we will never use the splat itself).
- One place where the splat would have been re-used by the existing code
now explicitly constructs a new constant splat that will be safe.
- The broadcast lowering is much more reasonable with undefs by doing
a correct check of whether the splat is the only user of a loaded
value, checking that the splat actually crosses multiple lanes before
using a broadcast, and handling broadcasts of non-constant splats.
As a consequence of the last bullet, the weird usage of vpshufd instead
of vbroadcast is gone, and we actually can lower an AVX splat with
vbroadcastss where before we emitted a really strange pattern of
a vector load and a manual splat across the vector.
llvm-svn: 212602
Alexey Bataev [Wed, 9 Jul 2014 10:00:31 +0000 (10:00 +0000)]
Fixed incompatibility with MSVC builds in range-based for loops in DataRecursiveASTVisitor and RecursiveASTVisitor for OpenMP constructs.
llvm-svn: 212601
Alexey Bataev [Wed, 9 Jul 2014 09:50:46 +0000 (09:50 +0000)]
Revert commit 212599.
llvm-svn: 212600
Alexey Bataev [Wed, 9 Jul 2014 09:33:29 +0000 (09:33 +0000)]
[OPENMP] Fixed incompatibility in [Data]RecursiveASTVisitor::TraverseOMPExecutableDirective method with MSVC for range-based loops.
llvm-svn: 212599
Tim Northover [Wed, 9 Jul 2014 09:24:43 +0000 (09:24 +0000)]
ARM: use LLVM's atomicrmw instructions when ldrex/strex are available.
Having some kind of weird kernel-assisted ABI for these when the
native instructions are available appears to be (and should be) the
exception; OSs have been gradually opting in for years and the code
was getting silly.
So let LLVM decide whether it's possible/profitable to inline them by
default.
Patch by Phoebe Buckheister.
llvm-svn: 212598
Daniel Jasper [Wed, 9 Jul 2014 08:42:42 +0000 (08:42 +0000)]
clang-format: Add new option to indent wrapped function declarations.
Though not completely identical, make former
IndentFunctionDeclarationAfterType change this flag for backwards
compatibility (it is somewhat close in meaning and better the err'ing on
an unknown config flag).
llvm-svn: 212597
Timur Iskhodzhanov [Wed, 9 Jul 2014 08:35:33 +0000 (08:35 +0000)]
[ASan/Win] Don't instrument COMDAT globals. Properly fixes PR20244.
llvm-svn: 212596
Dmitri Gribenko [Wed, 9 Jul 2014 08:30:15 +0000 (08:30 +0000)]
SourceMgr: consistently use 'unsigned' for the memory buffer ID type
llvm-svn: 212595
Daniel Jasper [Wed, 9 Jul 2014 08:19:11 +0000 (08:19 +0000)]
clang-format: Update flag documentation.
llvm-svn: 212594
Daniel Jasper [Wed, 9 Jul 2014 08:18:31 +0000 (08:18 +0000)]
Delete removed formatting option.
llvm-svn: 212593
Alexey Bataev [Wed, 9 Jul 2014 08:00:46 +0000 (08:00 +0000)]
[OPENMP] Improved code of DataRecursiveASTVisitor and RecursiveASTVisitor for OpenMP constructs per Tobias Grosser comments.
llvm-svn: 212592
Daniel Jasper [Wed, 9 Jul 2014 07:50:33 +0000 (07:50 +0000)]
clang-format: Revamp function declaration/definition indentation.
Key changes:
- Correctly (well ...) distinguish function declarations and variable
declarations with ()-initialization.
- Don't indent when breaking function declarations/definitions after the
return type.
- Indent variable declarations and typedefs when breaking after the
type.
This fixes llvm.org/PR17999.
llvm-svn: 212591
Alp Toker [Wed, 9 Jul 2014 06:27:05 +0000 (06:27 +0000)]
Prospective -fsanitize=memory build fix following r212586
This -f group flag appears to influence linker flags, breaking the usual rules
and causing CMake's link invocation to fail during feature detection due to
missing link dependencies (msan_*).
Let's forcibly add it for now to get things the way they were before feature
detection started working.
llvm-svn: 212590
Nikola Smiljanic [Wed, 9 Jul 2014 05:42:35 +0000 (05:42 +0000)]
Fix typos.
llvm-svn: 212589
Nikola Smiljanic [Wed, 9 Jul 2014 05:34:24 +0000 (05:34 +0000)]
Use correct memeber when displaying StringMap's size.
llvm-svn: 212588
Alp Toker [Wed, 9 Jul 2014 03:39:32 +0000 (03:39 +0000)]
CMake: make __DATE__, __TIME__ etc. macro usage an error
When LLVM_ENABLE_TIMESTAMPS has been disabled we can prevent the preprocessor
from embedding dates, times and file timestamps.
There are a few motivations for this:
1) Validate the recent CMake feature detection bugfix from LLVM r212586 with
a flag that's not actually available everywhere.
2) Dogfood clang's new -Wdate-time warning from r210511 when bootstrapping.
3) Encourage reproducible builds.
llvm-svn: 212587
Alp Toker [Wed, 9 Jul 2014 03:38:19 +0000 (03:38 +0000)]
CMake: fix compiler feature detection
add_flag_if_supported() and add_flag_or_print_warning() were effectively
no-ops, just returning the value of the first result (usually
'-fno-omit-frame-pointer') for all subsequent checks for different flags.
Due to the way CMake caches feature detection results, we need to provide
symbolic variable names which will persist the cached results. This commit
fixes feature detection using these two macros.
The feature checks now run and get stored correctly, and the correct output can
be observed in configure logs:
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Success
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Success
llvm-svn: 212586
Alp Toker [Wed, 9 Jul 2014 01:37:36 +0000 (01:37 +0000)]
clang-interpreter: don't check input file existence, we're in-process
This flag is set by most other tools and avoids extra stat() calls. The
frontend will diagnose anyway as it performs the check atomically while opening
files at point of use.
We could probably make Driver::CheckInputsExist default to false and only
enable it in the main 'clang' binary, or even better only perform the checks if
we know the tool is external but that needs more thought.
llvm-svn: 212585
Alp Toker [Wed, 9 Jul 2014 01:37:24 +0000 (01:37 +0000)]
Simplify warning flag value handling from r206826
Also give the field it a more appropriate name and improve the docs.
llvm-svn: 212584
Todd Fiala [Wed, 9 Jul 2014 01:29:05 +0000 (01:29 +0000)]
__arm64__ and __aarch64__ #ifdef adjustments
Change by Paul Osmialowski
See http://reviews.llvm.org/D4379 for details.
llvm-svn: 212583
Jason Molenda [Wed, 9 Jul 2014 01:10:37 +0000 (01:10 +0000)]
Correct indentation level for one line.
llvm-svn: 212582
Chandler Carruth [Wed, 9 Jul 2014 00:41:34 +0000 (00:41 +0000)]
[SDAG] At the suggestion of Hal, switch to an output parameter that
tracks which elements of the build vector are in fact undef.
This should make actually inpsecting them (likely in my next patch)
reasonably pretty. Also makes the output parameter optional as it is
clear now that *most* users are happy with undefs in their splats.
llvm-svn: 212581
Ehsan Akhgari [Wed, 9 Jul 2014 00:40:50 +0000 (00:40 +0000)]
[ms-coff] Add a test for proper handling of full Windows path names in the .drectve section
Summary: This test ensures that we can correctly specify a full Windows path to the clang ASAN runtime libraries. This is in preparation to fix PR20246.
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D4427
llvm-svn: 212580
Nick Kledzik [Wed, 9 Jul 2014 00:25:52 +0000 (00:25 +0000)]
Change llvm-nm to use -M instead of -s to work with latest llvm-nm
llvm-svn: 212579
Nico Weber [Tue, 8 Jul 2014 23:54:25 +0000 (23:54 +0000)]
rewrap to 80 cols, no behavior change
llvm-svn: 212578
NAKAMURA Takumi [Tue, 8 Jul 2014 23:48:22 +0000 (23:48 +0000)]
MipsTargetStreamer.h: Avoid "using" to appease msc17.
llvm-svn: 212577
Kevin Enderby [Tue, 8 Jul 2014 23:47:31 +0000 (23:47 +0000)]
Changed the lvm-nm alias "-s" for -print-armap to "-M".
This will allow the "-s" flag to implemented in the future as it
is in darwin’s nm(1) to list symbols only in the specified section.
Given a LGTM by Shankar Easwaran who originally implemented
the support for lvm-nm’s -print-armap and archive map symbols.
llvm-svn: 212576
Jason Molenda [Tue, 8 Jul 2014 23:46:39 +0000 (23:46 +0000)]
Tweak for lldb coding style consistency.
llvm-svn: 212575
Nico Weber [Tue, 8 Jul 2014 23:46:20 +0000 (23:46 +0000)]
rewrap to 80 cols, no behavior change
llvm-svn: 212574
Jim Grosbach [Tue, 8 Jul 2014 23:28:48 +0000 (23:28 +0000)]
AArch64: Better codegen for loading from __fp16.
Loading will generally extend to an f32 or an 64, so make sure
to match those patterns directly to load into the FPR16 register
class directly rather than going through the integer GPRs.
This also eliminates an extra step in the convert-to-f64 path
which was first converting to f32 and then to f64 from there.
rdar://
17594379
llvm-svn: 212573
Hal Finkel [Tue, 8 Jul 2014 23:16:49 +0000 (23:16 +0000)]
Improve BasicAA CS-CS queries
BasicAA contains knowledge of certain intrinsics, such as memcpy and memset,
and uses that information to form more-accurate answers to CallSite vs. Loc
ModRef queries. Unfortunately, it did not use this information when answering
CallSite vs. CallSite queries.
Generically, when an intrinsic takes one or more pointers and the intrinsic is
marked only to read/write from its arguments, the offset/size is unknown. As a
result, the generic code that answers CallSite vs. CallSite (and CallSite vs.
Loc) queries in AA uses UnknownSize when forming Locs from an intrinsic's
arguments. While BasicAA's CallSite vs. Loc override could use more-accurate
size information for some intrinsics, it did not do the same for CallSite vs.
CallSite queries.
This change refactors the intrinsic-specific logic in BasicAA into a generic AA
query function: getArgLocation, which is overridden by BasicAA to supply the
intrinsic-specific knowledge, and used by AA's generic implementation. This
allows the intrinsic-specific knowledge to be used by both CallSite vs. Loc and
CallSite vs. CallSite queries, and simplifies the BasicAA implementation.
Currently, only one function, Mac's memset_pattern16, is handled by BasicAA
(all the rest are intrinsics). As a side-effect of this refactoring, BasicAA's
getModRefBehavior override now also returns OnlyAccessesArgumentPointees for
this function (which is an improvement).
llvm-svn: 212572
Rui Ueyama [Tue, 8 Jul 2014 23:11:01 +0000 (23:11 +0000)]
[PECOFF] Fix .bss section alignment
Previously the alignment of the .bss section was not
properly set because of a bug in AtomizeDefinedSymbolsInSection.
We set the alignment of the section at the end of the function,
but we use an eraly return for the .bss section, so the code had
been skipped.
llvm-svn: 212571
Tobias Grosser [Tue, 8 Jul 2014 22:51:03 +0000 (22:51 +0000)]
DominanceInfo is strongly preferred over RegionInfo
This is and always was strong community consensus. Make this clear in the header
in case newcomers may not be aware.
llvm-svn: 212570
Marshall Clow [Tue, 8 Jul 2014 22:38:11 +0000 (22:38 +0000)]
string_view enhancements. Move to the correct namespace. Better constexpr support (thanks to Richard for the suggestions). Update the tests to match this. Add <experimental/__config for experimental macros/etc to live.
llvm-svn: 212569
Kevin Enderby [Tue, 8 Jul 2014 22:10:02 +0000 (22:10 +0000)]
Add support for BSD format Archive map symbols (aka the table of contents
from a __.SYMDEF or "__.SYMDEF SORTED" archive member).
llvm-svn: 212568
Greg Clayton [Tue, 8 Jul 2014 21:45:21 +0000 (21:45 +0000)]
Make sure that qProcessInfo packet returns correct cpu type/subtype for processes on Haswell machines with a Haswell enabled kernel.
<rdar://problem/
17332107>
llvm-svn: 212567
Reid Kleckner [Tue, 8 Jul 2014 21:35:03 +0000 (21:35 +0000)]
MS compat: Allow lookup of types from dependent bases in functions
If we want to resolve the remaining FIXMEs here, we probably want to
extend the main lookup mechanism to perform lookup into dependent bases,
but we would have to tread lightly. Adding more name lookup has major
impact on compile time.
If we did extend the main mechanism, we would add a flag to LookupResult
that allows us to find names from dependent base classes where the base
is a specialization of a known template. The final LookupResult would
still return LookupResult::NotFoundInCurrentInstantiation, but it would
have a collection of Decls. If we find a real lookup result, we would
clear the flag and the existing lookup results and begin accumulating
only real lookup results.
We would structure the lookup as a secondary lookup between normal
lookup and typo correction for normal compilation, but for MSVC
compatibility mode, we would always enable this extra lookup into
dependent bases.
llvm-svn: 212566
Dmitry Vyukov [Tue, 8 Jul 2014 20:37:16 +0000 (20:37 +0000)]
tsan: reapply 212531 and 212532 with a fix
don't reset s->addr as well
llvm-svn: 212565
Alexey Samsonov [Tue, 8 Jul 2014 20:23:18 +0000 (20:23 +0000)]
Remove unnecessary check for NULL
llvm-svn: 212564
Saleem Abdulrasool [Tue, 8 Jul 2014 20:21:29 +0000 (20:21 +0000)]
test: merge arm-intrin into ms-intrin, fix invocation
This merges the two tests into one since there is no real reason to separate
them. It also fixes the test invocation to specify -fms-compatibility without
which we would end up without an Intrin.h header.
llvm-svn: 212563