Chandler Carruth [Thu, 18 Dec 2014 05:19:47 +0000 (05:19 +0000)]
[SROA] Cleanup - remove the use of std::mem_fun_ref nonsense and use
a lambda now that we have them.
llvm-svn: 224500
Rafael Espindola [Thu, 18 Dec 2014 05:08:43 +0000 (05:08 +0000)]
Modernize the getStreamedBitcodeModule interface a bit. NFC.
llvm-svn: 224499
Craig Topper [Thu, 18 Dec 2014 05:02:14 +0000 (05:02 +0000)]
[PowerPC] Use MCPhysReg for tables of registers. Const-correct the tables. Only put the anonymous namespace around classes. NFC.
llvm-svn: 224498
Craig Topper [Thu, 18 Dec 2014 05:02:12 +0000 (05:02 +0000)]
[X86] Use correct opsize on indirect call and jump aliases.
llvm-svn: 224497
Craig Topper [Thu, 18 Dec 2014 05:02:10 +0000 (05:02 +0000)]
[X86] Don't use PS prefix on LDMXCSR/STMXCSR.
Near as I can tell prefixes are ignored on these instructions except for a comment in the Intel docs about 0xf3. Binutils disassembler seems to ignore prefixes on these instructions. Our disassembler still doesn't distinguish PS and "no prefix" well enough for this to make a functional change, but it helps with experiments I'm doing on a potential new disassembler table builder.
llvm-svn: 224496
Craig Topper [Thu, 18 Dec 2014 05:02:08 +0000 (05:02 +0000)]
[X86] Remove unnecessary 'In64BitMode' predicate for instructions that already indicate use of REX.W.
llvm-svn: 224495
Justin Hibbits [Thu, 18 Dec 2014 03:06:37 +0000 (03:06 +0000)]
Add a corresponding '@LOCAL' parse to match r224415.
Pointed out by Jim Grosbach.
llvm-svn: 224494
Eric Christopher [Thu, 18 Dec 2014 02:23:27 +0000 (02:23 +0000)]
Update for llvm front end change and use the TargetOptions struct
for ABI.
llvm-svn: 224493
Eric Christopher [Thu, 18 Dec 2014 02:20:58 +0000 (02:20 +0000)]
Add a new string member to the TargetOptions struct for the name
of the abi we should be using. For targets that don't use the
option there's no change, otherwise this allows external users
to set the ABI via string and avoid some of the -backend-option
pain in clang.
Use this option to move the ABI for the ARM port from the
Subtarget to the TargetMachine and update the testcases
accordingly since it's no longer valid to set via -mattr.
llvm-svn: 224492
Eric Christopher [Thu, 18 Dec 2014 02:08:55 +0000 (02:08 +0000)]
Make sure that arm-linux-gnu is still the apcs-gnu ABI when we
use clang -cc1 matching the front end and backend. Fix up a couple
of tests that were testing aapcs for arm-linux-gnu.
The test that removes the aapcs abi calling convention removes
them because the default triple matches what the backend uses
for the calling convention there and so it doesn't need to be
explicitly stated - see the code in TargetInfo.cpp.
llvm-svn: 224491
Eric Christopher [Thu, 18 Dec 2014 02:08:51 +0000 (02:08 +0000)]
Reinstate aapcs as the default arm abi.
llvm-svn: 224490
Eric Christopher [Thu, 18 Dec 2014 02:08:45 +0000 (02:08 +0000)]
Model ARM backend ABI selection after the front end code doing the
same. This will change the "bare metal" ABI from APCS to AAPCS.
The only difference between the front and back end code is that
the code for Triple::GNU was added for environment. That will migrate
to the front end shortly.
Tests updated with the ABI they were originally testing in the case
of bare metal (e.g. -mtriple armv7) or with a -gnu for arm-linux
triples.
llvm-svn: 224489
Petar Jovanovic [Thu, 18 Dec 2014 01:21:33 +0000 (01:21 +0000)]
Do not define CRT_HAS_128BIT for MIPS64
Do not define it for MIPS64 until its backend supports it.
See the bug report [1] for more information.
[1] http://llvm.org/bugs/show_bug.cgi?id=20098
Differential Revision: http://reviews.llvm.org/D6703
llvm-svn: 224488
Duncan P. N. Exon Smith [Thu, 18 Dec 2014 01:05:33 +0000 (01:05 +0000)]
Reapply "Linker: Drop superseded subprograms"
This reverts commit r224416, reapplying r224389. The buildbots hadn't
recovered after my revert, waiting until David reverted a couple of his
commits. It looks like it was just bad timing (where we were both
modifying code related to the same assertion). Trying again...
Here's the original text:
When a function gets replaced by `ModuleLinker`, drop superseded
subprograms. This ensures that the "first" subprogram pointing at a
function is the same one that `!dbg` references point at.
This is a stop-gap fix for PR21910. Notably, this fixes Release+Asserts
bootstraps that are currently asserting out in
`LexicalScopes::initialize()` due to the explicit instantiations in
`lib/IR/Dominators.cpp` eventually getting replaced by -argpromotion.
llvm-svn: 224487
Duncan P. N. Exon Smith [Thu, 18 Dec 2014 00:54:39 +0000 (00:54 +0000)]
IR: Make DICompositeType mutators private
Make `DICompositeType` mutators private to prevent misuse. All calls to
`setArrays()` and `setContainingType()` should go through
`DIBuilder::replaceArrays()` and `DIBuilder::replaceVTableHolder()`.
This is a follow-up to r224482 (now that clang has been updated in
r224483).
llvm-svn: 224486
Kevin Enderby [Thu, 18 Dec 2014 00:53:40 +0000 (00:53 +0000)]
Add printing the LC_LINKER_OPTION load command with llvm-objdump’s -private-headers.
Also corrected the name of the load command to not end in an ’S’ as well as corrected
the name of the MachO::linker_option_command struct and other places that had the
word option as plural which did not match the Mac OS X headers.
llvm-svn: 224485
Duncan P. N. Exon Smith [Thu, 18 Dec 2014 00:48:56 +0000 (00:48 +0000)]
CGDebugInfo: Use DIBuilder API for self-referencing DICompositeTypes
Use new `DIBuilder` API from LLVM r224482 to mutate `DICompositeType`s,
rather than changing them directly. This allows `DIBuilder` to track
otherwise orphaned cycles when `CollectContainingType()` creates a
self-reference.
Fixes PR21941.
llvm-svn: 224483
Duncan P. N. Exon Smith [Thu, 18 Dec 2014 00:46:16 +0000 (00:46 +0000)]
IR: Handle self-referencing DICompositeTypes in DIBuilder
Add API to DIBuilder to handle self-referencing `DICompositeType`s.
Self-references aren't expected in the debug info graph, and we take
advantage of that by only calling `resolveCycles()` on nodes that were
once forward declarations (otherwise, DIBuilder needs an expensive
tracking reference to every unresolved node it creates, which in cyclic
graphs is *all of them*).
However, clang seems to create self-referencing `DICompositeType`s. Add
API to manage this safely. The paired commit to clang will include the
regression test.
I'll make the `DICompositeType` API `private` in a follow-up to prevent
misuse (I've separated that to prevent build failures from missing the
clang commit).
llvm-svn: 224482
Alexey Samsonov [Thu, 18 Dec 2014 00:45:32 +0000 (00:45 +0000)]
[dsymutil] Fix missing member initializer.
This bug was found by the MSan bootstrap bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/5330/steps/check-llvm%20msan/logs/stdio
llvm-svn: 224481
Reid Kleckner [Thu, 18 Dec 2014 00:42:51 +0000 (00:42 +0000)]
Fix diagnostic for static methods referencing fields from using decls
Previously we thought the instance member was a function, not a field,
and we'd say something silly like:
t.cpp:4:27: error: call to non-static member function without an object argument
static int f() { return n; }
^
Noticed in PR21923.
llvm-svn: 224480
Fariborz Jahanian [Thu, 18 Dec 2014 00:30:54 +0000 (00:30 +0000)]
[Objective-C]. Modern property getters have side-effects.
So, place warning about property getter should not be used for side-effect
under its own group so warning can be turned off.
rdar://
19137815
llvm-svn: 224479
Richard Trieu [Thu, 18 Dec 2014 00:06:45 +0000 (00:06 +0000)]
Fix a function that only calls itself. The const_cast needs to remove the
const so that the other overloaded function will be called.
llvm-svn: 224478
Dan Albert [Thu, 18 Dec 2014 00:03:57 +0000 (00:03 +0000)]
[libcxxabi] Add __cxa_thread_atexit for TLS support on Linux.
Summary:
Fixes PR21738.
The implementation for this is handled by __cxa_thread_atexit_impl,
which is supplied by libc.
More information:
https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables
Reviewers: mclow.lists, EricWF, jroelofs
Reviewed By: jroelofs
Subscribers: majnemer, cfe-commits
Differential Revision: http://reviews.llvm.org/D6708
llvm-svn: 224477
Justin Bogner [Wed, 17 Dec 2014 23:55:04 +0000 (23:55 +0000)]
InstrProf: Simplify/reduce state in CoverageMapping (NFC)
This state object makes things harder to reason about and isn't really
useful, since we can just emit the mappings before the state changes
rather than holding on to it.
llvm-svn: 224476
Rafael Espindola [Wed, 17 Dec 2014 23:49:22 +0000 (23:49 +0000)]
Revert "Put static local variables of inline functions in the function comdat."
This reverts commit r224369.
Thanks to Reid Kleckner for pointing out that we need a bigger gun to fix this
case.
llvm-svn: 224475
Alexey Samsonov [Wed, 17 Dec 2014 23:46:53 +0000 (23:46 +0000)]
[ASan] Mark test for -fsized-delete as XFAIL for dynamic runtime.
-fsized-delete is implemented via weak symbols, and doesn't work
properly when malloc/free replacements are provided in shared
ASan runtime.
llvm-svn: 224474
Alexey Samsonov [Wed, 17 Dec 2014 23:46:49 +0000 (23:46 +0000)]
[ASan] Add -ldl to linker invocation to lit tests that require it.
This fixes these tests under dynamic ASan runtime.
llvm-svn: 224473
Renato Golin [Wed, 17 Dec 2014 23:43:39 +0000 (23:43 +0000)]
Fix obvious cut&paste error on AArch64 Compiler-RT settings
llvm-svn: 224472
Reid Kleckner [Wed, 17 Dec 2014 23:40:46 +0000 (23:40 +0000)]
Don't assume friended C++ method decls have qualifiers
There are a few cases where unqualified lookup can find C++ methods.
Unfortunately, none of them seem to have illegal access paths, so I
can't excercise the diagnostic source range code that I am changing
here.
Fixes PR21851, which was a crash on valid.
llvm-svn: 224471
Alexey Samsonov [Wed, 17 Dec 2014 23:14:01 +0000 (23:14 +0000)]
[ASan] Always build shared ASan runtime on Linux.
This commit changes the strategy for building shared ASan runtime
and the way we test it:
- COMPILER_RT_BUILD_SHARED_ASAN CMake option is removed. We now
always build shared ASan runtime (it is the default on Android,
Windows and Mac, and not the default on Linux and FreeBSD).
- Platforms, which use static runtime by default now have
"check-asan-dynamic" testsuite. This testsuite contains instrumented
unit tests, and ASan lit tests, and runs them with shared ASan
runtime. This testsuite is *not* a part of "check-asan" and
*not* a part of "check-all", as adding 1000 more test cases, which
duplicate existing ones is costly. However, you're welcome to
add this command to your buildbot.
llvm-svn: 224470
Kostya Serebryany [Wed, 17 Dec 2014 23:06:36 +0000 (23:06 +0000)]
[sanitizer] add CombinedAllocator::InitIfLinkerInitialized and use it in lsan: speeds up lsan start-up time by ~25%
llvm-svn: 224469
Eric Christopher [Wed, 17 Dec 2014 22:26:32 +0000 (22:26 +0000)]
Fix a format string warning by noting that StringIsBreakpointName
will set the error accordingly and so there's no need to set it
again.
llvm-svn: 224468
Eric Christopher [Wed, 17 Dec 2014 22:25:37 +0000 (22:25 +0000)]
Fix initialization order to match that of the source.
llvm-svn: 224467
Duncan P. N. Exon Smith [Wed, 17 Dec 2014 22:05:42 +0000 (22:05 +0000)]
LTO: Lazy-load LTOModule in local contexts
Start lazy-loading `LTOModule`s that own their contexts. These can only
really be used for parsing symbols, so its unnecessary to ever
materialize their functions.
I looked into using `IRObjectFile::create()` and optionally calling
`materializAllPermanently()` afterwards, but this turned out to be
awkward.
- The default target triple and data layout logic needs to happen
*before* the call to `IRObjectFile::IRObjectFile()`, but after
`Module` was created.
- I tried passing a lambda in to do the module initialization, but
this seemed to require threading the error message from
`TargetRegistry::lookupTarget()` through `std::error_code`.
- I also looked at setting `errMsg` directly from within the lambda,
but this didn't look any better.
(I guess there's a reason we weren't already using that function.)
llvm-svn: 224466
Aaron Ballman [Wed, 17 Dec 2014 21:57:17 +0000 (21:57 +0000)]
Adding a -Wunused-value warning for expressions with side effects used in an unevaluated expression context, such as sizeof(), or decltype(). Also adds a similar warning when the expression passed to typeid() *is* evaluated, since it is equally likely that the user would expect the expression operand to be unevaluated in that case.
llvm-svn: 224465
Kostya Serebryany [Wed, 17 Dec 2014 21:51:07 +0000 (21:51 +0000)]
[sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, compiler-rt part
llvm-svn: 224464
Kostya Serebryany [Wed, 17 Dec 2014 21:50:04 +0000 (21:50 +0000)]
[sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, llvm part
llvm-svn: 224463
Kostya Serebryany [Wed, 17 Dec 2014 21:46:33 +0000 (21:46 +0000)]
[sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, clang part
llvm-svn: 224462
Matthias Braun [Wed, 17 Dec 2014 21:25:20 +0000 (21:25 +0000)]
RegisterCoalescer: Fix stripCopies() picking up main range instead of subregister range
This fixes a problem where stripCopies() would switch to values in the
main liverange when it crossed a copy instruction. However when joining
subranges we need to stay in the respective subregister ranges.
llvm-svn: 224461
Enrico Granata [Wed, 17 Dec 2014 21:18:43 +0000 (21:18 +0000)]
Provide CreateValueFromData,Expression at the SBTarget level as well as the SBValue level; and also make all the implenentations agree on using the matching ValueObject::Create instead of doing code copypastas
llvm-svn: 224460
Tobias Grosser [Wed, 17 Dec 2014 21:13:55 +0000 (21:13 +0000)]
Dead code elimination: Update dependences after eliminating code
Without updating dependences we may lose implicit transitive dependences for
which all explicit dependences have gone through the statement iterations we
have just eliminated.
No test case. We should probably implement a -verify-dependences option.
This fixes llvm.org/PR21227
llvm-svn: 224459
Matt Arsenault [Wed, 17 Dec 2014 21:04:08 +0000 (21:04 +0000)]
R600/SI: Fix f64 inline immediates
llvm-svn: 224458
Richard Smith [Wed, 17 Dec 2014 20:42:37 +0000 (20:42 +0000)]
[c++1z] Fixes for generalized non-type template argument support: check for
exact type match for deduced template arguments, and be sure to produce correct
canonical TemplateArgument representations to enable correct redeclaration
matching.
llvm-svn: 224456
Colin LeMahieu [Wed, 17 Dec 2014 20:35:11 +0000 (20:35 +0000)]
[Hexagon] Reconfiguring register alternate names.
llvm-svn: 224455
Reid Kleckner [Wed, 17 Dec 2014 20:23:11 +0000 (20:23 +0000)]
Destroy the diagnostic client first in ~DiagnosticEngine
Add a comment and a test to ~DiagnosticEngine about the ordering
requirements on the teardown of DiagnosticConsumer. This could also be
accomplished by rearranging the fields of ~DiagnosticEngine, but I felt
that this was a better, more explicit solution.
This fixes PR21911, an issue that occurred after the unique_ptr
migration in r222193.
llvm-svn: 224454
Yaron Keren [Wed, 17 Dec 2014 20:12:29 +0000 (20:12 +0000)]
This test does not pass for -target i686-pc-windows-gnu (-mingw32)
when clang is built with mingw-w64 4.9.1 or according to
http://llvm.org/PR20995 , mingw-w64 4.7.2 as well.
llvm-svn: 224453
Will Schmidt [Wed, 17 Dec 2014 19:56:29 +0000 (19:56 +0000)]
Enable the P8Model entry
This was missed last time around, for the P8 Instruction Scheduling
changes (223257). This will hook the P8Model entry in so those
changes will actually be used.
llvm-svn: 224452
Reid Kleckner [Wed, 17 Dec 2014 19:34:15 +0000 (19:34 +0000)]
Don't build invalid AST nodes during recovery
A DependentScopeDeclRefExpr should always have a nested name specifier.
During template instantiation, if we found that the named context was
incomplete, we would previously build a DependentScopeDeclRefExpr with
an empty qualifier.
This error recovery path has been asserting for some time. The other
error codepaths use ExprError, so we can do the same.
Fixes PR21864.
llvm-svn: 224451
Alexey Samsonov [Wed, 17 Dec 2014 19:31:39 +0000 (19:31 +0000)]
[ASan] Move flag parsing logic to asan_flags.cc. NFC.
llvm-svn: 224450
Richard Smith [Wed, 17 Dec 2014 19:24:30 +0000 (19:24 +0000)]
Support constant evaluation for member calls on std::initializer_list
temporaries.
llvm-svn: 224449
Ed Maste [Wed, 17 Dec 2014 19:14:57 +0000 (19:14 +0000)]
lld self-hosts on FreeBSD too
llvm-svn: 224448
Matthias Braun [Wed, 17 Dec 2014 19:13:47 +0000 (19:13 +0000)]
ExecutionDepsFix: Correctly handle wide registers.
The ExecutionDepsFix previously mapped each register to 1 or zero
registers of the register class it was called with and therefore
simulating liveness for. This was problematic for cases involving wider
registers like Q0 on ARM where ExecutionDepsFix gets invoked for the Dxx
registers. In these cases the wide register would get mapped to the last
matching D register, while it should have been all matching D registers.
This commit changes the AliasMap to use a SmallVector to map registers
to potentially multiple destination regclass registers. This is required
to avoid regressions with subregister liveness tracking enabled.
llvm-svn: 224447
David Blaikie [Wed, 17 Dec 2014 19:11:27 +0000 (19:11 +0000)]
Revert "Fix test cases given Clang's improved location information."
The Clang improevments were reverted due to failures created in an asan
bootstrap.
This reverts commit r224387.
llvm-svn: 224446
JF Bastien [Wed, 17 Dec 2014 18:12:10 +0000 (18:12 +0000)]
Random Number Generator Refactoring (removing from Module)
This patch removes the RNG from Module. Passes should instead create a new RNG for their use as needed.
Patch by Stephen Crane @rinon.
Differential revision: http://reviews.llvm.org/D4377
llvm-svn: 224444
Zachary Turner [Wed, 17 Dec 2014 18:02:36 +0000 (18:02 +0000)]
Work around an internal compiler error in MSVC.
For some reason MSVC ICEs when trying to index into a map using
a temporary object. Work around this by separating out the call
into multiple lines.
Patch by Aidan Dodds
Differential Revision: http://reviews.llvm.org/D6702
Reviewed by: Zachary Turner, Greg Clayton
llvm-svn: 224443
Zachary Turner [Wed, 17 Dec 2014 18:02:19 +0000 (18:02 +0000)]
Enhance the Pipe interface for better portability.
This patch makes a number of improvements to the Pipe interface.
1) An interface (PipeBase) is provided which exposes pure virtual
methods for any implementation of Pipe to override. While not
strictly necessary, this helps catch errors where the interfaces
are out of sync.
2) All methods return lldb_private::Error instead of returning bool
or void. This allows richer error information to be propagated
up to LLDB.
3) A new ReadWithTimeout() method is exposed in the base class and
implemented on Windows.
4) Support for both named and anonymous pipes is exposed through the
base interface and implemented on Windows. For creating a new
pipe, both named and anonymous pipes are supported, and for
opening an existing pipe, only named pipes are supported.
New methods described in points #3 and #4 are stubbed out on posix,
but fully implemented on Windows. These should be implemented by
someone on the linux / mac / bsd side.
Reviewed by: Greg Clayton, Oleksiy Vyalov
Differential Revision: http://reviews.llvm.org/D6686
llvm-svn: 224442
David Blaikie [Wed, 17 Dec 2014 18:02:04 +0000 (18:02 +0000)]
Revert "DebugInfo: Generalize debug info location handling"
Fails an ASan bootstrap - I'll try to reproduce locally & sort that out
before recommitting.
This reverts commit r224385.
llvm-svn: 224441
Jingyue Wu [Wed, 17 Dec 2014 17:59:04 +0000 (17:59 +0000)]
[NVPTX] Fix bugs related to isSingleValueType
Summary:
With isSingleValueType starting to treat vector types as single-value types,
code that uses this interface needs to be updated.
Test Plan:
vector-global.ll
nvcl-param-align.ll
Reviewers: jholewinski
Reviewed By: jholewinski
Subscribers: llvm-commits, meheff, eliben, jholewinski
Differential Revision: http://reviews.llvm.org/D6573
llvm-svn: 224440
Saleem Abdulrasool [Wed, 17 Dec 2014 17:52:33 +0000 (17:52 +0000)]
Basic: clean up bleeding whitespace
Whitespace cleanup. NFC.
llvm-svn: 224439
Saleem Abdulrasool [Wed, 17 Dec 2014 17:52:30 +0000 (17:52 +0000)]
CodeGen: implement __emit intrinsic
For MSVC compatibility, add the `__emit' builtin. This is used in the Windows
SDK headers, and must therefore be implemented as a builtin rather than an
intrinsic.
The `__emit' builtin provides a mechanism to emit a 16-bit opcode instruction
into the stream. The value must be a compile time constant expression. No
guarantees are made about the CPU and memory states after the execution of the
instruction.
Due to the unchecked nature of the builtin, only support this on Windows on ARM.
llvm-svn: 224438
Timur Iskhodzhanov [Wed, 17 Dec 2014 17:52:12 +0000 (17:52 +0000)]
Fix CR/LF line endings in test case
llvm-svn: 224437
Joerg Sonnenberger [Wed, 17 Dec 2014 17:14:11 +0000 (17:14 +0000)]
Revert r224433, r224371 is good enough for now.
llvm-svn: 224435
Yaron Keren [Wed, 17 Dec 2014 16:56:54 +0000 (16:56 +0000)]
Rangify for loop, NFC.
llvm-svn: 224434
Joerg Sonnenberger [Wed, 17 Dec 2014 16:25:45 +0000 (16:25 +0000)]
Disable the keyword-as-macro warning for now until the noise level is
reduced.
llvm-svn: 224433
Saleem Abdulrasool [Wed, 17 Dec 2014 16:17:44 +0000 (16:17 +0000)]
ARM: correct an off-by-one in an assert
The assert was off-by-one, resulting in failures for valid input.
Thanks to Asiri Rathnayake for pointing out the failure!
llvm-svn: 224432
NAKAMURA Takumi [Wed, 17 Dec 2014 14:47:06 +0000 (14:47 +0000)]
s/ScheduleKind/SchedKind/ in \param. [-Wdocumentation]
llvm-svn: 224431
NAKAMURA Takumi [Wed, 17 Dec 2014 14:46:56 +0000 (14:46 +0000)]
Exclude printLineState() in -Asserts. [-Wunused-function]
llvm-svn: 224430
Michael Kuperstein [Wed, 17 Dec 2014 12:32:17 +0000 (12:32 +0000)]
[DAGCombine] Slightly improve lowering of BUILD_VECTOR into a shuffle.
This handles the case of a BUILD_VECTOR being constructed out of elements extracted from a vector twice the size of the result vector. Previously this was always scalarized. Now, we try to construct a shuffle node that feeds on extract_subvectors.
This fixes PR15872 and provides a partial fix for PR21711.
Differential Revision: http://reviews.llvm.org/D6678
llvm-svn: 224429
Toma Tabacu [Wed, 17 Dec 2014 12:02:58 +0000 (12:02 +0000)]
[mips] Always clobber $1 for MIPS inline asm.
Summary:
Because GCC doesn't use $1 for code generation, inline assembly code can use $1 without having to add it to the clobbers list.
LLVM, on the other hand, does not shy away from using $1, and this can cause conflicts with inline assembly which assumes GCC-like code generation.
A solution to this problem is to make Clang automatically clobber $1 for all MIPS inline assembly.
This is not the optimal solution, but it seems like a necessary compromise, for now.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6638
llvm-svn: 224428
Vladimir Medic [Wed, 17 Dec 2014 11:49:56 +0000 (11:49 +0000)]
MipsABIInfo class is used in different libraries. Moving the files to MCTargetDesc folder(LLVMMipsDesc library) prevents linkage errors. There are no functional changes.
llvm-svn: 224427
Yaron Keren [Wed, 17 Dec 2014 11:04:07 +0000 (11:04 +0000)]
Teach compile_commands.json test that windows-gnu is the new name for mingw32.
llvm-svn: 224426
Toma Tabacu [Wed, 17 Dec 2014 10:56:16 +0000 (10:56 +0000)]
[mips] Set GCC-compatible MIPS asssembler options before inline asm blocks.
Summary:
When generating MIPS assembly, LLVM always overrides the default assembler options by emitting the '.set noreorder', '.set nomacro' and '.set noat' directives,
while GCC uses the default options if an assembly-level function contains inline assembly code.
This becomes a problem when the code generated by LLVM is interleaved with inline assembly which assumes GCC-like assembler options (from Linux, for example).
This patch fixes these conflicts by setting the appropriate assembler options at the beginning of an inline asm block and popping them at the end.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6637
llvm-svn: 224425
Suyog Sarda [Wed, 17 Dec 2014 10:34:27 +0000 (10:34 +0000)]
Revert 224119 "This patch recognizes (+ (+ v0, v1) (+ v2, v3)), reorders them for bundling into vector of loads,
and vectorizes it."
This was re-ordering floating point data types resulting in mismatch in output.
llvm-svn: 224424
Evgeniy Stepanov [Wed, 17 Dec 2014 10:30:06 +0000 (10:30 +0000)]
[msan] Stop calling pthread_getspecific in signal handlers.
pthread_getspecific is not async-signal-safe.
MsanThread pointer is now stored in a TLS variable, and the TSD slot
is used only for its destructor, and never from a signal handler.
This should fix intermittent CHECK failures in MsanTSDSet.
llvm-svn: 224423
Dmitry Vyukov [Wed, 17 Dec 2014 10:19:20 +0000 (10:19 +0000)]
tsan: add disabled test case for issue 87
llvm-svn: 224422
Yaron Keren [Wed, 17 Dec 2014 09:55:15 +0000 (09:55 +0000)]
Teach lit.cfg to recognize -windows-gnu in addition to -mingw32.
llvm-svn: 224421
Peter Collingbourne [Wed, 17 Dec 2014 09:45:05 +0000 (09:45 +0000)]
irgen: fix canAvoid*
Patch by Andrew Wilkins!
canAvoidElementLoad and canAvoidLoad were incorrectly
eliding loads when an index expression is used as an
another array index expression. This led to a panic.
See comments on https://github.com/go-llvm/llgo/issues/175
Test Plan: lit test added
Differential Revision: http://reviews.llvm.org/D6676
llvm-svn: 224420
Daniel Jasper [Wed, 17 Dec 2014 09:11:08 +0000 (09:11 +0000)]
clang-format: Fix incorrect calculation of token lenghts.
This led, e.g. to break JavaScript regex literals too early.
llvm-svn: 224419
Elena Demikhovsky [Wed, 17 Dec 2014 08:12:59 +0000 (08:12 +0000)]
Added 5 more tests related to sink store revision 224247
- by Ella Bolshinsky
http://reviews.llvm.org/D6420
llvm-svn: 224418
Erik Eckstein [Wed, 17 Dec 2014 07:29:19 +0000 (07:29 +0000)]
Strength reduce intrinsics with overflow into regular arithmetic operations if possible.
Some intrinsics, like s/uadd.with.overflow and umul.with.overflow, are already strength reduced.
This change adds other arithmetic intrinsics: s/usub.with.overflow, smul.with.overflow.
It completes the work on PR20194.
llvm-svn: 224417
Duncan P. N. Exon Smith [Wed, 17 Dec 2014 07:27:31 +0000 (07:27 +0000)]
Revert "Linker: Drop superseded subprograms"
This reverts commit r224389. Based on feedback from the bots, the
assertion seems to be going off *more* often, not less (previously I was
just seeing it in an internal bootstrap, now it's happening in public
builds too).
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/936/
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/5325
Reverting in order to investigate.
llvm-svn: 224416
Justin Hibbits [Wed, 17 Dec 2014 06:23:35 +0000 (06:23 +0000)]
Add parsing of 'foo@local".
Summary:
Currently, it supports generating, but not parsing, this expression.
Test added as well.
Test Plan: New test added, no regressions due to this.
Reviewers: hfinkel
Reviewed By: hfinkel
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6672
llvm-svn: 224415
Rafael Espindola [Wed, 17 Dec 2014 03:38:04 +0000 (03:38 +0000)]
Remove a debugging assert.
Sorry for the noise, I have no idea how it survived to the final version.
llvm-svn: 224414
Rafael Espindola [Wed, 17 Dec 2014 03:07:20 +0000 (03:07 +0000)]
Remove unused includes and out of date comment. NFC.
llvm-svn: 224413
Rafael Espindola [Wed, 17 Dec 2014 02:42:20 +0000 (02:42 +0000)]
Fix the windows build.
llvm-svn: 224412
David Majnemer [Wed, 17 Dec 2014 02:41:36 +0000 (02:41 +0000)]
Sema: Don't dyn_cast a null pointer in CheckUsingDeclQualifier
This code was written with the intent that a pointer could be null but
we dyn_cast'd it anyway. Change the dyn_cast to a dyn_cast_or_null.
This fixes PR21933.
llvm-svn: 224411
Rafael Espindola [Wed, 17 Dec 2014 02:32:44 +0000 (02:32 +0000)]
Refactor and simplify the code reading /proc/cpuinfo. NFC.
llvm-svn: 224410
Matthias Braun [Wed, 17 Dec 2014 02:18:13 +0000 (02:18 +0000)]
RegisterCoalescer: Sprinkle some const modifiers.
llvm-svn: 224409
Duncan P. N. Exon Smith [Wed, 17 Dec 2014 02:00:38 +0000 (02:00 +0000)]
llvm-lto: Add testing coverage for local contexts
Add coverage in `llvm-lto` for the API exposed by libLTO to create
modules in local contexts.
The goal here isn't to test the symbol-related API extensively, just to
confirm that these modules work at all. (I'll be shifting code around
soon that should be NFC and I realized there was no test coverage.)
llvm-svn: 224408
Nick Lewycky [Wed, 17 Dec 2014 01:56:51 +0000 (01:56 +0000)]
Delete debugging cruft that crept in with r223802.
llvm-svn: 224407
Alexey Samsonov [Wed, 17 Dec 2014 01:55:03 +0000 (01:55 +0000)]
[ASan] Re-structure the allocator code. NFC.
Introduce "Allocator" object, which contains all the bits and pieces
ASan allocation machinery actually use: allocator from sanitizer_common,
quarantine, fallback allocator and quarantine caches, fallback mutex.
This step is a preparation to adding more state to this object. We want
to reduce dependency of Allocator on commandline flags and be able to
"safely" modify its behavior (such as the size of the redzone) at
runtime.
llvm-svn: 224406
David Majnemer [Wed, 17 Dec 2014 01:54:33 +0000 (01:54 +0000)]
InstSimplify: shl nsw/nuw undef, %V -> undef
We can always choose an value for undef which might cause %V to shift
out an important bit except for one case, when %V is zero.
However, shl behaves like an identity function when the right hand side
is zero.
llvm-svn: 224405
Nick Lewycky [Wed, 17 Dec 2014 01:52:08 +0000 (01:52 +0000)]
Make ValueEnumerator::print use OS for metadata too. Noticed by inspection.
llvm-svn: 224404
David Majnemer [Wed, 17 Dec 2014 01:39:22 +0000 (01:39 +0000)]
Parse: Consume tokens more carefully in CheckForLParenAfterColonColon
We would consume the lparen even if it wasn't followed by an identifier
or a star-identifier pair.
This fixes PR21815.
llvm-svn: 224403
Quentin Colombet [Wed, 17 Dec 2014 01:36:17 +0000 (01:36 +0000)]
[CodeGenPrepare] Reapply r224351 with a fix for the assertion failure:
The type promotion helper does not support vector type, so when make
such it does not kick in in such cases.
Original commit message:
[CodeGenPrepare] Move sign/zero extensions near loads using type promotion.
This patch extends the optimization in CodeGenPrepare that moves a sign/zero
extension near a load when the target can combine them. The optimization may
promote any operations between the extension and the load to make that possible.
Although this optimization may be beneficial for all targets, in particular
AArch64, this is enabled for X86 only as I have not benchmarked it for other
targets yet.
** Context **
Most targets feature extended loads, i.e., loads that perform a zero or sign
extension for free. In that context it is interesting to expose such pattern in
CodeGenPrepare so that the instruction selection pass can form such loads.
Sometimes, this pattern is blocked because of instructions between the load and
the extension. When those instructions are promotable to the extended type, we
can expose this pattern.
** Motivating Example **
Let us consider an example:
define void @foo(i8* %addr1, i32* %addr2, i8 %a, i32 %b) {
%ld = load i8* %addr1
%zextld = zext i8 %ld to i32
%ld2 = load i32* %addr2
%add = add nsw i32 %ld2, %zextld
%sextadd = sext i32 %add to i64
%zexta = zext i8 %a to i32
%addza = add nsw i32 %zexta, %zextld
%sextaddza = sext i32 %addza to i64
%addb = add nsw i32 %b, %zextld
%sextaddb = sext i32 %addb to i64
call void @dummy(i64 %sextadd, i64 %sextaddza, i64 %sextaddb)
ret void
}
As it is, this IR generates the following assembly on x86_64:
[...]
movzbl (%rdi), %eax # zero-extended load
movl (%rsi), %es # plain load
addl %eax, %esi # 32-bit add
movslq %esi, %rdi # sign extend the result of add
movzbl %dl, %edx # zero extend the first argument
addl %eax, %edx # 32-bit add
movslq %edx, %rsi # sign extend the result of add
addl %eax, %ecx # 32-bit add
movslq %ecx, %rdx # sign extend the result of add
[...]
The throughput of this sequence is 7.45 cycles on Ivy Bridge according to IACA.
Now, by promoting the additions to form more extended loads we would generate:
[...]
movzbl (%rdi), %eax # zero-extended load
movslq (%rsi), %rdi # sign-extended load
addq %rax, %rdi # 64-bit add
movzbl %dl, %esi # zero extend the first argument
addq %rax, %rsi # 64-bit add
movslq %ecx, %rdx # sign extend the second argument
addq %rax, %rdx # 64-bit add
[...]
The throughput of this sequence is 6.15 cycles on Ivy Bridge according to IACA.
This kind of sequences happen a lot on code using 32-bit indexes on 64-bit
architectures.
Note: The throughput numbers are similar on Sandy Bridge and Haswell.
** Proposed Solution **
To avoid the penalty of all these sign/zero extensions, we merge them in the
loads at the beginning of the chain of computation by promoting all the chain of
computation on the extended type. The promotion is done if and only if we do not
introduce new extensions, i.e., if we do not degrade the code quality.
To achieve this, we extend the existing “move ext to load” optimization with the
promotion mechanism introduced to match larger patterns for addressing mode
(r200947).
The idea of this extension is to perform the following transformation:
ext(promotableInst1(...(promotableInstN(load))))
=>
promotedInst1(...(promotedInstN(ext(load))))
The promotion mechanism in that optimization is enabled by a new TargetLowering
switch, which is off by default. In other words, by default, the optimization
performs the “move ext to load” optimization as it was before this patch.
** Performance **
Configuration: x86_64: Ivy Bridge fixed at 2900MHz running OS X 10.10.
Tested Optimization Levels: O3/Os
Tests: llvm-testsuite + externals.
Results:
- No regression beside noise.
- Improvements:
CINT2006/473.astar: ~2%
Benchmarks/PAQ8p: ~2%
Misc/perlin: ~3%
The results are consistent for both O3 and Os.
<rdar://problem/
18310086>
llvm-svn: 224402
Richard Smith [Wed, 17 Dec 2014 01:08:39 +0000 (01:08 +0000)]
Add missing testcase from r224388.
llvm-svn: 224401
Kevin Enderby [Wed, 17 Dec 2014 01:01:30 +0000 (01:01 +0000)]
Add printing the LC_ENCRYPTION_INFO_64 load command with llvm-objdump’s -private-headers
and add tests for the two AArch64 binaries.
llvm-svn: 224400
David Blaikie [Wed, 17 Dec 2014 00:43:22 +0000 (00:43 +0000)]
PR21875: codegen for non-type template parameters of nullptr_t type
llvm-svn: 224399
Anna Zaks [Wed, 17 Dec 2014 00:34:07 +0000 (00:34 +0000)]
[CallGraph] Make sure the edges are not missed due to re-declarations
A patch by Daniel DeFreez!
We were previously dropping edges on re-declarations. Store the
canonical declarations in the graph to ensure that different
references to the same function end up reflected with the same call graph
node.
(Note, this might lead to performance fluctuation because call graph
is used to determine the function analysis order.)
llvm-svn: 224398
Reid Kleckner [Wed, 17 Dec 2014 00:29:23 +0000 (00:29 +0000)]
Revert "[CodeGenPrepare] Move sign/zero extensions near loads using type promotion."
This reverts commit r224351. It causes assertion failures when building
ICU.
llvm-svn: 224397