platform/upstream/llvm.git
10 years agoRemove use of uniform initialization ({}) introduced in r212725 since this isn't...
David Blaikie [Thu, 10 Jul 2014 18:46:15 +0000 (18:46 +0000)]
Remove use of uniform initialization ({}) introduced in r212725 since this isn't supported in MSVC.

llvm-svn: 212754

10 years agoAvoid definining more GCC specific predefined macros in clang-cl
Ehsan Akhgari [Thu, 10 Jul 2014 18:44:24 +0000 (18:44 +0000)]
Avoid definining more GCC specific predefined macros in clang-cl

Reviewers: hansw, rnk

Subscribers: cfe-commits

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

llvm-svn: 212753

10 years agoQuick (attempted) fix for non-asserts builds for a test introduced in r212743.
David Blaikie [Thu, 10 Jul 2014 18:40:54 +0000 (18:40 +0000)]
Quick (attempted) fix for non-asserts builds for a test introduced in r212743.

llvm-svn: 212752

10 years ago[Driver/Unittests] Follow up for r212666, add unit test for the newly exposed getARMC...
Argyrios Kyrtzidis [Thu, 10 Jul 2014 18:38:38 +0000 (18:38 +0000)]
[Driver/Unittests] Follow up for r212666, add unit test for the newly exposed getARMCPUForMArch() function.

llvm-svn: 212751

10 years agoRevert "Revert r212640, "Add trunc (select c, a, b) -> select c (trunc a), (trunc...
Matt Arsenault [Thu, 10 Jul 2014 18:21:04 +0000 (18:21 +0000)]
Revert "Revert r212640, "Add trunc (select c, a, b) -> select c (trunc a), (trunc b) combine.""

Don't try to convert the select condition type.

llvm-svn: 212750

10 years ago[TSan] Fix a bug in libcxx-tsan build conditions spotted by Ryuta Suzuki
Alexey Samsonov [Thu, 10 Jul 2014 18:17:51 +0000 (18:17 +0000)]
[TSan] Fix a bug in libcxx-tsan build conditions spotted by Ryuta Suzuki

llvm-svn: 212749

10 years ago[DAG] Further improve the logic in DAGCombiner that folds a pair of shuffles into...
Andrea Di Biagio [Thu, 10 Jul 2014 18:04:55 +0000 (18:04 +0000)]
[DAG] Further improve the logic in DAGCombiner that folds a pair of shuffles into a single shuffle if the resulting mask is legal.

This patch teaches the DAGCombiner how to fold shuffles according to the
following new rules:
  1. shuffle(shuffle(x, y), undef) -> x
  2. shuffle(shuffle(x, y), undef) -> y
  3. shuffle(shuffle(x, y), undef) -> shuffle(x, undef)
  4. shuffle(shuffle(x, y), undef) -> shuffle(y, undef)

The backend avoids to combine shuffles according to rules 3. and 4. if
the resulting shuffle does not have a legal mask. This is to avoid introducing
illegal shuffles that are potentially expanded into a sub-optimal sequence of
target specific dag nodes during vector legalization.

Added test case combine-vec-shuffle-2.ll to verify that we correctly triggers
the new rules when combining shuffles.

llvm-svn: 212748

10 years ago[X86] Mark pseudo instruction TEST8ri_NOEREX as hasSIdeEffects=0.
Akira Hatanaka [Thu, 10 Jul 2014 18:00:53 +0000 (18:00 +0000)]
[X86] Mark pseudo instruction TEST8ri_NOEREX as hasSIdeEffects=0.

Also, add a case clause in X86InstrInfo::shouldScheduleAdjacent to enable
macro-fusion.

<rdar://problem/15680770>

llvm-svn: 212747

10 years agoAdd the CSR company and the Kalimba DSP processor to Triple.
Eric Christopher [Thu, 10 Jul 2014 17:26:54 +0000 (17:26 +0000)]
Add the CSR company and the Kalimba DSP processor to Triple.

Patch by Matthew Gardiner with fixes by me.

llvm-svn: 212745

10 years agoMake it possible for the Subtarget to change between function
Eric Christopher [Thu, 10 Jul 2014 17:26:51 +0000 (17:26 +0000)]
Make it possible for the Subtarget to change between function
passes in the mips back end. This, unfortunately, required a
bit of churn in the various predicates to use a pointer rather
than a reference.

llvm-svn: 212744

10 years ago[PowerPC] ABI support for aligned by-value aggregates
Ulrich Weigand [Thu, 10 Jul 2014 17:20:07 +0000 (17:20 +0000)]
[PowerPC] ABI support for aligned by-value aggregates

This patch adds support for respecting the ABI and type alignment
of aggregates passed by value.  Currently, all aggregates are aligned
at 8 bytes in the parameter save area.  This is incorrect for two
reasons:

- Aggregates that need alignment of 16 bytes or more should be aligned
  at 16 bytes in the parameter save area.  This is implemented by
  using an appropriate "byval align" attribute in the IR.

- Aggregates that need alignment beyond 16 bytes need to be dynamically
  realigned by the caller.  This is implemented by setting the Realign
  flag of the ABIArgInfo::getIndirect call.

In addition, when expanding a va_arg call accessing a type that is
aligned at 16 bytes in the argument save area (either one of the
aggregate types as above, or a vector type which is already aligned
at 16 bytes), code needs to align the va_list pointer accordingly.

Reviewed by Hal Finkel.

llvm-svn: 212743

10 years agoInstCombine: Fix a crash in Descale for multiply-by-zero
Duncan P. N. Exon Smith [Thu, 10 Jul 2014 17:13:27 +0000 (17:13 +0000)]
InstCombine: Fix a crash in Descale for multiply-by-zero

Fix a crash in `InstCombiner::Descale()` when a multiply-by-zero gets
created as an argument to a GEP partway through an iteration, causing
-instcombine to optimize the GEP before the multiply.

rdar://problem/17615671

llvm-svn: 212742

10 years agoProvide -verify support to match "any" line for diagnostics in included files.
Andy Gibbs [Thu, 10 Jul 2014 16:43:29 +0000 (16:43 +0000)]
Provide -verify support to match "any" line for diagnostics in included files.

Allow diagnostic checks that originate in included files to be matched without necessarily determining the line number that the diagnostic occurs on.  The new syntax replaces the line number with '*'.  This extension is limited to diagnostics in included files and may be used where the include file is not part of the test-suite itself.

Expected uses are for diagnostics originating in system headers, or for users who use -verify in testing 3rd-party library code where the location of diagnostics in header files may change from revision to revision and their precise location is not important to the success of the test-case.

llvm-svn: 212735

10 years ago[PowerPC] ABI support for non-Altivec vector types
Ulrich Weigand [Thu, 10 Jul 2014 16:39:01 +0000 (16:39 +0000)]
[PowerPC] ABI support for non-Altivec vector types

This patch adds support for passing arguments of non-Altivec vector type
(i.e. defined via attribute ((vector_size (...)))) on powerpc64-linux.

While such types are not mentioned in the formal ABI document, this
patch implements a calling convention compatible with GCC:

- Vectors of size < 16 bytes are passed in a GPR
- Vectors of size > 16 bytes are passed via reference

Note that vector types with a number of elements that is not a power
of 2 are not supported by GCC, so there is no pre-existing ABI to
follow.  We choose to pass those (of size < 16) as if widened to the
next power of two, so they might end up in a vector register or
in a GPR.  (Sizes > 16 are always passed via reference as well.)

Reviewed by Hal Finkel.

llvm-svn: 212734

10 years agoFix clang tests to be compliant with LLVM IR aliases
David Majnemer [Thu, 10 Jul 2014 16:26:19 +0000 (16:26 +0000)]
Fix clang tests to be compliant with LLVM IR aliases

Comdat IR references were mistakenly printed for aliases when they
passed through the IR/AsmWriter code.

This makes clang's tests not check for the existance of these wrongly
printed comdat references.

llvm-svn: 212733

10 years agoIR: Aliases don't belong to an explicit comdat
David Majnemer [Thu, 10 Jul 2014 16:26:10 +0000 (16:26 +0000)]
IR: Aliases don't belong to an explicit comdat

Aliases inherit their comdat from their aliasee, they don't have an
explicit comdat.

This fixes PR20279.

llvm-svn: 212732

10 years ago[analyzer] Check for code testing a variable for 0 after using it as a denominator.
Jordan Rose [Thu, 10 Jul 2014 16:10:52 +0000 (16:10 +0000)]
[analyzer] Check for code testing a variable for 0 after using it as a denominator.

This new checker, alpha.core.TestAfterDivZero, catches issues like this:

  int sum = ...
  int avg = sum / count; // potential division by zero...
  if (count == 0) { ... } // ...caught here

Because the analyzer does not necessarily explore /all/ paths through a program,
this check is restricted to only work on zero checks that immediately follow a
division operation (/ % /= %=). This could later be expanded to handle checks
dominated by a division operation but not necessarily in the same CFG block.

Patch by Anders Rönnholm! (with very minor modifications by me)

llvm-svn: 212731

10 years agoFeeding isSafeToSpeculativelyExecute its DataLayout pointer (in Sink)
Hal Finkel [Thu, 10 Jul 2014 16:07:11 +0000 (16:07 +0000)]
Feeding isSafeToSpeculativelyExecute its DataLayout pointer (in Sink)

This is the one remaining place I see where passing
isSafeToSpeculativelyExecute a DataLayout pointer might matter (at least for
loads) -- I think I got the others in r212720. Most of the other remaining
callers of isSafeToSpeculativelyExecute only use it for call sites (or
otherwise exclude loads).

llvm-svn: 212730

10 years agoMips: Silence a -Wcovered-switch-default
David Majnemer [Thu, 10 Jul 2014 16:04:04 +0000 (16:04 +0000)]
Mips: Silence a -Wcovered-switch-default

Remove a default label which covered no enumerators, replace it with a
llvm_unreachable.

No functionality changed.

llvm-svn: 212729

10 years ago[Codestyle][x32] Cosmetic codestyle fix.
Zinovy Nis [Thu, 10 Jul 2014 15:42:35 +0000 (15:42 +0000)]
[Codestyle][x32] Cosmetic codestyle fix.

llvm-svn: 212728

10 years agoSupport the built-in type-trait support in gcc 4.7 and later. Thanks to Albert Wong...
Marshall Clow [Thu, 10 Jul 2014 15:38:20 +0000 (15:38 +0000)]
Support the built-in type-trait support in gcc 4.7 and later. Thanks to Albert Wong for the patch.

llvm-svn: 212727

10 years ago[mips] Added FPXX modeless calling convention.
Zoran Jovanovic [Thu, 10 Jul 2014 15:36:12 +0000 (15:36 +0000)]
[mips] Added FPXX modeless calling convention.
Differential Revision: http://reviews.llvm.org/D4293

llvm-svn: 212726

10 years ago[x32] Adding X32 target support to driver, including TargetInfo,DescriptionString...
Zinovy Nis [Thu, 10 Jul 2014 15:27:19 +0000 (15:27 +0000)]
[x32] Adding X32 target support to driver, including TargetInfo,DescriptionString, flags, paths lookup, etc. Cover changes with new tests. The author of the patch is Pavel Chupin (@pavel.v.chupin).
The changes enable "hello world" on x32 target (x86_64-*-linux-gnux32). s/isX32/IsX32/ also fixed.

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

llvm-svn: 212725

10 years agoAdd support for BIONIC C library (Android). Patch from Dan Albert
Marshall Clow [Thu, 10 Jul 2014 15:20:28 +0000 (15:20 +0000)]
Add support for BIONIC C library (Android). Patch from Dan Albert

llvm-svn: 212724

10 years agoFix warning in test - missing exception specifier for overload of operator new
Marshall Clow [Thu, 10 Jul 2014 15:19:50 +0000 (15:19 +0000)]
Fix warning in test - missing exception specifier for overload of operator new

llvm-svn: 212723

10 years ago[AArch64] Add logical alias instructions to MC AsmParser
Arnaud A. de Grandmaison [Thu, 10 Jul 2014 15:12:26 +0000 (15:12 +0000)]
[AArch64] Add logical alias instructions to MC AsmParser

This patch teaches the AsmParser to accept some logical+immediate
instructions and convert them as shown:

  bic  Rd, Rn, #imm  ->  and Rd, Rn, #~imm
  bics Rd, Rn, #imm  ->  ands Rd, Rn, #~imm
  orn  Rd, Rn, #imm  ->  orr Rd, Rn, #~imm
  eon  Rd, Rn, #imm  ->  eor Rd, Rn, #~imm

Those instructions are an alternate syntax available to assembly coders,
and are needed in order to support code already compiling with some other
assemblers. For example, the bic construct is used by the linux kernel.

llvm-svn: 212722

10 years agoReapply typo fix.
Bruce Mitchener [Thu, 10 Jul 2014 14:45:57 +0000 (14:45 +0000)]
Reapply typo fix.

This was lost in the re-merging of command validation changes.

llvm-svn: 212721

10 years agoFeeding isSafeToSpeculativelyExecute its DataLayout pointer
Hal Finkel [Thu, 10 Jul 2014 14:41:31 +0000 (14:41 +0000)]
Feeding isSafeToSpeculativelyExecute its DataLayout pointer

isSafeToSpeculativelyExecute can optionally take a DataLayout pointer. In the
past, this was mainly used to make better decisions regarding divisions known
not to trap, and so was not all that important for users concerned with "cheap"
instructions. However, now it also helps look through bitcasts for
dereferencable loads, and will also be important if/when we add a
dereferencable pointer attribute.

This is some initial work to feed a DataLayout pointer through to callers of
isSafeToSpeculativelyExecute, generally where one was already available.

llvm-svn: 212720

10 years ago[mips][mips64r6] Add support for mips-img-linux-gnu GCC toolchains
Daniel Sanders [Thu, 10 Jul 2014 14:40:57 +0000 (14:40 +0000)]
[mips][mips64r6] Add support for mips-img-linux-gnu GCC toolchains

Summary:
* Support the multilib layout used by the mips-img-linux-gnu
* Recognize mips{,64}{,el}-img-linux-gnu as being aliases of mips-img-linux-gnu
* Use the correct dynamic linker for mips-img-linux-gnu
* Make mips32r6/mips64r6 the default CPU for mips-img-linux-gnu

Subscribers: mpf

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

llvm-svn: 212719

10 years agoAArch64: correctly fast-isel i8 & i16 multiplies
Tim Northover [Thu, 10 Jul 2014 14:18:46 +0000 (14:18 +0000)]
AArch64: correctly fast-isel i8 & i16 multiplies

We were asking for a register for type i8 or i16 which caused an assert.

rdar://problem/17620015

llvm-svn: 212718

10 years ago[mips] Add support for -modd-spreg/-mno-odd-spreg
Daniel Sanders [Thu, 10 Jul 2014 13:38:23 +0000 (13:38 +0000)]
[mips] Add support for -modd-spreg/-mno-odd-spreg

Summary:
When -mno-odd-spreg is in effect, 32-bit floating point values are not
permitted in odd FPU registers. The option also prohibits 32-bit and 64-bit
floating point comparison results from being written to odd registers.

This option has three purposes:
* It allows support for certain MIPS implementations such as loongson-3a that
  do not allow the use of odd registers for single precision arithmetic.
* When using -mfpxx, -mno-odd-spreg is the default and this allows us to
  statically check that code is compliant with the O32 FPXX ABI since mtc1/mfc1
  instructions to/from odd registers are guaranteed not to appear for any
  reason. Once this has been established, the user can then re-enable
  -modd-spreg to regain the use of all 32 single-precision registers.
* When using -mfp64 and -mno-odd-spreg together, an O32 extension named
  O32 FP64A is used as the ABI. This is intended to provide almost all
  functionality of an FR=1 processor but can also be executed on a FR=0 core
  with the assistance of a hardware compatibility mode which emulates FR=0
  behaviour on an FR=1 processor.

* Added '.module oddspreg' and '.module nooddspreg' each of which update
  the .MIPS.abiflags section appropriately
* Moved setFpABI() call inside emitDirectiveModuleFP() so that the caller
  doesn't have to remember to do it.
* MipsABIFlags now calculates the flags1 and flags2 member on demand rather
  than trying to maintain them in the same format they will be emitted in.

There is one portion of the -mfp64 and -mno-odd-spreg combination that is not
implemented yet. Moves to/from odd-numbered double-precision registers must not
use mtc1. I will fix this in a follow-up.

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

llvm-svn: 212717

10 years ago[x32] Add AsmBackend for X32 which uses ELF32 with x86_64 (the author is Pavel Chupin).
Zinovy Nis [Thu, 10 Jul 2014 13:03:26 +0000 (13:03 +0000)]
[x32] Add AsmBackend for X32 which uses ELF32 with x86_64 (the author is Pavel Chupin).

This is minimal change for backend required to have "hello world" compiled and working on x32 target (x86_64-linux-gnux32). More patches for x32 will follow.

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

llvm-svn: 212716

10 years ago[msan] Fix performance issue in fast_memset.
Evgeniy Stepanov [Thu, 10 Jul 2014 12:45:56 +0000 (12:45 +0000)]
[msan] Fix performance issue in fast_memset.

Fast path was never triggered when called from __msan_poison.

llvm-svn: 212715

10 years ago[x86,SDAG] Introduce any- and sign-extend-vector-inreg nodes analogous
Chandler Carruth [Thu, 10 Jul 2014 12:32:32 +0000 (12:32 +0000)]
[x86,SDAG] Introduce any- and sign-extend-vector-inreg nodes analogous
to the zero-extend-vector-inreg node introduced previously for the same
purpose: manage the type legalization of widened extend operations,
especially to support the experimental widening mode for x86.

I'm adding both because sign-extend is expanded in terms of any-extend
with shifts to propagate the sign bit. This removes the last
fundamental scalarization from vec_cast2.ll (a test case that hit many
really bad edge cases for widening legalization), although the trunc
tests in that file still appear scalarized because the the shuffle
legalization is scalarizing. Funny thing, I've been working on that.

Some initial experiments with this and SSE2 scenarios is showing
moderately good behavior already for sign extension. Still some work to
do on the shuffle combining on X86 before we're generating optimal
sequences, but avoiding scalarization is a huge step forward.

llvm-svn: 212714

10 years ago[mach-o]: support -Z option to skip standard library paths
Tim Northover [Thu, 10 Jul 2014 11:46:13 +0000 (11:46 +0000)]
[mach-o]: support -Z option to skip standard library paths

llvm-svn: 212713

10 years ago[mach-o]: support user-specified (-L) library search paths
Tim Northover [Thu, 10 Jul 2014 11:46:08 +0000 (11:46 +0000)]
[mach-o]: support user-specified (-L) library search paths

llvm-svn: 212712

10 years ago[SystemZ] Use SystemZCallingConv.td to define callee-saved registers
Richard Sandiford [Thu, 10 Jul 2014 11:44:37 +0000 (11:44 +0000)]
[SystemZ] Use SystemZCallingConv.td to define callee-saved registers

Just a clean-up.  No behavioral change intended.

llvm-svn: 212711

10 years agoSpecialCaseList.h: Fix -Wdocumentation with \code.
NAKAMURA Takumi [Thu, 10 Jul 2014 11:39:59 +0000 (11:39 +0000)]
SpecialCaseList.h: Fix -Wdocumentation with \code.

llvm-svn: 212710

10 years agollvm/test/CodeGen/X86/shift-parts.ll: FileCheck-ize. (from r212640)
NAKAMURA Takumi [Thu, 10 Jul 2014 11:37:39 +0000 (11:37 +0000)]
llvm/test/CodeGen/X86/shift-parts.ll: FileCheck-ize. (from r212640)

llvm-svn: 212709

10 years agoRevert r212640, "Add trunc (select c, a, b) -> select c (trunc a), (trunc b) combine."
NAKAMURA Takumi [Thu, 10 Jul 2014 11:37:28 +0000 (11:37 +0000)]
Revert r212640, "Add trunc (select c, a, b) -> select c (trunc a), (trunc b) combine."

This caused miscompilation on, at least, x86-64. SExt(i1 cond) confused other optimizations.

llvm-svn: 212708

10 years ago[SystemZ] Tweak instruction format classifications
Richard Sandiford [Thu, 10 Jul 2014 11:29:23 +0000 (11:29 +0000)]
[SystemZ] Tweak instruction format classifications

There's no real need to have Shift as a separate format type from Binary.
The comments for other format types were too specific and in some cases
no longer accurate.

Just a clean-up, no behavioral change intended.

llvm-svn: 212707

10 years ago[mach-o]: support -syslibroot and -l options
Tim Northover [Thu, 10 Jul 2014 11:21:06 +0000 (11:21 +0000)]
[mach-o]: support -syslibroot and -l options

These behave slightly idiosyncratically in the best of cases, and have
additional hacks layered on top of that for compatibility with badly behaved
build systems (via ld64).

For -lXYZ:
  + If XYZ is actually XY.o then search all library paths for XY.o
  + Otherwise search all library paths, first for libXYZ.dylib, then libXYZ.a
  + By default the library paths are /usr/lib and /usr/local/lib in that order.

For -syslibroot:
  + -syslibroot options apply to absolute paths in the search order.
  + All -syslibroot prefixes that exist are added to the search path *instead*
    of the original.
  + If no -syslibroot prefixed path exists, the original is kept.
  + Hacks^WExceptions:
      + If only 1 -syslibroot is given and doesn't contain /usr/lib or
        /usr/local/lib, that path is dropped entirely. (rdar://problem/6438270).
      + If the last -syslibroot is "/", all of them are ignored entirely.
        (rdar://problem/5829579).

At least, that's my best interpretation of what ld64 does in buildSearchPaths.

llvm-svn: 212706

10 years ago[x86] Add another combine that is particularly useful for the new vector
Chandler Carruth [Thu, 10 Jul 2014 11:09:29 +0000 (11:09 +0000)]
[x86] Add another combine that is particularly useful for the new vector
shuffle lowering: match shuffle patterns equivalent to an unpcklwd or
unpckhwd instruction.

This allows us to use generic lowering code for v8i16 shuffles and match
the unpack pattern late.

llvm-svn: 212705

10 years ago[msan] Switch chained origins hash to murmur2.
Evgeniy Stepanov [Thu, 10 Jul 2014 11:02:33 +0000 (11:02 +0000)]
[msan] Switch chained origins hash to murmur2.

llvm-svn: 212704

10 years ago[SystemZ] Add MC support for LEDBRA, LEXBRA and LDXBRA
Richard Sandiford [Thu, 10 Jul 2014 11:00:55 +0000 (11:00 +0000)]
[SystemZ] Add MC support for LEDBRA, LEXBRA and LDXBRA

These instructions aren't used for codegen since the original L*DB instructions
are suitable for fround.

llvm-svn: 212703

10 years ago[SystemZ] Avoid using i8 constants for immediate fields
Richard Sandiford [Thu, 10 Jul 2014 10:52:51 +0000 (10:52 +0000)]
[SystemZ] Avoid using i8 constants for immediate fields

Immediate fields that have no natural MVT type tended to use i8 if the
field was small enough.  This was a bit confusing since i8 isn't a legal
type for the target.  Fields for short immediates in a 32-bit or 64-bit
operation use i32 or i64 instead, so it would be better to do the same
for all fields.

No behavioral change intended.

llvm-svn: 212702

10 years ago[SystemZ] Fix FPR dwarf numbering
Richard Sandiford [Thu, 10 Jul 2014 10:45:11 +0000 (10:45 +0000)]
[SystemZ] Fix FPR dwarf numbering

The dwarf FPR numbers are supposed to have the order F0, F2, F4, F6,
F1, F3, F5, F7, F8, etc., which matches the pairing of registers for
long doubles.  E.g. a long double stored in F0 is paired with F2.

llvm-svn: 212701

10 years ago[mips] Add support for -modd-spreg/-mno-odd-spreg
Daniel Sanders [Thu, 10 Jul 2014 10:39:51 +0000 (10:39 +0000)]
[mips] Add support for -modd-spreg/-mno-odd-spreg

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

llvm-svn: 212700

10 years ago[ASan/Win] Don't hardcode ASan runtime version in ASan dll thunk
Timur Iskhodzhanov [Thu, 10 Jul 2014 10:33:48 +0000 (10:33 +0000)]
[ASan/Win] Don't hardcode ASan runtime version in ASan dll thunk

Reviewed at http://reviews.llvm.org/D4459

llvm-svn: 212699

10 years agoGet the inferior binary's name via the command line argument instead
Jason Molenda [Thu, 10 Jul 2014 10:23:01 +0000 (10:23 +0000)]
Get the inferior binary's name via the command line argument instead
of hardcoding it.

llvm-svn: 212698

10 years agoMake it possible for ints/floats to return different values from getBooleanContents()
Daniel Sanders [Thu, 10 Jul 2014 10:18:12 +0000 (10:18 +0000)]
Make it possible for ints/floats to return different values from getBooleanContents()

Summary:
On MIPS32r6/MIPS64r6, floating point comparisons return 0 or -1 but integer
comparisons return 0 or 1.

Updated the various uses of getBooleanContents. Two simplifications had to be
disabled when float and int boolean contents differ:
- ScalarizeVecRes_VSELECT except when the kind of boolean contents is trivially
  discoverable (i.e. when the condition of the VSELECT is a SETCC node).
- visitVSELECT (select C, 0, 1) -> (xor C, 1).
  Come to think of it, this one could test for the common case of 'C'
  being a SETCC too.

Preserved existing behaviour for all other targets and updated the affected
MIPS32r6/MIPS64r6 tests. This also fixes the pi benchmark where the 'low'
variable was counting in the wrong direction because it thought it could simply
add the result of the comparison.

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, jholewinski, mcrosier, llvm-commits

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

llvm-svn: 212697

10 years agoMachO: add dummy armv6m architecture directory so clang_macho_embedded builds things.
Tim Northover [Thu, 10 Jul 2014 10:06:42 +0000 (10:06 +0000)]
MachO: add dummy armv6m architecture directory so clang_macho_embedded builds things.

Without some mention of armv6m in a subdirectory of builtins, the make code
doesn't even know that armv6m exists and is something it should be looking for
in the platform-specific Makefiles. This means that none of the functions
listed actually get built and we end up with an almost entirely empty
libclang_rt.a for armv6m.

Unfortunately, the assembly code in the usual arm directory has no hope of
running on armv6m, which only supports Thumb-1 (not even ARM mode), so adding
it there won't work. Realistically, we probably *will* want to put any
optimised versions in a separate directory, so creating it now is harmless.

rdar://problem/17613576

llvm-svn: 212696

10 years ago[x86] Expand the target DAG combining for PSHUFD nodes to be able to
Chandler Carruth [Thu, 10 Jul 2014 09:57:36 +0000 (09:57 +0000)]
[x86] Expand the target DAG combining for PSHUFD nodes to be able to
combine into half-shuffles through unpack instructions that expand the
half to a whole vector without messing with the dword lanes.

This fixes some redundant instructions in splat-like lowerings for
v16i8, which are now getting to be *really* nice.

llvm-svn: 212695

10 years agoFix test name.
Jason Molenda [Thu, 10 Jul 2014 09:55:19 +0000 (09:55 +0000)]
Fix test name.

llvm-svn: 212694

10 years agoMake sanitizers' interceptors non-weak on FreeBSD
Viktor Kutuzov [Thu, 10 Jul 2014 09:16:58 +0000 (09:16 +0000)]
Make sanitizers' interceptors non-weak on FreeBSD
Differential Revision: http://reviews.llvm.org/D4418

llvm-svn: 212693

10 years ago[x86] Tweak the v16i8 single input special case lowering for shuffles
Chandler Carruth [Thu, 10 Jul 2014 09:16:40 +0000 (09:16 +0000)]
[x86] Tweak the v16i8 single input special case lowering for shuffles
that splat i8s into i16s.

Previously, we would try much too hard to arrange a sequence of i8s in
one half of the input such that we could unpack them into i16s and
shuffle those into place. This isn't always going to be a cheaper i8
shuffle than our other strategies. The case where it is always going to
be cheaper is when we can arrange all the necessary inputs into one half
using just i16 shuffles. It happens that viewing the problem this way
also makes it much easier to produce an efficient set of shuffles to
move the inputs into one half and then unpack them.

With this, our splat code gets one step closer to being not terrible
with the new experimental lowering strategy. It also exposes two
combines missing which I will add next.

llvm-svn: 212692

10 years agoOnly use fast stack unwinding for sanitizers failure reports on FreeBSD
Viktor Kutuzov [Thu, 10 Jul 2014 09:11:15 +0000 (09:11 +0000)]
Only use fast stack unwinding for sanitizers failure reports on FreeBSD
Differential Revision: http://reviews.llvm.org/D4420

llvm-svn: 212691

10 years agoFix getting environment variables for sanitizers needs on FreeBSD
Viktor Kutuzov [Thu, 10 Jul 2014 08:53:29 +0000 (08:53 +0000)]
Fix getting environment variables for sanitizers needs on FreeBSD
Differential Revision: http://reviews.llvm.org/D4229

llvm-svn: 212690

10 years agoAdd clang headers that fix machine-dependent definitions on FreeBSD 9.2
Viktor Kutuzov [Thu, 10 Jul 2014 08:43:39 +0000 (08:43 +0000)]
Add clang headers that fix machine-dependent definitions on FreeBSD 9.2
Differential Revision: http://reviews.llvm.org/D3908

llvm-svn: 212689

10 years agoA test case for not asserting in isDereferenceablePointer upon unsized types
Hal Finkel [Thu, 10 Jul 2014 07:04:37 +0000 (07:04 +0000)]
A test case for not asserting in isDereferenceablePointer upon unsized types

This is the test case for r212687.

llvm-svn: 212688

10 years agoFix isDereferenceablePointer not to try to take the size of an unsized type.
Hal Finkel [Thu, 10 Jul 2014 06:06:11 +0000 (06:06 +0000)]
Fix isDereferenceablePointer not to try to take the size of an unsized type.

I'll add a test-case shortly.

llvm-svn: 212687

10 years agoAllow isDereferenceablePointer to look through some bitcasts
Hal Finkel [Thu, 10 Jul 2014 05:27:53 +0000 (05:27 +0000)]
Allow isDereferenceablePointer to look through some bitcasts

isDereferenceablePointer should not give up upon encountering any bitcast. If
we're casting from a pointer to a larger type to a pointer to a small type, we
can continue by examining the bitcast's operand. This missing capability
was noted in a comment in the function.

In order for this to work, isDereferenceablePointer now takes an optional
DataLayout pointer (essentially all callers already had such a pointer
available). Most code uses isDereferenceablePointer though
isSafeToSpeculativelyExecute (which already took an optional DataLayout
pointer), and to enable the LICM test case, LICM needs to actually provide its DL
pointer to isSafeToSpeculativelyExecute (which it was not doing previously).

llvm-svn: 212686

10 years agoFix a type mismatch in NativeProcessLinux that shows up in 32-bit builds.
Todd Fiala [Thu, 10 Jul 2014 05:25:39 +0000 (05:25 +0000)]
Fix a type mismatch in NativeProcessLinux that shows up in 32-bit builds.

http://llvm.org/bugs/show_bug.cgi?id=20255

llvm-svn: 212685

10 years agoMC: modernise for loop
Saleem Abdulrasool [Thu, 10 Jul 2014 04:50:09 +0000 (04:50 +0000)]
MC: modernise for loop

Convert a for loop to range bsaed form.  NFC.

llvm-svn: 212684

10 years agoMC: add and use an accessor for WinCFI
Saleem Abdulrasool [Thu, 10 Jul 2014 04:50:06 +0000 (04:50 +0000)]
MC: add and use an accessor for WinCFI

This adds a utility method to access the WinCFI information in bulk and uses
that to iterate rather than requesting the count and individually iterating
them.  This is in preparation for restructuring WinCFI handling to enable more
clear sharing across architectures to enable unwind information emission for
Windows on ARM.

llvm-svn: 212683

10 years agoRemove move assignment operator to appease older GCCs.
Peter Collingbourne [Thu, 10 Jul 2014 04:39:40 +0000 (04:39 +0000)]
Remove move assignment operator to appease older GCCs.

llvm-svn: 212682

10 years agoFixes for broken Debian build - g++ 4.7 support.
Todd Fiala [Thu, 10 Jul 2014 04:39:13 +0000 (04:39 +0000)]
Fixes for broken Debian build - g++ 4.7 support.

These fix the broken debian lldb build, which is using g++ 4.7.2.

TypeFormat changes:
1. stopped using the C++11 "dtor = default;" construct.
The generated default destructor in the two derived classes wanted
them to have a different throws() semantic that was causing 4.7 to
fail to generate it.  I switched these to empty destructors defined
in the .cpp file.

2. Switched the m_types map from an ordered map to an unordered_map.
g++ 4.7's c++ library supports the C++11 emplace() used by TypeFormat
but the same c++ library's map impl does not.  Since TypeFormat didn't
look like it depended on ordering in the map, I just switched it to
a std::unordered_map.

NativeProcessLinux - g++ 4.7 chokes on lexing the "<::" in
static_cast<::pid_t>(wpid).  g++ 4.8+ and clang are fine with it.
I just put a space in between the "<" and the "::" and that cleared
it up.

llvm-svn: 212681

10 years ago[x86] Initial improvements to the new shuffle lowering for v16i8
Chandler Carruth [Thu, 10 Jul 2014 04:34:06 +0000 (04:34 +0000)]
[x86] Initial improvements to the new shuffle lowering for v16i8
shuffles specifically for cases where a small subset of the elements in
the input vector are actually used.

This is specifically targetted at improving the shuffles generated for
trunc operations, but also helps out splat-like operations.

There is still some really low-hanging fruit here that I want to address
but this is a huge step in the right direction.

llvm-svn: 212680

10 years agoExplicitly define move constructor and move assignment operator to appease MSVC.
Peter Collingbourne [Thu, 10 Jul 2014 04:29:06 +0000 (04:29 +0000)]
Explicitly define move constructor and move assignment operator to appease MSVC.

llvm-svn: 212679

10 years agoSpecialCaseList: use std::unique_ptr.
Peter Collingbourne [Thu, 10 Jul 2014 03:55:02 +0000 (03:55 +0000)]
SpecialCaseList: use std::unique_ptr.

llvm-svn: 212678

10 years ago[AArch64]Fix an assertion failure in DAG Combiner about concating 2 build_vector.
Hao Liu [Thu, 10 Jul 2014 03:41:50 +0000 (03:41 +0000)]
[AArch64]Fix an assertion failure in DAG Combiner about concating 2 build_vector.

llvm-svn: 212677

10 years agoR600/SI: Add support for llvm.convert.{to|from}.fp16
Matt Arsenault [Thu, 10 Jul 2014 03:22:20 +0000 (03:22 +0000)]
R600/SI: Add support for llvm.convert.{to|from}.fp16

llvm-svn: 212676

10 years agoFix types in documentation.
Matt Arsenault [Thu, 10 Jul 2014 03:22:16 +0000 (03:22 +0000)]
Fix types in documentation.

The examples were using f32, but the IR type is called float

llvm-svn: 212675

10 years ago[x86] Refactor some of the new code for lowering v16i8 shuffles to
Chandler Carruth [Thu, 10 Jul 2014 02:24:26 +0000 (02:24 +0000)]
[x86] Refactor some of the new code for lowering v16i8 shuffles to
remove duplication and make it easier to select different strategies.

No functionality changed.

llvm-svn: 212674

10 years agoAdd a new 'stresstest' category, set the api/multiple-debuggers test case as a stress...
Jason Molenda [Thu, 10 Jul 2014 02:21:16 +0000 (02:21 +0000)]
Add a new 'stresstest' category, set the api/multiple-debuggers test case as a stresstest.

llvm-svn: 212673

10 years agoAdd lit configs for libcxxabi tests.
Dan Albert [Thu, 10 Jul 2014 02:20:11 +0000 (02:20 +0000)]
Add lit configs for libcxxabi tests.

This makes running libcxxabi tests on Linux _much_ easier.
Adds a check-libcxxabi target to cmake.

Also defaults to building a dynamic libc++abi. This is so that the
default options still test the libc++abi that is being built. There are
two problems with testing a static libc++abi. In the case of a
standalone build, the tests will link the system's libc++, which might
not have been built against our libc++abi. In the case of an in tree
build, libc++ will prefer a dynamic libc++abi from the system over a
static libc++abi from the output directory.

llvm-svn: 212672

10 years agoAdd a new test in api/multiple-debuggers which tries to create 50
Jason Molenda [Thu, 10 Jul 2014 02:17:31 +0000 (02:17 +0000)]
Add a new test in api/multiple-debuggers which tries to create 50
debug sessions simultaneously to expose race conditoin/locking
issues.

This directory has an inferior program, testprog.cpp that has a
couple of functions we can put breakpoints on.

It has a driver program, multi-process-driver.cpp, which links
against the LLDB solib and uses the SB APIs.  It creates 50 pthreads,
creates a debugger on all of them, launches a debug session of the
inferior testprog, hits a couple breakpoints, walks the stack,
continues, etc., and then kills the inferior and ends the debug
session.

A pass is if all fifty debug sessions complete successfully
in the alloted time (~60 seconds).

We may need to tweak this one to work correctly on different
platforms/targets but I wanted to get it checked in to start.

llvm-svn: 212671

10 years agoPrevent link warnings due to -Wframe-larger-than=
Alp Toker [Thu, 10 Jul 2014 02:13:29 +0000 (02:13 +0000)]
Prevent link warnings due to -Wframe-larger-than=

Although this is nominally a -W option, we actually handle it in the driver
exactly as an f-group flag that's translated directly to -mllvm.

That means f_Group (and unintuitively, not W_Group) has the semantics we want
to make it behave like a standard warning flag: no automatic forwarding, no
warning for link invocations and compile-only.

Silences diagnostics like:

  [691/1545] Linking CXX executable bin/llvm-diff
  clang-3.5: warning: argument unused during compilation: '-Wframe-larger-than=2048'

(Hopefully we can move towards handling these in the frontend but that'll
require some infrastructure work.)

llvm-svn: 212670

10 years agoMS ABI: Fix __fastcall methods that return structs
Reid Kleckner [Thu, 10 Jul 2014 01:58:55 +0000 (01:58 +0000)]
MS ABI: Fix __fastcall methods that return structs

The sret paramater consumes the register after the implicit 'this'
parameter, as with other calling conventions.

Fixes PR20278, which turned out to be very easy.

llvm-svn: 212669

10 years ago[dfsan] Handle bitcast aliases.
Peter Collingbourne [Thu, 10 Jul 2014 01:30:39 +0000 (01:30 +0000)]
[dfsan] Handle bitcast aliases.

llvm-svn: 212668

10 years agoCleanup. No functionality change.
Richard Smith [Thu, 10 Jul 2014 01:20:17 +0000 (01:20 +0000)]
Cleanup. No functionality change.

llvm-svn: 212667

10 years ago[Driver] Expose getARMCPUForMArch() function in the Driver API; NFC.
Argyrios Kyrtzidis [Thu, 10 Jul 2014 01:03:37 +0000 (01:03 +0000)]
[Driver] Expose getARMCPUForMArch() function in the Driver API; NFC.

llvm-svn: 212666

10 years agoFix configure+make build of profile runtime library
Alexey Samsonov [Thu, 10 Jul 2014 00:53:20 +0000 (00:53 +0000)]
Fix configure+make build of profile runtime library

llvm-svn: 212665

10 years ago[ASan] Force the compiler to generate frame pointer in certain Mac-specific interceptors.
Alexey Samsonov [Thu, 10 Jul 2014 00:06:53 +0000 (00:06 +0000)]
[ASan] Force the compiler to generate frame pointer in certain Mac-specific interceptors.

Patch by Kuba Brecka!

llvm-svn: 212664

10 years ago[Sanitizer] Remove SANITIZER_NEEDS_SEGV from shared sanitizer_common headers.
Alexey Samsonov [Wed, 9 Jul 2014 23:59:40 +0000 (23:59 +0000)]
[Sanitizer] Remove SANITIZER_NEEDS_SEGV from shared sanitizer_common headers.

Otherwise, it can be accidentally redefined when we build specific sanitizer
runtime. This definition should be provided only once - when we build
sanitizer_common library.

llvm-svn: 212663

10 years agoSkip tests that are intermittent on Linux, fix gdb-remote port-grabbing code.
Todd Fiala [Wed, 9 Jul 2014 23:10:43 +0000 (23:10 +0000)]
Skip tests that are intermittent on Linux, fix gdb-remote port-grabbing code.

Marked skipped for Linux:
TestCallStopAndContinue
TestConvenienceVariables
TestStopHookMultipleThreads

Fixed up gdb-remote port-grabbing code to use a random port in a wide range,
and to allow that to fail more gracefully.  This appears to have solved some
gdb-remote intermittent failing behavior.

llvm-svn: 212662

10 years ago[SDAG] Make the new zext-vector-inreg node default to expand so targets
Chandler Carruth [Wed, 9 Jul 2014 22:53:04 +0000 (22:53 +0000)]
[SDAG] Make the new zext-vector-inreg node default to expand so targets
don't need to set it manually.

This is based on feedback from Tom who pointed out that if every target
needs to handle this we need to reach out to those maintainers. In fact,
it doesn't make sense to duplicate everything when anything other than
expand seems unlikely at this stage.

llvm-svn: 212661

10 years agoSkip TestCallStopAndContinue and TestCallThatRestarts on Darwin.
Todd Fiala [Wed, 9 Jul 2014 22:03:30 +0000 (22:03 +0000)]
Skip TestCallStopAndContinue and TestCallThatRestarts on Darwin.

These are failing intermittently.

See http://llvm.org/bugs/show_bug.cgi?id=19246 for TestCallThatRestarts.  Also applies to Linux.
See http://llvm.org/bugs/show_bug.cgi?id=20274 for TestCallStopAndContinue.

llvm-svn: 212660

10 years agoMarked TestTargetAPI.test_launch_new_process_and_redirect_stdout_with_* as XFAIL...
Todd Fiala [Wed, 9 Jul 2014 21:24:41 +0000 (21:24 +0000)]
Marked TestTargetAPI.test_launch_new_process_and_redirect_stdout_with_* as XFAIL on Darwin.

See http://llvm.org/bugs/show_bug.cgi?id=20273

llvm-svn: 212659

10 years agoRemoved the "-fix" suffix from tests that verify both fixes and messages.
Alexander Kornienko [Wed, 9 Jul 2014 21:21:39 +0000 (21:21 +0000)]
Removed the "-fix" suffix from tests that verify both fixes and messages.

llvm-svn: 212658

10 years agoTestRealDefinition tests marked XFAIL on Darwin.
Todd Fiala [Wed, 9 Jul 2014 21:21:39 +0000 (21:21 +0000)]
TestRealDefinition tests marked XFAIL on Darwin.

http://llvm.org/bugs/show_bug.cgi?id=20272

llvm-svn: 212657

10 years agoMarked failing TestObjCDynamicValue tests as XFAIL on Darwin.
Todd Fiala [Wed, 9 Jul 2014 21:19:03 +0000 (21:19 +0000)]
Marked failing TestObjCDynamicValue tests as XFAIL on Darwin.

See http://llvm.org/bugs/show_bug.cgi?id=20271

llvm-svn: 212656

10 years agoMarked failing TestObjCDynamicSBType tests XFAIL on Darwin.
Todd Fiala [Wed, 9 Jul 2014 21:15:46 +0000 (21:15 +0000)]
Marked failing TestObjCDynamicSBType tests XFAIL on Darwin.

See http://llvm.org/bugs/show_bug.cgi?id=20270

llvm-svn: 212655

10 years agoMarked failing TestHiddenIvars tests as XFAIL on Darwin.
Todd Fiala [Wed, 9 Jul 2014 21:10:13 +0000 (21:10 +0000)]
Marked failing TestHiddenIvars tests as XFAIL on Darwin.

See http://llvm.org/bugs/show_bug.cgi?id=20269

llvm-svn: 212654

10 years agoCheck messages and fixes in the same test.
Alexander Kornienko [Wed, 9 Jul 2014 21:09:26 +0000 (21:09 +0000)]
Check messages and fixes in the same test.

Summary: This reduces duplication of test code and improves locality of checks.

Reviewers: sbenza, djasper

Reviewed By: sbenza, djasper

Subscribers: cfe-commits

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

llvm-svn: 212653

10 years agoMove GOTPass and StubsPass from Core to MachO
Nick Kledzik [Wed, 9 Jul 2014 21:04:24 +0000 (21:04 +0000)]
Move GOTPass and StubsPass from Core to MachO

llvm-svn: 212652

10 years agoAdd a reset method to the counting predicates in the test suite
Marshall Clow [Wed, 9 Jul 2014 21:04:22 +0000 (21:04 +0000)]
Add a reset method to the counting predicates in the test suite

llvm-svn: 212651

10 years agoMarked TestObjCMethods failing tests XFAIL, fixed cleanup code, removed now-passing...
Todd Fiala [Wed, 9 Jul 2014 21:02:52 +0000 (21:02 +0000)]
Marked TestObjCMethods failing tests XFAIL, fixed cleanup code, removed now-passing expected failure markers.

All tests matching '-p TestObjCMethods' now are marked correctly for MacOSX, and some
error classes have been removed in cleanup code looking for files that
might not exist due to previous failure.

See http://llvm.org/bugs/show_bug.cgi?id=20267

llvm-svn: 212650

10 years agoRecommit r212203: Don't try to construct debug LexicalScopes hierarchy for functions...
David Blaikie [Wed, 9 Jul 2014 21:02:41 +0000 (21:02 +0000)]
Recommit r212203: Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information.

Reverted by Eric Christopher (Thanks!) in r212203 after Bob Wilson
reported LTO issues. Duncan Exon Smith and Aditya Nandakumar helped
provide a reduced reproduction, though the failure wasn't too hard to
guess, and even easier with the example to confirm.

The assertion that the subprogram metadata associated with an
llvm::Function matches the scope data referenced by the DbgLocs on the
instructions in that function is not valid under LTO. In LTO, a C++
inline function might exist in multiple CUs and the subprogram metadata
nodes will refer to the same llvm::Function. In this case, depending on
the order of the CUs, the first intance of the subprogram metadata may
not be the one referenced by the instructions in that function and the
assertion will fail.

A test case (test/DebugInfo/cross-cu-linkonce-distinct.ll) is added, the
assertion removed and a comment added to explain this situation.

Original commit message:

If a function isn't actually in a CU's subprogram list in the debug info
metadata, ignore all the DebugLocs and don't try to build scopes, track
variables, etc.

While this is possibly a minor optimization, it's also a correctness fix
for an incoming patch that will add assertions to LexicalScopes and the
debug info verifier to ensure that all scope chains lead to debug info
for the current function.

Fix up a few test cases that had broken/incomplete debug info that could
violate this constraint.

Add a test case where this occurs by design (inlining a
debug-info-having function in an attribute nodebug function - we want
this to work because /if/ the nodebug function is then inlined into a
debug-info-having function, it should be fine (and will work fine - we
just stitch the scopes up as usual), but should the inlining not happen
we need to not assert fail either).

llvm-svn: 212649

10 years agoMarked failing test XFAIL for TestRegisterVariables.test_with_dsym_and_run_command...
Todd Fiala [Wed, 9 Jul 2014 20:45:09 +0000 (20:45 +0000)]
Marked failing test XFAIL for TestRegisterVariables.test_with_dsym_and_run_command on Darwin

See http://llvm.org/bugs/show_bug.cgi?id=20266

llvm-svn: 212648