Shankar Easwaran [Mon, 20 Oct 2014 03:03:43 +0000 (03:03 +0000)]
[ELF] Make updateReferenceForMergeStringAccess virtual.
The ELF subtargets would usually want to override the function
updateReferenceForMergeStringAccess. Allow this by making it virtual.
llvm-svn: 220180
Shankar Easwaran [Mon, 20 Oct 2014 02:59:06 +0000 (02:59 +0000)]
[ELF] Fix functionality of merging similar strings.
For PC relative accesses, negative addends were to be ignored. The linker was
not ignoring it and would fail with an assert. This fixes the issue and is able
to get Helloworld working.
llvm-svn: 220179
Chandler Carruth [Mon, 20 Oct 2014 00:24:14 +0000 (00:24 +0000)]
Teach the load analysis driving core instcombine logic and other bits of
logic to look through pointer casts, making them trivially stronger in
the face of loads and stores with intervening pointer casts.
I've included a few test cases that demonstrate the kind of folding
instcombine can do without pointer casts and then variations which
obfuscate the logic through bitcasts. Without this patch, the variations
all fail to optimize fully.
This is more important now than it has been in the past as I've started
moving the load canonicialization to more closely follow the value type
requirements rather than the pointer type requirements and thus this
needs to be prepared for more pointer casts. When I made the same change
to stores several test cases regressed without logic along these lines
so I wanted to systematically improve matters first.
llvm-svn: 220178
Richard Smith [Mon, 20 Oct 2014 00:15:49 +0000 (00:15 +0000)]
[modules] Add support for #include_next.
#include_next interacts poorly with modules: it depends on where in the list of
include paths the current file was found. Files covered by module maps are not
found in include search paths when building the module (and are not found in
include search paths when @importing the module either), so this isn't really
meaningful. Instead, we fake up the result that #include_next *should* have
given: find the first path that would have resulted in the given file being
picked, and search from there onwards.
llvm-svn: 220177
Chandler Carruth [Mon, 20 Oct 2014 00:11:31 +0000 (00:11 +0000)]
Add a datalayout string to this test so that it exercises the full gamut
of InstCombine rather than just the bits enabled when datalayout is
optional.
The primary fixes here are because now things are little endian.
In good news, silliness like this seems like it will be going away as
we've got pretty stong consensus on dropping optional datalayout
entirely.
llvm-svn: 220176
David Majnemer [Sun, 19 Oct 2014 23:40:06 +0000 (23:40 +0000)]
CodeGen: ConstStructBuilder must verify packed constraints after padding
This reverts commit r220169 which reverted r220153. However, it also
contains additional changes:
- We may need to add padding *after* we've packed the struct. This
occurs when the aligned next field offset is greater than the new
field's offset. When this occurs, we make the struct packed.
*However*, once packed the next field offset might be less than the
new feild's offset. It is in this case that we might further pad the
struct.
- We would pad structs which were perfectly sized! This behavior is
immensely old. This behavior came from blindly subtracting
NextFieldOffsetInChars from RecordSize. This doesn't take into
account the fact that the struct might have a greater overall
alignment than the last field.
llvm-svn: 220175
Rafael Espindola [Sun, 19 Oct 2014 23:24:46 +0000 (23:24 +0000)]
Always use -Wl,-gc-sections on our build.
Both bfd ld and gold correctly handle --export-dynamic, so gc-sections is safe even for binaries
that support plugins.
llvm-svn: 220174
Bill Schmidt [Sun, 19 Oct 2014 21:29:21 +0000 (21:29 +0000)]
[PowerPC] Clean up -mattr=+vsx tests to always specify -mcpu
We recently discovered an issue that reinforces what a good idea it is
to always specify -mcpu in our code generation tests, particularly for
-mattr=+vsx. This patch ensures that all tests that specify
-mattr=+vsx also specify -mcpu=pwr7 or -mcpu=pwr8, as appropriate.
Some of the uses of -mattr=+vsx added recently don't make much sense
(when specified for -mtriple=powerpc-apple-darwin8 or -march=ppc32,
for example). For cases like this I've just removed the extra VSX
test commands; there's enough coverage without them.
llvm-svn: 220173
Bill Schmidt [Sun, 19 Oct 2014 20:48:47 +0000 (20:48 +0000)]
[PowerPC] Temporarily disable VSX for PowerPC fast-isel tests
Patch by Bill Seurer; some comment formatting changes by me.
There are a few PowerPC test cases for FastISel support that currently
fail with VSX support enabled. The temporary workaround under
discussion in http://reviews.llvm.org/D5362 helps, but the tests still
fail because they specify -fast-isel-abort, and the VSX workaround
punts back to SelectionDAG. We have plans to fix FastISel permanently
for VSX, but until that's in place these tests are preventing us from
enabling VSX by default. Therefore we are adding -mattr=-vsx to these
tests until the full support is ready.
llvm-svn: 220172
Bill Schmidt [Sun, 19 Oct 2014 20:27:56 +0000 (20:27 +0000)]
[PowerPC] Re-enable VSX test line for fma.ll with -mcpu=pwr7
The VSX testing variant in test/CodeGen/PowerPC/fma.ll had to be
disabled because of unexpected behavior on many of the builders. I
tracked this down to a situation that occurs when the VSX attribute is
enabled for a target that disables the MI early scheduling pass. This
patch adds -mcpu=pwr7 to make this predictable. The other issue will
be addressed separately.
llvm-svn: 220171
NAKAMURA Takumi [Sun, 19 Oct 2014 19:58:33 +0000 (19:58 +0000)]
Preprocessor.h: Suppress a warning in SkipMainFilePreamble. [-Wsign-compare]
llvm-svn: 220170
Chandler Carruth [Sun, 19 Oct 2014 19:41:46 +0000 (19:41 +0000)]
Revert r220153: "CodeGen: ConstStructBuilder must verify packed constraints after padding"
This commit caused two tests in LNT to regress. I'm able to reproduce on
any platform and will send reproduction steps to the original commit
log. This should restore the LNT bots that have been failing.
llvm-svn: 220169
Lang Hames [Sun, 19 Oct 2014 19:36:33 +0000 (19:36 +0000)]
[ADT] Add a 'find_as' operation to DenseSet.
This operation is analogous to its counterpart in DenseMap: It allows lookup
via cheap-to-construct keys (provided that getHashValue and isEqual are
implemented for the cheap key-type in the DenseMapInfo specialization).
Thanks to Chandler for the review.
llvm-svn: 220168
Chandler Carruth [Sun, 19 Oct 2014 19:13:49 +0000 (19:13 +0000)]
[complex] Teach the complex math IR gen to emit direct math and
a NaN-test prior to the call to the library function.
This should automatically make fastmath (including just non-NaNs) able to avoid
the expensive libcalls and also open the door to more advanced folding in LLVM
based on the rules for complex math.
Two important notes to remember: first is that this isn't yet a proper
limited range mode, it's still just improving the unlimited range mode.
Also, it isn't really perfecet w.r.t. what an unlimited range mode
should be doing because it isn't quite handling the flags produced by
all the operations in the way desirable for that mode, but then neither
is compiler-rt's libcall. When the compiler-rt libcall is improved to
carefully manage flags, the code emitted here should be improved
correspondingly. And it is still a long-term desirable thing to add
a limited range mode to Clang that would be able to use direct math
without library calls here.
Special thanks to Steve Canon for the careful review on this patch and
teaching me about these issues. =D
Differential Revision: http://reviews.llvm.org/D5756
llvm-svn: 220167
NAKAMURA Takumi [Sun, 19 Oct 2014 18:45:13 +0000 (18:45 +0000)]
clang/test/Layout/itanium-union-bitfield.cpp: Appease i686.
llvm-svn: 220166
Chandler Carruth [Sun, 19 Oct 2014 10:46:46 +0000 (10:46 +0000)]
Do a better and more complete job of preserving metadata when combining
loads.
This handles many more cases than just the AA metadata, some of them
suggested by Hal in his review of the AA metadata handling patch. I've
tried to test this behavior where tractable to do so.
I'll point out that I have specifically *not* included a test for
debuginfo because it was going to require 2 or 3 times as much work to
craft some input which would survive the "helpful" stripping of debug
info metadata that doesn't match the desired schema. This is another
good example of why the current state of write-ability for our debug
info metadata is unacceptable. I spent over 30 minutes trying to conjure
some test case that would survive, even copying from other debug info
tests, but it always failed to survive with no explanation of why or how
I might fix it. =[
llvm-svn: 220165
Chandler Carruth [Sun, 19 Oct 2014 09:06:56 +0000 (09:06 +0000)]
Move previously dead code to handle computing the known bits of an alias
up to where it actually works as intended. The problem is that
a GlobalAlias isa GlobalValue and so the prior block handled all of the
cases.
This allows us to constant fold based on the actual constant expression
in the global alias. As an example, see the last function in the newly
added test case which explicitly aligns an unaligned pointer using
constant expression math. Without this change, we fail to see that and
fold an alignment test to zero.
llvm-svn: 220164
David Majnemer [Sun, 19 Oct 2014 08:32:32 +0000 (08:32 +0000)]
InstCombine: (sub (or A B) (xor A B)) --> (and A B)
The following implements the transformation:
(sub (or A B) (xor A B)) --> (and A B).
Patch by Ankur Garg!
Differential Revision: http://reviews.llvm.org/D5719
llvm-svn: 220163
David Majnemer [Sun, 19 Oct 2014 08:23:08 +0000 (08:23 +0000)]
InstCombine: Optimize icmp eq/ne (shl Const2, A), Const1
The following implements the optimization for sequences of the form:
icmp eq/ne (shl Const2, A), Const1
Such sequences can be transformed to:
icmp eq/ne A, (TrailingZeros(Const1) - TrailingZeros(Const2))
This handles only the equality operators for now. Other operators need
to be handled.
Patch by Ankur Garg!
llvm-svn: 220162
Chandler Carruth [Sun, 19 Oct 2014 08:17:50 +0000 (08:17 +0000)]
Fix a long-standing miscompile in the load analysis that was uncovered
by my refactoring of this code.
The method isSafeToLoadUnconditionally assumes that the load will
proceed with the preferred type alignment. Given that, it has to ensure
that the alloca or global is at least that aligned. It has always done
this historically when a datalayout is present, but has never checked it
when the datalayout is absent. When I refactored the code in r220156,
I exposed this path when datalayout was present and that turned the
latent bug into a patent bug.
This fixes the issue by just removing the special case which allows
folding things without datalayout. This isn't worth the complexity of
trying to tease apart when it is or isn't safe without actually knowing
the preferred alignment.
llvm-svn: 220161
Ted Kremenek [Sun, 19 Oct 2014 07:30:55 +0000 (07:30 +0000)]
[analyzer] Tweak MallocSizeOfChecker to not warn when using sizeof(void*) to allocate a bunch of any pointer type.
This suppresses a common false positive when analyzing libc++.
Along the way, introduce some tests to show this checker actually
works with C++ static_cast<>.
llvm-svn: 220160
Shankar Easwaran [Sun, 19 Oct 2014 03:28:13 +0000 (03:28 +0000)]
[ELF][Cleanup] Remove unused code.
The old code was used as a workaround to fix how relocations are calculated for
sections with SHF_MERGE|SHF_STRINGS attribute. This patch removes the erroneous
code.
llvm-svn: 220159
Bob Wilson [Sun, 19 Oct 2014 02:19:27 +0000 (02:19 +0000)]
Use the triple's isiOS() method instead of checking the value directly. NFC.
llvm-svn: 220158
Eric Fiselier [Sun, 19 Oct 2014 00:42:41 +0000 (00:42 +0000)]
[libcxx] Redo adding support for building and testing with an ABI library not along linker paths
Summary:
This is the second attempt at allowing for the use of libraries that the linker cannot find. The first attempt used `CMAKE_LIBRARY_PATH` and `find_library` to select which ABI library should be used. There were a number of problems with this approach:
- `find_library` didn't work with cmake targets (ie in-tree libcxxabi build)
- It wasn't always possible to determine where `find_library` actually found your library.
- `target_link_libraries` inserted the path of the ABI library into libc++'s RPATH when `find_library` was used.
- Linking libc++ and it's ABI library is a special case. It's a lot easier to keep it simple.
After discussion with @cbergstrum a new approach was decided upon.
This patch achieve the same ends by simply using `LIBCXX_CXX_ABI_LIBRARY_PATH` to specify where to find the library (if the linker won't find it). When this variable is defined it is simply added as a library search path when linking libc++. It is a lot easier to duplicate this behavior in LIT. It also prevents libc++ from being linked with an RPATH.
Reviewers: mclow.lists, cbergstrom, chandlerc, danalbert
Reviewed By: chandlerc, danalbert
Subscribers: chandlerc, cfe-commits
Differential Revision: http://reviews.llvm.org/D5860
llvm-svn: 220157
Chandler Carruth [Sun, 19 Oct 2014 00:42:16 +0000 (00:42 +0000)]
Switch how the datalayout availability test is handled in this code to
make much more sense and in theory be more correct.
If you trace the code alllll the way back to when it was first
introduced, the comments make it slightly more clear what was going on
here. At that time, the only way Base != V was if DL (then TD) was
non-null. As a consequence, if DL *was* null, that meant we were loading
directly from the alloca or global found above the test. After
refactoring, this has become at least terribly subtle and potentially
incorrect. There are many forms of pointer manipulation that can be
traversed without DataLayout, and some of them would in fact change the
size of object being loaded vs. allocated.
Rather than this subtlety, I've hoisted the actual 'return true' bits
into the code which actually found an alloca or global and based them on
the loaded pointer being that alloca or global. This is both more clear
and safer. I've also added comments about exactly why this set of
predicates is used.
I've also corrected a misleading comment about globals -- if overridden
they may not just have a different size, they may be null and completely
unsafe to load from!
Hopefully this confuses the next reader a bit less. I don't have any
test cases or anything, the patch is motivated strictly to improve the
readability of the code.
llvm-svn: 220156
Bob Wilson [Sun, 19 Oct 2014 00:39:30 +0000 (00:39 +0000)]
Use triple predicate functions instead of checking values directly. NFC.
llvm-svn: 220155
Eric Fiselier [Sun, 19 Oct 2014 00:10:15 +0000 (00:10 +0000)]
Fix unused variables in tests to placate scan-build. Patch from Steve MacKenzie.
llvm-svn: 220154
David Majnemer [Sun, 19 Oct 2014 00:03:10 +0000 (00:03 +0000)]
CodeGen: ConstStructBuilder must verify packed constraints after padding
Before, ConstStructBuilder::AppendBytes would check packed constraints
prior to padding being added before the field's offset. However, adding
this padding might force our struct to be packed. Because we wouldn't
check *after* adding padding, ConstStructBuilder would be in an
inconsistent state leading to a crash.
This fixes PR21300.
llvm-svn: 220153
Filipe Cabecinhas [Sat, 18 Oct 2014 23:47:59 +0000 (23:47 +0000)]
New round of fixes for "Always compile debuginfo-tests for the host triple"
clang tests were breaking, at least when compiling clang only, from an
installed llvm. Make the lit.cfg script deal with the case when we don't
have a host_triple available.
llvm-svn: 220152
Chandler Carruth [Sat, 18 Oct 2014 23:47:22 +0000 (23:47 +0000)]
Rename 'TD' to 'DL' in this function as the argument is now a DataLayout
argument.
llvm-svn: 220151
Chandler Carruth [Sat, 18 Oct 2014 23:46:17 +0000 (23:46 +0000)]
Fix the other comment to use modern doxygen style and be a bit more
direct. Notably, comment on the fact that the loaded type is significant
in that it determines how wide of an access must be safe.
llvm-svn: 220150
Chandler Carruth [Sat, 18 Oct 2014 23:41:25 +0000 (23:41 +0000)]
More formatting cleanup brought to you by clang-format.
llvm-svn: 220149
Filipe Cabecinhas [Sat, 18 Oct 2014 23:36:12 +0000 (23:36 +0000)]
New round of fixes for "Always compile debuginfo-tests for the host triple"
clang tests were breaking, at least when compiling clang only, from an
installed llvm. Make the lit.cfg script deal with the case when we don't
have a host_triple available.
llvm-svn: 220148
Chandler Carruth [Sat, 18 Oct 2014 23:31:55 +0000 (23:31 +0000)]
Clean up doxygen syntax and reword comments to flow better, have a brief
section, and not have unfinished sentence fragments.
llvm-svn: 220147
Chandler Carruth [Sat, 18 Oct 2014 23:19:03 +0000 (23:19 +0000)]
Clean up the formatting and trailing whitespace of a routine before
editting it.
llvm-svn: 220146
Lang Hames [Sat, 18 Oct 2014 22:23:55 +0000 (22:23 +0000)]
[PBQP] Move register-allocation specific PBQP code into RegAllocPBQP.h.
Just clean-up - no functional change.
llvm-svn: 220145
Shankar Easwaran [Sat, 18 Oct 2014 20:36:35 +0000 (20:36 +0000)]
Fix display of files processed by the linker.
This fixes the way archive members are displayed when the linker is used with a
flag to show all the files that it processes.
When an archive file member is read, we need to show the archive filename and
the member.
llvm-svn: 220144
Lang Hames [Sat, 18 Oct 2014 17:26:07 +0000 (17:26 +0000)]
[PBQP] Replace the interference-constraints algorithm with a faster version
loosely based on linear scan.
On x86-64 this is good for a ~2% drop in compile time on the nightly test suite.
llvm-svn: 220143
Marshall Clow [Sat, 18 Oct 2014 11:03:33 +0000 (11:03 +0000)]
Whitespace maintenance. Remove a bunch of tabs that snuck in. No functionality change
llvm-svn: 220142
Chandler Carruth [Sat, 18 Oct 2014 11:00:12 +0000 (11:00 +0000)]
Preserve AA metadata when combining (cast (load (...))) -> (load (cast
(...))).
llvm-svn: 220141
Benjamin Kramer [Sat, 18 Oct 2014 10:43:51 +0000 (10:43 +0000)]
Use non-member begin/end for a slight readability improvement.
llvm-svn: 220140
Chandler Carruth [Sat, 18 Oct 2014 06:36:22 +0000 (06:36 +0000)]
[InstCombine] Do an about-face on how LLVM canonicalizes (cast (load
...)) and (load (cast ...)): canonicalize toward the former.
Historically, we've tried to load using the type of the *pointer*, and
tried to match that type as closely as possible removing as many pointer
casts as we could and trading them for bitcasts of the loaded value.
This is deeply and fundamentally wrong.
Repeat after me: memory does not have a type! This was a hard lesson for
me to learn working on SROA.
There is only one thing that should actually drive the type used for
a pointer, and that is the type which we need to use to load from that
pointer. Matching up pointer types to the loaded value types is very
useful because it minimizes the physical size of the IR required for
no-op casts. Similarly, the only thing that should drive the type used
for a loaded value is *how that value is used*! Again, this minimizes
casts. And in fact, the *only* thing motivating types in any part of
LLVM's IR are the types used by the operations in the IR. We should
match them as closely as possible.
I've ended up removing some tests here as they were testing bugs or
behavior that is no longer present. Mostly though, this is just cleanup
to let the tests continue to function as intended.
The only fallout I've found so far from this change was SROA and I have
fixed it to not be impeded by the different type of load. If you find
more places where this change causes optimizations not to fire, those
too are likely bugs where we are assuming that the type of pointers is
"significant" for optimization purposes.
llvm-svn: 220138
Chandler Carruth [Sat, 18 Oct 2014 06:36:18 +0000 (06:36 +0000)]
Remove a test that was ported from the old llvm-gcc frontend test suite.
This test is pretty awesome. It is claiming to test devirtualization.
However, the code in question is not in fact devirtualized by LLVM. If
you take the original C++ test case and run it through Clang at -O3 we
fail to devirtualize it completely. It also isn't a sufficiently focused
test case.
The *reason* we fail to devirtualize it isn't because of any missing
instcombine though. Instead, it is because we fail to emit an available
externally vtable and thus the vtable is just an external and completely
opaque. If I cause the vtable to be emitted, we successfully
devirtualize things.
Anyways, I'm just removing it because it is providing negative value at
this point: it isn't representative of the output of Clang really, LLVM
isn't doing the transform it claims to be testing, LLVM's failure to do
the transform isn't actually an LLVM bug at all and we shouldn't be
testing for it here, and finally the test is written in such a way that
it will trivially pass even when the point of the test is failing.
llvm-svn: 220137
Argyrios Kyrtzidis [Sat, 18 Oct 2014 06:23:50 +0000 (06:23 +0000)]
[libclang] If the code-completion point is inside the preamble, adjust the position at the beginning of the file after the preamble.
Otherwise we will not hit the code-completion point.
llvm-svn: 220136
Argyrios Kyrtzidis [Sat, 18 Oct 2014 06:19:36 +0000 (06:19 +0000)]
[libclang] Allow code-completion when pointing at the end-of-file.
llvm-svn: 220135
Shankar Easwaran [Sat, 18 Oct 2014 05:33:55 +0000 (05:33 +0000)]
Sort include files according to convention.
llvm-svn: 220131
Shankar Easwaran [Sat, 18 Oct 2014 05:26:35 +0000 (05:26 +0000)]
Make lld-link symlink relative.
llvm-svn: 220130
Shankar Easwaran [Sat, 18 Oct 2014 05:23:17 +0000 (05:23 +0000)]
[ELF] Add Readers for all the ELF subtargets.
This would permit the ELF reader to check the architecture that is being
selected by the linking process.
This patch also sorts the include files according to LLVM conventions.
llvm-svn: 220129
Nick Kledzik [Sat, 18 Oct 2014 02:28:01 +0000 (02:28 +0000)]
[llvm-objdump] don't test timestamp dump as that is time zone dependent
llvm-svn: 220123
David Blaikie [Sat, 18 Oct 2014 02:21:26 +0000 (02:21 +0000)]
PR21305: Typedefs in non-type template parameters in member data pointers.
Patch by Stephen Crane!
llvm-svn: 220122
Eric Fiselier [Sat, 18 Oct 2014 02:19:28 +0000 (02:19 +0000)]
Add special case for finding the in-tree ABI library.
When libcxx is built in-tree with libcxxabi it links against libcxxabi using
the name of the cmake target and not the actual library name. The cmake target
will not work with `find_library()`, so it needs special case handling.
llvm-svn: 220121
Nick Kledzik [Sat, 18 Oct 2014 01:50:55 +0000 (01:50 +0000)]
[llvm-objdump] enhance test case for mach-o -private-headers
llvm-svn: 220120
Nick Kledzik [Sat, 18 Oct 2014 01:21:02 +0000 (01:21 +0000)]
[llvm-objdump] Fix mach-o binding decompression error
llvm-svn: 220119
Eric Fiselier [Sat, 18 Oct 2014 01:15:17 +0000 (01:15 +0000)]
[libcxx] Add support for building and testing with an ABI library not along linker paths
Summary:
This patch adds support for building/testing libc++ with an ABI library that the linker would not normally find.
- `CMAKE_LIBRARY_PATH` is used to specify the list of search directories.
- The ABI library is now found using `find_library` instead of assuming its along the linker's search path.
- `CMAKE_LIBRARY_PATH` is passed to our LIT config as `library_paths`.
- For each path in `library_paths` the following flags are added `-L<path> -Wl,-rpath -Wl,<path>`
Some changes in existing behavior were also added:
- `target_link_libraries` is now passed the ABI library file instead of the library name. Ex `target_link_libraries(cxx "/usr/lib/libc++abi.so")` vs `target_link_libraries(cxx "c++abi")`.
- `-Wl,-rpath -Wl,<path>` is now used on OSX to link to libc++ instead of env['DYLD_LIBRARY_PATH'] if `use_system_lib=False`.
Reviewers: mclow.lists, danalbert, EricWF
Reviewed By: EricWF
Subscribers: emaste, cfe-commits
Differential Revision: http://reviews.llvm.org/D5038
llvm-svn: 220118
Richard Smith [Sat, 18 Oct 2014 00:56:31 +0000 (00:56 +0000)]
Hardcode the list of ELF targets here rather than using a glob.
The code was making non-portable assumptions about the exact string returned by
the glob (possibly by the shell?); this is more robust and matches what is done
everywhere else.
llvm-svn: 220117
Chandler Carruth [Sat, 18 Oct 2014 00:44:02 +0000 (00:44 +0000)]
[SROA] Change how SROA does vector-based promotion of allocas to handle
cases where the alloca type, the load types, and the store types used
all disagree.
Previously, the only way that vector-based promotion occured was if the
alloca type was a vector type. This was one of the *very* few remaining
uses of the alloca's type to guide SROA/mem2reg left in LLVM. It turns
out it was a bad idea.
The alloca type can change very easily based on the mixture of types
loaded and stored to that alloca. We shouldn't be relying on it as
a signal for very much. Instead, the source of truth should be loads and
stores. We should canonicalize the loads and stores as much as possible
and then rely on them exclusively in SROA.
When looking and loads and stores, we may find many different candidate
vector types. This change will let SROA try all of them to find a vector
type which is a viable way to promote the entire alloca to a vector
register.
With this change, it becomes possible to do better canonicalization and
optimization of loads and stores without breaking SROA in random ways,
and that should allow fixing a core source of performance loss in hot
numerical loops such as those in Eigen.
llvm-svn: 220116
Tim Northover [Sat, 18 Oct 2014 00:36:03 +0000 (00:36 +0000)]
[mach-o] keep Windows library happy.
&v[v.size()] may be invalid C++.
llvm-svn: 220115
Filipe Cabecinhas [Sat, 18 Oct 2014 00:05:26 +0000 (00:05 +0000)]
Append the %itanium_abi_host_triple substitution unconditionally
We will fail if it's not set, even if we don't substitute.
llvm-svn: 220114
Greg Clayton [Fri, 17 Oct 2014 23:58:27 +0000 (23:58 +0000)]
Fixed python API event test cases.
Issues were:
1 - It isn't good to have more than one listener for the process events, just supply a listener at launch instead of making a one then have the process broadcaster add a new listener
2 - run in async mode
llvm-svn: 220113
Filipe Cabecinhas [Fri, 17 Oct 2014 23:50:47 +0000 (23:50 +0000)]
Fix makefile for debuginfo-tests execution.
llvm-svn: 220112
NAKAMURA Takumi [Fri, 17 Oct 2014 23:46:34 +0000 (23:46 +0000)]
SemaDeclCXX.cpp: UninitializedFieldVisitor: Avoid member initializers to appease msc17.
llvm-svn: 220111
Aaron Watry [Fri, 17 Oct 2014 23:33:03 +0000 (23:33 +0000)]
R600/SI: Add global atomicrmw xchg
v2: Add separate offset/no-offset tests
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220110
Aaron Watry [Fri, 17 Oct 2014 23:33:01 +0000 (23:33 +0000)]
R600/SI: Add global atomicrmw xor
v2: Add separate offset/no-offset tests
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220109
Aaron Watry [Fri, 17 Oct 2014 23:32:59 +0000 (23:32 +0000)]
R600/SI: Add global atomicrmw or
v2: Add separate offset/no-offset tests
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220108
Aaron Watry [Fri, 17 Oct 2014 23:32:57 +0000 (23:32 +0000)]
R600/SI: Add global atomicrmw min/umin
v2: Add separate offset/no-offset tests
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220107
Aaron Watry [Fri, 17 Oct 2014 23:32:56 +0000 (23:32 +0000)]
R600/SI: Add global atomicrmw max/umax
v2: Add separate offset/no-offset tests
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220106
Aaron Watry [Fri, 17 Oct 2014 23:32:54 +0000 (23:32 +0000)]
R600/SI: Add global atomicrmw and
v2: Add separate offset/no-offset tests
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220105
Aaron Watry [Fri, 17 Oct 2014 23:32:52 +0000 (23:32 +0000)]
R600/SI: Add global atomicrmw sub
v2: Add separate offset/no-offset tests
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220104
Aaron Watry [Fri, 17 Oct 2014 23:32:50 +0000 (23:32 +0000)]
R600/SI: Fix/add tests for atomicrmw add
The previous tests claimed to test constant offsets in the function name,
but the tests weren't actually testing them.
Clone the tests, and do testing of all combinations of the following:
1) with/without constant pointer offset
2) 32/64-bit addressing modes
3) Usage and non-usage of the return value from the atomicrmw
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220103
Aaron Watry [Fri, 17 Oct 2014 23:32:49 +0000 (23:32 +0000)]
R600: Rename atomic_load global tests to atomic_add
The function name now matches what it's actually testing.
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220102
Evgeniy Stepanov [Fri, 17 Oct 2014 23:29:44 +0000 (23:29 +0000)]
[msan] Fix handling of byval arguments with large alignment.
MSan param-tls slots are 8-byte aligned. This change clips
alignment of memcpy into param-tls to 8.
llvm-svn: 220101
Sean Callanan [Fri, 17 Oct 2014 23:02:41 +0000 (23:02 +0000)]
Make the registerEHFrame function do nothing,
because the default implementation isn't meant
to run against a target process.
<rdar://problem/
16639561>
llvm-svn: 220100
Pete Cooper [Fri, 17 Oct 2014 22:59:33 +0000 (22:59 +0000)]
Check for dynamic alloca's when selecting lifetime intrinsics.
TL;DR: Indexing maps with [] creates missing entries.
The long version:
When selecting lifetime intrinsics, we index the *static* alloca map with the AllocaInst we find for that lifetime. Trouble is, we don't first check to see if this is a dynamic alloca.
On the attached example, this causes a dynamic alloca to create an entry in the static map, and returns 0 (the default) as the frame index for that lifetime. 0 was used for the frame index of the stack protector, which given that it now has a lifetime, is coloured, and merged with other stack slots.
PEI would later trigger an assert because it expects the stack protector to not be dead.
This fix ensures that we only get frame indices for static allocas, ie, those in the map. Dynamic ones are effectively dropped, which is suboptimal, but at least isn't completely broken.
rdar://problem/
18672951
llvm-svn: 220099
Nick Lewycky [Fri, 17 Oct 2014 22:45:44 +0000 (22:45 +0000)]
Fix typo in comment.
llvm-svn: 220098
Alexey Samsonov [Fri, 17 Oct 2014 22:37:33 +0000 (22:37 +0000)]
[ASan] Improve blacklisting of global variables.
This commit changes the way we blacklist global variables in ASan.
Now the global is excluded from instrumentation (either regular
bounds checking, or initialization-order checking) if:
1) Global is explicitly blacklisted by its mangled name.
This part is left unchanged.
2) SourceLocation of a global is in blacklisted source file.
This changes the old behavior, where instead of looking at the
SourceLocation of a variable we simply considered llvm::Module
identifier. This was wrong, as identifier may not correspond to
the file name, and we incorrectly disabled instrumentation
for globals coming from #include'd files.
3) Global is blacklisted by type.
Now we build the type of a global variable using Clang machinery
(QualType::getAsString()), instead of llvm::StructType::getName().
After this commit, the active users of ASan blacklist files
may have to revisit them (this is a backwards-incompatible change).
llvm-svn: 220097
Rui Ueyama [Fri, 17 Oct 2014 22:03:54 +0000 (22:03 +0000)]
[PECOFF] Emit x64 delay-import wrapper function
Previously we supported x86 only. This patch is to support x64.
The array of pointers to delay-loaded functions points the
DLL delay loading function at start-up. When a function is called
for the first time, the delay loading function gets called and
then rewrite the function pointer array.
llvm-svn: 220096
Enrico Granata [Fri, 17 Oct 2014 21:50:42 +0000 (21:50 +0000)]
Do not delete the class, or else multiple tests that try to rely on lldbinline will fail
llvm-svn: 220095
Bill Schmidt [Fri, 17 Oct 2014 21:32:22 +0000 (21:32 +0000)]
[PowerPC] Disable +vsx RUN line for fma.ll due to inconsistency on other builders
llvm-svn: 220094
Rafael Espindola [Fri, 17 Oct 2014 21:25:48 +0000 (21:25 +0000)]
Revert "TRE: make TRE a bit more aggressive"
This reverts commit r219899.
This also updates byval-tail-call.ll to make it clear what was breaking.
Adding r219899 again will cause the load/store to disappear.
llvm-svn: 220093
Bill Schmidt [Fri, 17 Oct 2014 21:19:59 +0000 (21:19 +0000)]
[PowerPC] Change assert to better form
llvm-svn: 220092
Matt Arsenault [Fri, 17 Oct 2014 21:13:11 +0000 (21:13 +0000)]
R600/SI: Remove redundant setting of instruction bits
These are all set on the instruction base classes.
llvm-svn: 220091
Bill Schmidt [Fri, 17 Oct 2014 21:02:44 +0000 (21:02 +0000)]
[PowerPC] Change liveness testing in VSX FMA mutation pass
With VSX enabled, LLVM crashes when compiling
test/CodeGen/PowerPC/fma.ll. I traced this to the liveness test
that's revised in this patch. The interval test is designed to only
work for virtual registers, but in this case the AddendSrcReg is
physical. Since there is already a walk of the MIs between the
AddendMI and the FMA, I added a check for def/kill of the AddendSrcReg
in that loop. At Hal Finkel's request, I converted the liveness test
to an assert restricted to virtual registers.
I've changed the fma.ll test to have VSX and non-VSX variants so we
can test both kinds of multiply-adds.
llvm-svn: 220090
Kostya Serebryany [Fri, 17 Oct 2014 21:02:13 +0000 (21:02 +0000)]
fix -fsanitize-address-field-padding for the cases with virtual base classes
Summary: Correctly compute the non-virtual size of a class.
Test Plan: Build SPEC 2016 with -fsanitize-address-field-padding
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5848
llvm-svn: 220089
Richard Smith [Fri, 17 Oct 2014 20:56:14 +0000 (20:56 +0000)]
Fix the rest of PR21289: a pack expansion that we can't expand yet makes a
template specialization type dependent, even if it has no dependent template
arguments. I've filed a corresponding bug against the C++ standard.
llvm-svn: 220088
Richard Trieu [Fri, 17 Oct 2014 20:56:10 +0000 (20:56 +0000)]
Add support for initializer lists on field initializers for -Wuninitialized
llvm-svn: 220087
Hans Wennborg [Fri, 17 Oct 2014 20:55:54 +0000 (20:55 +0000)]
Try to fix parse-progname.c test on Darwin
llvm-svn: 220086
Richard Smith [Fri, 17 Oct 2014 20:37:29 +0000 (20:37 +0000)]
Don't forget to substitute into the qualifier when instantiating the definition
of a member function of a class template that is defined outside the template.
This substitution can actually fail in some weird cases.
llvm-svn: 220085
Peter Collingbourne [Fri, 17 Oct 2014 18:32:36 +0000 (18:32 +0000)]
Disable ccache for go tests.
Should fix llvm-clang-lld-x86_64-debian-fast bot.
llvm-svn: 220071
Sean Callanan [Fri, 17 Oct 2014 18:16:04 +0000 (18:16 +0000)]
Fixed the expression parser to handle cases where
GetValueForVariableExpressionPath returns NULL and
doesn't set an error.
<rdar://problem/
18682916>
llvm-svn: 220070
Hans Wennborg [Fri, 17 Oct 2014 18:13:21 +0000 (18:13 +0000)]
Move test/CodeGen/sections.c to CodeGenCXX/sections.cpp
The test was running with -xc++. Seems it wants to be a C++ file.
llvm-svn: 220069
Matt Arsenault [Fri, 17 Oct 2014 18:02:31 +0000 (18:02 +0000)]
Fix typo
llvm-svn: 220068
Matt Arsenault [Fri, 17 Oct 2014 18:00:50 +0000 (18:00 +0000)]
R600/SI: Also check for FPImm literal constants
llvm-svn: 220067
Matt Arsenault [Fri, 17 Oct 2014 18:00:48 +0000 (18:00 +0000)]
R600/SI: Allow commuting with source modifiers
llvm-svn: 220066
Matt Arsenault [Fri, 17 Oct 2014 18:00:45 +0000 (18:00 +0000)]
R600/SI: Simplify code with hasModifiersSet
llvm-svn: 220065
Matt Arsenault [Fri, 17 Oct 2014 18:00:43 +0000 (18:00 +0000)]
R600/SI: Fix general commuting breaking src mods
The generic code trying to use findCommutedOpIndices won't
understand that it needs to swap the modifier operands also,
so it should fail if they are set.
llvm-svn: 220064
Matt Arsenault [Fri, 17 Oct 2014 18:00:41 +0000 (18:00 +0000)]
R600/SI: Cleanup code with ChangeToFPImmediate
llvm-svn: 220063
Matt Arsenault [Fri, 17 Oct 2014 18:00:39 +0000 (18:00 +0000)]
R600/SI: Allow comuting fp immediates
llvm-svn: 220062
Matt Arsenault [Fri, 17 Oct 2014 18:00:37 +0000 (18:00 +0000)]
R600/SI: Use early return instead of checking condition twice
Any commutable instruction will have at least src1.
llvm-svn: 220061
David Blaikie [Fri, 17 Oct 2014 18:00:12 +0000 (18:00 +0000)]
Rename TemplateArgument::getTypeForDecl to getParamTypeForDecl for clarity
Code review feedback from Richard Smith on r219900.
llvm-svn: 220060
Enrico Granata [Fri, 17 Oct 2014 17:56:59 +0000 (17:56 +0000)]
Make a general helper function on the AST context to retrieve a type by identifier in the fashion needed by data formatters
llvm-svn: 220059