platform/upstream/llvm.git
10 years agoRevert "r214832 - MachineCombiner Pass for selecting faster instruction"
Kevin Qin [Tue, 5 Aug 2014 05:43:47 +0000 (05:43 +0000)]
Revert "r214832 - MachineCombiner Pass for selecting faster instruction"

It broke compiling of most Benchmark and internal test, as clang got
clashed by segmentation fault or assertion.

llvm-svn: 214845

10 years ago[FastISel][AArch64] Don't perform sign-/zero-extension for function arguments that...
Juergen Ributzka [Tue, 5 Aug 2014 05:43:44 +0000 (05:43 +0000)]
[FastISel][AArch64] Don't perform sign-/zero-extension for function arguments that have already been sign-/zero-extended.

llvm-svn: 214844

10 years agoProvide convenient access to the zext/sext attributes of function arguments. NFC.
Juergen Ributzka [Tue, 5 Aug 2014 05:43:41 +0000 (05:43 +0000)]
Provide convenient access to the zext/sext attributes of function arguments. NFC.

llvm-svn: 214843

10 years agoHave MachineFunction cache a pointer to the subtarget to make lookups
Eric Christopher [Tue, 5 Aug 2014 02:39:49 +0000 (02:39 +0000)]
Have MachineFunction cache a pointer to the subtarget to make lookups
shorter/easier and have the DAG use that to do the same lookup. This
can be used in the future for TargetMachine based caching lookups from
the MachineFunction easily.

Update the MIPS subtarget switching machinery to update this pointer
at the same time it runs.

llvm-svn: 214838

10 years agoIf you found a step through plan stop looking up the stack for a step out plan.
Jim Ingham [Tue, 5 Aug 2014 01:59:20 +0000 (01:59 +0000)]
If you found a step through plan stop looking up the stack for a step out plan.

llvm-svn: 214837

10 years agoAdd some useful logging to the step log.
Jim Ingham [Tue, 5 Aug 2014 01:58:14 +0000 (01:58 +0000)]
Add some useful logging to the step log.

llvm-svn: 214836

10 years ago[PECOFF] addDeadStripRoot is not thread-safe.
Rui Ueyama [Tue, 5 Aug 2014 01:44:43 +0000 (01:44 +0000)]
[PECOFF] addDeadStripRoot is not thread-safe.

llvm-svn: 214835

10 years agodit pointed out on IRC that '__i = _VSTD::next(__i)' was a very long-winded way of...
Marshall Clow [Tue, 5 Aug 2014 01:34:12 +0000 (01:34 +0000)]
dit pointed out on IRC that '__i = _VSTD::next(__i)' was a very long-winded way of writing '++__i'. Since I hate being thought of as long-winded (this checkin comment notwithstanding), I fixed it. No functionality change.

llvm-svn: 214834

10 years ago[UBSan] Allow to suppress reports from vptr checker for specified types.
Alexey Samsonov [Tue, 5 Aug 2014 01:24:22 +0000 (01:24 +0000)]
[UBSan] Allow to suppress reports from vptr checker for specified types.

Based on http://reviews.llvm.org/D4702 by Byoungyoung Lee!

llvm-svn: 214833

10 years agoMachineCombiner Pass for selecting faster instruction
Gerolf Hoflehner [Tue, 5 Aug 2014 01:16:13 +0000 (01:16 +0000)]
MachineCombiner Pass for selecting faster instruction
 sequence on AArch64

Re-commit of r214669 without changes to test cases
LLVM::CodeGen/AArch64/arm64-neon-mul-div.ll and
LLVM:: CodeGen/AArch64/dp-3source.ll
This resolves the reported compfails of the original commit.

llvm-svn: 214832

10 years ago[Sanitizer] Turn SuppressionContext::Init() into InitIfNecessary().
Alexey Samsonov [Tue, 5 Aug 2014 00:43:23 +0000 (00:43 +0000)]
[Sanitizer] Turn SuppressionContext::Init() into InitIfNecessary().

Suppression context might be used in multiple sanitizers working
simultaneously (e.g. LSan and UBSan) and not knowing about each other.

llvm-svn: 214831

10 years agoReleaseNotes: add blurb about Windows support
Hans Wennborg [Tue, 5 Aug 2014 00:21:23 +0000 (00:21 +0000)]
ReleaseNotes: add blurb about Windows support

llvm-svn: 214830

10 years agoCodeGenObjCXX: Add a test for r214699
David Majnemer [Tue, 5 Aug 2014 00:01:15 +0000 (00:01 +0000)]
CodeGenObjCXX: Add a test for r214699

I forgot to add this with the changes for r214699.

llvm-svn: 214829

10 years agoMS ABI: Aligned tentative definitions don't have CommonLinkage
David Majnemer [Tue, 5 Aug 2014 00:01:13 +0000 (00:01 +0000)]
MS ABI: Aligned tentative definitions don't have CommonLinkage

int __declspec(align(16)) foo; is a tentative definition but the storage
for that variable should not have CommonLinkage.

llvm-svn: 214828

10 years agoAdd TCR register access
Joerg Sonnenberger [Mon, 4 Aug 2014 23:53:42 +0000 (23:53 +0000)]
Add TCR register access

llvm-svn: 214826

10 years agoAdd PPC 603's tlbld and tlbli instructions.
Joerg Sonnenberger [Mon, 4 Aug 2014 23:49:45 +0000 (23:49 +0000)]
Add PPC 603's tlbld and tlbli instructions.

llvm-svn: 214825

10 years ago[PECOFF] Fix /include option in .drectve section.
Rui Ueyama [Mon, 4 Aug 2014 23:48:57 +0000 (23:48 +0000)]
[PECOFF] Fix /include option in .drectve section.

/INCLUDE arguments passed as command line options are handled in the
same way as Unix -u. All option values are converted to an undefined
symbol and added to a dummy input file, so that the specified symbols
are resolved.

One tricky thing on Windows is that the option is also allowed to
appear in the object file's directive section. At the time when
it's being read, all (regular) command line options have already
been processed. We cannot add undefined atoms to the dummy file
anymore.

Previously, we added such /INCLUDE to a set that has already been
processed. As a result the options were ignored.

This patch fixes the issue. Now, /INCLUDE symbols in the directive
section are handled as real undefined symbol in the COFF file.
We create an undefined symbol for each /INCLUDE argument and add
it to the file being parsed.

llvm-svn: 214824

10 years agoTeach ProcessWindows plugin to support stdio i/o redirection.
Zachary Turner [Mon, 4 Aug 2014 23:31:21 +0000 (23:31 +0000)]
Teach ProcessWindows plugin to support stdio i/o redirection.

llvm-svn: 214816

10 years agoAllow CP10/CP11 operations on ARMv5/v6
Renato Golin [Mon, 4 Aug 2014 23:21:56 +0000 (23:21 +0000)]
Allow CP10/CP11 operations on ARMv5/v6

Those registers are VFP/NEON and vector instructions should be used instead,
but old cores rely on those co-processors to enable VFP unwinding. This change
was prompted by the libc++abi's unwinding routine and is also present in many
legacy low-level bare-metal code that we ought to compile/assemble.

Fixing bug PR20025 and allowing PR20529 to proceed with a fix in libc++abi.

llvm-svn: 214802

10 years ago[PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi
Bill Schmidt [Mon, 4 Aug 2014 23:21:26 +0000 (23:21 +0000)]
[PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi

My original LE implementation of the vsldoi instruction, with its
altivec.h interfaces vec_sld and vec_vsldoi, produces incorrect
shufflevector operations in the LLVM IR.  Correct code is generated
because the back end handles the incorrect shufflevector in a
consistent manner.

This patch and a companion patch for LLVM correct this problem by
removing the fixup from altivec.h and the corresponding fixup from the
PowerPC back end.  Several test cases are also modified to reflect the
now-correct LLVM IR.

The vec_sums and vec_vsumsws interfaces in altivec.h are also fixed,
because they used vec_perm calls intended to be recognized as vsldoi
instructions.  These vec_perm calls are now replaced with code that
more clearly shows the intent of the transformation.

llvm-svn: 214801

10 years ago[PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi
Bill Schmidt [Mon, 4 Aug 2014 23:21:01 +0000 (23:21 +0000)]
[PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi

My original LE implementation of the vsldoi instruction, with its
altivec.h interfaces vec_sld and vec_vsldoi, produces incorrect
shufflevector operations in the LLVM IR.  Correct code is generated
because the back end handles the incorrect shufflevector in a
consistent manner.

This patch and a companion patch for Clang correct this problem by
removing the fixup from altivec.h and the corresponding fixup from the
PowerPC back end.  Several test cases are also modified to reflect the
now-correct LLVM IR.

llvm-svn: 214800

10 years agoEnable Darwin vararg parameters support in assembler macros.
Kevin Enderby [Mon, 4 Aug 2014 23:14:37 +0000 (23:14 +0000)]
Enable Darwin vararg parameters support in assembler macros.

Duplicate the vararg tests for linux and add a tests which mixed
vararg arguments with darwin positional parameters.

Patch by: Janne Grunau <j@jannau.net>

llvm-svn: 214799

10 years agoChanged the liveness tracking in the RegisterScavenger
Pedro Artigas [Mon, 4 Aug 2014 23:07:49 +0000 (23:07 +0000)]
Changed the liveness tracking in the RegisterScavenger
to use register units instead of registers.

reviewed by Jakob Stoklund Olesen.

llvm-svn: 214798

10 years agoAdd simplified aliases for access to DCCR, ICCR, DEAR and ESR
Joerg Sonnenberger [Mon, 4 Aug 2014 22:56:42 +0000 (22:56 +0000)]
Add simplified aliases for access to DCCR, ICCR, DEAR and ESR

llvm-svn: 214797

10 years agoThreadSafety.cpp: Prune bogus \param(s). [-Wdocumentation]
NAKAMURA Takumi [Mon, 4 Aug 2014 22:48:46 +0000 (22:48 +0000)]
ThreadSafety.cpp: Prune bogus \param(s). [-Wdocumentation]

llvm-svn: 214796

10 years agoThreadSafetyAnalysis: Fix annotations in class members. [-Wdocumentation]
NAKAMURA Takumi [Mon, 4 Aug 2014 22:48:36 +0000 (22:48 +0000)]
ThreadSafetyAnalysis: Fix annotations in class members. [-Wdocumentation]

llvm-svn: 214795

10 years agoclang/test/Sema/struct-packed-align.c: Add the case in MS mode that alignment doesn...
NAKAMURA Takumi [Mon, 4 Aug 2014 22:48:19 +0000 (22:48 +0000)]
clang/test/Sema/struct-packed-align.c: Add the case in MS mode that alignment doesn't affect packing.

Also, revert a couple of suppressions.
  r214298, "Suppress clang/test/Sema/struct-packed-align.c for targeting LLP64."
  r214301, "Suppress clang/test/Sema/struct-packed-align.c also on msvc for investigating."

llvm-svn: 214794

10 years agoTrailing linefeed.
NAKAMURA Takumi [Mon, 4 Aug 2014 22:48:09 +0000 (22:48 +0000)]
Trailing linefeed.

llvm-svn: 214793

10 years agoRemove separator parameter from static local naming code
Reid Kleckner [Mon, 4 Aug 2014 22:35:30 +0000 (22:35 +0000)]
Remove separator parameter from static local naming code

It was always set to ".", which was duplicated in a few places.

llvm-svn: 214792

10 years ago[PECOFF] Remove unused paraemter.
Rui Ueyama [Mon, 4 Aug 2014 22:19:53 +0000 (22:19 +0000)]
[PECOFF] Remove unused paraemter.

llvm-svn: 214791

10 years agoFix SmallDenseMap assignment operator.
Andrew Trick [Mon, 4 Aug 2014 22:18:25 +0000 (22:18 +0000)]
Fix SmallDenseMap assignment operator.

Self assignment would lead to buckets of garbage, causing quadratic probing to hang.

llvm-svn: 214790

10 years agoThread Safety Analysis: add a -Wthread-safety-negative flag that warns whenever
DeLesley Hutchins [Mon, 4 Aug 2014 22:13:06 +0000 (22:13 +0000)]
Thread Safety Analysis: add a -Wthread-safety-negative flag that warns whenever
a mutex is acquired, but corresponding mutex is not provably not-held.  This
is based on the earlier negative requirements patch.

llvm-svn: 214789

10 years ago[FastISel][AArch64] Fix shift lowering for i8 and i16 value types.
Juergen Ributzka [Mon, 4 Aug 2014 21:49:51 +0000 (21:49 +0000)]
[FastISel][AArch64] Fix shift lowering for i8 and i16 value types.

This fix changes the parameters #r and #s that are passed to the UBFM/SBFM
instruction to get the zero/sign-extension for free.

The original problem was that the shift left would use the 32-bit shift even for
i8/i16 value types, which could leave the upper bits set with "garbage" values.

The arithmetic shift right on the other side would use the wrong MSB as sign-bit
to determine what bits to shift into the value.

This fixes <rdar://problem/17907720>.

llvm-svn: 214788

10 years agoIR: Fix up doxygen comment for LLVMContext::diagnose
Justin Bogner [Mon, 4 Aug 2014 21:49:15 +0000 (21:49 +0000)]
IR: Fix up doxygen comment for LLVMContext::diagnose

This comment was referring to the DiagnosticSeverity with RS_
prefixes, but they're actually DS_. I've also modernized the comment
style since I was changing it anyway.

llvm-svn: 214787

10 years agoUpdate for LLVM API change.
Eric Christopher [Mon, 4 Aug 2014 21:33:42 +0000 (21:33 +0000)]
Update for LLVM API change.

llvm-svn: 214786

10 years ago[SDAG] Fix a really, really terrible bug in the DAG combiner.
Chandler Carruth [Mon, 4 Aug 2014 21:29:59 +0000 (21:29 +0000)]
[SDAG] Fix a really, really terrible bug in the DAG combiner.

This code is completely wrong. It is also dead, as if it were to *ever*
run, it would crash. Fortunately, after my work to the combiner, it is
at least *possible* to reach the code, and llvm-stress has found a test
case. Thanks to Patrick for reporting.

It would be really good if anyone who remembers how this code works and
what it was intended to do could add some more obvious test coverage
instead of my completely contrived and reduced test case. My test case
was so brittle I left a bread crumb comment in it to help the next
person to stumble on it and not know what it was actually testing for.

llvm-svn: 214785

10 years agotlbre / tlbwe / tlbsx / tlbsx. variants for the PPC 4xx CPUs.
Joerg Sonnenberger [Mon, 4 Aug 2014 21:28:22 +0000 (21:28 +0000)]
tlbre / tlbwe / tlbsx / tlbsx. variants for the PPC 4xx CPUs.

llvm-svn: 214784

10 years agoAdd code to AssemblyParse_x86::get_non_call_site_unwind_plan
Jason Molenda [Mon, 4 Aug 2014 21:26:55 +0000 (21:26 +0000)]
Add code to AssemblyParse_x86::get_non_call_site_unwind_plan
to recognize an epilogue that ends with a jmp to
objc_retainAutoreleaseReturnValue instead of a ret instruction.
<rdar://problem/17889928>

llvm-svn: 214783

10 years agoReorder to keep data and routines separate and to keep a couple of
Eric Christopher [Mon, 4 Aug 2014 21:25:44 +0000 (21:25 +0000)]
Reorder to keep data and routines separate and to keep a couple of
similar routines close to each other.

llvm-svn: 214782

10 years agoRemove the TargetMachine forwards for TargetSubtargetInfo based
Eric Christopher [Mon, 4 Aug 2014 21:25:23 +0000 (21:25 +0000)]
Remove the TargetMachine forwards for TargetSubtargetInfo based
information and update all callers. No functional change.

llvm-svn: 214781

10 years agoReimplement the temporary non-const getSubtargetImpl routine so
Eric Christopher [Mon, 4 Aug 2014 21:24:07 +0000 (21:24 +0000)]
Reimplement the temporary non-const getSubtargetImpl routine so
that we can avoid implementing it on every target. Thanks to Richard
Smith for the suggestions!

llvm-svn: 214780

10 years ago[AArch64] Extend the number of scalar instructions supported in the AdvSIMD
Chad Rosier [Mon, 4 Aug 2014 21:20:25 +0000 (21:20 +0000)]
[AArch64] Extend the number of scalar instructions supported in the AdvSIMD
scalar integer instruction pass.

This is a patch I had lying around from a few months ago.  The pass is
currently disabled by default, so nothing to interesting.

llvm-svn: 214779

10 years agoUsersManual: update clang-cl options
Hans Wennborg [Mon, 4 Aug 2014 21:07:58 +0000 (21:07 +0000)]
UsersManual: update clang-cl options

llvm-svn: 214777

10 years agoMC uses .lcomm now, so adjust.
Joerg Sonnenberger [Mon, 4 Aug 2014 21:06:00 +0000 (21:06 +0000)]
MC uses .lcomm now, so adjust.

llvm-svn: 214776

10 years agoFix failure to invoke exception handler on Win64
Reid Kleckner [Mon, 4 Aug 2014 21:05:27 +0000 (21:05 +0000)]
Fix failure to invoke exception handler on Win64

When the last instruction prior to a function epilogue is a call, we
need to emit a nop so that the return address is not in the epilogue IP
range.  This is consistent with MSVC's behavior, and may be a workaround
for a bug in the Win64 unwinder.

Differential Revision: http://reviews.llvm.org/D4751

Patch by Vadim Chugunov!

llvm-svn: 214775

10 years agoDon't drop dllimport from qualified friend redeclarations (PR20512)
Hans Wennborg [Mon, 4 Aug 2014 20:54:39 +0000 (20:54 +0000)]
Don't drop dllimport from qualified friend redeclarations (PR20512)

This matches MSVC's logic, which seems to be that when the friend
declaration is qualified, it cannot be a declaration of a new symbol
and so the dll linkage doesn't change.

Differential Revision: http://reviews.llvm.org/D4764

llvm-svn: 214774

10 years agoNit picky const-correctness with auto. No functional changes.
Aaron Ballman [Mon, 4 Aug 2014 20:49:47 +0000 (20:49 +0000)]
Nit picky const-correctness with auto. No functional changes.

llvm-svn: 214773

10 years agoCorrect the emission kind constants committed in r214771
David Blaikie [Mon, 4 Aug 2014 20:36:00 +0000 (20:36 +0000)]
Correct the emission kind constants committed in r214771

llvm-svn: 214772

10 years agoDocument the "emission kind" field of the DICompileUnit in LLVM's Source Level Debugg...
David Blaikie [Mon, 4 Aug 2014 20:32:48 +0000 (20:32 +0000)]
Document the "emission kind" field of the DICompileUnit in LLVM's Source Level Debugging metadata.

llvm-svn: 214771

10 years agoA static_assert declaration cannot be a template; adding the diagnostic for this...
Aaron Ballman [Mon, 4 Aug 2014 20:28:35 +0000 (20:28 +0000)]
A static_assert declaration cannot be a template; adding the diagnostic for this instead of silently accepting and producing possibly-unexpected behavior.

llvm-svn: 214770

10 years agoRecognize mftbl as alias for mftb, for symmetry with mttb.
Joerg Sonnenberger [Mon, 4 Aug 2014 20:28:34 +0000 (20:28 +0000)]
Recognize mftbl as alias for mftb, for symmetry with mttb.

llvm-svn: 214769

10 years agoFix typo.
Dan Albert [Mon, 4 Aug 2014 20:27:45 +0000 (20:27 +0000)]
Fix typo.

llvm-svn: 214768

10 years agoAdd a sentence that all entries should include an email address.
Joerg Sonnenberger [Mon, 4 Aug 2014 19:33:25 +0000 (19:33 +0000)]
Add a sentence that all entries should include an email address.
Add one for Greg Clayton, Peter Collingbourne, Tobias Grosser and
Jakob Olesen based on recent commits.

llvm-svn: 214762

10 years agoReapply "DebugInfo: Ensure that all debug location scope chains from instructions...
David Blaikie [Mon, 4 Aug 2014 19:30:08 +0000 (19:30 +0000)]
Reapply "DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself."

Originally reverted in r213432 with flakey failures on an ASan self-host
build. After reduction it seems to be the same issue fixed in r213805
(ArgPromo + DebugInfo: Handle updating debug info over multiple
applications of argument promotion) and r213952 (by having
LiveDebugVariables strip dbg_value intrinsics in functions that are not
described by debug info). Though I cannot explain why this failure was
flakey...

llvm-svn: 214761

10 years agoFix a problem with reference_wrapper in C++03 that was causing counting predicates...
Marshall Clow [Mon, 4 Aug 2014 19:20:17 +0000 (19:20 +0000)]
Fix a problem with reference_wrapper in C++03 that was causing counting predicates to fail. Add a test to make sure it works. However, most of the reference_wrapper tests still fail in C++03 mode, due to a lack of decltype. No change there.

llvm-svn: 214760

10 years agoRevert r214757 (Same fix as r214758)
Alex Lorenz [Mon, 4 Aug 2014 19:04:38 +0000 (19:04 +0000)]
Revert r214757 (Same fix as r214758)

llvm-svn: 214759

10 years agoAdd CoverageMappingGen.cpp (introduced in r214752) to CMakeLists.txt
David Blaikie [Mon, 4 Aug 2014 18:59:39 +0000 (18:59 +0000)]
Add CoverageMappingGen.cpp (introduced in r214752) to CMakeLists.txt

llvm-svn: 214758

10 years agoadd lib/CodeGen/CoverageMappingGen.cpp to CMake
Alex Lorenz [Mon, 4 Aug 2014 18:55:53 +0000 (18:55 +0000)]
add lib/CodeGen/CoverageMappingGen.cpp to CMake

llvm-svn: 214757

10 years agoR600/SI: Fix definitions for ds_read2 / ds_write2 instructions.
Matt Arsenault [Mon, 4 Aug 2014 18:49:22 +0000 (18:49 +0000)]
R600/SI: Fix definitions for ds_read2 / ds_write2 instructions.

These were just wrong, using the wrong register classes
and store2 was missing an operand.

llvm-svn: 214756

10 years agoRename PPCLinuxMCAsmInfo to PPCELFMCAsmInfo to better reflect the
Joerg Sonnenberger [Mon, 4 Aug 2014 18:46:13 +0000 (18:46 +0000)]
Rename PPCLinuxMCAsmInfo to PPCELFMCAsmInfo to better reflect the
systems it represents.

llvm-svn: 214755

10 years agoAllow .lcomm with alignment on ELF targets.
Joerg Sonnenberger [Mon, 4 Aug 2014 18:45:10 +0000 (18:45 +0000)]
Allow .lcomm with alignment on ELF targets.

llvm-svn: 214754

10 years agoAdd locales to available_features for tests.
Dan Albert [Mon, 4 Aug 2014 18:44:48 +0000 (18:44 +0000)]
Add locales to available_features for tests.

Linux has a lot of failures caused by not having support for certain
locales. Since these come out as a lot of noise in the test results,
have lit.cfg detect the presence of the various locales used in the
tests and add them to config.available_features as locale.LOCALE_NAME.

This patch also adds REQUIRES: locale.REQUIRED_LOCALE to every test that
I saw failing in this manner. We probably need to add more for all the
tests requiring en_US.UTF-8, but we can do that on an as-needed basis.

One thing that concerns me is how many tests get skipped because of
missing locales (especially in regex/). We should make a point of
splitting up any tests that test default behavior _and_ behavior under a
given locale so that we aren't losing coverage for default behavior.

llvm-svn: 214753

10 years agoAdd coverage mapping generation.
Alex Lorenz [Mon, 4 Aug 2014 18:41:51 +0000 (18:41 +0000)]
Add coverage mapping generation.

This patch adds the '-fcoverage-mapping' option which
allows clang to generate the coverage mapping information
that can be used to provide code coverage analysis using
the execution counts obtained from the instrumentation
based profiling (-fprofile-instr-generate).

llvm-svn: 214752

10 years agoCoverage: add HasCodeBefore flag to a mapping region.
Alex Lorenz [Mon, 4 Aug 2014 18:00:51 +0000 (18:00 +0000)]
Coverage: add HasCodeBefore flag to a mapping region.

This flag will be used by the coverage tool to help
compute the execution counts for each line in a source file.

Differential Revision: http://reviews.llvm.org/D4746

llvm-svn: 214740

10 years agoRemoving some extraneous spaces; no functional changes intended.
Aaron Ballman [Mon, 4 Aug 2014 17:49:55 +0000 (17:49 +0000)]
Removing some extraneous spaces; no functional changes intended.

llvm-svn: 214739

10 years agoMove the R600 intrinsic support back to the target machine - there's
Eric Christopher [Mon, 4 Aug 2014 17:37:43 +0000 (17:37 +0000)]
Move the R600 intrinsic support back to the target machine - there's
nothing subtarget dependent about the intrinsic support in any
backend as far as I can tell.

llvm-svn: 214738

10 years agoPath: Stop claiming path::const_iterator is bidirectional
Justin Bogner [Mon, 4 Aug 2014 17:36:41 +0000 (17:36 +0000)]
Path: Stop claiming path::const_iterator is bidirectional

path::const_iterator claims that it's a bidirectional iterator, but it
doesn't satisfy all of the contracts for a bidirectional iterator.
For example, n3376 24.2.5 p6 says "If a and b are both dereferenceable,
then a == b if and only if *a and *b are bound to the same object",
but this doesn't work with how we stash and recreate Components.

This means that our use of reverse_iterator on this type is invalid
and leads to many of the valgrind errors we're hitting, as explained
by Tilmann Scheller here:

    http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140728/228654.html

Instead, we admit that path::const_iterator is only an input_iterator,
and implement a second input_iterator for path::reverse_iterator (by
changing const_iterator::operator-- to reverse_iterator::operator++).
All of the uses of this just traverse once over the path in one
direction or the other anyway.

llvm-svn: 214737

10 years agoFix PR#202520 - predicate called too many times in list::remove_if. Add tests for...
Marshall Clow [Mon, 4 Aug 2014 17:32:25 +0000 (17:32 +0000)]
Fix PR#202520 - predicate called too many times in list::remove_if. Add tests for list, forward_list, and the std::remove_if algorithm

llvm-svn: 214736

10 years agoFix crash when accessing a property of an invalid interface
Olivier Goffart [Mon, 4 Aug 2014 17:28:11 +0000 (17:28 +0000)]
Fix crash when accessing a property of an invalid interface

llvm-svn: 214735

10 years agoFix crash when assiging to a property with an invalid type
Olivier Goffart [Mon, 4 Aug 2014 17:28:05 +0000 (17:28 +0000)]
Fix crash when assiging to a property with an invalid type

This is a regression from clang 3.4

Set the result to ExprError and returns true, rather than simply
returns false because errors have been reported already and returning
false show a confusing error

llvm-svn: 214734

10 years agoRefactor SPRG instructions.
Joerg Sonnenberger [Mon, 4 Aug 2014 17:26:15 +0000 (17:26 +0000)]
Refactor SPRG instructions.

llvm-svn: 214733

10 years ago[X86] Place parentheses around "isMask_32(STReturns) && N <= 2".
Akira Hatanaka [Mon, 4 Aug 2014 17:23:38 +0000 (17:23 +0000)]
[X86] Place parentheses around "isMask_32(STReturns) && N <= 2".

This corrects r214672, which was committed to silence a gcc warning.

llvm-svn: 214732

10 years agoAdd support for m[ft][di]bat[ul] instructions.
Joerg Sonnenberger [Mon, 4 Aug 2014 17:07:41 +0000 (17:07 +0000)]
Add support for m[ft][di]bat[ul] instructions.

llvm-svn: 214731

10 years agoDiagnose GNU-style attributes preceding virt-specifiers, but only when the attribute...
Aaron Ballman [Mon, 4 Aug 2014 17:03:51 +0000 (17:03 +0000)]
Diagnose GNU-style attributes preceding virt-specifiers, but only when the attribute is known to GCC. Clang accepts attributes in this position, but
GCC does not, so this is a GCC-compat warning. If the attribute is not known to GCC, then the diagnostic is suppressed.

llvm-svn: 214730

10 years agoUse the known address space constant rather than checking it
Matt Arsenault [Mon, 4 Aug 2014 16:55:35 +0000 (16:55 +0000)]
Use the known address space constant rather than checking it

llvm-svn: 214729

10 years agoR600: Remove unused include
Matt Arsenault [Mon, 4 Aug 2014 16:55:33 +0000 (16:55 +0000)]
R600: Remove unused include

llvm-svn: 214728

10 years agoAdd a dummy subtarget to the CPP backend target machine. This will
Eric Christopher [Mon, 4 Aug 2014 16:40:55 +0000 (16:40 +0000)]
Add a dummy subtarget to the CPP backend target machine. This will
allow us to forward all of the standard TargetMachine calls to the
subtarget and still return null as we were before.

llvm-svn: 214727

10 years agoObey LLVM_LIBDIR_SUFFIX.
Dan Albert [Mon, 4 Aug 2014 16:13:32 +0000 (16:13 +0000)]
Obey LLVM_LIBDIR_SUFFIX.

llvm-svn: 214726

10 years agoThread safety analysis: Add support for negative requirements, which are
DeLesley Hutchins [Mon, 4 Aug 2014 16:10:59 +0000 (16:10 +0000)]
Thread safety analysis:  Add support for negative requirements, which are
capability expressions of the form !expr, and denote a capability that must
not be held.

llvm-svn: 214725

10 years agoAdd features for PPC 4xx and e500/e500mc instructions.
Joerg Sonnenberger [Mon, 4 Aug 2014 15:47:38 +0000 (15:47 +0000)]
Add features for PPC 4xx and e500/e500mc instructions.
Move the test cases for them into separate files.

llvm-svn: 214724

10 years agoHighlight the offending function parameter when the format argument refers to an...
Aaron Ballman [Mon, 4 Aug 2014 15:26:33 +0000 (15:26 +0000)]
Highlight the offending function parameter when the format argument refers to an invalid function parameter type.

llvm-svn: 214723

10 years agoHighlight the offending function parameter when the format_arg argument refers to...
Aaron Ballman [Mon, 4 Aug 2014 15:17:29 +0000 (15:17 +0000)]
Highlight the offending function parameter when the format_arg argument refers to an invalid function parameter type.

llvm-svn: 214722

10 years ago[PowerPC] Add target triple to vec_urem_const.ll test case
Ulrich Weigand [Mon, 4 Aug 2014 14:55:26 +0000 (14:55 +0000)]
[PowerPC] Add target triple to vec_urem_const.ll test case

This should hopefully fix build bots on other architectures.

llvm-svn: 214721

10 years agoclang-format: Understand parameter pack initialization.
Daniel Jasper [Mon, 4 Aug 2014 14:51:02 +0000 (14:51 +0000)]
clang-format: Understand parameter pack initialization.

Before:
  Constructor(A... a) : a_(X<A> { std::forward<A>(a) }...) {}

After:
  Constructor(A... a) : a_(X<A>{std::forward<A>(a)}...) {}

llvm-svn: 214720

10 years ago[SKX] Enabling load/store instructions: encoding
Robert Khasanov [Mon, 4 Aug 2014 14:35:15 +0000 (14:35 +0000)]
[SKX] Enabling load/store instructions: encoding
Instructions: VMOVAPD, VMOVAPS, VMOVDQA8, VMOVDQA16, VMOVDQA32,VMOVDQA64, VMOVDQU8, VMOVDQU16, VMOVDQU32,VMOVDQU64, VMOVUPD, VMOVUPS,

Reviewed by Elena Demikhovsky <elena.demikhovsky@intel.com>

llvm-svn: 214719

10 years ago[PowerPC] Swap arguments to vpkuhum/vpkuwum on little-endian
Ulrich Weigand [Mon, 4 Aug 2014 13:53:40 +0000 (13:53 +0000)]
[PowerPC] Swap arguments to vpkuhum/vpkuwum on little-endian

In commit r213915, Bill fixed little-endian usage of vmrgh* and vmrgl*
by swapping the input arguments.  As it turns out, the exact same fix
is also required for the vpkuhum/vpkuwum patterns.

This fixes another regression in llvmpipe when vector support is
enabled.

Reviewed by Bill Schmidt.

llvm-svn: 214718

10 years agoImproving the name of the function parameter, which happens to solve two likely-less...
Aaron Ballman [Mon, 4 Aug 2014 13:51:27 +0000 (13:51 +0000)]
Improving the name of the function parameter, which happens to solve two likely-less-than-useful MSVC warnings: warning C4258: 'I' : definition from the for loop is ignored; the definition from the enclosing scope is used.

llvm-svn: 214717

10 years ago[PowerPC] MULHU/MULHS are not legal for vector types
Ulrich Weigand [Mon, 4 Aug 2014 13:27:12 +0000 (13:27 +0000)]
[PowerPC] MULHU/MULHS are not legal for vector types

I ran into some test failures where common code changed vector division
by constant into a multiply-high operation (MULHU).  But these are not
implemented by the back-end, so we failed to recognize the insn.

Fixed by marking MULHU/MULHS as Expand for vector types.

llvm-svn: 214716

10 years agoFixed accidental use of reserved identifier in r214709.
Daniel Sanders [Mon, 4 Aug 2014 13:27:03 +0000 (13:27 +0000)]
Fixed accidental use of reserved identifier in r214709.

llvm-svn: 214715

10 years ago[PowerPC] Fix and improve vector comparisons
Ulrich Weigand [Mon, 4 Aug 2014 13:13:57 +0000 (13:13 +0000)]
[PowerPC] Fix and improve vector comparisons

This patch refactors code generation of vector comparisons.

This fixes a wrong code-gen bug for ISD::SETGE for floating-point types,
and improves generated code for vector comparisons in general.

Specifically, the patch moves all logic deciding how to implement vector
comparisons into getVCmpInst, which gets two extra boolean outputs
indicating to its caller whether its needs to swap the input operands
and/or negate the result of the comparison.  Apart from implementing
these two modifications as directed by getVCmpInst, there is no need
to ever implement vector comparisons in any other manner; in particular,
there is never a need to perform two separate comparisons (e.g. one for
equal and one for greater-than, as code used to do before this patch).

Reviewed by Bill Schmidt.

llvm-svn: 214714

10 years ago[asan] poison array cookies only on 64-bit arch
Kostya Serebryany [Mon, 4 Aug 2014 12:59:45 +0000 (12:59 +0000)]
[asan] poison array cookies only on 64-bit arch

llvm-svn: 214713

10 years ago[Driver][Mips] Construct dynamic linker path by string concatination.
Simon Atanasyan [Mon, 4 Aug 2014 12:57:52 +0000 (12:57 +0000)]
[Driver][Mips] Construct dynamic linker path by string concatination.
That reduces a number of `if` operators and prevent a combinatorics explosion
if/when more dynamic linker path variants added.

No functional changes.

llvm-svn: 214712

10 years ago[asan] introduce __asan_poison_cxx_array_cookie. This is asan-rt part of PR19838...
Kostya Serebryany [Mon, 4 Aug 2014 12:43:13 +0000 (12:43 +0000)]
[asan] introduce __asan_poison_cxx_array_cookie. This is asan-rt part of PR19838 (Left OOB accesses on new[]-allocated arrays with array cookies are not detected). No tests yet. They will follow once I commit the clang part.

llvm-svn: 214711

10 years ago[x32] Add __int128 support
Pavel Chupin [Mon, 4 Aug 2014 12:39:43 +0000 (12:39 +0000)]
[x32] Add __int128 support

Summary:
Adding __int128 support explicitly for x86_64 because currently it's on
only when pointer size >= 64 which is not the case for x32.

Test Plan: One of the tests using __int128 is updated

Reviewers: atanasyan, chandlerc

Subscribers: cfe-commits, rob.khasanov, zinovy.nis, dschuff

Differential Revision: http://reviews.llvm.org/D4755

llvm-svn: 214710

10 years ago[mips] Add assembler support for '.set mipsX'.
Daniel Sanders [Mon, 4 Aug 2014 12:20:00 +0000 (12:20 +0000)]
[mips] Add assembler support for '.set mipsX'.

Summary:
This patch also fixes an issue with the way the Mips assembler enables/disables architecture
features. Before this patch, the assembler never disabled feature bits. For example,
.set mips64
.set mips32r2

would result in the 'OR' of mips64 with mips32r2 feature bits which isn't right.
Unfortunately this isn't trivial to fix because there's not an easy way to clear
feature bits as the algorithm in MCSubtargetInfo (ToggleFeature) only clears the bits
that imply the feature being cleared and not the implied bits by the feature (there's a
better explanation to the code I added).

Patch by Matheus Almeida and updated by Toma Tabacu

Reviewers: vmedic, matheusalmeida, dsanders

Reviewed By: dsanders

Subscribers: tomatabacu, llvm-commits

Differential Revision: http://reviews.llvm.org/D4123

llvm-svn: 214709

10 years agoTargetInstrInfo::genAlternativeCodeSequence(): Fix a couple of \param(s). [-Wdocument...
NAKAMURA Takumi [Mon, 4 Aug 2014 10:23:22 +0000 (10:23 +0000)]
TargetInstrInfo::genAlternativeCodeSequence(): Fix a couple of \param(s). [-Wdocumentation]

llvm-svn: 214708

10 years ago[x86] Just unilaterally prefer SSSE3-style PSHUFB lowerings over clever
Chandler Carruth [Mon, 4 Aug 2014 10:17:35 +0000 (10:17 +0000)]
[x86] Just unilaterally prefer SSSE3-style PSHUFB lowerings over clever
use of PACKUS. It's cleaner that way.

I looked at implementing clever combine-based folding of PACKUS chains
into PSHUFB but it is quite hard and doesn't seem likely to be worth it.
The most annoying part would be detecting that the correct masking had
been done to use PACKUS-style instructions as a blend operation rather
than there being any saturating as is indicated by its name. We generate
really nice code for what few test cases I've come up with that aren't
completely contrived for this by just directly prefering PSHUFB and so
let's go with that strategy for now. =]

llvm-svn: 214707

10 years agoFix tests Clang::Sema/statements.c and Clang::SemaTemplate/instantiate-expr-1.cpp...
Keith Walker [Mon, 4 Aug 2014 10:13:09 +0000 (10:13 +0000)]
Fix tests Clang::Sema/statements.c and Clang::SemaTemplate/instantiate-expr-1.cpp when AArch64 is the default target.

Commit r213935 added additional validation of register constants/size for AArch64 and because these tests which contain Intel assembler the new validation caused these tests to fail when the default target is changed to an AArch64 target.

llvm-svn: 214706

10 years ago[clang-tidy] Rewrite a for-range loop in the old style.
Benjamin Kramer [Mon, 4 Aug 2014 10:11:47 +0000 (10:11 +0000)]
[clang-tidy] Rewrite a for-range loop in the old style.

Haven't thought that I ever needed to do this, but in this case comparing the
index using pointer arithmetic turns out to be really ugly. It also generates
nasty sign-compare warnings on 32 bit targets.

llvm-svn: 214705

10 years ago[asan] intercept sized operator delete[]
Kostya Serebryany [Mon, 4 Aug 2014 10:10:50 +0000 (10:10 +0000)]
[asan] intercept sized operator delete[]

llvm-svn: 214704