platform/upstream/llvm.git
9 years agoUse report_fatal_error instead of llvm_unreachable, so we don't crash on user input
Filipe Cabecinhas [Fri, 16 Jan 2015 04:54:12 +0000 (04:54 +0000)]
Use report_fatal_error instead of llvm_unreachable, so we don't crash on user input

llvm-svn: 226248

9 years ago[PowerPC] Adjust PatchPoints for ppc64le
Hal Finkel [Fri, 16 Jan 2015 04:40:58 +0000 (04:40 +0000)]
[PowerPC] Adjust PatchPoints for ppc64le

Bill Schmidt pointed out that some adjustments would be needed to properly
support powerpc64le (using the ELF V2 ABI). For one thing, R11 is not available
as a scratch register, so we need to use R12. R12 is also available under ELF
V1, so to maintain consistency, I flipped the order to make R12 the first
scratch register in the array under both ABIs.

llvm-svn: 226247

9 years agoPE/COFF: use dyn_cast for the check of the target
Saleem Abdulrasool [Fri, 16 Jan 2015 04:14:33 +0000 (04:14 +0000)]
PE/COFF: use dyn_cast for the check of the target

The target may be a synthetic symbol like __ImageBase.  cast_or_null will ensure
that the atom is a DefinedAtom, which is not guaranteed, which was the original
reason for the cast_or_null.  Switch this to dyn_cast, which should enable
building of executables for WoA.  Unfortunately, the issue of missing base
relocations still needs to be investigated.

llvm-svn: 226246

9 years agoFix Reassociate handling of constant in presence of undef float
Mehdi Amini [Fri, 16 Jan 2015 03:00:58 +0000 (03:00 +0000)]
Fix Reassociate handling of constant in presence of undef float

http://reviews.llvm.org/D6993

llvm-svn: 226245

9 years agoFixes to DNBArchImpl in debugserver to correctly get/set
Jason Molenda [Fri, 16 Jan 2015 02:31:35 +0000 (02:31 +0000)]
Fixes to DNBArchImpl in debugserver to correctly get/set
the register state when debugging AArch32 programs (armv7
programs running on an armv8 processor).  Most notably,
there is no "fpscr" register in the register context -
there is an fpsr and an fpcr.

Also fix a bug where the floating point values could not
be written in armv7 processes.
<rdar://problem/18977767>

llvm-svn: 226244

9 years agoRemove triple detection from cmake.
Dan Albert [Fri, 16 Jan 2015 02:27:17 +0000 (02:27 +0000)]
Remove triple detection from cmake.

This isn't actually used for anything, and is broken on Darwin
(currently causing build failures now that the triple is passed to aid
cross compiling). Rather than fix unused code, just remove it.

llvm-svn: 226243

9 years agoRevert "Revert Don't create new comdats in CodeGen"
Rafael Espindola [Fri, 16 Jan 2015 02:22:55 +0000 (02:22 +0000)]
Revert "Revert Don't create new comdats in CodeGen"

This reverts commit r226173, adding r226038 back.

No change in this commit, but clang was changed to also produce trivial comdats for
costructors, destructors and vtables when needed.

Original message:

Don't create new comdats in CodeGen.

This patch stops the implicit creation of comdats during codegen.

Clang now sets the comdat explicitly when it is required. With this patch clang and gcc
now produce the same result in pr19848.

llvm-svn: 226242

9 years agoWork around to get the build bot clang-cmake-armv7-a15-full green by
Kevin Enderby [Fri, 16 Jan 2015 02:08:11 +0000 (02:08 +0000)]
Work around to get the build bot clang-cmake-armv7-a15-full green by
removing the macho-archive-headers.test added with r226228 that it is
failing on for now while I try to figure out what is going on.

llvm-svn: 226241

9 years agoLIBCXXABI_TARGET_TRIPLE won't always be set.
Dan Albert [Fri, 16 Jan 2015 01:10:09 +0000 (01:10 +0000)]
LIBCXXABI_TARGET_TRIPLE won't always be set.

Fixes issue with r226235. Build configuration difference between
libc++ and libc++abi.

llvm-svn: 226240

9 years agoAnother attempt to fix the build bot clang-cmake-armv7-a15-full failing on
Kevin Enderby [Fri, 16 Jan 2015 01:09:54 +0000 (01:09 +0000)]
Another attempt to fix the build bot clang-cmake-armv7-a15-full failing on
the macho-archive-headers.test added with r226228.

llvm-svn: 226239

9 years agoAdd a new pass "inductive range check elimination"
Sanjoy Das [Fri, 16 Jan 2015 01:03:22 +0000 (01:03 +0000)]
Add a new pass "inductive range check elimination"

IRCE eliminates range checks of the form

  0 <= A * I + B < Length

by splitting a loop's iteration space into three segments in a way
that the check is completely redundant in the middle segment.  As an
example, IRCE will convert

  len = < known positive >
  for (i = 0; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

to

  len = < known positive >
  limit = smin(n, len)
  // no first segment
  for (i = 0; i < limit; i++) {
    if (0 <= i && i < len) { // this check is fully redundant
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }
  for (i = limit; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

IRCE can deal with multiple range checks in the same loop (it takes
the intersection of the ranges that will make each of them redundant
individually).

Currently IRCE does not do any profitability analysis.  That is a
TODO.

Please note that the status of this pass is *experimental*, and it is
not part of any default pass pipeline.  Having said that, I will love
to get feedback and general input from people interested in trying
this out.

This pass was originally r226201.  It was reverted because it used C++
features not supported by MSVC 2012.

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

llvm-svn: 226238

9 years ago[libc++] Add support for cross compiling.
Dan Albert [Fri, 16 Jan 2015 00:55:15 +0000 (00:55 +0000)]
[libc++] Add support for cross compiling.

Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 226237

9 years agoUse std::recursive_mutex instead of llvm's SmartMutex.
Rui Ueyama [Fri, 16 Jan 2015 00:55:01 +0000 (00:55 +0000)]
Use std::recursive_mutex instead of llvm's SmartMutex.

llvm-svn: 226236

9 years ago[libc++abi] Add support for cross compiling.
Dan Albert [Fri, 16 Jan 2015 00:52:11 +0000 (00:52 +0000)]
[libc++abi] Add support for cross compiling.

Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 226235

9 years agoAdd Socket::Get[Remote/Local]IpAddress and unit tests
Vince Harron [Fri, 16 Jan 2015 00:47:08 +0000 (00:47 +0000)]
Add Socket::Get[Remote/Local]IpAddress and unit tests

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

llvm-svn: 226234

9 years agoGive lldb a clean null build.
Nico Weber [Fri, 16 Jan 2015 00:35:05 +0000 (00:35 +0000)]
Give lldb a clean null build.

`ninja lldb` used to always run "echo -n", which on OS X results in literally
echoing "-n" to the screen.  Just remove the command from add_custom_target,
then it only adds an alias and `ninja lldb` now reports "no work to do".

Other than that, no intended behavior change.

llvm-svn: 226233

9 years agoThis should fix the build bot clang-cmake-armv7-a15-full failing on
Kevin Enderby [Fri, 16 Jan 2015 00:27:31 +0000 (00:27 +0000)]
This should fix the build bot clang-cmake-armv7-a15-full failing on
the macho-archive-headers.test added with r226228.

llvm-svn: 226232

9 years agoAdd comment regarding which i386 registers are non-volatile instead of
Jason Molenda [Fri, 16 Jan 2015 00:27:25 +0000 (00:27 +0000)]
Add comment regarding which i386 registers are non-volatile instead of
just pointing to the standard document regarding this.

llvm-svn: 226231

9 years agoR600/SI: Add patterns for v_cvt_{flr|rpi}_i32_f32
Matt Arsenault [Thu, 15 Jan 2015 23:58:35 +0000 (23:58 +0000)]
R600/SI: Add patterns for v_cvt_{flr|rpi}_i32_f32

llvm-svn: 226230

9 years agoFix edge case when Start overflowed in 32 bit mode
Filipe Cabecinhas [Thu, 15 Jan 2015 23:50:44 +0000 (23:50 +0000)]
Fix edge case when Start overflowed in 32 bit mode

llvm-svn: 226229

9 years agoAdd the option, -archive-headers, used with -macho to print the Mach-O archive header...
Kevin Enderby [Thu, 15 Jan 2015 23:19:11 +0000 (23:19 +0000)]
Add the option, -archive-headers, used with -macho to print the Mach-O archive headers to llvm-objdump.

llvm-svn: 226228

9 years agoUse a trivial comdat for C++ tables.
Rafael Espindola [Thu, 15 Jan 2015 23:18:01 +0000 (23:18 +0000)]
Use a trivial comdat for C++ tables.

This produces comdats for vtables, typeinfo, typeinfo names, and vtts.

When combined with llvm not producing implicit comdats, not doing this would
cause code bloat on ELF and link errors on COFF.

llvm-svn: 226227

9 years agoR600/SI: Fix trailing comma with modifiers
Matt Arsenault [Thu, 15 Jan 2015 23:17:03 +0000 (23:17 +0000)]
R600/SI: Fix trailing comma with modifiers

Instructions with 1 operand can still use source modifiers,
so make sure we don't print an extra comma afterwards.

llvm-svn: 226226

9 years agoSimplify.
Rui Ueyama [Thu, 15 Jan 2015 23:15:09 +0000 (23:15 +0000)]
Simplify.

llvm-svn: 226225

9 years ago[Hexagon] Adding new-value store and bit reverse instructions.
Colin LeMahieu [Thu, 15 Jan 2015 23:10:29 +0000 (23:10 +0000)]
[Hexagon] Adding new-value store and bit reverse instructions.

llvm-svn: 226224

9 years agoPrint out environment in lit notes
Jonathan Roelofs [Thu, 15 Jan 2015 23:04:37 +0000 (23:04 +0000)]
Print out environment in lit notes

llvm-svn: 226223

9 years agoRemove the slashes so they don't fail in some Windows setups
Filipe Cabecinhas [Thu, 15 Jan 2015 23:04:15 +0000 (23:04 +0000)]
Remove the slashes so they don't fail in some Windows setups

llvm-svn: 226222

9 years agoSome fixes for thread stepping on Windows.
Zachary Turner [Thu, 15 Jan 2015 22:54:08 +0000 (22:54 +0000)]
Some fixes for thread stepping on Windows.

This hooks up the changes necessary to set the trap flag on the
CPU and properly manage the process and thread's resume state
and private state so that the ThreadPlan does its thing.

Stepping still doesn't work as of this change, because there are
some issues with stack frames where it doesn't update the thread's
frame list correctly when it breaks inside of a function, but
I will try to fix that separately.

llvm-svn: 226221

9 years agoDuring source manager test, write back the file using binary mode.
Zachary Turner [Thu, 15 Jan 2015 22:53:44 +0000 (22:53 +0000)]
During source manager test, write back the file using binary mode.

On Windows, opening with "w" opens it as text instead of binary.
This causes translation of newline characters, so that "\n" turns
into "\r\n", which in turn leads to git detecting that the file
has changed and wanting to commit it.

llvm-svn: 226220

9 years agoReport fatal errors instead of segfaulting/asserting on a few invalid accesses while...
Filipe Cabecinhas [Thu, 15 Jan 2015 22:52:38 +0000 (22:52 +0000)]
Report fatal errors instead of segfaulting/asserting on a few invalid accesses while reading MachO files.

Summary:
Shift an older “invalid file” test to get a consistent naming for these tests.

Bugs found by afl-fuzz

Reviewers: rafael

Subscribers: llvm-commits

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

llvm-svn: 226219

9 years agoFixed the regex test case after recent modifications to the "help" command output.
Greg Clayton [Thu, 15 Jan 2015 22:52:17 +0000 (22:52 +0000)]
Fixed the regex test case after recent modifications to the "help" command output.

<rdar://problem/18527567>

llvm-svn: 226218

9 years ago[Object] Add SF_Exported flag. This flag will be set on all symbols that would
Lang Hames [Thu, 15 Jan 2015 22:33:30 +0000 (22:33 +0000)]
[Object] Add SF_Exported flag. This flag will be set on all symbols that would
be exported from a dylib if their containing object file were linked into one.

No test case: No command line tools query this flag, and there are no Object
unit tests.

llvm-svn: 226217

9 years agoRevert r226201 (Add a new pass "inductive range check elimination")
Sanjoy Das [Thu, 15 Jan 2015 22:18:10 +0000 (22:18 +0000)]
Revert r226201 (Add a new pass "inductive range check elimination")

The change used C++11 features not supported by MSVC 2012.  I will fix
the change to use things supported MSVC 2012 and recommit shortly.

llvm-svn: 226216

9 years agoInductiveRangeCheckElimination: Remove extra ';'
David Majnemer [Thu, 15 Jan 2015 21:55:16 +0000 (21:55 +0000)]
InductiveRangeCheckElimination: Remove extra ';'

This silences a GCC warning.

llvm-svn: 226215

9 years agoFixing pedantic build warnings.
Andrew Kaylor [Thu, 15 Jan 2015 21:50:53 +0000 (21:50 +0000)]
Fixing pedantic build warnings.

llvm-svn: 226214

9 years agoUse a trivial comdat for inline ctor/dtor when not using C5/D5.
Rafael Espindola [Thu, 15 Jan 2015 21:36:08 +0000 (21:36 +0000)]
Use a trivial comdat for inline ctor/dtor when not using C5/D5.

When combined with llvm not producing implicit comdats, not doing this would
cause code bloat on ELF and link errors on COFF.

llvm-svn: 226211

9 years ago[Hexagon] Fix 226206 by uncommenting required pattern and changing patterns for simpl...
Colin LeMahieu [Thu, 15 Jan 2015 21:35:49 +0000 (21:35 +0000)]
[Hexagon] Fix 226206 by uncommenting required pattern and changing patterns for simple load-extends.

llvm-svn: 226210

9 years ago[PowerPC] Add a target option for invariant function descriptors
Hal Finkel [Thu, 15 Jan 2015 21:22:22 +0000 (21:22 +0000)]
[PowerPC] Add a target option for invariant function descriptors

The PPC backend will now assume that PPC64 ELFv1 function descriptors are
invariant. This must be true for well-defined C/C++ code, but I'm providing an
option to disable this assumption in case someone's JIT-engine needs it.

llvm-svn: 226209

9 years agoWarn about dllexported explicit class template instantiation declarations (PR22035)
Hans Wennborg [Thu, 15 Jan 2015 21:18:30 +0000 (21:18 +0000)]
Warn about dllexported explicit class template instantiation declarations (PR22035)

Clang would previously become confused and crash here.

It does not make a lot of sense to export these, so warning seems appropriate.

MSVC will export some member functions for this kind of specializations, whereas
MinGW ignores the dllexport-edness. The latter behaviour seems better.

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

llvm-svn: 226208

9 years ago[PowerPC] Loosen ELFv1 PPC64 func descriptor loads for indirect calls
Hal Finkel [Thu, 15 Jan 2015 21:17:34 +0000 (21:17 +0000)]
[PowerPC] Loosen ELFv1 PPC64 func descriptor loads for indirect calls

Function pointers under PPC64 ELFv1 (which is used on PPC64/Linux on the
POWER7, A2 and earlier cores) are really pointers to a function descriptor, a
structure with three pointers: the actual pointer to the code to which to jump,
the pointer to the TOC needed by the callee, and an environment pointer. We
used to chain these loads, and make them opaque to the rest of the optimizer,
so that they'd always occur directly before the call. This is not necessary,
and in fact, highly suboptimal on embedded cores. Once the function pointer is
known, the loads can be performed ahead of time; in fact, they can be hoisted
out of loops.

Now these function descriptors are almost always generated by the linker, and
thus the contents of the descriptors are invariant. As a result, by default,
we'll mark the associated loads as invariant (allowing them to be hoisted out
of loops). I've added a target feature to turn this off, however, just in case
someone needs that option (constructing an on-stack descriptor, casting it to a
function pointer, and then calling it cannot be well-defined C/C++ code, but I
can imagine some JIT-compilation system doing so).

Consider this simple test:
  $ cat call.c

  typedef void (*fp)();
  void bar(fp x) {
    for (int i = 0; i < 1600000000; ++i)
      x();
  }

  $ cat main.c

  typedef void (*fp)();
  void bar(fp x);
  void foo() {}
  int main() {
    bar(foo);
  }

On the PPC A2 (the BG/Q supercomputer), marking the function-descriptor loads
as invariant brings the execution time down to ~8 seconds from ~32 seconds with
the loads in the loop.

The difference on the POWER7 is smaller. Compiling with:

  gcc -std=c99 -O3 -mcpu=native call.c main.c : ~6 seconds [this is 4.8.2]

  clang -O3 -mcpu=native call.c main.c : ~5.3 seconds

  clang -O3 -mcpu=native call.c main.c -mno-invariant-function-descriptors : ~4 seconds
  (looks like we'd benefit from additional loop unrolling here, as a first
   guess, because this is faster with the extra loads)

The -mno-invariant-function-descriptors will be added to Clang shortly.

llvm-svn: 226207

9 years ago[Hexagon] Updating indexed load-extend patterns and changing test to new expected...
Colin LeMahieu [Thu, 15 Jan 2015 21:07:52 +0000 (21:07 +0000)]
[Hexagon] Updating indexed load-extend patterns and changing test to new expected output.

llvm-svn: 226206

9 years agoAdd "explicit".
Rui Ueyama [Thu, 15 Jan 2015 21:05:00 +0000 (21:05 +0000)]
Add "explicit".

llvm-svn: 226205

9 years agoUriParser - fixed potential buffer overrun
Vince Harron [Thu, 15 Jan 2015 20:57:01 +0000 (20:57 +0000)]
UriParser - fixed potential buffer overrun

Switched from ::strtoul to StringConvert::ToUInt32
Changed port output parameter to be -1 if port is unspecified

llvm-svn: 226204

9 years ago[asan] Loosen test for upcoming ppc64 change
Hal Finkel [Thu, 15 Jan 2015 20:48:38 +0000 (20:48 +0000)]
[asan] Loosen test for upcoming ppc64 change

This test casts 0x4 to a function pointer and calls it. Unfortunately, the
faulting address may not exactly be 0x4 on PPC64 ELFv1 systems. The LLVM PPC
backend used to always generate the loads "in order", so we'd fault at 0x4
anyway. However, at upcoming change to loosen that ordering, and we'll pick a
different order on some targets. As a result, as explained in the comment, we
need to allow for certain nearby addresses as well.

llvm-svn: 226202

9 years agoAdd a new pass "inductive range check elimination"
Sanjoy Das [Thu, 15 Jan 2015 20:45:46 +0000 (20:45 +0000)]
Add a new pass "inductive range check elimination"

IRCE eliminates range checks of the form

  0 <= A * I + B < Length

by splitting a loop's iteration space into three segments in a way
that the check is completely redundant in the middle segment.  As an
example, IRCE will convert

  len = < known positive >
  for (i = 0; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

to

  len = < known positive >
  limit = smin(n, len)
  // no first segment
  for (i = 0; i < limit; i++) {
    if (0 <= i && i < len) { // this check is fully redundant
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }
  for (i = limit; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

IRCE can deal with multiple range checks in the same loop (it takes
the intersection of the ranges that will make each of them redundant
individually).

Currently IRCE does not do any profitability analysis.  That is a
TODO.

Please note that the status of this pass is *experimental*, and it is
not part of any default pass pipeline.  Having said that, I will love
to get feedback and general input from people interested in trying
this out.

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

llvm-svn: 226201

9 years agoRevert "r226086 - Revert "r226071 - [RegisterCoalescer] Remove copies to reserved...
Hal Finkel [Thu, 15 Jan 2015 20:32:09 +0000 (20:32 +0000)]
Revert "r226086 - Revert "r226071 - [RegisterCoalescer] Remove copies to reserved registers""

Reapply r226071 with fixes. Two fixes:

 1. We need to manually remove the old and create the new 'deaf defs'
    associated with physical register definitions when we move the definition of
    the physical register from the copy point to the point of the original vreg def.

    This problem was picked up by the machinstr verifier, and could trigger a
    verification failure on test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll, so I've
    turned on the verifier in the tests.

 2. When moving the def point of the phys reg up, we need to make sure that it
    is neither defined nor read in between the two instructions. We don't, however,
    extend the live ranges of phys reg defs to cover uses, so just checking for
    live-range overlap between the pair interval and the phys reg aliases won't
    pick up reads. As a result, we manually iterate over the range and check for
    reads.

    A test soon to be committed to the PowerPC backend will test this change.

Original commit message:

[RegisterCoalescer] Remove copies to reserved registers

This allows the RegisterCoalescer to join "non-flipped" range pairs with a
physical destination register -- which allows the RegisterCoalescer to remove
copies like this:

<vreg> = something (maybe a load, for example)
... (things that don't use PHYSREG)
PHYSREG = COPY <vreg>

(with all of the restrictions normally applied by the RegisterCoalescer: having
compatible register classes, etc. )

Previously, the RegisterCoalescer handled only the opposite case (copying
*from* a physical register). I don't handle the problem fully here, but try to
get the common case where there is only one use of <vreg> (the COPY).

An upcoming commit to the PowerPC backend will make this pattern much more
common on PPC64/ELF systems.

llvm-svn: 226200

9 years agoMoved Args::StringToXIntYZ to StringConvert::ToXIntYZ
Vince Harron [Thu, 15 Jan 2015 20:08:35 +0000 (20:08 +0000)]
Moved Args::StringToXIntYZ to StringConvert::ToXIntYZ

The refactor was motivated by some comments that Greg made
http://reviews.llvm.org/D6918

and also to break a dependency cascade that caused functions linking
in string->int conversion functions to pull in most of lldb

llvm-svn: 226199

9 years agoStyle cleanup of old gc.root lowering code
Philip Reames [Thu, 15 Jan 2015 19:49:25 +0000 (19:49 +0000)]
Style cleanup of old gc.root lowering code

Use static functions for helpers rather than static member functions.  a) this changes the linking (minor at best), and b) this makes it obvious no object state is involved.

llvm-svn: 226198

9 years agoR600/SI: Improve fpext / fptrunc test coverage
Matt Arsenault [Thu, 15 Jan 2015 19:39:42 +0000 (19:39 +0000)]
R600/SI: Improve fpext / fptrunc test coverage

llvm-svn: 226197

9 years agoclang-format GCStrategy.cpp & GCRootLowering.cpp (NFC)
Philip Reames [Thu, 15 Jan 2015 19:39:17 +0000 (19:39 +0000)]
clang-format GCStrategy.cpp & GCRootLowering.cpp (NFC)

llvm-svn: 226196

9 years agoSplit GCStrategy.cpp into two files (NFC)
Philip Reames [Thu, 15 Jan 2015 19:29:42 +0000 (19:29 +0000)]
Split GCStrategy.cpp into two files (NFC)

This preparation for an update to http://reviews.llvm.org/D6811.  GCStrategy.cpp will hopefully be moving into IR/, where as the lowering logic needs to stay in CodeGen/

llvm-svn: 226195

9 years ago[Hexagon] Removing old versions of vsplice, valign, cl0, ct0 and updating references...
Colin LeMahieu [Thu, 15 Jan 2015 19:28:32 +0000 (19:28 +0000)]
[Hexagon] Removing old versions of vsplice, valign, cl0, ct0 and updating references to new versions.

llvm-svn: 226194

9 years agoUse set() instead of option() for string option.
Dan Albert [Thu, 15 Jan 2015 18:56:45 +0000 (18:56 +0000)]
Use set() instead of option() for string option.

Fixes issue in r226185.

llvm-svn: 226192

9 years agoR600/SI: Unify VOP2 instructions which are VOP3-only on VI
Marek Olsak [Thu, 15 Jan 2015 18:43:06 +0000 (18:43 +0000)]
R600/SI: Unify VOP2 instructions which are VOP3-only on VI

This removes some duplicated classes and definitions.

These instructions are defined:
  _e32 // pseudo
  _e32_si
  _e64 // pseudo
  _e64_si
  _e64_vi

llvm-svn: 226191

9 years agoR600/SI: Use 64-bit encoding by default for opcodes that are VOP3-only on VI
Marek Olsak [Thu, 15 Jan 2015 18:43:01 +0000 (18:43 +0000)]
R600/SI: Use 64-bit encoding by default for opcodes that are VOP3-only on VI

llvm-svn: 226190

9 years agoR600/SI: Add V_READLANE_B32 and V_WRITELANE_B32 for VI
Marek Olsak [Thu, 15 Jan 2015 18:42:55 +0000 (18:42 +0000)]
R600/SI: Add V_READLANE_B32 and V_WRITELANE_B32 for VI

These are VOP3-only on VI.

The new multiclass doesn't define VOP3 versions of VOP2 instructions.

llvm-svn: 226189

9 years agoR600/SI: Don't shrink instructions whose e32 encoding doesn't exist
Marek Olsak [Thu, 15 Jan 2015 18:42:51 +0000 (18:42 +0000)]
R600/SI: Don't shrink instructions whose e32 encoding doesn't exist

v2: modify hasVALU32BitEncoding instead
v3: - add pseudoToMCOpcode helper to AMDGPUInstInfo, which is used by both
      hasVALU32BitEncoding and AMDGPUMCInstLower::lower
    - report an error if a pseudo can't be lowered
llvm-svn: 226188

9 years agoR600/SI: Add common class VOPAnyCommon
Marek Olsak [Thu, 15 Jan 2015 18:42:44 +0000 (18:42 +0000)]
R600/SI: Add common class VOPAnyCommon

llvm-svn: 226187

9 years agoR600/SI: Don't select SI-only VOP3 opcodes on VI
Marek Olsak [Thu, 15 Jan 2015 18:42:40 +0000 (18:42 +0000)]
R600/SI: Don't select SI-only VOP3 opcodes on VI

llvm-svn: 226186

9 years agoAdd a cmake option for LIT configuration variant.
Dan Albert [Thu, 15 Jan 2015 18:35:04 +0000 (18:35 +0000)]
Add a cmake option for LIT configuration variant.

llvm-svn: 226185

9 years ago[Hexagon] Adding vmux instruction. Removing old transfer instructions and updating...
Colin LeMahieu [Thu, 15 Jan 2015 18:16:00 +0000 (18:16 +0000)]
[Hexagon] Adding vmux instruction.  Removing old transfer instructions and updating references.

llvm-svn: 226184

9 years agostatepoint tests: use statepoint-example gc
Ramkumar Ramachandra [Thu, 15 Jan 2015 18:10:44 +0000 (18:10 +0000)]
statepoint tests: use statepoint-example gc

Mechanical conversion of statepoint tests to use the example-statepoint
gc.

llvm-svn: 226183

9 years agoSupport @PLT loads on 32bit x86.
Joerg Sonnenberger [Thu, 15 Jan 2015 17:59:02 +0000 (17:59 +0000)]
Support @PLT loads on 32bit x86.

llvm-svn: 226182

9 years agoFix a -Wnull-conversion warning.
Nico Weber [Thu, 15 Jan 2015 17:55:24 +0000 (17:55 +0000)]
Fix a -Wnull-conversion warning.

llvm-svn: 226181

9 years agoFix build after clang r226128.
Nico Weber [Thu, 15 Jan 2015 17:51:05 +0000 (17:51 +0000)]
Fix build after clang r226128.

llvm-svn: 226180

9 years ago[Hexagon] Deleting old float comparison instruction and updating references to new...
Colin LeMahieu [Thu, 15 Jan 2015 17:28:14 +0000 (17:28 +0000)]
[Hexagon] Deleting old float comparison instruction and updating references to new ones.

llvm-svn: 226179

9 years agoPR 20146
Nathan Sidwell [Thu, 15 Jan 2015 16:45:53 +0000 (16:45 +0000)]
PR 20146
reject CV void return type on C definitions per 6.9.1/3

llvm-svn: 226178

9 years ago[sanitizer] Restore -fno-lto accidentally removed in r226169.
Evgeniy Stepanov [Thu, 15 Jan 2015 16:31:22 +0000 (16:31 +0000)]
[sanitizer] Restore -fno-lto accidentally removed in r226169.

llvm-svn: 226177

9 years ago[Hexagon] Replacing old fadd/fsub instructions and updating references.
Colin LeMahieu [Thu, 15 Jan 2015 16:30:07 +0000 (16:30 +0000)]
[Hexagon] Replacing old fadd/fsub instructions and updating references.

llvm-svn: 226176

9 years ago[sanitizer] Implement include= option.
Evgeniy Stepanov [Thu, 15 Jan 2015 16:26:59 +0000 (16:26 +0000)]
[sanitizer] Implement include= option.

Allows loading sanitizer options from file.

llvm-svn: 226175

9 years agoRefactor configure_link_flags for modularity. NFC
Jonathan Roelofs [Thu, 15 Jan 2015 16:18:13 +0000 (16:18 +0000)]
Refactor configure_link_flags for modularity. NFC

llvm-svn: 226174

9 years agoRevert Don't create new comdats in CodeGen
Timur Iskhodzhanov [Thu, 15 Jan 2015 16:14:34 +0000 (16:14 +0000)]
Revert Don't create new comdats in CodeGen

It breaks AddressSanitizer on Windows.

llvm-svn: 226173

9 years agoclang-tidy: 'size' call that could be replaced with 'empty' on STL containers
Alexander Kornienko [Thu, 15 Jan 2015 15:46:58 +0000 (15:46 +0000)]
clang-tidy: 'size' call that could be replaced with 'empty' on STL containers

We are porting some of the checkers at a company we developed to the Clang Tidy
infrastructure. We would like to open source the checkers that may be useful
for the community as well. This patch is the first checker that is being ported
to Clang Tidy. We also added fix-it hints, and applied them to LLVM:
http://reviews.llvm.org/D6924

The code compiled and the unit tests are passed after the fixits was applied.

The documentation of the checker:

/// The emptiness of a container should be checked using the empty method
/// instead of the size method. It is not guaranteed that size is a
/// constant-time function, and it is generally more efficient and also shows
/// clearer intent to use empty. Furthermore some containers may implement the
/// empty method but not implement the size method. Using empty whenever
/// possible makes it easier to switch to another container in the future.

It also uses some custom ASTMatchers. In case you find them useful I can submit
them as separate patches to clang. I will apply your suggestions to this patch.

http://reviews.llvm.org/D6925

Patch by Gábor Horváth!

llvm-svn: 226172

9 years ago[mips] Fix a typo in the compare patterns for MIPS32r6/MIPS64r6.
Daniel Sanders [Thu, 15 Jan 2015 15:41:03 +0000 (15:41 +0000)]
[mips] Fix a typo in the compare patterns for MIPS32r6/MIPS64r6.

Summary: The patterns intended for the SETLE node were actually matching the SETLT node.

Reviewers: atanasyan, sstankovic, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 226171

9 years agoFix the C-API MCJIT test for 32-bit big endian machines.
Vasileios Kalintiris [Thu, 15 Jan 2015 15:36:04 +0000 (15:36 +0000)]
Fix the C-API MCJIT test for 32-bit big endian machines.

Avoid using unions for storing the return value from
LLVMGetGlobalValueAddress() and LLVMGetFunctionAddress() and accessing it as
a pointer through another pointer member. This causes problems on 32-bit big
endian machines since the pointer gets the higher part of the return value of
the aforementioned functions.

llvm-svn: 226170

9 years ago[sanitizer] Flag parser rewrite.
Evgeniy Stepanov [Thu, 15 Jan 2015 15:13:43 +0000 (15:13 +0000)]
[sanitizer] Flag parser rewrite.

The new parser is a lot stricter about syntax, reports unrecognized
flags, and will make it easier to implemented some of the planned features.

llvm-svn: 226169

9 years ago[lsan] Fix a typo in a test.
Evgeniy Stepanov [Thu, 15 Jan 2015 15:00:49 +0000 (15:00 +0000)]
[lsan] Fix a typo in a test.

llvm-svn: 226168

9 years agoFix compilation of compiler_rt against libunwind.
Evgeniy Stepanov [Thu, 15 Jan 2015 14:27:38 +0000 (14:27 +0000)]
Fix compilation of compiler_rt against libunwind.

libunwind defines _Unwind_GetLanguageSpecificData as returning long
instead of (uint8_t *).

llvm-svn: 226167

9 years agoAdd disassembler tests for mips64r6 platform. There are no functional changes.
Vladimir Medic [Thu, 15 Jan 2015 14:18:12 +0000 (14:18 +0000)]
Add disassembler tests for mips64r6 platform. There are no functional changes.

llvm-svn: 226166

9 years agoAdd disassembler tests for mips32r6 platform. There are no functional changes.
Vladimir Medic [Thu, 15 Jan 2015 14:11:38 +0000 (14:11 +0000)]
Add disassembler tests for mips32r6 platform. There are no functional changes.

llvm-svn: 226165

9 years agoAdd disassembler tests for mips64r2 platform. There are no functional changes.
Vladimir Medic [Thu, 15 Jan 2015 14:06:34 +0000 (14:06 +0000)]
Add disassembler tests for mips64r2 platform. There are no functional changes.

llvm-svn: 226164

9 years agoFix SelectionDAG -view-*-dags filtering
Mehdi Amini [Thu, 15 Jan 2015 12:03:32 +0000 (12:03 +0000)]
Fix SelectionDAG -view-*-dags filtering

llvm-svn: 226163

9 years agoIn commit clang r226096, DefinitionRequired has been removed. Do the same in lldb...
Sylvestre Ledru [Thu, 15 Jan 2015 11:50:50 +0000 (11:50 +0000)]
In commit clang r226096, DefinitionRequired has been removed. Do the same in lldb implementation

llvm-svn: 226162

9 years agoReplace size method call of containers to empty method where appropriate
Alexander Kornienko [Thu, 15 Jan 2015 11:41:30 +0000 (11:41 +0000)]
Replace size method call of containers to empty method where appropriate

This patch was generated by a clang tidy checker that is being open sourced.
The documentation of that checker is the following:

/// The emptiness of a container should be checked using the empty method
/// instead of the size method. It is not guaranteed that size is a
/// constant-time function, and it is generally more efficient and also shows
/// clearer intent to use empty. Furthermore some containers may implement the
/// empty method but not implement the size method. Using empty whenever
/// possible makes it easier to switch to another container in the future.

Patch by Gábor Horváth!

llvm-svn: 226161

9 years ago[PM] Port TargetLibraryInfo to the new pass manager, provided by the
Chandler Carruth [Thu, 15 Jan 2015 11:39:46 +0000 (11:39 +0000)]
[PM] Port TargetLibraryInfo to the new pass manager, provided by the
TargetLibraryAnalysis pass.

There are actually no direct tests of this already in the tree. I've
added the most basic test that the pass manager bits themselves work,
and the TLI object produced will be tested by an upcoming patches as
they port passes which rely on TLI.

This is starting to point out the awkwardness of the invalidate API --
it seems poorly fitting on the *result* object. I suspect I will change
it to live on the analysis instead, but that's not for this change, and
I'd rather have a few more passes ported in order to have more
experience with how this plays out.

I believe there is only one more analysis required in order to start
porting instcombine. =]

llvm-svn: 226160

9 years ago[PM] Track an LLVM API change by switching this code to directly create
Chandler Carruth [Thu, 15 Jan 2015 10:43:18 +0000 (10:43 +0000)]
[PM] Track an LLVM API change by switching this code to directly create
the wrapper pass for TLI which is now separate from the core class.

llvm-svn: 226159

9 years ago[PM] Track an LLVM API update which separates the TargetLibraryInfo
Chandler Carruth [Thu, 15 Jan 2015 10:42:26 +0000 (10:42 +0000)]
[PM] Track an LLVM API update which separates the TargetLibraryInfo
object from the pass that provides access to it.

We should probably refactor the createTLI code here in Clang in light of
the new structure, but I wanted this patch to be a minimal one that just
patches the behavior back together.

llvm-svn: 226158

9 years ago[PM] Separate the TargetLibraryInfo object from the immutable pass.
Chandler Carruth [Thu, 15 Jan 2015 10:41:28 +0000 (10:41 +0000)]
[PM] Separate the TargetLibraryInfo object from the immutable pass.

The pass is really just a means of accessing a cached instance of the
TargetLibraryInfo object, and this way we can re-use that object for the
new pass manager as its result.

Lots of delta, but nothing interesting happening here. This is the
common pattern that is developing to allow analyses to live in both the
old and new pass manager -- a wrapper pass in the old pass manager
emulates the separation intrinsic to the new pass manager between the
result and pass for analyses.

llvm-svn: 226157

9 years agoAST: alignof might be dependent because of alignment attributes
David Majnemer [Thu, 15 Jan 2015 10:04:14 +0000 (10:04 +0000)]
AST: alignof might be dependent because of alignment attributes

Dependent alignment attributes should make an alignof expression
dependent as well.

llvm-svn: 226156

9 years agoHide some redundant AVX512 instructions from the asm parser, but force them to show...
Craig Topper [Thu, 15 Jan 2015 09:37:15 +0000 (09:37 +0000)]
Hide some redundant AVX512 instructions from the asm parser, but force them to show up in the disassembler.

llvm-svn: 226155

9 years agoRename InputGraph.h -> Node.h.
Rui Ueyama [Thu, 15 Jan 2015 08:58:38 +0000 (08:58 +0000)]
Rename InputGraph.h -> Node.h.

llvm-svn: 226154

9 years agoSimplify.
Rui Ueyama [Thu, 15 Jan 2015 08:51:23 +0000 (08:51 +0000)]
Simplify.

llvm-svn: 226153

9 years ago[CMake] clangCodeGen: Prune a redundant "Target" out of libdeps. It is supplied by...
NAKAMURA Takumi [Thu, 15 Jan 2015 08:51:01 +0000 (08:51 +0000)]
[CMake] clangCodeGen: Prune a redundant "Target" out of libdeps. It is supplied by Analysis.

llvm-svn: 226152

9 years agoAdd disassembler tests for mips64 platform. There are no functional changes.
Vladimir Medic [Thu, 15 Jan 2015 08:50:20 +0000 (08:50 +0000)]
Add disassembler tests for mips64 platform. There are no functional changes.

llvm-svn: 226151

9 years ago[ELF] Do not error on non-existent file in the driver.
Rui Ueyama [Thu, 15 Jan 2015 08:49:19 +0000 (08:49 +0000)]
[ELF] Do not error on non-existent file in the driver.

This change makes it easy to write unit tests for the GNU driver.
No more "empty group" hack is needed. No change in functionality.

llvm-svn: 226150

9 years agoRemove InputGraph and use std::vector<Node> instead.
Rui Ueyama [Thu, 15 Jan 2015 08:46:36 +0000 (08:46 +0000)]
Remove InputGraph and use std::vector<Node> instead.

In total we have removed more than 1000 lines!

llvm-svn: 226149

9 years agoAST: Ensure implicit records have default visibility
David Majnemer [Thu, 15 Jan 2015 08:41:25 +0000 (08:41 +0000)]
AST: Ensure implicit records have default visibility

Types composed with certain implicit record types would have their RTTI
marked as hidden because the implicit record type didn't have any
visibility.

This manifests itself as triggering false positives from tools like
clang's -fsantize=function feature.  The RTTI for a function type's
return type wouldn't match if the return type was an implicit record
type.

Patch by Stephan Bergmann!

llvm-svn: 226148

9 years agoRename InputElement Node.
Rui Ueyama [Thu, 15 Jan 2015 08:31:46 +0000 (08:31 +0000)]
Rename InputElement Node.

InputElement was named that because it's an element of an InputGraph.
It's losing the origin because the InputGraph is now being removed.
InputElement's subclass is FileNode, that naming inconsistency needed
to be fixed.

llvm-svn: 226147

9 years agoRemove InputGraph::addInputElement{,Front}.
Rui Ueyama [Thu, 15 Jan 2015 08:18:14 +0000 (08:18 +0000)]
Remove InputGraph::addInputElement{,Front}.

They were the last member functions of InputGraph (besides members()).
Now InputGraph is just a container of a vector. We are ready to replace
InputGraph with plain File vector.

llvm-svn: 226146

9 years agoRemove WrapperNode.
Rui Ueyama [Thu, 15 Jan 2015 08:10:10 +0000 (08:10 +0000)]
Remove WrapperNode.

WrapperNode was a useless subclass of FileNode. We should just use
FileNode instead.

llvm-svn: 226145