oota-llvm.git
9 years ago[Hexagon] Updating call/jump instruction patterns.
Colin LeMahieu [Fri, 16 Jan 2015 17:05:27 +0000 (17:05 +0000)]
[Hexagon] Updating call/jump instruction patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226288 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][DAG] Disable target specific combine on INSERTPS dag nodes at -O0.
Andrea Di Biagio [Fri, 16 Jan 2015 14:55:26 +0000 (14:55 +0000)]
[X86][DAG] Disable target specific combine on INSERTPS dag nodes at -O0.

This patch disables target specific combine on X86ISD::INSERTPS dag nodes
if optlevel is CodeGenOpt::None.

The backend currently implements a target specific combine rule that converts
a vector load used by an INSERTPS dag node into a scalar load plus a
scalar_to_vector. This allows ISel to select a single INSERTPSrm instead of
two instructions (i.e. a vector load plus INSERTPSrr).

However, the existing target combine rule on INSERTPS nodes only works under
the assumption that ISel will always be able to match an INSERTPSrm. This is
not true in general at -O0, since the backend only allows folding a load into
the memory operand of an instruction if the optimization level is not
CodeGenOpt::None.

In the example below:

//
__m128 test(__m128 a, __m128 *b) {
  __m128 c = _mm_insert_ps(a, *b, 1 << 6);
  return c;
}
//

Before this patch, at -O0, the backend would have canonicalized the load to 'b'
into a scalar load plus scalar_to_vector. Later on, ISel would have selected an
INSERTPSrr leaving the insertps mask in an inconsistent state:

  movss 4(%rdi), %xmm1
  insertps  $64, %xmm1, %xmm0 # xmm0 = xmm1[1],xmm0[1,2,3].

With this patch, the backend avoids folding the vector load into the operand of
the INSERTPS. The new codegen at -O0 is:

  movaps (%rdi), %xmm1
  insertps  $64, %xmm1, %xmm0 # %xmm1[1],xmm0[1,2,3].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226277 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Remove a redundant semicolon and add space before curly brackets. NFC.
Toma Tabacu [Fri, 16 Jan 2015 10:45:15 +0000 (10:45 +0000)]
[mips] Remove a redundant semicolon and add space before curly brackets. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226269 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Refactored stack memory folding tests to explicitly force register spilling
Simon Pilgrim [Fri, 16 Jan 2015 09:32:54 +0000 (09:32 +0000)]
[X86] Refactored stack memory folding tests to explicitly force register spilling

The current 'big vectors' stack folded reload testing pattern is very bulky and makes it difficult to test all instructions as big vectors will tend to use only the ymm instruction implementations.

This patch changes the tests to use a nop call that lists explicit xmm registers as sideeffects, with this we can force a partial register spill of the relevant registers and then check that the reload is correctly folded. The asm generated only adds the forced spill, a nop instruction and a couple of extra labels (a fraction of the current approach).

More exhaustive tests will follow shortly, I've added some extra tests (the xmm versions of some of the existing folding tests) as a starting point.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226264 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r226242 - Revert Revert Don't create new comdats in CodeGen
Timur Iskhodzhanov [Fri, 16 Jan 2015 08:38:45 +0000 (08:38 +0000)]
Revert r226242 - Revert Revert Don't create new comdats in CodeGen

This breaks AddressSanitizer (ninja check-asan) on Windows

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226251 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226248 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226247 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226245 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226242 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226241 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226239 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226238 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226232 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226230 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226229 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226228 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226226 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226224 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226219 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226217 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226216 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226215 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226214 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226210 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226207 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226206 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226201 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226200 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226198 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226197 91177308-0d34-0410-b5e6-96231b3b80d8

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)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226196 91177308-0d34-0410-b5e6-96231b3b80d8

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/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226195 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226194 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226191 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226190 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226189 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226188 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226187 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226186 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226184 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226183 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226182 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226179 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226176 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226173 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226171 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226170 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226166 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226165 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226164 91177308-0d34-0410-b5e6-96231b3b80d8

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226163 91177308-0d34-0410-b5e6-96231b3b80d8

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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226161 91177308-0d34-0410-b5e6-96231b3b80d8

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. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226160 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226157 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226155 91177308-0d34-0410-b5e6-96231b3b80d8

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226151 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSimplifyIndVar: Remove unused variable
David Majnemer [Thu, 15 Jan 2015 07:11:23 +0000 (07:11 +0000)]
SimplifyIndVar: Remove unused variable

OtherOperandIdx is not used anymore, remove it to silence warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226138 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate libdeps since TLI was moved from Target to Analysis in r226078.
NAKAMURA Takumi [Thu, 15 Jan 2015 05:21:00 +0000 (05:21 +0000)]
Update libdeps since TLI was moved from Target to Analysis in r226078.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226126 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReorder.
NAKAMURA Takumi [Thu, 15 Jan 2015 05:20:46 +0000 (05:20 +0000)]
Reorder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226125 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoutils/release/tag.sh: fix -revision vs. -rc check
Hans Wennborg [Thu, 15 Jan 2015 04:36:20 +0000 (04:36 +0000)]
utils/release/tag.sh: fix -revision vs. -rc check

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226124 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Clean up the TLI doxygen comments prior to refactoring this code
Chandler Carruth [Thu, 15 Jan 2015 03:51:04 +0000 (03:51 +0000)]
[PM] Clean up the TLI doxygen comments prior to refactoring this code
for the new pass manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226089 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "r226071 - [RegisterCoalescer] Remove copies to reserved registers"
Hal Finkel [Thu, 15 Jan 2015 03:08:59 +0000 (03:08 +0000)]
Revert "r226071 - [RegisterCoalescer] Remove copies to reserved registers"

Reverting this while I investigate some bad behavior this is causing. As a
possibly-related issue, adding -verify-machineinstrs to one of the test cases
now fails because of this change:

  llc test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll -march=x86-64 -o - -verify-machineinstrs

*** Bad machine code: No instruction at def index ***
- function:    foo
- basic block: BB#0 return (0x10007e21f10) [0B;736B)
- liverange:   [128r,128d:9)[160r,160d:8)[176r,176d:7)[336r,336d:6)[464r,464d:5)[480r,480d:4)[624r,624d:3)[752r,752d:2)[768r,768d:1)[78
4r,784d:0)  0@784r 1@768r 2@752r 3@624r 4@480r 5@464r 6@336r 7@176r 8@160r 9@128r
- register:    %DS
Valno #3 is defined at 624r

*** Bad machine code: Live segment doesn't end at a valid instruction ***
- function:    foo
- basic block: BB#0 return (0x10007e21f10) [0B;736B)
- liverange:   [128r,128d:9)[160r,160d:8)[176r,176d:7)[336r,336d:6)[464r,464d:5)[480r,480d:4)[624r,624d:3)[752r,752d:2)[768r,768d:1)[78
4r,784d:0)  0@784r 1@768r 2@752r 3@624r 4@480r 5@464r 6@336r 7@176r 8@160r 9@128r
- register:    %DS
[624r,624d:3)
LLVM ERROR: Found 2 machine code errors.

where 624r corresponds exactly to the interval combining change:

624B    %RSP<def> = COPY %vreg16; GR64:%vreg16
        Considering merging %vreg16 with %RSP
                RHS = %vreg16 [608r,624r:0)  0@608r
                updated: 608B   %RSP<def> = MOV64rm <fi#3>, 1, %noreg, 0, %noreg; mem:LD8[%saved_stack.1]
        Success: %vreg16 -> %RSP
        Result = %RSP

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226086 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSwitch this header file to not hard-code Windows line endings.
Chandler Carruth [Thu, 15 Jan 2015 02:21:56 +0000 (02:21 +0000)]
Switch this header file to not hard-code Windows line endings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226081 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PM] Move TargetLibraryInfo into the Analysis library.
Chandler Carruth [Thu, 15 Jan 2015 02:16:27 +0000 (02:16 +0000)]
[PM] Move TargetLibraryInfo into the Analysis library.

While the term "Target" is in the name, it doesn't really have to do
with the LLVM Target library -- this isn't an abstraction which LLVM
targets generally need to implement or extend. It has much more to do
with modeling the various runtime libraries on different OSes and with
different runtime environments. The "target" in this sense is the more
general sense of a target of cross compilation.

This is in preparation for porting this analysis to the new pass
manager.

No functionality changed, and updates inbound for Clang and Polly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226078 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWin64Exception.cpp: Try to fix crash for x64 EH. "Per" might be null there.
NAKAMURA Takumi [Thu, 15 Jan 2015 02:15:21 +0000 (02:15 +0000)]
Win64Exception.cpp: Try to fix crash for x64 EH. "Per" might be null there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226077 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix PR22222
Sanjoy Das [Thu, 15 Jan 2015 01:46:09 +0000 (01:46 +0000)]
Fix PR22222

The bug was introduced in r225282. r225282 assumed that sub X, Y is
the same as add X, -Y. This is not correct if we are going to upgrade
the sub to sub nuw. This change fixes the issue by making the
optimization ignore sub instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226075 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[TableGen] Add support for negative immediates to AsmMatcherEmitter
Hal Finkel [Thu, 15 Jan 2015 01:33:00 +0000 (01:33 +0000)]
[TableGen] Add support for negative immediates to AsmMatcherEmitter

This adds support for creating an InstAlias with a negative immediate, i.e.:

  def NOT : InstAlias<"not $dst, $src", (XORI GR32:$dst, GR32:$src, -1)>;

by resolving this problem:

RISCVGenAsmMatcher.inc:95:11: error: expected '= constant-expression' or end of enumerator definition
  CVT_imm_-1,
  ^^^^^^^^^^

Patch by Jordy Potman, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226073 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[RegisterCoalescer] Remove copies to reserved registers
Hal Finkel [Thu, 15 Jan 2015 01:25:28 +0000 (01:25 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226071 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Add assembler support for mcrfs and friends
Hal Finkel [Thu, 15 Jan 2015 01:00:53 +0000 (01:00 +0000)]
[PowerPC] Add assembler support for mcrfs and friends

Fill out our support for the floating-point status and control register
instructions (mcrfs and friends). As it turns out, these are necessary for
compiling src/test/harness_fp.h in TBB for PowerPC.

Thanks to Raf Schietekat for reporting the issue!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226070 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFor PR21145: recognise a builtin call to a known deallocation function even if
Richard Smith [Thu, 15 Jan 2015 01:00:33 +0000 (01:00 +0000)]
For PR21145: recognise a builtin call to a known deallocation function even if
it's defined in the current module. Clang generates this situation for the
C++14 sized deallocation functions, because it generates a weak definition in
case one isn't provided by the C++ runtime library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226069 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Replacing old versions of stores and loads.
Colin LeMahieu [Thu, 15 Jan 2015 00:15:30 +0000 (00:15 +0000)]
[Hexagon] Replacing old versions of stores and loads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226065 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd missing include directive for llvm::make_unique().
Adrian Prantl [Thu, 15 Jan 2015 00:11:36 +0000 (00:11 +0000)]
Add missing include directive for llvm::make_unique().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226064 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[GC] CodeGenPrep transform: simplify offsetable relocate
Ramkumar Ramachandra [Wed, 14 Jan 2015 23:27:07 +0000 (23:27 +0000)]
[GC] CodeGenPrep transform: simplify offsetable relocate

The transform is somewhat involved, but the basic idea is simple: find
derived pointers that have been offset from the base pointer using gep
and replace the relocate of the derived pointer with a gep to the
relocated base pointer (with the same offset).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226060 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Fix comment spelling, NFC
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 23:11:51 +0000 (23:11 +0000)]
IR: Fix comment spelling, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226058 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Replacing old version of convert and load f64.
Colin LeMahieu [Wed, 14 Jan 2015 23:07:36 +0000 (23:07 +0000)]
[Hexagon] Replacing old version of convert and load f64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226057 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agogetMangledTypeStr: clarify how it mangles types, and add tests
Philip Reames [Wed, 14 Jan 2015 23:05:17 +0000 (23:05 +0000)]
getMangledTypeStr: clarify how it mangles types, and add tests

"Write a set of tests that show how name mangling is done for overloaded intrinsics."  These happen to use gc.relocates to exercise the codepath in question, but is not a GC specific test.

Patch by: artagnon@gmail.com
Differential Revision: http://reviews.llvm.org/D6915

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226056 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate libdeps in NVPTXCodeGen, since r225944.
NAKAMURA Takumi [Wed, 14 Jan 2015 23:01:36 +0000 (23:01 +0000)]
Update libdeps in NVPTXCodeGen, since r225944.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226055 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse MMI->getPersonality() instead of MMI->getPersonalities()[MMI->getPersonalityIndex()]
Reid Kleckner [Wed, 14 Jan 2015 22:47:54 +0000 (22:47 +0000)]
Use MMI->getPersonality() instead of MMI->getPersonalities()[MMI->getPersonalityIndex()]

Also nuke the comment about supporting multiple personalities in a
single function, aka PR1414. That's just crazy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226052 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Move MDLocation into place
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 22:27:36 +0000 (22:27 +0000)]
IR: Move MDLocation into place

This commit moves `MDLocation`, finishing off PR21433.  There's an
accompanying clang commit for frontend testcases.  I'll attach the
testcase upgrade script I used to PR21433 to help out-of-tree
frontends/backends.

This changes the schema for `DebugLoc` and `DILocation` from:

    !{i32 3, i32 7, !7, !8}

to:

    !MDLocation(line: 3, column: 7, scope: !7, inlinedAt: !8)

Note that empty fields (line/column: 0 and inlinedAt: null) don't get
printed by the assembly writer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226048 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMachineVerifier: Allow undef reads if a matching superreg is defined.
Matthias Braun [Wed, 14 Jan 2015 22:25:14 +0000 (22:25 +0000)]
MachineVerifier: Allow undef reads if a matching superreg is defined.

Summary:
Some pseudo instruction expansions break down a wide register use into
multiple uses of smaller sub registers. If the super register was
partially undefined the broken down sub registers may be completely
undefined now leading to MachineVerifier complaints. Unfortunately
liveness information to add the required dead flags is not easily
(cheaply) available when expanding pseudo instructions.

This commit changes the verifier to be quiet if there is an additional
implicit use of a super register. Pseudo instruction expanders can use
this to mark cases where partially defined values get potentially broken
into completely undefined ones.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226047 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Always print MDLocation line
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 22:14:26 +0000 (22:14 +0000)]
IR: Always print MDLocation line

Print `MDLocation`'s `line` field even when it's 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226046 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Drop metadata references more aggressively during teardown
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 21:58:17 +0000 (21:58 +0000)]
IR: Drop metadata references more aggressively during teardown

Sometimes teardown happens before the debug info graph is complete
(e.g., when clang throws an error).  In that case, `MDNode`s will still
have RAUW, so deleting constants that the `MDNode`s point at will be
relatively expensive -- it'll cause re-uniquing all up the chain (what
I've been referring to as "teardown madness").

So, drop references *before* deleting constants.  We need to drop a few
more references now: the metadata side of the metadata/value bridges
needs to be dropped off the cliff along with the rest of it (previously,
the bridges were cleaned before we did anything with the `MDNode`s).

There's no real functionality change here -- state before and after
`LLVMContextImpl::~LLVMContextImpl()` is unchanged -- so no testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226044 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't create new comdats in CodeGen.
Rafael Espindola [Wed, 14 Jan 2015 20:55:48 +0000 (20:55 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226038 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Removing old, unused !tstbit instructions.
Colin LeMahieu [Wed, 14 Jan 2015 20:26:15 +0000 (20:26 +0000)]
[Hexagon] Removing old, unused !tstbit instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226036 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a test that would have found the issue with r225644.
Rafael Espindola [Wed, 14 Jan 2015 20:24:46 +0000 (20:24 +0000)]
Add a test that would have found the issue with r225644.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226035 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MBP] Add flags to disable the BadCFGConflict check in MachineBlockPlacement.
Chandler Carruth [Wed, 14 Jan 2015 20:19:29 +0000 (20:19 +0000)]
[MBP] Add flags to disable the BadCFGConflict check in MachineBlockPlacement.

Some benchmarks have shown that this could lead to a potential
performance benefit, and so adding some flags to try to help measure the
difference.

A possible explanation. In diamond-shaped CFGs (A followed by either
B or C both followed by D), putting B and C both in between A and
D leads to the code being less dense than it could be. Always either
B or C have to be skipped increasing the chance of cache misses etc.
Moving either B or C to after D might be beneficial on average.

In the long run, but we should probably do a better job of analyzing the
basic block and branch probabilities to move the correct one of B or
C to after D. But even if we don't use this in the long run, it is
a good baseline for benchmarking.

Original patch authored by Daniel Jasper with test tweaks and a second
flag added by me.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226034 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PPC64] Add support for the ICBT instruction on POWER8.
Bill Schmidt [Wed, 14 Jan 2015 20:17:10 +0000 (20:17 +0000)]
[PPC64] Add support for the ICBT instruction on POWER8.

Patch by Kit Barton.

Support for the ICBT instruction is currently present, but limited to
embedded processors. This change adds a new FeatureICBT that can be used
to identify whether the ICBT instruction is available on a specific processor.

Two new tests are added:
 * Positive test to ensure the icbt instruction is present when using
-mcpu=pwr8
 * Negative test to ensure the icbt instruction is not generated when
using -mcpu=pwr7

Both test cases use the Prefetch opcode in LLVM. They are based on the
ppc64-prefetch.ll test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226033 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix linking of shared libraries.
Rafael Espindola [Wed, 14 Jan 2015 20:08:46 +0000 (20:08 +0000)]
Fix linking of shared libraries.

In shared libraries the plugin can see non-weak declarations that are still
undefined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226031 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd comment about a gotcha I ran across while touching this code.
David Blaikie [Wed, 14 Jan 2015 19:59:18 +0000 (19:59 +0000)]
Add comment about a gotcha I ran across while touching this code.

I haven't looked closely at exactly why the side effect is required, but
this seems better than not mentioning it at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226030 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Fix a use-after-free in RAUW
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 19:56:10 +0000 (19:56 +0000)]
IR: Fix a use-after-free in RAUW

Happened pretty commonly during `LLVMContext` teardown when `clang -g`
hit an error.  This fixes the use-after-free.  Next I'll clean up
teardown so that it's not RAUW'ing when metadata-tracked values are
deleted (only really causes a problem if the graph is mid-construction
when teardown starts, but it's still unnecessary work).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226029 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agounique_ptrify the value in DominatorTreeBase::DomTreeNodes
David Blaikie [Wed, 14 Jan 2015 19:55:27 +0000 (19:55 +0000)]
unique_ptrify the value in DominatorTreeBase::DomTreeNodes

(noticed the need for an explicit dtor in a recent commit & figured I'd
tidy that up)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226028 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix handling of extern_weak. This was broken by r225983.
Rafael Espindola [Wed, 14 Jan 2015 19:43:32 +0000 (19:43 +0000)]
Fix handling of extern_weak. This was broken by r225983.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226026 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstCombine: Don't take A-B<0 into A<B if A-B has other uses
David Majnemer [Wed, 14 Jan 2015 19:26:56 +0000 (19:26 +0000)]
InstCombine: Don't take A-B<0 into A<B if A-B has other uses

This fixes PR22226.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226023 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Add r224985 back with two fixes."
Rafael Espindola [Wed, 14 Jan 2015 19:07:23 +0000 (19:07 +0000)]
Revert "Add r224985 back with two fixes."

This reverts commit r225644 while I debug a regression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226022 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEmit the Itanium LSDA for unknown EH personalities on Win64
Reid Kleckner [Wed, 14 Jan 2015 18:50:10 +0000 (18:50 +0000)]
Emit the Itanium LSDA for unknown EH personalities on Win64

This fixes lots of generic CodeGen tests that use __gcc_personality_v0.
This suggests that using ExceptionHandling::MSVC was a mistake, and we
should instead classify each function by personality function. This
would, for example, allow us to LTO a binary containing uses of SEH and
Itanium EH.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226019 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove dead code for llvm.eh.selector in the old EH model
Reid Kleckner [Wed, 14 Jan 2015 18:49:39 +0000 (18:49 +0000)]
Remove dead code for llvm.eh.selector in the old EH model

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226018 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Removing old versions of cmph and updating references.
Colin LeMahieu [Wed, 14 Jan 2015 18:26:14 +0000 (18:26 +0000)]
[Hexagon] Removing old versions of cmph and updating references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226013 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd support for comdats with names larger than 256 characters.
Rafael Espindola [Wed, 14 Jan 2015 18:25:45 +0000 (18:25 +0000)]
Add support for comdats with names larger than 256 characters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226012 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReleaseNotes.rst: bump version to 3.7
Hans Wennborg [Wed, 14 Jan 2015 18:07:30 +0000 (18:07 +0000)]
ReleaseNotes.rst: bump version to 3.7

The 3.6 notes are now in the 3.6 branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226007 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Hexagon] Removing old versions of cmpb and updating references.
Colin LeMahieu [Wed, 14 Jan 2015 18:05:44 +0000 (18:05 +0000)]
[Hexagon] Removing old versions of cmpb and updating references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226006 91177308-0d34-0410-b5e6-96231b3b80d8