oota-llvm.git
6 years agoEnable gtest SEH when building with clang-cl
Reid Kleckner [Thu, 8 Oct 2015 22:44:39 +0000 (22:44 +0000)]
Enable gtest SEH when building with clang-cl

Clang supports SEH well enough that this should work out of the box.  If
it doesn't, we'll hear about it.

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

6 years agoAArch64: Stop using MachineInstr::getNextNode()
Duncan P. N. Exon Smith [Thu, 8 Oct 2015 22:43:26 +0000 (22:43 +0000)]
AArch64: Stop using MachineInstr::getNextNode()

Stop using `getNextNode()` to get an insertion point (at least, in this
one place).  Instead, use iterator logic directly.

The `getNextNode()` interface isn't actually supposed to work for
creating iterators; it's supposed to return `nullptr` (not a real
iterator) if this is the last node.  It's currently broken and will
"happen" to work, but if we ever fix the function, we'll get some
strange failures in places like this.

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

6 years agoMC: Stop using Fragment::getNextNode()
Duncan P. N. Exon Smith [Thu, 8 Oct 2015 22:36:08 +0000 (22:36 +0000)]
MC: Stop using Fragment::getNextNode()

Stop using `getNextNode()` to get an iterator to a fragment (at least,
in this one place).  Instead, use iterator logic directly.

The `getNextNode()` interface isn't actually supposed to work for
creating iterators; it's supposed to return `nullptr` (not a real
iterator) if this is the last node.  It's currently broken and will
"happen" to work, but if we ever fix the function, we'll get some
strange failures in places like this.

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

6 years ago[dsymutil] Try to find lipo first besides dsymutil before looking up the PATH.
Frederic Riss [Thu, 8 Oct 2015 22:35:53 +0000 (22:35 +0000)]
[dsymutil] Try to find lipo first besides dsymutil before looking up the PATH.

Even if we don't have it in PATH, lipo should usually exist in the same directory
as dsymutil. Keep the fallback looking up the PATH, it's very useful when
testing a non-installed executable.

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

6 years agoPowerPC: Don't use getNextNode() for insertion point
Duncan P. N. Exon Smith [Thu, 8 Oct 2015 22:20:37 +0000 (22:20 +0000)]
PowerPC: Don't use getNextNode() for insertion point

Stop using `getNextNode()` to create an insertion point for machine
instructions (at least, in this one place).  Instead, use an iterator.
As a drive-by, clean up dump statements to use iterator logic.

The `getNextNode()` interface isn't actually supposed to work for
insertion points; it's supposed to return `nullptr` if this is the last
node.  It's currently broken and will "happen" to work, but if we ever
fix the function, we'll get some strange failures.

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

6 years agoNew MSan mapping layout (llvm part).
Evgeniy Stepanov [Thu, 8 Oct 2015 21:35:26 +0000 (21:35 +0000)]
New MSan mapping layout (llvm part).

This is an implementation of
https://github.com/google/sanitizers/issues/579

It has a number of advantages over the current mapping:
* Works for non-PIE executables.
* Does not require ASLR; as a consequence, debugging MSan programs in
  gdb no longer requires "set disable-randomization off".
* Supports linux kernels >=4.1.2.
* The code is marginally faster and smaller.

This is an ABI break. We never really promised ABI stability, but
this patch includes a courtesy escape hatch: a compile-time macro
that reverts back to the old mapping layout.

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

6 years agoAdd Triple::isAndroid().
Evgeniy Stepanov [Thu, 8 Oct 2015 21:21:24 +0000 (21:21 +0000)]
Add Triple::isAndroid().

This is a simple refactoring that replaces Triple.getEnvironment()
checks for Android with Triple.isAndroid().

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

6 years agoFix another UBSan test error from r248897 and follow on fix r249689
Teresa Johnson [Thu, 8 Oct 2015 20:52:23 +0000 (20:52 +0000)]
Fix another UBSan test error from r248897 and follow on fix r249689

While here fix a few more issues with potential overflow and add
new tests for these cases. Ensured that test now passes with UBSan.

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

6 years agoRemove a '#' so that we can check either form for the various targets.
Eric Christopher [Thu, 8 Oct 2015 20:18:15 +0000 (20:18 +0000)]
Remove a '#' so that we can check either form for the various targets.

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

6 years agoMove the MMX subtarget feature out of the SSE set of features and into
Eric Christopher [Thu, 8 Oct 2015 20:10:06 +0000 (20:10 +0000)]
Move the MMX subtarget feature out of the SSE set of features and into
its own variable.

This is needed so that we can explicitly turn off MMX without turning
off SSE and also so that we can diagnose feature set incompatibilities
that involve MMX without SSE.

Rationale:

// sse3
__m128d test_mm_addsub_pd(__m128d A, __m128d B) {
  return _mm_addsub_pd(A, B);
}

// mmx
void shift(__m64 a, __m64 b, int c) {
  _mm_slli_pi16(a, c);
  _mm_slli_pi32(a, c);
  _mm_slli_si64(a, c);
  _mm_srli_pi16(a, c);
  _mm_srli_pi32(a, c);
  _mm_srli_si64(a, c);
  _mm_srai_pi16(a, c);
  _mm_srai_pi32(a, c);
}

clang -msse3 -mno-mmx file.c -c

For this code we should be able to explicitly turn off MMX
without affecting the compilation of the SSE3 function and then
diagnose and error on compiling the MMX function.

This matches the existing gcc behavior and follows the spirit of
the SSE/MMX separation in llvm where we can (and do) turn off
MMX code generation except in the presence of intrinsics.

Updated a couple of tests, but primarily tested with a couple of tests
for turning on only mmx and only sse.

This is paired with a patch to clang to take advantage of this behavior.

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

6 years agoRe-apply r249644: Handle inline stacks in gcov-encoded sample profiles.
Diego Novillo [Thu, 8 Oct 2015 19:40:37 +0000 (19:40 +0000)]
Re-apply r249644: Handle inline stacks in gcov-encoded sample profiles.

This fixes memory allocation problems by making the merge operation keep
the profile readers around until the merged profile has been emitted.
This is needed to prevent the inlined function names to disappear from
the function profiles. Since all the names are kept as references, once
the reader disappears, the names are also deallocated.

Additionally, XFAIL on big-endian architectures. The test case uses a
gcov file generated on a little-endian system.

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

6 years ago[bpf] Do not expand UNDEF SDNode during insn selection lowering
Alexei Starovoitov [Thu, 8 Oct 2015 18:52:40 +0000 (18:52 +0000)]
[bpf] Do not expand UNDEF SDNode during insn selection lowering

  o Before this patch, BPF backend will expand UNDEF node
    to i64 constant 0.
  o For second pass of dag combiner, legalizer will run through
    each to-be-processed dag node.
  o If any new SDNode is generated and has an undef operand,
    dag combiner will put undef node, newly-generated constant-0 node,
    and any node which uses these nodes in the working list.
  o During this process, it is possible undef operand is
    generated again, and this will form an infinite loop
    for dag combiner pass2.
  o This patch allows UNDEF to be a legal type.

Signed-off-by: Yonghong Song <yhs@plumgrid.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249718 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SCEV] Bring some methods up to coding style; NFC
Sanjoy Das [Thu, 8 Oct 2015 18:46:59 +0000 (18:46 +0000)]
[SCEV] Bring some methods up to coding style; NFC

 - Start methods with lower case
 - Reflow a comment
 - Delete header comment repeated in .cpp file

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

6 years ago[WinEH] Relax assertion in the presence of stack realignment
Reid Kleckner [Thu, 8 Oct 2015 18:41:52 +0000 (18:41 +0000)]
[WinEH] Relax assertion in the presence of stack realignment

The code is correct as is, but we should test it.

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

6 years ago[PowerPC] Add R_PPC64_GLOB_DAT and R_PPC64_RELATIVE to PowerPC64.def
Hal Finkel [Thu, 8 Oct 2015 18:30:27 +0000 (18:30 +0000)]
[PowerPC] Add R_PPC64_GLOB_DAT and R_PPC64_RELATIVE to PowerPC64.def

These are not used by LLVM proper, but will be used by upcoming commits to lld
(and will receive test coverage there).

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

6 years ago[SCEV] Remove comment repeated in cpp file; NFC
Sanjoy Das [Thu, 8 Oct 2015 18:28:42 +0000 (18:28 +0000)]
[SCEV] Remove comment repeated in cpp file; NFC

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

6 years ago[SCEV] Pick backedge values for phi nodes correctly
Sanjoy Das [Thu, 8 Oct 2015 18:28:36 +0000 (18:28 +0000)]
[SCEV] Pick backedge values for phi nodes correctly

Summary:
`getConstantEvolutionLoopExitValue` and `ComputeExitCountExhaustively`
assumed all phi nodes in the loop header have the same order of incoming
values.  This is not correct, and this commit changes
`getConstantEvolutionLoopExitValue` and `ComputeExitCountExhaustively`
to lookup the backedge value of a phi node using the loop's latch block.

Unfortunately, there is still some code duplication
`getConstantEvolutionLoopExitValue` and `ComputeExitCountExhaustively`.
At some point in the future we should extract out a helper class /
method that can evolve constant evolution phi nodes across iterations.

Fixes 25060.  Thanks to Mattias Eriksson for the spot-on analysis!

Depends on D13457.

Reviewers: atrick, hfinkel

Subscribers: materi, llvm-commits

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

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

6 years agoHandle Archive::getNumberOfSymbols being called in an archive with no symbols.
Rafael Espindola [Thu, 8 Oct 2015 18:06:20 +0000 (18:06 +0000)]
Handle Archive::getNumberOfSymbols being called in an archive with no symbols.

No change in llvm, but will be tested from lld.

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

6 years ago[SystemZ] Fix another assertion failure in tryBuildVectorShuffle
Ulrich Weigand [Thu, 8 Oct 2015 17:46:59 +0000 (17:46 +0000)]
[SystemZ] Fix another assertion failure in tryBuildVectorShuffle

This fixes yet another scenario where tryBuildVectorShuffle would
attempt to create a BUILD_VECTOR node with an invalid combination
of types.  This can happen if the incoming BUILD_VECTOR has elements
of a type different from the vector element type, which is allowed
in certain cases as long as they are all the same type.

When one of these elements is used in the residual vector, and
UNDEF elements are added to fill up the residual vector, those
UNDEFs then have to use the type of the original element, not
the vector element type, or else the resulting BUILD_VECTOR
will have an invalid type combination.

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

6 years agoMake the Kaleidoscope Orc examples -Wdeprecated clean by avoiding copying some AST...
David Blaikie [Thu, 8 Oct 2015 17:22:12 +0000 (17:22 +0000)]
Make the Kaleidoscope Orc examples -Wdeprecated clean by avoiding copying some AST nodes

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

6 years ago[InstCombine] transform masking off of an FP sign bit into a fabs() intrinsic call...
Sanjay Patel [Thu, 8 Oct 2015 17:09:31 +0000 (17:09 +0000)]
[InstCombine] transform masking off of an FP sign bit into a fabs() intrinsic call (PR24886)

This is a partial fix for PR24886:
https://llvm.org/bugs/show_bug.cgi?id=24886

Without this IR transform, the backend (x86 at least) was producing inefficient code.

This patch is making 2 assumptions:

    1. The canonical form of a fabs() operation is, in fact, the LLVM fabs() intrinsic.
    2. The high bit of an FP value is always the sign bit; as noted in the bug report, this isn't specified by the LangRef.

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

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

6 years ago[ValueTracking] teach computeKnownBits that a fabs() clears sign bits
Sanjay Patel [Thu, 8 Oct 2015 16:56:55 +0000 (16:56 +0000)]
[ValueTracking] teach computeKnownBits that a fabs() clears sign bits

This was requested in D13076: if we're going to canonicalize to fabs(), ValueTracking
should know that fabs() clears sign bits.

In this patch (as in D13076), we're not handling vectors yet even though computeKnownBits'
fabs() case itself should be vector-ready via the splat in this patch.
Fixing this will require follow-on patches to correct other logic that uses 'getScalarType'.

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

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

6 years agoFix a bug in llvm-objdump’s printing of Objective-C meta data
Kevin Enderby [Thu, 8 Oct 2015 16:56:35 +0000 (16:56 +0000)]
Fix a bug in llvm-objdump’s printing of Objective-C meta data
from malformed Mach-O files that caused a crash because of loops
in the class meta data.

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

6 years agoWindows: Fixed sys::findProgramByName to work with files containing dot in their...
George Rimar [Thu, 8 Oct 2015 16:03:19 +0000 (16:03 +0000)]
Windows: Fixed sys::findProgramByName to work with files containing dot in their name.

Problem was in SearchPathW function that does not attach an extension if file already has one.
That does not work for executables like ld.lld2 for example which require to have .exe extension but SearchPath thinks that its "lld2".
Solution was to add the extension manually.

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

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

6 years agoSupport for llvm-bcanalyzer dumping of record array strings.
Teresa Johnson [Thu, 8 Oct 2015 15:56:24 +0000 (15:56 +0000)]
Support for llvm-bcanalyzer dumping of record array strings.

Summary:
Adds support for automatically detecting and printing strings
represented by Array abbrev operands, analogous to the string dumping
performed for Blob abbrev operands.

Enhanced the ThinLTO combined index test to check for the appropriate
module and function strings.

Reviewers: dexonsmith, joker.eph, davidxl

Subscribers: llvm-commits

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

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

6 years ago[X86] Disable X86CallFrameOptimization on Darwin in presence of EH
Frederic Riss [Thu, 8 Oct 2015 15:45:08 +0000 (15:45 +0000)]
[X86] Disable X86CallFrameOptimization on Darwin in presence of EH

We emit 1 compact unwind encoding per function, and this can’t represent
the varying stack pointer that will be generated by X86CallFrameOptimization.
Disable the optimization on Darwin.

(It might be possible to split the function into multiple ranges
and emit 1 compact unwind info per range. The compact unwind emission
code isn’t ready for that and this kind of info certainly isn’t
tested/used anywhere. It might be worth exploring this path if we want
to get the space savings at some point though)

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

6 years agoFix combined function index abbrev (NFC)
Teresa Johnson [Thu, 8 Oct 2015 13:52:56 +0000 (13:52 +0000)]
Fix combined function index abbrev (NFC)

Removed an unused abbrev op in the VST_CODE_COMBINED_FNENTRY abbrev.

I noticed while writing/testing an array string dumper for
llvm-bcanalyze that the combined function's VST entry abbrevs contained
an old field that I am not using. Everything was working fine since the
bitcode writer and reader were in sync on how the record fields were
actually being set up and interpreted.

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

6 years agoAdd a helper for getting a section's content as an array.
Rafael Espindola [Thu, 8 Oct 2015 13:38:42 +0000 (13:38 +0000)]
Add a helper for getting a section's content as an array.

It will be used in lld shortly.

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

6 years agoFix UBSan test error from r248897 about left shift of unsigned value.
Teresa Johnson [Thu, 8 Oct 2015 13:14:59 +0000 (13:14 +0000)]
Fix UBSan test error from r248897 about left shift of unsigned value.

Fixed by masking off the upper bits that we are shifting off before
doing the left shift.

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

6 years agoAVX512: vpextrb/w/d/q and vpinsrb/w/d/q implementation.
Igor Breger [Thu, 8 Oct 2015 12:55:01 +0000 (12:55 +0000)]
AVX512: vpextrb/w/d/q and vpinsrb/w/d/q implementation.
This instructions doesn't have intrincis.
Added tests for lowering and encoding.

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

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

6 years agoCompute demanded bits for icmp instructions
James Molloy [Thu, 8 Oct 2015 12:40:06 +0000 (12:40 +0000)]
Compute demanded bits for icmp instructions

Instead of bailing out when we see an icmp, we can instead at least
say that if the upper bits of both operands are known zero, they are
not demanded. This doesn't help with signed comparisons, but it's at
least better than bailing out.

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

6 years agoTreat Mul just like Add and Subtract
James Molloy [Thu, 8 Oct 2015 12:39:59 +0000 (12:39 +0000)]
Treat Mul just like Add and Subtract

Like adds and subtracts, muls ripple only to the left so we can use
the same logic.

While we're here, add a print method to DemandedBits so it can be used
with -analyze, which we'll use in the testcase.

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

6 years agoMake demanded bits lazy
James Molloy [Thu, 8 Oct 2015 12:39:50 +0000 (12:39 +0000)]
Make demanded bits lazy

The algorithm itself is still eager, but it doesn't get run until a
query function is called. This greatly reduces the compile-time impact
of requiring DemandedBits when at runtime it is not often used.

NFCI.

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

6 years ago[X86] Fix wrong treatment of multi-lane blends in BUILD_VECTORtoBlendMask()
Michael Kuperstein [Thu, 8 Oct 2015 08:13:02 +0000 (08:13 +0000)]
[X86] Fix wrong treatment of multi-lane blends in BUILD_VECTORtoBlendMask()

This fixes two separate bugs:
1) The mask for the high lane was not set correctly. That fixes PR24532.
2) The transformation should bail out if it believes it involves more than
2 lanes, as it does not currently do anything sensible in this case.

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

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

6 years agoDo not assert on first non-prologue instruction being a CFI directive.
Michael Kuperstein [Thu, 8 Oct 2015 07:48:49 +0000 (07:48 +0000)]
Do not assert on first non-prologue instruction being a CFI directive.

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

6 years ago[SystemZ] SystemZElimCompare pass improved.
Jonas Paulsson [Thu, 8 Oct 2015 07:40:23 +0000 (07:40 +0000)]
[SystemZ] SystemZElimCompare pass improved.

Compare elimination extended to recognize load-and-test instructions used
for comparison and eliminate them the same way as with compare instructions.

Test case fp-cmp-05.ll updated to expect optimized results now also for z13.

The order of instruction shortening and compare elimination passes have been
changed so that opcodes do not have to be handled in both passes.

Reviewed by Ulrich Weigand.

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

6 years ago[SystemZ] Bugfix: check CC reg liveness in SystemZShortenInst.
Jonas Paulsson [Thu, 8 Oct 2015 07:40:19 +0000 (07:40 +0000)]
[SystemZ] Bugfix: check CC reg liveness in SystemZShortenInst.

The following instruction shortening transformations would introduce a
definition of the CC reg, so therefore liveness of CC reg must be checked:

WFADB -> ADBR
WFSDB -> SDBR

Also add the CC reg implicit def operand to the MI in case of change of opcode.

Reviewed by Ulrich Weigand.

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

6 years ago [SystemZ] Use load-and-test for fp compare with 0 if vector support is present.
Jonas Paulsson [Thu, 8 Oct 2015 07:40:16 +0000 (07:40 +0000)]
 [SystemZ] Use load-and-test for fp compare with 0 if vector support is present.

Since the LTxBRCompare instructions can't be used with vector registers, a
normal load-and-test instruction (with a modelled def operand) is used instead.

Reviewed by Ulrich Weigand.

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

6 years ago[SystemZ] More minor fixing in SystemZElimCompare.cpp
Jonas Paulsson [Thu, 8 Oct 2015 07:40:11 +0000 (07:40 +0000)]
[SystemZ] More minor fixing in SystemZElimCompare.cpp

Don't use subreg indices since they are not used after regalloc.

Reviewed by Ulrich Weigand.

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

6 years ago[SystemZ] Minor fixes in SystemZElimCompare.cpp
Jonas Paulsson [Thu, 8 Oct 2015 07:39:55 +0000 (07:39 +0000)]
[SystemZ] Minor fixes in SystemZElimCompare.cpp

Reviewed by Ulrich Weigand.

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

6 years agoUse range-based for loops. NFC.
Craig Topper [Thu, 8 Oct 2015 06:06:42 +0000 (06:06 +0000)]
Use range-based for loops. NFC.

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

6 years ago[SCEV] Check `Pred` first in isKnownPredicateViaSplitting
Sanjoy Das [Thu, 8 Oct 2015 03:46:00 +0000 (03:46 +0000)]
[SCEV] Check `Pred` first in isKnownPredicateViaSplitting

Comparing `Pred` with `ICmpInst::ICMP_ULT` is cheaper that memory access
-- do that check before loading / storing `ProvingSplitPredicate`.

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

6 years ago[SCEV] Use `auto *` instead of `auto`; NFCI
Sanjoy Das [Thu, 8 Oct 2015 03:45:58 +0000 (03:45 +0000)]
[SCEV] Use `auto *` instead of `auto`; NFCI

(As prescribed by the coding style document)

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

6 years agoRevert "Handle inline stacks in gcov-encoded sample profiles."
Diego Novillo [Thu, 8 Oct 2015 01:17:26 +0000 (01:17 +0000)]
Revert "Handle inline stacks in gcov-encoded sample profiles."

This reverts commit r249644.

The buildbots are failing the new test I added. Investigating.

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

6 years ago[libFuzzer] fix 32-bit build
Kostya Serebryany [Thu, 8 Oct 2015 00:59:25 +0000 (00:59 +0000)]
[libFuzzer] fix 32-bit build

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

6 years agoHandle inline stacks in gcov-encoded sample profiles.
Diego Novillo [Thu, 8 Oct 2015 00:39:11 +0000 (00:39 +0000)]
Handle inline stacks in gcov-encoded sample profiles.

This patch adds support for reading sample profiles with inline stacks.
Inline stacks in a profile are generated when the sampled binary has
samples in inlined functions.

For instance, if main() calls foo() and foo() calls bar(), and bar() is
inlined into foo() and foo() inlined into main(), the profile may look
something like:

main total:364084 head:0
  [ ... ]
  2.3: _Z3fool total:243786
    1: 60149
    1.2: 38568
    1.4: 46511
    1.7: _Z3bari total:98558
      1.1: 52672
      1.2: 45886

At line 2, discriminator 3, main() calls foo(). In turn, foo() calls
bar() at line 1, discriminator 7.

In the textual format, this stacking of inline calls is represented
with indentation.

With this change, LLVM can now read sample profile files generated by
the create_gcov tool from https://github.com/google/autofdo.

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

6 years agoCodeGen: print and verify after TargetPassConfig::insertPass by default
Justin Bogner [Thu, 8 Oct 2015 00:36:22 +0000 (00:36 +0000)]
CodeGen: print and verify after TargetPassConfig::insertPass by default

In r224059, we started verifying after addPass, but missed doing so on
insertPass. There isn't a good reason for the discrepancy, and
skipping the verifier in these cases causes bugs.

This also exposes a verifier error that was introduced in r249087, but
the verifier doesn't run until after the register coalescer, when the
issue happens to have been resolved. I've skipped the verifier after
SIFixSGPRLiveRangesID to avoid the failures for now and will follow up
with Matt for a proper fix.

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

6 years ago[WinEH] Add missing test case for llvm.eh.exceptioncode
Reid Kleckner [Wed, 7 Oct 2015 23:55:06 +0000 (23:55 +0000)]
[WinEH] Add missing test case for llvm.eh.exceptioncode

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

6 years ago[WinEH] Fix 32-bit funclet epilogues in the presence of dynamic allocas
Reid Kleckner [Wed, 7 Oct 2015 23:55:01 +0000 (23:55 +0000)]
[WinEH] Fix 32-bit funclet epilogues in the presence of dynamic allocas

In particular, passing non-trivially copyable objects by value on win32
uses a dynamic alloca (inalloca). We would clobber ESP in the epilogue
and end up returning to outer space.

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

6 years agoStop linking all target libraries in llvm-nm and llvm-objdump.
Pete Cooper [Wed, 7 Oct 2015 22:39:17 +0000 (22:39 +0000)]
Stop linking all target libraries in llvm-nm and llvm-objdump.

llvm-nm only needs the target to parse module level assembly in bitcode.  It doesn't need a disassembler or codegen.

llvm-objdump needs to be able to disassemble a file, but doesn't need asm parsers or codegen.

This reduces the sizes of these tools by a few MB each, depending on how many backends are linked in.

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

6 years ago[Orc] Enable user supplied partitioning functors in the CompileOnDemand layer.
Lang Hames [Wed, 7 Oct 2015 21:53:41 +0000 (21:53 +0000)]
[Orc] Enable user supplied partitioning functors in the CompileOnDemand layer.

Previously the CompileOnDemand layer always created single-function partitions.
In theory this new API allows for more interesting partitions, though this has
not been well tested yet.

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

6 years ago[WinEH] Refer to filter funclets using their symbol-table symbol
David Majnemer [Wed, 7 Oct 2015 21:34:00 +0000 (21:34 +0000)]
[WinEH] Refer to filter funclets using their symbol-table symbol

The relocation for the filter funclet will be against a symbol table
entry for a function instead of the section, making it easier to
understand what is going on.

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

6 years ago[RS4GC] Use AssertingVH for RematerializedValueMapTy, NFCI
Sanjoy Das [Wed, 7 Oct 2015 21:32:35 +0000 (21:32 +0000)]
[RS4GC] Use AssertingVH for RematerializedValueMapTy, NFCI

Reviewers: reames, swaroop.sridhar

Subscribers: llvm-commits

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

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

6 years ago[WinEH] Undo the effect of r249578 for 32-bit
Reid Kleckner [Wed, 7 Oct 2015 21:13:15 +0000 (21:13 +0000)]
[WinEH] Undo the effect of r249578 for 32-bit

The __CxxFrameHandler3 tables for 32-bit are supposed to hold stack
offsets relative to EBP, not ESP. I blindly updated the win-catchpad.ll
test case, and immediately noticed that 32-bit catching stopped working.

While I'm at it, move the frame index to frame offset WinEH table logic
out of PEI.  PEI shouldn't have to know about WinEHFuncInfo. I realized
we can calculate frame index offsets just fine from the table printer.

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

6 years ago[WinEH] Remove unreachable blocks before preparation
David Majnemer [Wed, 7 Oct 2015 21:08:25 +0000 (21:08 +0000)]
[WinEH] Remove unreachable blocks before preparation

We remove unreachable blocks because it is pointless to consider them
for coloring.  However, we still had stale pointers to these blocks in
some data structures after we removed them from the function.

Instead, remove the unreachable blocks before attempting to do anything
with the function.

This fixes PR25099.

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

6 years agoSupport: Stop using iplist in Recycler
Duncan P. N. Exon Smith [Wed, 7 Oct 2015 20:49:09 +0000 (20:49 +0000)]
Support: Stop using iplist in Recycler

Recycler just needs a singly-linked list, and it takes less (and
simpler) code to hand-roll one of those than to build up the equivalent
`iplist_traits`.  In theory, this should speed things up a bit too, but
this is really just a drive-by cleanup so I haven't measured.

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

6 years agogit-clang-format r249548.
Rafael Espindola [Wed, 7 Oct 2015 20:32:24 +0000 (20:32 +0000)]
git-clang-format r249548.

Sorry for missing this the first time.

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

6 years ago[mips][FastISel] Factor out common code from switch statement. NFC
Vasileios Kalintiris [Wed, 7 Oct 2015 20:06:30 +0000 (20:06 +0000)]
[mips][FastISel] Factor out common code from switch statement. NFC

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

6 years agoIR: Create SymbolTableList wrapper around iplist, NFC
Duncan P. N. Exon Smith [Wed, 7 Oct 2015 20:05:10 +0000 (20:05 +0000)]
IR: Create SymbolTableList wrapper around iplist, NFC

Create `SymbolTableList`, a wrapper around `iplist` for lists that
automatically manage a symbol table.  This commit reduces a ton of code
duplication between the six traits classes that were used previously.

As a drive by, reduce the number of template parameters from 2 to 1 by
using a SymbolTableListParentType metafunction (I originally had this as
a separate commit, but it touched most of the same lines so I squashed
them).

I'm in the process of trying to remove the UB in `createSentinel()` (see
the FIXMEs I added for `ilist_embedded_sentinel_traits` and
`ilist_half_embedded_sentinel_traits`).  My eventual goal is to separate
the list logic into a base class layer that knows nothing about (and
isn't templated on) the downcasted nodes -- removing the need to invoke
UB -- but for now I'm just trying to get a handle on all the current use
cases (and cleaning things up as I see them).

Besides these six SymbolTable lists, there are two others that use the
addNode/removeNode/transferNodes() hooks: the `MachineInstruction` and
`MachineBasicBlock` lists.  Ideally there'll be a way to factor these
hooks out of the low-level API entirely, but I'm not quite there yet.

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

6 years ago[IRBuilder] Add gc.statepoint related methods to IRBuilder
Sanjoy Das [Wed, 7 Oct 2015 19:52:12 +0000 (19:52 +0000)]
[IRBuilder] Add gc.statepoint related methods to IRBuilder

Summary:
This adds some more routines to `IRBuilder` around creating calls and
invokes to `gc.statepoint`.  These will be used later.

Reviewers: reames, swaroop.sridhar

Subscribers: sanjoy, llvm-commits

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

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

6 years ago[mips][FastISel] Use ternary operator to select opcode. NFC
Vasileios Kalintiris [Wed, 7 Oct 2015 19:43:31 +0000 (19:43 +0000)]
[mips][FastISel] Use ternary operator to select opcode. NFC

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

6 years ago[WinEH] Set NoModuleLevelChanges in clone flags
Joseph Tremoulet [Wed, 7 Oct 2015 19:29:56 +0000 (19:29 +0000)]
[WinEH] Set NoModuleLevelChanges in clone flags

Summary:
This is necessary to keep the cloner from making bogus copies of debug
metadata attached to the IR it is cloning.
Also, avoid running RemapInstruction over all instructions in the common
case that no cloning was performed.

Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: llvm-commits

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

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

6 years agoUse SpecificBumpPtrAllocator to simplify the MCSeciton destruction.
Rafael Espindola [Wed, 7 Oct 2015 19:08:19 +0000 (19:08 +0000)]
Use SpecificBumpPtrAllocator to simplify the MCSeciton destruction.

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

6 years ago[X86]Update test to use FileCheck.
Kevin B. Smith [Wed, 7 Oct 2015 18:21:41 +0000 (18:21 +0000)]
[X86]Update test to use FileCheck.
Updates this test to use FileCheck and a single llc invocation rather than
3 llc invocations and grep.

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

6 years agoRevert "Revert "This patch builds on top of D13378 to handle constant condition.""
Mehdi Amini [Wed, 7 Oct 2015 18:14:25 +0000 (18:14 +0000)]
Revert "Revert "This patch builds on top of D13378 to handle constant condition.""

This reverts commit r249528 and reapply r249431. The fix for the
fallout has been commited in r249575.

From: Mehdi Amini <mehdi.amini@apple.com>

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

6 years ago[mips][FastISel] Simple refactoring of MipsFastISel::emitLogicalOP(). NFC.
Vasileios Kalintiris [Wed, 7 Oct 2015 18:14:24 +0000 (18:14 +0000)]
[mips][FastISel] Simple refactoring of MipsFastISel::emitLogicalOP(). NFC.

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

6 years ago[AArch64] Fold a floating-point divide by power of two into fp conversion.
Chad Rosier [Wed, 7 Oct 2015 17:51:37 +0000 (17:51 +0000)]
[AArch64] Fold a floating-point divide by power of two into fp conversion.

Part of http://reviews.llvm.org/D13442

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

6 years ago[WinEH] Fix two minor issues in __CxxFrameHandler3 tables
Reid Kleckner [Wed, 7 Oct 2015 17:49:32 +0000 (17:49 +0000)]
[WinEH] Fix two minor issues in __CxxFrameHandler3 tables

There was an off-by-one bug in ip2state tables which manifested when one
call immediately preceded the try-range of the next. The return address
of the previous call would appear to be within the try range of the next
scope, resulting in extra destructors or catches running.

We also computed the wrong offset for catch parameter stack objects. The
offset should be from RSP, not from RBP.

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

6 years agoAMDGPU: Fix missing implicit m0 uses on movrel instructions
Matt Arsenault [Wed, 7 Oct 2015 17:46:32 +0000 (17:46 +0000)]
AMDGPU: Fix missing implicit m0 uses on movrel instructions

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

6 years ago[AArch64] Fold a floating-point multiply by power of two into fp conversion.
Chad Rosier [Wed, 7 Oct 2015 17:39:18 +0000 (17:39 +0000)]
[AArch64] Fold a floating-point multiply by power of two into fp conversion.

Part of http://reviews.llvm.org/D13442

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

6 years ago[IndVars] Preserve LCSSA in `eliminateIdentitySCEV`
Sanjoy Das [Wed, 7 Oct 2015 17:38:31 +0000 (17:38 +0000)]
[IndVars] Preserve LCSSA in `eliminateIdentitySCEV`

Summary:
After r249211, SCEV can see through some LCSSA phis.  Add a
`replacementPreservesLCSSAForm` check before replacing uses of these phi
nodes with a simplified use of the induction variable to avoid breaking
LCSSA.

Fixes 25047.

Depends on D13460.

Reviewers: atrick, hfinkel

Subscribers: llvm-commits

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

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

6 years ago[SCEV] Use some C++11'ism, NFC
Sanjoy Das [Wed, 7 Oct 2015 17:38:25 +0000 (17:38 +0000)]
[SCEV] Use some C++11'ism, NFC

Summary:

Subscribers: llvm-commits

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

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

6 years ago[ARM] Promote helper function to SelectionDAG.
Chad Rosier [Wed, 7 Oct 2015 17:28:58 +0000 (17:28 +0000)]
[ARM] Promote helper function to SelectionDAG.

I'll be using the function in a similar combine for AArch64.  The helper was
also improved to handle undef values.

Part of http://reviews.llvm.org/D13442

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

6 years agoTest commit access. Fixed comment to have correct input parameter name and
Kevin B. Smith [Wed, 7 Oct 2015 17:24:25 +0000 (17:24 +0000)]
Test commit access. Fixed comment to have correct input parameter name and
period termination.

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

6 years ago[WinEH] Update CoreCLR EH for catchpad MBBs
Joseph Tremoulet [Wed, 7 Oct 2015 17:16:25 +0000 (17:16 +0000)]
[WinEH] Update CoreCLR EH for catchpad MBBs

Summary:
Set the pad MBB as a funclet entry for CoreCLR as well as MSVCCXX, and
update state numbering to put the catchpad block rather than its normal
successor into the unwind map.

Reviewers: majnemer

Subscribers: llvm-commits

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

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

6 years ago[ARM] Use correct half-precision functions in EABI mode
Oliver Stannard [Wed, 7 Oct 2015 16:58:49 +0000 (16:58 +0000)]
[ARM] Use correct half-precision functions in EABI mode

The ARM RTABI defines the half- to single-precision float conversion functions
with an __aeabi prefix, but libgcc only has them with a __gnu prefix. Therefore
we need to emit the __aeabi version when compiling with an eabi or eabihf
triple, and the __gnu version with a gnueabi or gnueabihf triple.

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

6 years agoMove test back to Generic now it's fixed the right way (thanks Eric!)
David Blaikie [Wed, 7 Oct 2015 16:26:28 +0000 (16:26 +0000)]
Move test back to Generic now it's fixed the right way (thanks Eric!)

I knee-jerk tried to fix this in completely the wrong way - it's not an
CPU limitation, but an OS/object file type one, so moving it
into a CPU-specific classification didn't help at all.

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

6 years ago[ARM] Prevent PerformVDIVCombine from combining a vcvt/vdiv with 8 lanes.
Chad Rosier [Wed, 7 Oct 2015 16:15:40 +0000 (16:15 +0000)]
[ARM] Prevent PerformVDIVCombine from combining a vcvt/vdiv with 8 lanes.

This would result in a crash since the vcvt used does not support v8i32 types.

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

6 years agoTeach computeKnownBits to use new align attribute/metadata
Artur Pilipenko [Wed, 7 Oct 2015 16:01:18 +0000 (16:01 +0000)]
Teach computeKnownBits to use new align attribute/metadata

Reviewed By: reames

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

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

6 years ago[ARM][AArch64] Only lower to interleaved load/store if the target has NEON
Jeroen Ketema [Wed, 7 Oct 2015 14:53:29 +0000 (14:53 +0000)]
[ARM][AArch64] Only lower to interleaved load/store if the target has NEON

Without an additional check for NEON, the compiler crashes during
legalization of NEON ldN/stN.

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

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

6 years agoUse non virtual destructors for sections.
Rafael Espindola [Wed, 7 Oct 2015 13:46:06 +0000 (13:46 +0000)]
Use non virtual destructors for sections.

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

6 years ago[ARM] Push more complex check down to reduce compile time. NFC.
Chad Rosier [Wed, 7 Oct 2015 13:40:44 +0000 (13:40 +0000)]
[ARM] Push more complex check down to reduce compile time. NFC.

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

6 years agoDon't repeat names in comments and don't indent in namespaces. NFC.
Rafael Espindola [Wed, 7 Oct 2015 13:38:49 +0000 (13:38 +0000)]
Don't repeat names in comments and don't indent in namespaces. NFC.

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

6 years agoRevert: r249536 - Testing commit access with a trival whitespace change.
Scott Egerton [Wed, 7 Oct 2015 10:57:06 +0000 (10:57 +0000)]
Revert: r249536 - Testing commit access with a trival whitespace change.

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

6 years agoTesting commit access with a trival whitespace change.
Scott Egerton [Wed, 7 Oct 2015 10:49:49 +0000 (10:49 +0000)]
Testing commit access with a trival whitespace change.

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

6 years agoRevert "This patch builds on top of D13378 to handle constant condition."
James Molloy [Wed, 7 Oct 2015 09:03:34 +0000 (09:03 +0000)]
Revert "This patch builds on top of D13378 to handle constant condition."

This reverts commit r249431. This caused failures in sqlite3: http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/14453

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

6 years ago[EarlyCSE] Fix handling of target memory intrinsics for CSE'ing loads.
Arnaud A. de Grandmaison [Wed, 7 Oct 2015 07:41:29 +0000 (07:41 +0000)]
[EarlyCSE] Fix handling of target memory intrinsics for CSE'ing loads.

Summary:
Some target intrinsics can access multiple elements, using the pointer as a
base address (e.g. AArch64 ld4). When trying to CSE such instructions,
it must be checked the available value comes from a compatible instruction
because the pointer is not enough to discriminate whether the value is
correct.

Reviewers: ssijaric

Subscribers: mcrosier, llvm-commits, aemerson

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

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

6 years ago[X86] Emit .cfi_escape GNU_ARGS_SIZE when adjusting the stack before calls
Michael Kuperstein [Wed, 7 Oct 2015 07:01:31 +0000 (07:01 +0000)]
[X86] Emit .cfi_escape GNU_ARGS_SIZE when adjusting the stack before calls

When outgoing function arguments are passed using push instructions, and EH
is enabled, we may need to indicate to the stack unwinder that the stack
pointer was adjusted before the call.

This should fix the exception handling issues in PR24792.

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

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

6 years agoAVX512: Change encoding of vpshuflw and vpshufhw instructions. Implement WIG as W0...
Igor Breger [Wed, 7 Oct 2015 06:31:18 +0000 (06:31 +0000)]
AVX512: Change encoding of vpshuflw and vpshufhw instructions. Implement WIG as W0 and not W1, like all other instruction have been implemented.
Add encoding tests.

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

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

6 years ago[RS4GC] Remove an unnecessary assert & related variables
Sanjoy Das [Wed, 7 Oct 2015 02:39:27 +0000 (02:39 +0000)]
[RS4GC] Remove an unnecessary assert & related variables

I don't think this assert adds much value, and removing it and related
variables avoids an "unused variable" warning in release builds.

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

6 years ago[OperandBundles] Add an accessor to get an operand bundle by tag
Sanjoy Das [Wed, 7 Oct 2015 02:39:24 +0000 (02:39 +0000)]
[OperandBundles] Add an accessor to get an operand bundle by tag

Not used at the moment, but will be used in a later change to
RewriteStatepointsForGC.

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

6 years ago[OperandBundles] Remove a useless accessor from OperandBundleUser
Sanjoy Das [Wed, 7 Oct 2015 02:39:21 +0000 (02:39 +0000)]
[OperandBundles] Remove a useless accessor from OperandBundleUser

Since the `const` version of `getOperandBundle` returns a value of the
same type as the non-`const` version, the non-`const` version is
redundant.

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

6 years ago[RS4GC] Cosmetic cleanup, NFC
Sanjoy Das [Wed, 7 Oct 2015 02:39:18 +0000 (02:39 +0000)]
[RS4GC] Cosmetic cleanup, NFC

Summary:
A series of cosmetic cleanup changes to RewriteStatepointsForGC:

  - Rename variables to LLVM style
  - Remove some redundant asserts
  - Remove an unsued `Pass *` parameter
  - Remove unnecessary variables
  - Use C++11 idioms where applicable
  - Pass CallSite by value, not reference

Reviewers: reames, swaroop.sridhar

Subscribers: llvm-commits, sanjoy

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

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

6 years agoRemove the comdat-ness from the testcase as it won't lower properly
Eric Christopher [Wed, 7 Oct 2015 01:52:33 +0000 (01:52 +0000)]
Remove the comdat-ness from the testcase as it won't lower properly
on darwin with it since darwin doesn't have comdat and it isn't
necessary for the testcase.

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

6 years agoAMDGPU: Add comment for VOP2b operand class
Matt Arsenault [Wed, 7 Oct 2015 01:36:00 +0000 (01:36 +0000)]
AMDGPU: Add comment for VOP2b operand class

Because of the constant bus requirement, it is never legal to
use a literal constant for these instructions despite the encoding
allowing it. This was already doing the right thing, but note why.

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

6 years agoUpdate test to use FileCheck and clean up run lines to match the
Eric Christopher [Wed, 7 Oct 2015 01:21:49 +0000 (01:21 +0000)]
Update test to use FileCheck and clean up run lines to match the
expected behavior.

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

6 years agoAMDGPU: Properly register passes
Matt Arsenault [Wed, 7 Oct 2015 00:42:53 +0000 (00:42 +0000)]
AMDGPU: Properly register passes

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

6 years agoAMDGPU: Use explicit register size indirect pseudos
Matt Arsenault [Wed, 7 Oct 2015 00:42:51 +0000 (00:42 +0000)]
AMDGPU: Use explicit register size indirect pseudos

This stops using an unknown reg class operand.

Currently build_vector selection has a broken looking check
where it tries to use a VGPR reg class and an SGPR one if it
sees an SGPR use.

With the source operand has an explicit VGPR class,
illegal copies will be inserted that SIFixSGPRCopies will take care
of normally later, which will allow removing the weird check
of build_vector users. Without this, when removed v_movrels_b32 would
still be emitted even though all of the values were only stored in
SGPRs.

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

6 years agoAMDGPU: Remove inferRegClassFromUses / inferRegClassFromDefs
Matt Arsenault [Wed, 7 Oct 2015 00:42:31 +0000 (00:42 +0000)]
AMDGPU: Remove inferRegClassFromUses / inferRegClassFromDefs

I'm not sure why this would be necessary, and no tests fail with
them removed. Looking at the uses is suspect as well because
the use reg classes will likely change when the users are moved
as a result of moving this instruction.

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

6 years ago[SEH] Add llvm.eh.exceptioncode intrinsic
Reid Kleckner [Wed, 7 Oct 2015 00:27:33 +0000 (00:27 +0000)]
[SEH] Add llvm.eh.exceptioncode intrinsic

This will support the Clang __exception_code intrinsic.

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