Shankar Easwaran [Sat, 14 Mar 2015 05:26:50 +0000 (05:26 +0000)]
[ELF] Simplify appending chunks to segments.
The Segment Chunk had two functions one to append a section and one to append a
chunk. A section is a subclass of a chunk and clearly this can be merged into
one single function.
llvm-svn: 232249
Chandler Carruth [Sat, 14 Mar 2015 04:47:43 +0000 (04:47 +0000)]
[modules] Teach the AST reader to handle the case of importing a module
with a subset of the existing target CPU features or mismatched CPU
names.
While we can't check that the CPU name used to build the module will end
up being able to codegen correctly for the translation unit, we actually
check that the imported features are a subset of the existing features.
While here, rewrite the code to use std::set_difference and have it
diagnose all of the differences found.
Test case added which walks the set relationships and ensures we
diagnose all the right cases and accept the others.
No functional change for implicit modules here, just better diagnostics.
llvm-svn: 232248
Zachary Turner [Sat, 14 Mar 2015 04:19:32 +0000 (04:19 +0000)]
[gtest] Fix gtest failures on Windows.
On Windows, you need to call WSAStartup() before making any socket
calls, and WSACleanup() before you shutdown. This wasn't being
done, so all of the socket tests were failing. This fixes
that, which brings the unit test suite to a fully working state
on Windows.
llvm-svn: 232247
Frederic Riss [Sat, 14 Mar 2015 03:46:51 +0000 (03:46 +0000)]
[dsymutil] Generate debug_aranges section.
This actually shares most of its implementation with the generation
of the debug_ranges (the absence of 'a' is not a typo) contribution
for the unit's DW_AT_ranges attribute.
llvm-svn: 232246
Frederic Riss [Sat, 14 Mar 2015 03:46:40 +0000 (03:46 +0000)]
[dsymutil] Identify each CompileUnit with a unique ID.
The ID can eg. de used in MCSymbol names to differentiate the ones
that need to be created for every unit.
The ID is a constructor parameter and not a static class member so
there is no issue with counter updates if we decide to thread that
code.
llvm-svn: 232245
Zachary Turner [Sat, 14 Mar 2015 03:10:51 +0000 (03:10 +0000)]
[CMake] Convert TABs to spaces.
This file had been using TAB all along, but my recent change that
used spaces exposed the issue.
llvm-svn: 232244
Ed Maste [Sat, 14 Mar 2015 02:54:57 +0000 (02:54 +0000)]
Skip additional lldb-mi tests that failed on FreeBSD
llvm-svn: 232243
Peter Collingbourne [Sat, 14 Mar 2015 02:42:39 +0000 (02:42 +0000)]
CFI: Add test for bad cast checks.
llvm-svn: 232242
Peter Collingbourne [Sat, 14 Mar 2015 02:42:25 +0000 (02:42 +0000)]
Implement bad cast checks using control flow integrity information.
This scheme checks that pointer and lvalue casts are made to an object of
the correct dynamic type; that is, the dynamic type of the object must be
a derived class of the pointee type of the cast. The checks are currently
only introduced where the class being casted to is a polymorphic class.
Differential Revision: http://reviews.llvm.org/D8312
llvm-svn: 232241
David Blaikie [Sat, 14 Mar 2015 01:53:18 +0000 (01:53 +0000)]
[opaque pointer type] Start migrating GEP creation to explicitly specify the pointee type
I'm just going to migrate these in a pretty ad-hoc & incremental way -
providing the backwards compatible API for now, then locally removing
it, fixing a few callers, adding it back in and commiting those callers.
Rinse, repeat.
The assertions should ensure that if I get this wrong we'll find out
about it and not just have one giant patch to revert, recommit, revert,
recommit, etc.
llvm-svn: 232240
Ahmed Bougacha [Sat, 14 Mar 2015 01:43:57 +0000 (01:43 +0000)]
Add a bunch of CHECK missing colons in tests. NFC.
Some wouldn't pass; fixed most, the rest will be fixed separately.
llvm-svn: 232239
Peter Collingbourne [Sat, 14 Mar 2015 01:35:33 +0000 (01:35 +0000)]
CFI: Add a test for distinguishing between non-overriding siblings.
llvm-svn: 232238
Ahmed Bougacha [Sat, 14 Mar 2015 01:10:19 +0000 (01:10 +0000)]
Add a bunch of missing "CHECK" colons in tests. NFC.
llvm-svn: 232237
Benjamin Kramer [Sat, 14 Mar 2015 00:20:13 +0000 (00:20 +0000)]
CommandLine: Replace cold std::sort with array_pod_sort.
Also replace an old use of qsort with it. Compiles down to the same thing but
gives us some type safety. Safes a couple of kb on CommandLine.o.
NFC.
llvm-svn: 232236
Peter Collingbourne [Sat, 14 Mar 2015 00:00:49 +0000 (00:00 +0000)]
LowerBitSets: Do not export symbols for bit set referenced globals on Darwin.
The linker on that platform may re-order symbols or strip dead symbols, which
will break bit set checks. Avoid this by hiding the symbols from the linker.
llvm-svn: 232235
Frederic Riss [Fri, 13 Mar 2015 23:55:29 +0000 (23:55 +0000)]
[dsymutil] Fix typo in comment.
Next time, when I fix a typo, I'll take the time to reread the whole
comment instead of waiting for the commit email to realize that there
is another one two words later...
llvm-svn: 232234
Frederic Riss [Fri, 13 Mar 2015 23:51:06 +0000 (23:51 +0000)]
[dsymutil] Fix typo in doxygen comment.
llvm-svn: 232233
Frederic Riss [Fri, 13 Mar 2015 23:30:31 +0000 (23:30 +0000)]
[dsymutil] Implement DW_AT_ranges linking.
Nothing fancy, just a straightforward offset to apply to the original
debug_ranges entries to get them in line with the linked addresses.
llvm-svn: 232232
Frederic Riss [Fri, 13 Mar 2015 23:30:27 +0000 (23:30 +0000)]
[dsymutil] Move a function declaration closer to its peers.
llvm-svn: 232231
Frederic Riss [Fri, 13 Mar 2015 23:30:07 +0000 (23:30 +0000)]
DWARFDebugRangeList: make the list of entries available to clients.
For users like llvm-dsymutil that want to have access to the encoded
debug_ranges entries.
llvm-svn: 232230
David Majnemer [Fri, 13 Mar 2015 22:36:55 +0000 (22:36 +0000)]
MS ABI: Generate default constructor closures
The MS ABI utilizes a compiler generated function called the "vector
constructor iterator" to construct arrays of objects with
non-trivial constructors/destructors. For this to work, the constructor
must follow a specific calling convention. A thunk must be created if
the default constructor has default arguments, is variadic or is
otherwise incompatible. This thunk is called the default constructor
closure.
N.B. Default constructor closures are only generated if the default
constructor is exported because clang itself does not utilize vector
constructor iterators. Failing to export the default constructor
closure will result in link/load failure if a translation unit compiled
with MSVC is on the import side.
Differential Revision: http://reviews.llvm.org/D8331
llvm-svn: 232229
Enrico Granata [Fri, 13 Mar 2015 22:35:44 +0000 (22:35 +0000)]
If creating a Python command via a class, the help text is handled directly by the class object, no need for setting it manually via the cmdline
llvm-svn: 232228
Vince Harron [Fri, 13 Mar 2015 22:33:42 +0000 (22:33 +0000)]
Revert test/Makefile to state before r232205
llvm-svn: 232227
Enrico Granata [Fri, 13 Mar 2015 22:32:11 +0000 (22:32 +0000)]
Add accessors on SBCommand to get and set the help texts for a command
llvm-svn: 232226
Enrico Granata [Fri, 13 Mar 2015 22:27:36 +0000 (22:27 +0000)]
Introduce documentation for Python command objects
llvm-svn: 232225
Enrico Granata [Fri, 13 Mar 2015 22:22:28 +0000 (22:22 +0000)]
Add support for Python object commands to return custom short and long help by implementing
def get_short_help(self)
def get_long_help(self)
methods on the command object
Also, add a test case for this feature
llvm-svn: 232224
Rafael Espindola [Fri, 13 Mar 2015 22:18:18 +0000 (22:18 +0000)]
Use add32ri8 and friends on fast isel.
This fixes pr22854.
The core issue on the bug is that there are multiple instructions that
print the same in assembly. In fact, there doesn't seem to be any
syntax for specifying that a constant that fits in 8 bits should use a 32 bit
immediate.
The attached patch changes fast isel to consider i16immSExt8,
i32immSExt8, and i64immSExt8. They were disabled because fastisel didn’t know
to call the predicate back in the day.
llvm-svn: 232223
Alexei Starovoitov [Fri, 13 Mar 2015 22:03:25 +0000 (22:03 +0000)]
bpf: turn on HasJIT flag in BPF backend
basic tests that use BPF backend to produce code in memory are passing.
llvm-svn: 232222
Rafael Espindola [Fri, 13 Mar 2015 21:54:20 +0000 (21:54 +0000)]
Be lazy about loading metadata in IRObjectFile.
This speeds up llvm-ar building lib64/libclangSema.a with debug IR files
from 8.
658015807 seconds to just 0.
351036519 seconds :-)
llvm-svn: 232221
Zachary Turner [Fri, 13 Mar 2015 21:51:11 +0000 (21:51 +0000)]
Fix makefiles to build shared library tests on Windows.
Abstracted away some POSIX-isms that caused MAKE to issue invalid
commands on Windows. Added a new force-include for the test
programs so that we can use platform-specific macros.
TestSharedLib now builds and cleans up on Windows, though the test
still fails some of the expectations.
Differential Revision: http://reviews.llvm.org/D8277
Patch by: Adrian McCarthy
Issue Tracker: http://llvm.org/pr21727
llvm-svn: 232220
Reid Kleckner [Fri, 13 Mar 2015 21:39:29 +0000 (21:39 +0000)]
Translate some MSVC CMAKE_*_FLAGS to clang flags in clang_compile
Passing MSVC-style cflags to the gcc-style clang driver will almost
always end badly. Just translate a couple of simple flags used by the
base CMake cflags like /D, /U, and /O.
llvm-svn: 232219
Zachary Turner [Fri, 13 Mar 2015 21:33:34 +0000 (21:33 +0000)]
[CMake] Fix unit test build on Linux.
A filename had been misspelled in the CMake.
llvm-svn: 232218
Benjamin Kramer [Fri, 13 Mar 2015 21:17:02 +0000 (21:17 +0000)]
BranchFolding: MergePotentialsElt has a total order, just call array_pod_sort.
No functionality change intended.
llvm-svn: 232217
David Blaikie [Fri, 13 Mar 2015 21:03:36 +0000 (21:03 +0000)]
[opaque pointer type] Bitcode support for explicit type parameter on the gep operator
This happened to be fairly easy to support backwards compatibility based
on the number of operands (old format had an even number, new format has
one more operand so an odd number).
test/Bitcode/old-aliases.ll already appears to test old gep operators
(if I remove the backwards compatibility in the BitcodeReader, this and
another test fail) so I'm not adding extra test coverage here.
llvm-svn: 232216
David Blaikie [Fri, 13 Mar 2015 21:03:34 +0000 (21:03 +0000)]
Turn assertion into bitcode reading error
I don't think we test invalid bitcode records in any detail, so no test
here - just a change for consistency with existing error checks in
surrounding code.
llvm-svn: 232215
David Blaikie [Fri, 13 Mar 2015 21:03:30 +0000 (21:03 +0000)]
Simplify expression
llvm-svn: 232214
Zachary Turner [Fri, 13 Mar 2015 20:55:07 +0000 (20:55 +0000)]
Create a check-lldb-unit target to run unit tests.
llvm-svn: 232212
Zachary Turner [Fri, 13 Mar 2015 20:54:57 +0000 (20:54 +0000)]
Rework the gtest directory structure.
This makes the directory structure mirror the canonical LLVM
directory structure for a gtest suite.
Additionally, this patch deletes the xcode project. Nobody
is currently depending on this, and it would be better to have
gtest unit tests be hand-maintained in the Xcode workspace
rather than using this python test runner. Patches to that
effect will be submitted as followups.
llvm-svn: 232211
Zachary Turner [Fri, 13 Mar 2015 20:54:21 +0000 (20:54 +0000)]
Create a CMake build for the gtest unit tests.
llvm-svn: 232210
Robert Lougher [Fri, 13 Mar 2015 20:53:01 +0000 (20:53 +0000)]
Reapply "[Reassociate] Add initial support for vector instructions."
This reapplies the patch previously committed at revision 232190. This was
reverted at revision 232196 as it caused test failures in tests that did not
expect operands to be commuted. I have made the tests more resilient to
reassociation in revision 232206.
llvm-svn: 232209
Alexei Starovoitov [Fri, 13 Mar 2015 20:49:38 +0000 (20:49 +0000)]
bpf: fix build
fix missed bits which were left over after r231987
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
llvm-svn: 232208
Robert Lougher [Fri, 13 Mar 2015 20:35:45 +0000 (20:35 +0000)]
Make tests more robust. No functional change.
In preparation for recommit of revision 232190, change tests so that they
are resilient to operands being commuted by the reassociate pass.
llvm-svn: 232206
Vince Harron [Fri, 13 Mar 2015 19:54:54 +0000 (19:54 +0000)]
Add support for XFAILing a test on specific clang versions
llvm-svn: 232205
Rui Ueyama [Fri, 13 Mar 2015 19:52:39 +0000 (19:52 +0000)]
Windows: Include <eh.h> instead of declarating __uncaught_exception.
llvm-svn: 232204
Duncan P. N. Exon Smith [Fri, 13 Mar 2015 19:42:09 +0000 (19:42 +0000)]
instcombine: alloca: Canonicalize scalar allocation array size
As a follow-up to r232200, add an `-instcombine` to canonicalize scalar
allocations to `i32 1`. Since r232200, `iX 1` (for X != 32) are only
created by RAUWs, so this shouldn't fire too often. Nevertheless, it's
a cheap check and a nice cleanup.
llvm-svn: 232202
Duncan P. N. Exon Smith [Fri, 13 Mar 2015 19:34:55 +0000 (19:34 +0000)]
instcombine: alloca: Limit array size type promotion
Move type promotion of the size of the array allocation to the end of
`simplifyAllocaArraySize()`. This avoids promoting the type of the
array size if it's a `ConstantInt`, since the next -instcombine
iteration will drop it to a scalar allocation anyway. Similarly, this
avoids promoting the type if it's an `UndefValue`, in which case the
alloca gets RAUW'ed.
This is NFC when considered over the lifetime of -instcombine, since
it's just reducing the number of iterations needed to reach fixed point.
llvm-svn: 232201
Duncan P. N. Exon Smith [Fri, 13 Mar 2015 19:30:44 +0000 (19:30 +0000)]
AsmWriter: Write alloca array size explicitly (and -instcombine fixup)
Write the `alloca` array size explicitly when it's non-canonical.
Previously, if the array size was `iX 1` (where X is not 32), the type
would mutate to `i32` when round-tripping through assembly.
The testcase I added fails in `verify-uselistorder` (as well as
`FileCheck`), since the use-lists for `i32 1` and `i64 1` change.
(Manman Ren came across this when running `verify-uselistorder` on some
non-trivial, optimized code as part of PR5680.)
The type mutation started with r104911, which allowed array sizes to be
something other than an `i32`. Starting with r204945, we
"canonicalized" to `i64` on 64-bit platforms -- and then on every
round-trip through assembly, mutated back to `i32`.
I bundled a fixup for `-instcombine` to avoid r204945 on scalar
allocations. (There wasn't a clean way to sequence this into two
commits, since the assembly change on its own caused testcase churn, and
the `-instcombine` change can't be tested without the assembly changes.)
An obvious alternative fix -- change `AllocaInst::AllocaInst()`,
`AsmWriter` and `LLParser` to treat `intptr_t` as the canonical type for
scalar allocations -- was rejected out of hand, since this required
teaching them each about the data layout.
A follow-up commit will add an `-instcombine` to canonicalize the scalar
allocation array size to `i32 1` rather than leaving `iX 1` alone.
rdar://problem/
20075773
llvm-svn: 232200
Duncan P. N. Exon Smith [Fri, 13 Mar 2015 19:26:33 +0000 (19:26 +0000)]
instcombine: alloca: Remove nesting in simplifyAllocaArraySize(), NFC
llvm-svn: 232199
Manman Ren [Fri, 13 Mar 2015 19:24:30 +0000 (19:24 +0000)]
Add a parameter for getLazyBitcodeModule to lazily load Metadata.
We only defer loading metadata inside ParseModule when ShouldLazyLoadMetadata
is true and we have not loaded any Metadata block yet.
This commit implements all-or-nothing loading of Metadata. If there is a
request to load any metadata block, we will load all deferred metadata blocks.
We make sure the deferred metadata blocks are loaded before we materialize any
function or a module.
The default value of the added parameter ShouldLazyLoadMetadata for
getLazyBitcodeModule is false, so the default behavior stays the same.
We only set the parameter to true when creating LTOModule in local contexts.
These can only really be used for parsing symbols, so it's unnecessary to ever
load the metadata blocks.
If we are going to enable lazy-loading of Metadata for other usages of
getLazyBitcodeModule, where deferred metadata blocks need to be loaded, we can
expose BitcodeReader::materializeMetadata to Module, similar to
Module::materialize.
rdar://
19804575
llvm-svn: 232198
Duncan P. N. Exon Smith [Fri, 13 Mar 2015 19:22:03 +0000 (19:22 +0000)]
instcombine: alloca: Split out simplifyAllocaArraySize(), NFC
Follow-up commits will change some of the logic here. Splitting into a
separate function simplifies the logic by allowing early returns instead
of deeper nesting.
llvm-svn: 232197
Robert Lougher [Fri, 13 Mar 2015 19:20:46 +0000 (19:20 +0000)]
Revert: "[Reassociate] Add initial support for vector instructions."
This reverts revision 232190 due to buildbot failure reported on clang-hexagon-elf
for test arm64_vtst.c. To be investigated.
llvm-svn: 232196
Joerg Sonnenberger [Fri, 13 Mar 2015 19:05:24 +0000 (19:05 +0000)]
Improve wording of newline handling.
llvm-svn: 232195
Oleksiy Vyalov [Fri, 13 Mar 2015 18:44:56 +0000 (18:44 +0000)]
Extend Platform(s) in order to cache remote executables using ModuleCache and make POSIX dynamic loader to use this flow when attaching to a remote target.
http://reviews.llvm.org/D8306
llvm-svn: 232194
Frederic Riss [Fri, 13 Mar 2015 18:35:57 +0000 (18:35 +0000)]
[dsymutil] Fix handling of cross-cu forward references.
We recorded the forward references in the CU that holds the referenced
DIE, but this is wrong as those will get resoled *after* the CU that
holds the reference. Record the references in their originating CU along
with a pointer to the remote CU to be able to compute the fixed up
offset at the right time.
llvm-svn: 232193
Frederic Riss [Fri, 13 Mar 2015 18:35:54 +0000 (18:35 +0000)]
[dsymutil] Add relocation of compile_units low_pc/high_pc.
They need to be handled specifically as they could vary pretty
widely depending on how the linker moves functions around.
llvm-svn: 232192
Frederic Riss [Fri, 13 Mar 2015 18:35:39 +0000 (18:35 +0000)]
[dsymutil] Fix location cloning for newer dwarf versions.
The typo got unnoticed because we were testing only on Dwarf 2. Add a
Dwarf4 test that exercises the code path, and also tests some newer
FORMs that the other test doesn't cover.
llvm-svn: 232191
Robert Lougher [Fri, 13 Mar 2015 18:33:27 +0000 (18:33 +0000)]
[Reassociate] Add initial support for vector instructions.
This patch adds initial support for vector instructions to the reassociation
pass. It enables most parts of the pass to work with vectors but to keep the
size of the patch small, optimization of Xor trees, canonicalization of
negative constants and converting shifts to muls, etc., have been left out.
This will be handled in later patches.
The patch is based on an initial patch by Chad Rosier.
Differential Revision: http://reviews.llvm.org/D7566
llvm-svn: 232190
Sanjoy Das [Fri, 13 Mar 2015 18:31:19 +0000 (18:31 +0000)]
[SCEV] Fix PR22856.
Summary:
ScalarEvolutionExpander assumes that the header block of a loop is a
legal place to have a use for a phi node. This is true only for phis
that are either in the header or dominate the header block, but it is
not true for phi nodes that are strictly internal to the loop body.
This change teaches ScalarEvolutionExpander to place uses of PHI nodes
in the basic block the PHI nodes belong to. This is always legal, and
`hoistIVInc` ensures that the said position dominates `IsomorphicInc`.
Reviewers: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8311
llvm-svn: 232189
David Majnemer [Fri, 13 Mar 2015 18:26:17 +0000 (18:26 +0000)]
MS ABI: Implement __GetExceptionInfo for std::make_exception_ptr
std::make_exception_ptr calls std::__GetExceptionInfo in order to figure
out how to properly copy the exception object.
Differential Revision: http://reviews.llvm.org/D8280
llvm-svn: 232188
David Blaikie [Fri, 13 Mar 2015 18:21:46 +0000 (18:21 +0000)]
Test case updates for explicit type parameter to the gep operator
llvm-svn: 232187
David Blaikie [Fri, 13 Mar 2015 18:21:20 +0000 (18:21 +0000)]
Test case updates for explicit type parameter to the gep operator
llvm-svn: 232186
David Blaikie [Fri, 13 Mar 2015 18:21:11 +0000 (18:21 +0000)]
Update test case to make it easier to automatically port to typeless pointer gep operator changes coming soon
llvm-svn: 232185
David Blaikie [Fri, 13 Mar 2015 18:20:45 +0000 (18:20 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter to gep operator
Similar to gep (r230786) and load (r230794) changes.
Similar migration script can be used to update test cases, which
successfully migrated all of LLVM and Polly, but about 4 test cases
needed manually changes in Clang.
(this script will read the contents of stdin and massage it into stdout
- wrap it in the 'apply.sh' script shown in previous commits + xargs to
apply it over a large set of test cases)
import fileinput
import sys
import re
rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL)
def conv(match):
line = match.group(1)
line += match.group(4)
line += ", "
line += match.group(2)
return line
line = sys.stdin.read()
off = 0
for match in re.finditer(rep, line):
sys.stdout.write(line[off:match.start()])
sys.stdout.write(conv(match))
off = match.end()
sys.stdout.write(line[off:])
llvm-svn: 232184
Meador Inge [Fri, 13 Mar 2015 18:15:01 +0000 (18:15 +0000)]
LinkerScript: Add -T <scriptfile> option
GNU LD has an option named -T/--script which allows a user to specify
a linker script to be used [1]. LLD already accepts linker scripts
without this option, but the option is widely used. Therefore it is
best to support it in LLD as well.
[1] https://sourceware.org/binutils/docs/ld/Options.html#Options
llvm-svn: 232183
Kevin Enderby [Fri, 13 Mar 2015 17:56:32 +0000 (17:56 +0000)]
Add the option, -non-verbose to llvm-objdump used with -macho to print things
using numeric values and not their symbolic constant names.
The routines that print Mach-O stuff already had a verbose parameter and this
change is just changing the passing true to passing !NonVerbose. With just a
couple of fixes and a bunch of test case updates.
llvm-svn: 232182
Jan Vesely [Fri, 13 Mar 2015 17:32:46 +0000 (17:32 +0000)]
r600: Clear visited structure before running.
Fixes random crashes in for-loop piglit.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
llvm-svn: 232181
Jan Vesely [Fri, 13 Mar 2015 17:32:43 +0000 (17:32 +0000)]
r600: Use deque and simplify loops in AMDGPUCFGStructurizer
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
llvm-svn: 232180
Andrea Di Biagio [Fri, 13 Mar 2015 17:29:49 +0000 (17:29 +0000)]
[X86][AVX] Fix wrong lowering of v4x64 shuffles into concat_vector plus extract_subvector nodes.
This patch fixes a bug in the shuffle lowering logic implemented by function
'lowerV2X128VectorShuffle'.
The are few cases where function 'lowerV2X128VectorShuffle' wrongly expands a
shuffle of two v4X64 vectors into a CONCAT_VECTORS of two EXTRACT_SUBVECTOR
nodes. The problematic expansion only occurs when the shuffle mask M has an
'undef' element at position 2, and M is equivalent to mask <0,1,4,5>.
In that case, the algorithm propagates the wrong vector to one of the two
new EXTRACT_SUBVECTOR nodes.
Example:
;;
define <4 x double> @test(<4 x double> %A, <4 x double> %B) {
entry:
%0 = shufflevector <4 x double> %A, <4 x double> %B, <4 x i32><i32 undef, i32 1, i32 undef, i32 5>
ret <4 x double> %0
}
;;
Before this patch, llc (-mattr=+avx) generated:
vinsertf128 $1, %xmm0, %ymm0, %ymm0
With this patch, llc correctly generates:
vinsertf128 $1, %xmm1, %ymm0, %ymm0
Added test lower-vec-shuffle-bug.ll
Differential Revision: http://reviews.llvm.org/D8259
llvm-svn: 232179
Benjamin Kramer [Fri, 13 Mar 2015 16:59:29 +0000 (16:59 +0000)]
unique_ptrs are unique already, no need to unique them any further.
llvm-svn: 232178
Matt Arsenault [Fri, 13 Mar 2015 16:43:48 +0000 (16:43 +0000)]
R600/SI: Add test for min / max with immediate
Make sure this isn't getting confused by canonicalizations
of comparisons with a constant.
llvm-svn: 232177
David Majnemer [Fri, 13 Mar 2015 16:39:46 +0000 (16:39 +0000)]
ConstantFold: Fix big shift constant folding
Constant folding for shift IR instructions ignores all bits above 32 of
second argument (shift amount).
Because of that, some undef results are not recognized and APInt can
raise an assert failure if second argument has more than 64 bits.
Patch by Paweł Bylica!
Differential Revision: http://reviews.llvm.org/D7701
llvm-svn: 232176
Zachary Turner [Fri, 13 Mar 2015 16:31:58 +0000 (16:31 +0000)]
[CMake] Make LLDBWrapPython.cpp depend on the .swig files.
Previously it would only regenerate LLDBWrapPython.cpp if one of
the .i files changed, or if lldb.swig changed. This patch also
makes it depend on the rest of the *.swig files, so that if any
of them changes it regenerates the CMake.
llvm-svn: 232175
Benjamin Kramer [Fri, 13 Mar 2015 16:10:42 +0000 (16:10 +0000)]
Sema: Replace the SetVector/DenseMap/std::sort combination with a simple std::map
This guarantees the order and doesn't increase malloc counts a lot as there are
typically very few elements int the map. Provide a little iterator adapter to
keep the same interface as we had with the flat sorted list.
No functional change intended.
llvm-svn: 232173
Jonathan Roelofs [Fri, 13 Mar 2015 15:09:42 +0000 (15:09 +0000)]
Fix build break on Solaris introduced by r231940
Solaris apparently doesn't have iswblank_l.
Thanks to C Bergstrom for the report!
llvm-svn: 232172
Tamas Berghammer [Fri, 13 Mar 2015 14:54:42 +0000 (14:54 +0000)]
Make TestSBFrameFindValue compatible with remote targets
llvm-svn: 232171
Tamas Berghammer [Fri, 13 Mar 2015 14:32:25 +0000 (14:32 +0000)]
Forward adb port for reverse connect test cases
The test cases in TestStubReverseConnect are using a socket connection
from python to lldb-server running on a remote target. To enable the
socket connection an adb port forwarding have to be set up when the
remote target is android.
Differential revision: http://reviews.llvm.org/D8319
llvm-svn: 232170
Tamas Berghammer [Fri, 13 Mar 2015 14:30:42 +0000 (14:30 +0000)]
Skip VectorTypesFormatting test case when using gcc
Gcc don't support the ext_vector_type extension used by the test
llvm-svn: 232169
Daniel Jasper [Fri, 13 Mar 2015 14:29:39 +0000 (14:29 +0000)]
When building a module, all headers of submodules can be used.
This extends r232159.
llvm-svn: 232168
Viktor Kutuzov [Fri, 13 Mar 2015 14:08:55 +0000 (14:08 +0000)]
[Tsan] Fix test.h to work on FreeBSD
Differential Revision: http://reviews.llvm.org/D8303
llvm-svn: 232167
Daniel Jasper [Fri, 13 Mar 2015 13:32:11 +0000 (13:32 +0000)]
clang-format: Don't corrupt macros with open braces.
Formatting:
#define A { {
#define B } }
Before:
#define A \
{ \
{ #define B } \
}
After:
#define A \
{ \
{
#define B \
} \
}
This fixes llvm.org/PR22884.
llvm-svn: 232166
Daniel Sanders [Fri, 13 Mar 2015 12:45:09 +0000 (12:45 +0000)]
Recommit r232027 with PR22883 fixed: Add infrastructure for support of multiple memory constraints.
The operand flag word for ISD::INLINEASM nodes now contains a 15-bit
memory constraint ID when the operand kind is Kind_Mem. This constraint
ID is a numeric equivalent to the constraint code string and is converted
with a target specific hook in TargetLowering.
This patch maps all memory constraints to InlineAsm::Constraint_m so there
is no functional change at this point. It just proves that using these
previously unused bits in the encoding of the flag word doesn't break
anything.
The next patch will make each target preserve the current mapping of
everything to Constraint_m for itself while changing the target independent
implementation of the hook to return Constraint_Unknown appropriately. Each
target will then be adapted in separate patches to use appropriate
Constraint_* values.
PR22883 was caused the matching operands copying the whole of the operand flags
for the matched operand. This included the constraint id which needed to be
replaced with the operand number. This has been fixed with a conversion
function. Following on from this, matching operands also used the operand
number as the constraint id. This has been fixed by looking up the matched
operand and taking it from there.
llvm-svn: 232165
Alexey Bataev [Fri, 13 Mar 2015 12:27:31 +0000 (12:27 +0000)]
[OPENMP] Additional sema analysis for 'omp atomic[ update]'.
Adds additional semantic analysis + generation of helper expressions for proper codegen.
llvm-svn: 232164
Tamas Berghammer [Fri, 13 Mar 2015 11:59:58 +0000 (11:59 +0000)]
Fix expectation in TestDataFormatterSynth
The value of some_values (pointer) expeced to start by 0x0 but nothing
requires that the first digit of the address be '0'.
This CL change the expectation to check only for a value starting with 0x.
llvm-svn: 232163
Toma Tabacu [Fri, 13 Mar 2015 11:40:01 +0000 (11:40 +0000)]
[mips] [IAS] Refactor MipsTargetStreamer::emitMipsAbiFlags(). NFC.
Summary: Make emitMipsAbiFlags a direct member of MipsTargetELFStreamer, as that's the only place where it's used, and remove the empty implementations from MipsTargetStreamer and MipsTargetAsmStreamer.
Reviewers: dsanders, rafael
Reviewed By: rafael
Subscribers: rafael, llvm-commits
Differential Revision: http://reviews.llvm.org/D8199
llvm-svn: 232161
Tamas Berghammer [Fri, 13 Mar 2015 11:36:47 +0000 (11:36 +0000)]
Create NativeRegisterContext for android-arm64
Differential revision: http://reviews.llvm.org/D8058
llvm-svn: 232160
Daniel Jasper [Fri, 13 Mar 2015 11:26:16 +0000 (11:26 +0000)]
Make a module "use" also count as use of all its submodules
llvm-svn: 232159
Tamas Berghammer [Fri, 13 Mar 2015 11:16:14 +0000 (11:16 +0000)]
Fix SO entry is main executable detection on android
* On Android (at least on platfrom-21 x86) the dynamic linker reports the
executable with its full path
* Use the platform path of the executable when storing it into the cache
(used to identify the SO entry for the executable) as this is the path
what will be reported by the dynamic linker. If the platform path isn't
set (local debugging) then it falls back to the normal file path.
Differential revision: http://reviews.llvm.org/D8296
llvm-svn: 232158
Tamas Berghammer [Fri, 13 Mar 2015 11:16:12 +0000 (11:16 +0000)]
Fix missing data in GetProcessInfo on linux
Fill in the missing part of the architecture in GetProcessInfo from the
HostArchitecture (e.g. Environment).
Differential revision: http://reviews.llvm.org/D8292
llvm-svn: 232157
Tamas Berghammer [Fri, 13 Mar 2015 11:16:08 +0000 (11:16 +0000)]
Add filepath to qModuleInfo packet
The file path is currently required on android because the executables
only contain the name of the system libraries without their path. This
CL add an extra field to the qModuleInfo packet to return the full path
of a modul and add logic to locate a shared module on android.
Differential revision: http://reviews.llvm.org/D8221
llvm-svn: 232156
Tamas Berghammer [Fri, 13 Mar 2015 11:16:03 +0000 (11:16 +0000)]
Add code to exit the NativeProcessLinux Monitor thread on android
This CL change the logic used to terminate the monitor thread of
NativeProcessLinux to use a signal instead of pthread_cancel as
pthread_cancel is not supported on android.
Differential revision: http://reviews.llvm.org/D8205
llvm-svn: 232155
Alexander Musman [Fri, 13 Mar 2015 10:38:23 +0000 (10:38 +0000)]
[OPENMP] Re-factor __kmpc_for_static_init_* routine generation.
llvm-svn: 232154
Tamas Berghammer [Fri, 13 Mar 2015 10:32:42 +0000 (10:32 +0000)]
Fix fetching the architecture of the target on process launch
Previously it was fetched only if the architecture isn't valid, but the
architecture can be valid without containing all information about the
current target (e.g. missing os).
Differential revision: http://reviews.llvm.org/D8057
llvm-svn: 232153
Tamas Berghammer [Fri, 13 Mar 2015 10:32:37 +0000 (10:32 +0000)]
Remove non const version of GetArchitecture from Target.h
The architecture of a target should be updated only by the
SetArchitecture method so the target can correctly manage its modules.
llvm-svn: 232152
Pavel Labath [Fri, 13 Mar 2015 10:22:00 +0000 (10:22 +0000)]
Respect include_inlines when looking up functions in SymbolFileDWARF
Summary:
SymbolFileDWARF was not respecting the include_inlines argument in function lookup in all code
paths. This resulted in an attempt to call an inlined function during expression evaluation,
which is impossible, and usually resulted in a segfault in the inferior. This patch makes sure
include_inlines is respected in all code paths.
Reviewers: clayborg
Subscribers: lldb-commits, sivachandra
Differential Revision: http://reviews.llvm.org/D8286
llvm-svn: 232151
Tamas Berghammer [Fri, 13 Mar 2015 10:12:25 +0000 (10:12 +0000)]
Skip fdleak tests on android
Android have more file descriptor opened by the shell what are inherited
to the process (different ones on device and on emulator).
Differential revision: http://reviews.llvm.org/D8299
llvm-svn: 232150
Chandler Carruth [Fri, 13 Mar 2015 08:29:54 +0000 (08:29 +0000)]
[Modules] Teach Clang to survive ambiguous macros which come from system
headers even if they arrived when merging non-system modules.
The idea of this code is that we don't want to warn the user about
macros defined multiple times by their system headers with slightly
different definitions. We should have this behavior if either the
macro comes from a system module, or the definition within the module
comes from a system header. Previously, we would warn on ambiguous
macros being merged when they came from a users modules even though they
only showed up via system headers.
By surviving this we can handle common system header macro differences
like differing 'const' qualification of pointers due to some headers
predating 'const' being valid in C code, even when those systems headers
are pre-built into a system module.
Differential Revision: http://reviews.llvm.org/D8310
llvm-svn: 232149
Argyrios Kyrtzidis [Fri, 13 Mar 2015 07:39:30 +0000 (07:39 +0000)]
[libclang] Fix crash when code-completing inside constructor initializer for a builtin type.
rdar://
20149746
llvm-svn: 232145
Owen Anderson [Fri, 13 Mar 2015 07:09:33 +0000 (07:09 +0000)]
Teach TBAA analysis to report errors on cyclic TBAA metadata rather than hanging.
llvm-svn: 232144
Owen Anderson [Fri, 13 Mar 2015 06:41:26 +0000 (06:41 +0000)]
Fix an infinite recursion in the verifier caused by calling isSized on a recursive type.
llvm-svn: 232143
Hao Liu [Fri, 13 Mar 2015 05:15:23 +0000 (05:15 +0000)]
[MachineCopyPropagation] Fix a bug causing incorrect removal for the instruction sequences as follows
%Q5_Q6<def> = COPY %Q2_Q3
%D5<def> =
%D3<def> =
%D3<def> = COPY %D6 // Incorrectly removed in MachineCopyPropagation
Using of %D3 results in incorrect result ...
Reviewed in http://reviews.llvm.org/D8242
llvm-svn: 232142