Chandler Carruth [Thu, 7 Aug 2014 10:14:27 +0000 (10:14 +0000)]
[x86] Fix another miscompile in the new vector shuffle lowering found
via the fuzz tester.
Here I missed an offset when round-tripping a value through a shuffle
mask. I got it right 2 lines below. See a problem? I do. ;] I'll
probably be adding a little "swap" algorithm which accepts a range and
two values and swaps those values where they occur in the range. Don't
really have a name for it, let me know if you do.
llvm-svn: 215094
Jim Cownie [Thu, 7 Aug 2014 10:12:54 +0000 (10:12 +0000)]
Commit PowerPC64 support from Carlo Bertolli at IBM.
llvm-svn: 215093
Chandler Carruth [Thu, 7 Aug 2014 09:45:02 +0000 (09:45 +0000)]
[x86] Fix another miscompile in the new vector shuffle lowering found
through the new fuzzer.
This one is great: bad operator precedence led the modulus to happen at
the wrong point. All the asserts didn't fire because there were usually
the right values past the end of the 4 element region we were looking
at. Probably could have gotten a crash here with ASan + fuzzing, but the
correctness tests pinpointed this really nicely.
llvm-svn: 215092
Pavel Chupin [Thu, 7 Aug 2014 09:41:19 +0000 (09:41 +0000)]
[x32] Use ebp/esp as frame and stack pointer
Summary:
Since pointers are 32-bit on x32 we can use ebp and esp as frame and stack
pointer. Some operations like PUSH/POP and CFI_INSTRUCTION still
require 64-bit register, so using 64-bit MachineFramePtr where required.
X86_64 NaCl uses 64-bit frame/stack pointers, however it's been found that
both isTarget64BitLP64 and isTarget64BitILP32 are true for NaCl. Addressing
this issue here as well by making isTarget64BitLP64 false.
Also mark hasReservedSpillSlot unreachable on X86. See inlined comments.
Test Plan: Add one new simple test and upgrade 2 existing with x32 target case.
Reviewers: nadav, dschuff
Subscribers: llvm-commits, zinovy.nis
Differential Revision: http://reviews.llvm.org/D4617
llvm-svn: 215091
Chandler Carruth [Thu, 7 Aug 2014 08:11:31 +0000 (08:11 +0000)]
[x86] Fix a miscompile in the new shuffle lowering found through the new
fuzz testing.
The function which tested for adjacency did what it said on the tin, but
when I called it, I wanted it to do something more thorough: I wanted to
know if the *pairs* of shuffle elements were adjacent and started at
0 mod 2. In one place I had the decency to try to test for this, but in
the other it was completely skipped, miscompiling this test case. Fix
this by making the helper actually do what I wanted it to do everywhere
I called it (and removing the now redundant code in one place).
I *really* dislike the name "canWidenShuffleElements" for this
predicate. If anyone can come up with a better name, please let me know.
The other name I thought about was "canWidenShuffleMask" but is it
really widening the mask to reduce the number of lanes shuffled? I don't
know. Naming things is hard.
llvm-svn: 215089
Pete Cooper [Thu, 7 Aug 2014 05:47:13 +0000 (05:47 +0000)]
Update Tablegen documents given that binary literals are now sized
llvm-svn: 215088
Pete Cooper [Thu, 7 Aug 2014 05:47:10 +0000 (05:47 +0000)]
Update BitRecTy::convertValue to allow if expressions with bit values on both sides of the if
llvm-svn: 215087
Pete Cooper [Thu, 7 Aug 2014 05:47:07 +0000 (05:47 +0000)]
Change the { } expression in tablegen to accept sized binary literals which are not just 0 and 1.
It also allows nested { } expressions, as now that they are sized, we can merge pull bits from the nested value.
In the current behaviour, everything in { } must have been convertible to a single bit.
However, now that binary literals are sized, its useful to be able to initialize a range of bits.
So, for example, its now possible to do
bits<8> x = { 0, 1, { 0b1001 }, 0, 0b0 }
llvm-svn: 215086
Pete Cooper [Thu, 7 Aug 2014 05:47:04 +0000 (05:47 +0000)]
Change BitsInit to inherit from TypedInit.
This is useful in a later patch where binary literals such as 0b000 will become BitsInit values instead of IntInit values.
llvm-svn: 215085
Pete Cooper [Thu, 7 Aug 2014 05:47:00 +0000 (05:47 +0000)]
Change TableGen so that binary literals such as 0b001 are now sized.
Instead of these becoming an integer literal internally, they now become bits<n> values.
Prior to this change, 0b001 was 1 bit long. This is confusing as clearly the user gave 3 bits.
This new type holds both the literal value and the size, and so can ensure sizes match on initializers.
For example, this used to be legal
bits<1> x = 0b00;
but now it must be written as
bits<2> x = 0b00;
llvm-svn: 215084
Pete Cooper [Thu, 7 Aug 2014 05:46:57 +0000 (05:46 +0000)]
TableGen: Change { } to only accept bits<n> entries when n == 1.
Prior to this change, it was legal to do something like
bits<2> opc = { 0, 1 };
bits<2> opc2 = { 1, 0 };
bits<2> a = { opc, opc2 };
This involved silently dropping bits from opc and opc2 which is very hard to debug.
Now the above test would be an error. Having tested with an assert, none of LLVM/clang was relying on this behaviour.
Thanks to Adam Nemet for the above test.
llvm-svn: 215083
Pete Cooper [Thu, 7 Aug 2014 05:46:54 +0000 (05:46 +0000)]
Fix a whole bunch of binary literals which were the wrong size. All were being silently zero extended to the correct width.
The commit after this changes { } and 0bxx literals to be of type bits<n> and not int. This means we need to write exactly the right number of bits, and not rely on the values being silently zero extended for us.
llvm-svn: 215082
Viktor Kutuzov [Thu, 7 Aug 2014 04:58:41 +0000 (04:58 +0000)]
Add FreeBSD support to the address sanitizer's malloc_context_size.cc test case
Differential Revision: http://reviews.llvm.org/D4665
llvm-svn: 215081
Chandler Carruth [Thu, 7 Aug 2014 04:49:54 +0000 (04:49 +0000)]
Add an option to the shuffle fuzzer that lets you fuzz exclusively
within a single bit-width of vectors. This is particularly useful for
when you know you have bugs in a certain area and want to find simpler
test cases than those produced by an open-ended fuzzing that ends up
legalizing the vector in addition to shuffling it.
llvm-svn: 215056
Bill Wendling [Thu, 7 Aug 2014 04:21:45 +0000 (04:21 +0000)]
Use the minor number for the revision numbers.
llvm-svn: 215055
Chandler Carruth [Thu, 7 Aug 2014 04:13:51 +0000 (04:13 +0000)]
Add a vector shuffle fuzzer.
This is a python script which for a given seed generates a random
sequence of random shuffles of a random vector width. It embeds this
into a function and emits a main function which calls the test routine
and checks that the results (where defined) match the obvious results.
I'll be using this to drive out miscompiles from the new vector shuffle
logic now that it is clean of any crashes I can find with llvm-stress.
Note, my python skills are very poor. Sorry if this is terrible code,
and feel free to tell me how I should write this or just patch it as
necessary.
The tests generated try to be very portable and use boring C routines.
It technically will mis-declare the C routines and pass 32-bit integers
to parametrs that expect 64-bit integers. If someone wants to fix this
and has less terrible ideas of how to do it, I'm all ears. Fortunately,
this "just works" for x86. =]
llvm-svn: 215054
Justin Bogner [Thu, 7 Aug 2014 03:58:32 +0000 (03:58 +0000)]
Driver: Add tests for -fprofile-arcs and -fno-profile-arcs
I tried to be lazy and get away with no test in r215051, but Chad
caught me :)
llvm-svn: 215053
Justin Bogner [Thu, 7 Aug 2014 03:47:28 +0000 (03:47 +0000)]
DebugInfo: Make a test more portable
mach-o doesn't like sections without segments, and elf is perfectly
happy with commas in section names, so use a Darwin-like section name.
Suggestion by Eric Christopher.
llvm-svn: 215052
Justin Bogner [Thu, 7 Aug 2014 03:14:34 +0000 (03:14 +0000)]
Driver: Add -fno-profile-arcs to go with -fprofile-arcs
This is a trivial gcc-compatible change.
llvm-svn: 215051
Saleem Abdulrasool [Thu, 7 Aug 2014 02:59:41 +0000 (02:59 +0000)]
MC: split Win64EHUnwindEmitter into a shared streamer
This changes Win64EHEmitter into a utility WinEH UnwindEmitter that can be
shared across multiple architectures and a target specific bit which is
overridden (Win64::UnwindEmitter). This enables sharing the section selection
code across X86 and the intended use in ARM for emitting unwind information for
Windows on ARM.
llvm-svn: 215050
Richard Trieu [Thu, 7 Aug 2014 02:09:05 +0000 (02:09 +0000)]
Update the context location of the condition of a conditional operator to the
question mark instead of the context of the conditional operator. The
condition does not need the context of the conditional operator at all.
llvm-svn: 215048
Reid Kleckner [Thu, 7 Aug 2014 01:00:42 +0000 (01:00 +0000)]
Make FullExprArg trivially copyable by removing the copy ctor
The default copy ctor is good. This avoids using inalloca for a bunch
of Sema methods when self-hosting.
llvm-svn: 215047
Richard Smith [Thu, 7 Aug 2014 00:24:21 +0000 (00:24 +0000)]
Use -Rblah, not -Wblah, to control remark diagnostics. This was always the
intent when we added remark support, but was never implemented in the general
case, because the first -R flags didn't need it. (-Rpass= had special handling
to accomodate its argument.)
-Rno-foo, -Reverything, and -Rno-everything can be used to turn off a remark,
or to turn on or off all remarks. Per discussion on cfe-commits, -Weverything
does not affect remarks, and -Reverything does not affect warnings or errors.
The only "real" -R flag we have right now is -Rmodule-build; that flag is
effectively renamed from -Wmodule-build to -Rmodule-build by this change.
-Wpass and -Wno-pass (and their friends) are also renamed to -Rpass and
-Rno-pass by this change; it's not completely clear whether we intended to have
a -Rpass (with no =pattern), but that is unchanged by this commit, other than
the flag name. The default pattern is effectively one which matches no passes.
In future, we may want to make the default pattern be .*, so that -Reverything
works for -Rpass properly.
llvm-svn: 215046
Quentin Colombet [Thu, 7 Aug 2014 00:20:44 +0000 (00:20 +0000)]
[X86][SchedModel] Fixed missing/wrong scheduling model found by code inspection.
Source: Agner Fog's Instruction tables.
Related to <rdar://problem/
15607571>
llvm-svn: 215045
Reid Kleckner [Thu, 7 Aug 2014 00:05:00 +0000 (00:05 +0000)]
Add back the leading space when printing commands with -###
This was an unintentional behavior change from r214924.
llvm-svn: 215044
Fariborz Jahanian [Wed, 6 Aug 2014 23:40:31 +0000 (23:40 +0000)]
Objective-C ARC. More code for Objective-C's
new APIs for literals. nfc. wip. rdar://
17554063
llvm-svn: 215043
Kevin Enderby [Wed, 6 Aug 2014 23:24:41 +0000 (23:24 +0000)]
Add the -mcpu= option to llvm-objdump for use with the disassemblers.
Also make the disassembler created with the Mach-O parser (the -m option)
pick up the Target specific attributes specified with -mattr option.
llvm-svn: 215032
Reid Kleckner [Wed, 6 Aug 2014 23:21:13 +0000 (23:21 +0000)]
MC X86: Accept ".att_syntax prefix" and diagnose noprefix
Fixes PR18916. I don't think we need to implement support for either
hybrid syntax. Nobody should write Intel assembly with '%' prefixes on
their registers or AT&T assembly without them.
llvm-svn: 215031
Alexey Samsonov [Wed, 6 Aug 2014 23:13:23 +0000 (23:13 +0000)]
[TSan] Try to fix Go runtime build
llvm-svn: 215000
David Blaikie [Wed, 6 Aug 2014 22:30:12 +0000 (22:30 +0000)]
Revert "Reapply "DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself.""
This reverts commit r214761.
Revert while Reid investigates & provides a reproduction for an
assertion failure for this on Windows.
llvm-svn: 214999
Rui Ueyama [Wed, 6 Aug 2014 22:01:54 +0000 (22:01 +0000)]
Revert "Fix modelling of non-lifetime-extended temporary destructors in the analyzer."
This reverts commit r214962 because after the change the
following code doesn't compile with -Wreturn-type -Werror.
#include <cstdlib>
class NoReturn {
public:
~NoReturn() __attribute__((noreturn)) { exit(1); }
};
int check() {
true ? NoReturn() : NoReturn();
}
llvm-svn: 214998
Keno Fischer [Wed, 6 Aug 2014 21:18:13 +0000 (21:18 +0000)]
Fix ProcessKDP after Host/Socket addition
Reviewers: zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D4815
llvm-svn: 214996
Sanjay Patel [Wed, 6 Aug 2014 21:08:38 +0000 (21:08 +0000)]
fix typo
llvm-svn: 214995
Yaron Keren [Wed, 6 Aug 2014 20:59:09 +0000 (20:59 +0000)]
getNewMemBuffer memsets the buffer to zeros,
the caller don't have to initialize it.
llvm-svn: 214994
Fariborz Jahanian [Wed, 6 Aug 2014 20:56:21 +0000 (20:56 +0000)]
Objective-C ARC. Adding declarations for Objective-C's
new APIs for literals. nfc. wip. rdar://
17554063
llvm-svn: 214993
Sanjay Patel [Wed, 6 Aug 2014 20:45:30 +0000 (20:45 +0000)]
Fix a test that has no checks.
X86 doesn't have fneg, so check for xor.
Differential Revision: http://reviews.llvm.org/D4812
llvm-svn: 214992
Matt Arsenault [Wed, 6 Aug 2014 20:27:55 +0000 (20:27 +0000)]
R600: Cleanup fadd and fsub tests
llvm-svn: 214991
Rui Ueyama [Wed, 6 Aug 2014 19:37:35 +0000 (19:37 +0000)]
Fix mach-o tests on Windows
The tests assume the path separator is '/', but if you run
them on Windows it is '\'. As a result the tests are failing
on Windows. This should be the minimal change to make these
tests to pass on Windows platform.
Differential Revision: http://reviews.llvm.org/D4710
llvm-svn: 214990
Rui Ueyama [Wed, 6 Aug 2014 19:30:38 +0000 (19:30 +0000)]
Revert "r214897 - Remove dead zero store to calloc initialized memory"
It broke msan.
llvm-svn: 214989
Eric Christopher [Wed, 6 Aug 2014 18:45:26 +0000 (18:45 +0000)]
Remove the target machine from CCState. Previously it was only used
to get the subtarget and that's accessible from the MachineFunction
now. This helps clear the way for smaller changes where we getting
a subtarget will require passing in a MachineFunction/Function as
well.
llvm-svn: 214988
Adrian Prantl [Wed, 6 Aug 2014 18:41:24 +0000 (18:41 +0000)]
Improve performance of calculateDbgValueHistory.
In r210492 the logic of calculateDbgValueHistory was changed to end
register variable live ranges at the end of MBB conditionally on
the fact that the register was or not clobbered by the function body.
This requires an initial scan of all the operands of the function
to collect all clobbered registers. In a second pass over all
instructions, we compare this set with the set of clobbered
registers for the current MachineInstruction. This modification
incurred a compilation time regression on some benchmarks: the
debug info emission phase takes ~10% more time.
While a small performance hit is unavoidable due to the initial
scan requirement, we can improve the situation by avoiding to
create too many temporary sets and just use lambdas to work directly
on the result of the initial scan.
Fixes <rdar://problem/
17884104>
Patch by Frederic Riss!
llvm-svn: 214987
Adrian Prantl [Wed, 6 Aug 2014 18:41:19 +0000 (18:41 +0000)]
Cleanup collectChangingRegs
The handling of the epilogue is best expressed as an early exit and
there is no reason to look for register defs in DbgValue MIs.
Patch by Frederic Riss!
llvm-svn: 214986
David Blaikie [Wed, 6 Aug 2014 18:24:19 +0000 (18:24 +0000)]
DebugInfo: Fix ranges+gmlt test case to actually exercise the gmlt situation.
Originally this test case tested the specified behavior (that -gmlt
would not produce DW_AT_ranges and that when no CU DW_AT_ranges were
produced, no debug_ranges section (not even an empty list) would be
produced) but then the ranges emission code was improved not to create
ranges of a single element (instead favoring high_pc/low_pc) and so this
test case no longer exercised the -gmlt portion of the behavior.
This caused me some confusion when reading the comments and trying to
update this test case for future changes to -gmlt. I've made this test
resilient to those changes (by using the {{DW_TAG|NULL}} pattern to
block the end of the attribute search at the end of the CU's attribute
list without mandating that it must (or must not) be followed by another
tag (the future changes to -gmlt should produce no subprograms in this
CU))
Fix the test case to have two functions in distinct sections to force
the use of DW_AT_ranges.
llvm-svn: 214985
Zachary Turner [Wed, 6 Aug 2014 18:16:26 +0000 (18:16 +0000)]
Creates a socket host object.
This patch moves the logic of many common socket operations into
its own class lldb_private::Socket. It then modifies the
ConnectionFileDescriptor class, and a few users of that class,
to use this new Socket class instead of hardcoding socket logic
directly.
Finally, this patch creates a common interface called IOObject for
any objects that support reading and writing, so that endpoints
such as sockets and files can be treated the same.
Differential Revision: http://reviews.llvm.org/D4641
Reviewed by: Todd Fiala, Greg Clayton
llvm-svn: 214984
Fariborz Jahanian [Wed, 6 Aug 2014 18:13:46 +0000 (18:13 +0000)]
Objective-C ARC. First patch toward generating new APIs
for Objective-C's array and dictionary literals.
rdar://
17554063. This is wip.
llvm-svn: 214983
Reid Kleckner [Wed, 6 Aug 2014 18:09:15 +0000 (18:09 +0000)]
Add a triple to this test to get the right IR mangling
llvm-svn: 214982
Reid Kleckner [Wed, 6 Aug 2014 18:09:04 +0000 (18:09 +0000)]
Don't count inreg params when mangling fastcall functions
This is consistent with MSVC.
llvm-svn: 214981
Reid Kleckner [Wed, 6 Aug 2014 17:57:23 +0000 (17:57 +0000)]
Round up the size of byval arguments to MinAlign
Otherwise we can end up with an argument frame size that is not a
multiple of stack slot size, which is very awkward.
This fixes PR20547, which was a bug in x86_64 Sys V vararg handling.
However, it's much easier to test this with x86 callee-cleanup
functions, which previously ended in "retl $6" instead of "retl $8".
This does affect behavior of all backends, but it presumably fixes the
same bug in all of them.
llvm-svn: 214980
Duncan P. N. Exon Smith [Wed, 6 Aug 2014 17:36:08 +0000 (17:36 +0000)]
UseListOrder: Use std::vector
I initially used a `SmallVector<>` for `UseListOrder::Shuffle`, which
was a silly choice. When I realized my error I quickly rolled a custom
data structure.
This commit simplifies it to a `std::vector<>`. Now that I've had a
chance to measure performance, this data structure isn't part of a
bottleneck, so the additional complexity is unnecessary.
This is part of PR5680.
llvm-svn: 214979
Chad Rosier [Wed, 6 Aug 2014 16:56:58 +0000 (16:56 +0000)]
[AArch64] Add a few isTarget* API to AArch64 Subtarget.
llvm-svn: 214977
NAKAMURA Takumi [Wed, 6 Aug 2014 16:53:13 +0000 (16:53 +0000)]
FormatTokenLexer: Avoid non-static member initializer.
llvm-svn: 214976
Chad Rosier [Wed, 6 Aug 2014 16:06:41 +0000 (16:06 +0000)]
Add test case omitted in r214974.
llvm-svn: 214975
Chad Rosier [Wed, 6 Aug 2014 16:05:02 +0000 (16:05 +0000)]
[AArch64] Fix OS ABI flag for aarch64-linux-gnu target.
For triple aarch64-linux-gnu we were incorrectly setting IRIX.
For triple aarch64 we are correctly setting SYSV.
Patch by Ana Pazos <apazos@codeaurora.org>.
llvm-svn: 214974
Sanjay Patel [Wed, 6 Aug 2014 15:58:15 +0000 (15:58 +0000)]
use register iterators that include self to reduce code duplication in CriticalAntiDepBreaker
This patch addresses 2 FIXME comments that I added to CriticalAntiDepBreaker while fixing PR20020.
Initialize an MCSubRegIterator and an MCRegAliasIterator to include the self reg.
Assuming that works as advertised, there should be functional difference with this patch, just less code.
Also, remove the associated asserts - we're setting those values just before, so the asserts don't do anything meaningful.
Differential Revision: http://reviews.llvm.org/D4566
llvm-svn: 214973
Robert Khasanov [Wed, 6 Aug 2014 15:40:34 +0000 (15:40 +0000)]
[AVX512] Added load/store instructions to Register2Memory opcode tables.
Added lowering tests for load/store.
Reviewed by Elena Demikhovsky <elena.demikhovsky@intel.com>
llvm-svn: 214972
Dan Liew [Wed, 6 Aug 2014 14:37:00 +0000 (14:37 +0000)]
Fix missing favicon.ico warning (Sphinx 1.2.2). The comments next to
``html_favicon`` seem to conflict with [what it in the sphinx
docs](http://sphinx-doc.org/config.html#confval-html_favicon).
So I've copied the comments from there to conf.py and changed its
value appropriately to remove the missing favicon.ico warning.
llvm-svn: 214971
Manuel Klimek [Wed, 6 Aug 2014 14:21:59 +0000 (14:21 +0000)]
Remove unnecessary semicolon.
llvm-svn: 214970
Daniel Jasper [Wed, 6 Aug 2014 14:15:41 +0000 (14:15 +0000)]
clang-format: Correct SBPO_Always-behavior after function-like keywords
Before:
auto f (int x) -> decltype(x) { return sizeof(x); }
int g () noexcept(someCall ());
static_assert(sizeof(char) == 1, "Your compiler is broken");
After:
auto f (int x) -> decltype (x) { return sizeof (x); }
int g () noexcept (someCall ());
static_assert (sizeof (char) == 1, "Your compiler is broken");
This fixes llvm.org/PR20559.
Patch by Roman Kashitsyn, thank you!
llvm-svn: 214969
Dan Liew [Wed, 6 Aug 2014 14:11:47 +0000 (14:11 +0000)]
Fix sphinx warning.
llvm-svn: 214968
Dan Liew [Wed, 6 Aug 2014 13:49:33 +0000 (13:49 +0000)]
Fix sphinx warning.
llvm-svn: 214967
Daniel Jasper [Wed, 6 Aug 2014 13:40:26 +0000 (13:40 +0000)]
clang-format: Add special comments to disable formatting.
With this patch:
int ThisWillBeFormatted;
// clang-format off
int ThisWontBeFormatted;
// clang-format on
int Formatted;
This is for regions where a significantly nicer code layout can be found
knowing the content of the code.
This fixes llvm.org/PR20463.
llvm-svn: 214966
James Molloy [Wed, 6 Aug 2014 13:31:32 +0000 (13:31 +0000)]
[AArch64] Add a testcase for r214957.
llvm-svn: 214965
Daniel Jasper [Wed, 6 Aug 2014 13:14:58 +0000 (13:14 +0000)]
clang-format: Fix indentation in multi-line placement new.
Before:
auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
new (
aaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaa))
typename
aaaaaaaaaaaaaaaaaaaaaaaa();
After:
auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
new (
aaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaa))
typename
aaaaaaaaaaaaaaaaaaaaaaaa();
llvm-svn: 214964
James Molloy [Wed, 6 Aug 2014 12:56:19 +0000 (12:56 +0000)]
Add a new option -run-slp-after-loop-vectorization.
This swaps the order of the loop vectorizer and the SLP/BB vectorizers. It is disabled by default so we can do performance testing - ideally we want to change to having the loop vectorizer running first, and the SLP vectorizer using its leftovers instead of the other way around.
llvm-svn: 214963
Manuel Klimek [Wed, 6 Aug 2014 12:45:51 +0000 (12:45 +0000)]
Fix modelling of non-lifetime-extended temporary destructors in the analyzer.
1. Changes to the CFG:
When creating the CFG for temporary destructors, we create a structure
that mirrors the branch structure of the conditionally executed
temporary constructors in a full expression.
The branches we create use a CXXBindTemporaryExpr as terminator which
corresponds to the temporary constructor which must have been executed
to enter the destruction branch.
2. Changes to the Analyzer:
When we visit a CXXBindTemporaryExpr we mark the CXXBindTemporaryExpr as
executed in the state; when we reach a branch that contains the
corresponding CXXBindTemporaryExpr as terminator, we branch out
depending on whether the corresponding CXXBindTemporaryExpr was marked
as executed.
llvm-svn: 214962
Alexander Kornienko [Wed, 6 Aug 2014 11:49:10 +0000 (11:49 +0000)]
Rename ChecksFilter to GlobList, as there's nothing specific to checks in it.
Summary:
Rename ChecksFilter to GlobList, as there's nothing specific to checks in it.
It's a rather generic way to represent sets of strings (or patterns), so it may
be used for something else in ClangTidy. The new name would not look strange
when used to filter other entities.
Reviewers: klimek
Reviewed By: klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4806
llvm-svn: 214961
Ed Maste [Wed, 6 Aug 2014 11:43:54 +0000 (11:43 +0000)]
Add decorators for tests failing to build on the lab.llvm.org FreeBSD buildbot
llvm.org/pr20548
llvm-svn: 214960
Tim Northover [Wed, 6 Aug 2014 11:13:14 +0000 (11:13 +0000)]
ARM: do not generate BLX instructions on Cortex-M CPUs.
Particularly on MachO, we were generating "blx _dest" instructions on M-class
CPUs, which don't actually exist. They happen to get fixed up by the linker
into valid "bl _dest" instructions (which is why such a massive issue has
remained largely undetected), but we shouldn't rely on that.
llvm-svn: 214959
Tim Northover [Wed, 6 Aug 2014 11:13:06 +0000 (11:13 +0000)]
ARM-MachO: materialize callee address correctly on v4t.
llvm-svn: 214958
James Molloy [Wed, 6 Aug 2014 10:42:18 +0000 (10:42 +0000)]
[AArch64] Conditional selects are expensive on out-of-order cores.
Specifically Cortex-A57. This probably applies to Cyclone too but I haven't enabled it for that as I can't test it.
This gives ~4% improvement on SPEC 174.vpr, and ~1% in 471.omnetpp.
llvm-svn: 214957
Alexander Kornienko [Wed, 6 Aug 2014 10:17:55 +0000 (10:17 +0000)]
check_clang_tidy_fix.sh: added comments, use set -o errexit instead of '|| exit $?' on each command
llvm-svn: 214956
Viktor Kutuzov [Wed, 6 Aug 2014 10:16:52 +0000 (10:16 +0000)]
Segregate FreeBSD-specific parts from sanitizer_procmaps_linux.cc
Differential Revision: http://reviews.llvm.org/D4555
llvm-svn: 214955
Chandler Carruth [Wed, 6 Aug 2014 10:16:36 +0000 (10:16 +0000)]
[x86] Fix two independent miscompiles in the process of getting the same
test case to actually generate correct code.
The primary miscompile fixed here is that we weren't correctly handling
in-place elements in one half of a single-input v8i16 shuffle when
moving a dword of elements from that half to the other half. Some times,
we would clobber the in-place elements in forming the dword to move
across halves.
The fix to this involves forcibly marking the in-place inputs even when
there is no need to gather them into a dword, and to much more carefully
re-arrange the elements when grouping them into a dword to move across
halves. With these two changes we would generate correct shuffles for
the test case, but found another miscompile. There are also some random
perturbations of the generated shuffle pattern in SSE2. It looks like
a wash; more instructions in some cases fewer in others.
The second miscompile would corrupt the results into nonsense. This is
a buggy pattern in one of the added DAG combines. Mapping elements
through a PSHUFD when pairing redundant half-shuffles is *much* harder
than this code makes it out to be -- it requires reasoning about *all*
of where the input is used in the PSHUFD, not just one part of where it
is used. Plus, we can't combine a half shuffle *into* a PSHUFD but the
code didn't guard against it. I think this was just a bad idea and I've
just removed that aspect of the combine. No tests regress as
a consequence so seems OK.
llvm-svn: 214954
Chandler Carruth [Wed, 6 Aug 2014 10:16:33 +0000 (10:16 +0000)]
[x86] Switch to a formulation of a for loop that is much more obviously
not corrupting the mask by mutating it more times than intended. No
functionality changed (the results were non-overlapping so the old
version "worked" but was non-obvious).
llvm-svn: 214953
Benjamin Kramer [Wed, 6 Aug 2014 08:19:30 +0000 (08:19 +0000)]
[clang-tidy] forward arguments of the testing script to clang-tidy.
llvm-svn: 214952
Adam Nemet [Wed, 6 Aug 2014 07:13:12 +0000 (07:13 +0000)]
[X86] Fixes commit r214890 to match the posted patch
This was another fallout from my local rebase where something went wrong :(
llvm-svn: 214951
Simon Atanasyan [Wed, 6 Aug 2014 06:04:48 +0000 (06:04 +0000)]
[Driver] Add missed include header.
llvm-svn: 214950
Simon Atanasyan [Wed, 6 Aug 2014 05:44:47 +0000 (05:44 +0000)]
[Driver] Move information about toolchain specific include directories
from the common driver code to the corresponding `MultilibSet` declarations.
Now the `MultilibSet` can hold an optional callback function which is
responsible to return a set of include directories specific for the toolchain.
That allows to remove MIPS toolchain specific directories from
`Linux::AddClangSystemIncludeArgs` method and simplify adding new directories
in the future.
llvm-svn: 214949
Rui Ueyama [Wed, 6 Aug 2014 03:29:17 +0000 (03:29 +0000)]
[PECOFF] Exported symbols are dead-strip roots.
llvm-svn: 214948
David Majnemer [Wed, 6 Aug 2014 03:12:47 +0000 (03:12 +0000)]
MS ABI: Mangle lambdas which are given the same mangling number
It is possible for lambdas to get the same mangling number because they
may exist in different mangling contexts. To handle this correctly,
mangle the context into the name as well.
llvm-svn: 214947
Jim Ingham [Wed, 6 Aug 2014 01:49:59 +0000 (01:49 +0000)]
When stepping, handle the case where the step leaves us with
the same parent frame, but different current frame - e.g. when
you step past a tail call exit from a function. Apply the same
"avoid-no-debug" rules to this case as for a "step-in".
<rdar://problem/
16189225>
llvm-svn: 214946
Matt Arsenault [Wed, 6 Aug 2014 00:44:25 +0000 (00:44 +0000)]
Correct comment
llvm-svn: 214945
Peter Collingbourne [Wed, 6 Aug 2014 00:33:40 +0000 (00:33 +0000)]
[dfsan] Try not to create too many additional basic blocks in functions which
already have a large number of blocks. Works around a performance issue with
the greedy register allocator.
llvm-svn: 214944
Matt Arsenault [Wed, 6 Aug 2014 00:29:49 +0000 (00:29 +0000)]
R600: Increase nearby load scheduling threshold.
This partially fixes weird looking load scheduling
in memcpy test. The load clustering doesn't seem
particularly smart, but this method seems to be partially
deprecated so it might not be worth trying to fix.
llvm-svn: 214943
Matt Arsenault [Wed, 6 Aug 2014 00:29:43 +0000 (00:29 +0000)]
R600/SI: Implement areLoadsFromSameBasePtr
This currently has a noticable effect on the kernel argument loads.
LDS and global loads are more problematic, I think because of how copies
are currently inserted to ensure that the address is a VGPR.
llvm-svn: 214942
Jim Ingham [Wed, 6 Aug 2014 00:24:38 +0000 (00:24 +0000)]
Probably should initialize that new ivar while I'm at it...
llvm-svn: 214941
Quentin Colombet [Wed, 6 Aug 2014 00:22:39 +0000 (00:22 +0000)]
[X86][SchedModel] Fixed some wrong scheduling model found by code inspection.
Source: Agner Fog's Instruction tables.
Related to <rdar://problem/
15607571>
llvm-svn: 214940
David Blaikie [Wed, 6 Aug 2014 00:21:25 +0000 (00:21 +0000)]
DebugInfo: Assert that any CU for which debug_loc lists are emitted, has at least one range.
This was coming in weird debug info that had variables (and hence
debug_locs) but was in GMLT mode (because it was missing the 13th field
of the compile_unit metadata) so no ranges were constructed. We should
always have at least one range for any CU with a debug_loc in it -
because the range should cover the debug_loc.
The assertion just ensures that the "!= 1" range case inside the
subsequent loop doesn't get entered for the case where there are no
ranges at all, which should never reach here in the first place.
llvm-svn: 214939
Jim Ingham [Wed, 6 Aug 2014 00:10:12 +0000 (00:10 +0000)]
Add a variant of the CommandOverrideCallback that takes a
CommandReturnObject. Otherwise, all the overridden command
can do is say it overrode the command, not say what it did...
Also removed the duplicate definition of CommandOverrideCallback
from the private interfaces.
Now to figure out how to get this through the SB API's...
<rdar://problem/
17911629>
llvm-svn: 214938
David Blaikie [Tue, 5 Aug 2014 23:57:31 +0000 (23:57 +0000)]
DebugInfo: Fix a bunch of tests that, owing to their compile_unit metadata not including a 13th field, had some subtle behavior.
Without the 13th field, the "emission kind" field defaults to 0 (which
is not equal to either of the values of the emission kind enum (1 ==
full debug info, 2 == line tables only)).
In this particular instance, the comparison with "FullDebugInfo" was
done when adding elements to the ranges list - so for these test cases
no values were added to the ranges list.
This got weirder when emitting debug_loc entries as the addresses should
be relative to the range of the CU if the CU has only one range (the
reasonable assumption is that if we're emitting debug_loc lists for a CU
that CU has at least one range - but due to the above situation, it has
zero) so the ranges were emitted relative to the start of the section
rather than relative to the start of the CU's singular range.
Fix these tests by accounting for the difference in the description of
debug_loc entries (in some cases making the test ignorant to these
differences, in others adding the extra label difference expression,
etc) or the presence/absence of high/low_pc on the CU, and add the 13th
field to their CUs to enable proper "full debug info" emission here.
In a future commit I'll fix up a bunch of other test cases that are not
so rigorously depending on this behavior, but still doing similarly
weird things due to the missing 13th field.
llvm-svn: 214937
Matt Arsenault [Tue, 5 Aug 2014 23:53:20 +0000 (23:53 +0000)]
R600/SI: Add definitions for ds_read2st64_ / ds_write2st64_
llvm-svn: 214936
Rui Ueyama [Tue, 5 Aug 2014 23:43:21 +0000 (23:43 +0000)]
Remove trailing whitespaces
llvm-svn: 214935
JF Bastien [Tue, 5 Aug 2014 23:27:34 +0000 (23:27 +0000)]
Fix typos in comments and doc
Committing http://reviews.llvm.org/D4798 for Robin Morisset (morisset@google.com)
llvm-svn: 214934
David Blaikie [Tue, 5 Aug 2014 23:14:16 +0000 (23:14 +0000)]
DebugInfo: Move the reference to the CU from the location list entry to the list itself, since it is constant across an entire list.
This simplifies construction and usage while making the data structure
smaller. It was a holdover from the days when we didn't have a separate
DebugLocList and all we had was a flat list of DebugLocEntries.
llvm-svn: 214933
David Majnemer [Tue, 5 Aug 2014 22:43:45 +0000 (22:43 +0000)]
MS ABI: Mangle empty type parameter packs compatibly
The MS mangling scheme apparently has separate manglings for type and
non-type parameter packs when they are empty. Match template arguments
with parameters during mangling; check the parameter to see if it was
destined to hold type-ish things or nontype-ish things.
Differential Revision: http://reviews.llvm.org/D4792
llvm-svn: 214932
Reid Kleckner [Tue, 5 Aug 2014 22:39:07 +0000 (22:39 +0000)]
Fix Driver tests that I broke on Windows in r214924
llvm-svn: 214931
Eli Bendersky [Tue, 5 Aug 2014 22:27:50 +0000 (22:27 +0000)]
Expose the name mangling C API to Python bindings.
llvm-svn: 214930
Rafael Espindola [Tue, 5 Aug 2014 22:10:21 +0000 (22:10 +0000)]
Remove a virtual function from TargetMachine. NFC.
llvm-svn: 214929
Jonathan Roelofs [Tue, 5 Aug 2014 21:32:21 +0000 (21:32 +0000)]
Re-apply r214881: Fix return sequence on armv4 thumb
This reverts r214893, re-applying r214881 with the test case relaxed a bit to
satiate the build bots.
POP on armv4t cannot be used to change thumb state (unilke later non-m-class
architectures), therefore we need a different return sequence that uses 'bx'
instead:
POP {r3}
ADD sp, #offset
BX r3
This patch also fixes an issue where the return value in r3 would get clobbered
for functions that return 128 bits of data. In that case, we generate this
sequence instead:
MOV ip, r3
POP {r3}
ADD sp, #offset
MOV lr, r3
MOV r3, ip
BX lr
http://reviews.llvm.org/D4748
llvm-svn: 214928
Lang Hames [Tue, 5 Aug 2014 20:51:46 +0000 (20:51 +0000)]
[MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verify
mode.
This will cause -verify mode to report failure when RuntimeDyld encounters an
internal error (e.g. overflows in relocation computations). Previously we had
let these errors slip past unreported.
llvm-svn: 214925