oota-llvm.git
9 years ago[AVX] Lower / fast-isel scalar FP selects into VBLENDV instructions (PR22483)
Sanjay Patel [Thu, 5 Mar 2015 21:46:54 +0000 (21:46 +0000)]
[AVX] Lower / fast-isel scalar FP selects into VBLENDV instructions (PR22483)

This patch reduces code size for all AVX targets and increases speed for some chips.

SSE 4.1 introduced the useless (see code comments) 2-register form of BLENDV and
only in the packed float/double flavors.

AVX subsequently made the instruction useful by adding a 4-register operand form.

So we just need to paper over the lack of scalar forms of this instruction, complicate
the code to choose float or double forms, and use blendv on scalars since all FP is in
xmm registers anyway.

This gives us an approximately 50% speed up for a blendv microbenchmark sequence
on SandyBridge and Haswell:
blendv : 29.73 cycles/iter
logic : 43.15 cycles/iter

No new test cases with this patch because:

1. fast-isel-select-sse.ll tests the positive side for regular X86 lowering and fast-isel
2. sse-minmax.ll and fp-select-cmp-and.ll confirm that we're not firing for scalar selects without AVX
3. fp-select-cmp-and.ll and logical-load-fold.ll confirm that we're not firing for scalar selects with constants.

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

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

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

9 years agoSelectionDAGBuilder: Merge 3 copies of the limited precision exp2 emission code.
Benjamin Kramer [Thu, 5 Mar 2015 21:13:08 +0000 (21:13 +0000)]
SelectionDAGBuilder: Merge 3 copies of the limited precision exp2 emission code.

NFC intended.

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

9 years agoFix uninitialized memory references in WinEHPrepare
Andrew Kaylor [Thu, 5 Mar 2015 21:06:42 +0000 (21:06 +0000)]
Fix uninitialized memory references in WinEHPrepare

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

9 years agoSDAG: Merge the meat of two ExpandAtomic implementations.
Benjamin Kramer [Thu, 5 Mar 2015 20:04:29 +0000 (20:04 +0000)]
SDAG: Merge the meat of two ExpandAtomic implementations.

The copies already diverged, don't let them become any worse. Reduce
redundancy in code with a little macro metaprogramming.

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

9 years ago[AArch64] Teach AsmPrinter about GlobalAddress operands.
Ahmed Bougacha [Thu, 5 Mar 2015 20:04:21 +0000 (20:04 +0000)]
[AArch64] Teach AsmPrinter about GlobalAddress operands.

Fixes PR22761, rdar://20024866.
Differential Revision: http://reviews.llvm.org/D8042

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

9 years ago[RewriteStatepointsForGC] Add additional tests around relocation
Philip Reames [Thu, 5 Mar 2015 19:52:13 +0000 (19:52 +0000)]
[RewriteStatepointsForGC] Add additional tests around relocation

These are focused around the actual relocation rewriting itself, not the rest of the infrastructure.

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

9 years agoUse the correct func begin symbol in all places in ppc.
Rafael Espindola [Thu, 5 Mar 2015 19:47:50 +0000 (19:47 +0000)]
Use the correct func begin symbol in all places in ppc.

I missed an occurrence of the old symbol in my previous patch.

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

9 years agoTableGen: Initialize ErrorInfo to ~0ULL in the MatchInstructionImpl
Tom Stellard [Thu, 5 Mar 2015 19:46:55 +0000 (19:46 +0000)]
TableGen: Initialize ErrorInfo to ~0ULL in the MatchInstructionImpl

This is what all the targets check for and is consistent with the
initialized value of MissingFeatures, which is sometimes assinged
to ErrorInfo.

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

9 years ago[ARM] Enable vector extload combine for legal types.
Ahmed Bougacha [Thu, 5 Mar 2015 19:37:53 +0000 (19:37 +0000)]
[ARM] Enable vector extload combine for legal types.

This commit enables forming vector extloads for ARM.
It only does so for legal types, and when we can't fold the extension
in a wide/long form of the user instruction.

Enabling it for larger types isn't as good an idea on ARM as it is on
X86, because:
- we pretend that extloads are legal, but end up generating vld+vmov
- we have instructions like vld {dN, dM}, which can't be generated
  when we "manually expand" extloads to vld+vmov.

For legal types, the combine doesn't fire that often: in the
integration tests only in a big endian testcase, where it removes a
pointless AND.

Related to rdar://19723053
Differential Revision: http://reviews.llvm.org/D7423

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

9 years agoReplace PrintStackTrace(FILE*) with PrintStackTrace(raw_ostream&)
Zachary Turner [Thu, 5 Mar 2015 19:10:52 +0000 (19:10 +0000)]
Replace PrintStackTrace(FILE*) with PrintStackTrace(raw_ostream&)

This will be followed by a change on the clang side to update
the only user of this function with the new version.

Differential Revision: http://reviews.llvm.org/D8074
Reviewed By: Reid Kleckner

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

9 years agoRemove accidental errs() call in Verifier
Reid Kleckner [Thu, 5 Mar 2015 19:05:25 +0000 (19:05 +0000)]
Remove accidental errs() call in Verifier

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

9 years agoUse the generic Lfunc_begin label on ppc.
Rafael Espindola [Thu, 5 Mar 2015 18:55:50 +0000 (18:55 +0000)]
Use the generic Lfunc_begin label on ppc.

This removes yet another custom label to mark the start of a function.

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

9 years agoX86: Optimize address mode matching for FRAME_ALLOC_RECOVER nodes
David Majnemer [Thu, 5 Mar 2015 18:50:12 +0000 (18:50 +0000)]
X86: Optimize address mode matching for FRAME_ALLOC_RECOVER nodes

We know that the absolute symbol will be less than 2GB and thus will
always fit.

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

9 years agoRevert busted CallSite change from r231386
Reid Kleckner [Thu, 5 Mar 2015 18:32:14 +0000 (18:32 +0000)]
Revert busted CallSite change from r231386

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

9 years agoSilence -Wmissing-braces warning from clang-cl
Reid Kleckner [Thu, 5 Mar 2015 18:26:58 +0000 (18:26 +0000)]
Silence -Wmissing-braces warning from clang-cl

The first element of STACKFRAME64 is a struct and Clang wants us to put
braces around it's initialization. Instead, drop the zero. The result
should be the same.

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

9 years agoReplace llvm.frameallocate with llvm.frameescape
Reid Kleckner [Thu, 5 Mar 2015 18:26:34 +0000 (18:26 +0000)]
Replace llvm.frameallocate with llvm.frameescape

Turns out it's pretty straightforward and simplifies the implementation.

Reviewers: andrew.w.kaylor

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

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

9 years agoRevert r231276 (including r231277): Add a lock() function in PassRegistry to speed...
Erik Eckstein [Thu, 5 Mar 2015 17:53:00 +0000 (17:53 +0000)]
Revert r231276 (including r231277): Add a lock() function in PassRegistry to speed up multi-thread synchronization.

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

9 years ago[Windows] Implement PrintStackTrace(FILE*)
Zachary Turner [Thu, 5 Mar 2015 17:47:52 +0000 (17:47 +0000)]
[Windows] Implement PrintStackTrace(FILE*)

llvm::sys::PrintBacktrace(FILE*) is supposed to print a backtrace
of the current thread given the current PC.  This function was
unimplemented on Windows, and instead the only time we could
print a backtrace was as the result of an exception through
LLVMUnhandledExceptionFilter.

This patch implements backtracing of self by using
RtlCaptureContext to get a CONTEXT for the current thread, and
moving the printing and StackWalk64 code to a common method that
printing own stack trace and printing stack trace of an exception
can use.

Differential Revision: http://reviews.llvm.org/D8068
Reviewed by: Reid Kleckner

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

9 years ago[DagCombiner] Allow shuffles to merge through bitcasts
Simon Pilgrim [Thu, 5 Mar 2015 17:14:04 +0000 (17:14 +0000)]
[DagCombiner] Allow shuffles to merge through bitcasts

Currently shuffles may only be combined if they are of the same type, despite the fact that bitcasts are often introduced in between shuffle nodes (e.g. x86 shuffle type widening).

This patch allows a single input shuffle to peek through bitcasts and if the input is another shuffle will merge them, shuffling using the smallest sized type, and re-applying the bitcasts at the inputs and output instead.

Dropped old ShuffleToZext test - this patch removes the use of the zext and vector-zext.ll covers these anyhow.

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

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

9 years agoFileCheck: Document CHECK-SAME, follow-up to r230612
Duncan P. N. Exon Smith [Thu, 5 Mar 2015 17:00:05 +0000 (17:00 +0000)]
FileCheck: Document CHECK-SAME, follow-up to r230612

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

9 years agoWhile reviewing the changes to Clang to add builtin support for the vsld, vsrd, and...
Kit Barton [Thu, 5 Mar 2015 16:24:38 +0000 (16:24 +0000)]
While reviewing the changes to Clang to add builtin support for the vsld, vsrd, and vsrad instructions, it was pointed out that the builtins are generating the LLVM opcodes (shl, lshr, and ashr) not calls to the intrinsics. This patch changes the implementation of the vsld, vsrd, and vsrad instructions from from intrinsics to VXForm_1 instructions and makes them legal with P8 Altivec. It also removes the definition of the int_ppc_altivec_vsld, int_ppc_altivec_vsrd, and int_ppc_altivec_vsrad intrinsics.

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

9 years agoRevert change r231366 as it broke clang-native-arm-cortex-a9 Analysis/properties...
Igor Laevsky [Thu, 5 Mar 2015 15:41:14 +0000 (15:41 +0000)]
Revert change r231366 as it broke clang-native-arm-cortex-a9 Analysis/properties.m test.

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

9 years agoAVX-512, SKX: Enabled masked_load/store operations for this target.
Elena Demikhovsky [Thu, 5 Mar 2015 15:11:35 +0000 (15:11 +0000)]
AVX-512, SKX: Enabled masked_load/store operations for this target.

Added lowering for ISD::CONCAT_VECTORS and ISD::INSERT_SUBVECTOR for i1 vectors,
it is needed to pass all masked_memop.ll tests for SKX.

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

9 years agoFix -Woverflow warning in unittest.
Frederic Riss [Thu, 5 Mar 2015 14:43:15 +0000 (14:43 +0000)]
Fix -Woverflow warning in unittest.

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

9 years agoTeach lowering to correctly handle invoke statepoint and gc results tied to them...
Igor Laevsky [Thu, 5 Mar 2015 14:11:21 +0000 (14:11 +0000)]
Teach lowering to correctly handle invoke statepoint and gc results tied to them. Note that we still can not lower gc.relocates for invoke statepoints.
Also it extracts getCopyFromRegs helper function in SelectionDAGBuilder as we need to be able to customize type of the register exported from basic block during lowering of the gc.result.

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

9 years ago[PBQP] Use a local bit-matrix to speedup searching an edge in the graph.
Arnaud A. de Grandmaison [Thu, 5 Mar 2015 09:12:59 +0000 (09:12 +0000)]
[PBQP] Use a local bit-matrix to speedup searching an edge in the graph.

Build time (user time) for building llvm+clang+lldb in release mode:
 - default allocator: 9086 seconds
 - with PBQP: 9126 seconds
 - with PBQP + local bit matrix cache: 9097 seconds

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

9 years ago[InstCombine] Fix an assertion when fmul has a ConstantExpr operand
Michael Kuperstein [Thu, 5 Mar 2015 08:38:57 +0000 (08:38 +0000)]
[InstCombine] Fix an assertion when fmul has a ConstantExpr operand

isNormalFp and isFiniteNonZeroFp should not assume vector operands can not be constant expressions.

Patch by Pawel Jurek <pawel.jurek@intel.com>
Differential Revision: http://reviews.llvm.org/D8053

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

9 years agoRevert "[TableGen] Implement at least some support for multiple explicit results...
Craig Topper [Thu, 5 Mar 2015 07:17:52 +0000 (07:17 +0000)]
Revert "[TableGen] Implement at least some support for multiple explicit results in an instruction pattern. No functional change to existing patterns."

This is failing on several build bots.

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

9 years ago[TableGen] Implement at least some support for multiple explicit results in an instru...
Craig Topper [Thu, 5 Mar 2015 07:11:36 +0000 (07:11 +0000)]
[TableGen] Implement at least some support for multiple explicit results in an instruction pattern. No functional change to existing patterns.

This should help with the AVX512 masked gather changes Elena is working on. This patch is derived from some of the changes Elena made to tablegen, but modified by me to support arbitrary number of results.

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

9 years ago[TableGen] Add support constraining a vector type in a pattern to have a specific...
Craig Topper [Thu, 5 Mar 2015 07:11:34 +0000 (07:11 +0000)]
[TableGen] Add support constraining a vector type in a pattern to have a specific element type and for constraining a vector type to have the same number of elements as another vector type. This is useful for AVX512 mask operations so we relate the mask type to the type of the other arguments.

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

9 years ago[X86] Use vmovss to handle inserting an element into index 0 of a v8f32 vector of...
Craig Topper [Thu, 5 Mar 2015 06:38:42 +0000 (06:38 +0000)]
[X86] Use vmovss to handle inserting an element into index 0 of a v8f32 vector of zeros.

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

9 years agoRemove useless break after return.
Frederic Riss [Thu, 5 Mar 2015 06:13:39 +0000 (06:13 +0000)]
Remove useless break after return.

Pointed out by Paul Robinson.

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

9 years agoAdd a few more performance tips
Philip Reames [Thu, 5 Mar 2015 05:55:55 +0000 (05:55 +0000)]
Add a few more performance tips

These came from my own experience and may not apply equally to all use cases.  Any alternate perspective anyone has should be used to refine these.

As always, grammar and spelling adjustments are more than welcome.  Please just directly commit a fix if you see something problematic.

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

9 years agoRevert "[dsymutil] MSVC does generate move constructors, but it should accept to...
Frederic Riss [Thu, 5 Mar 2015 05:29:05 +0000 (05:29 +0000)]
Revert "[dsymutil] MSVC does generate move constructors, but it should accept to default them"

This reverts commit r231350.

It turns out MSVC doesn't generate implicit move constructors and also doesn't accept to default them...
See for example http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc/builds/2786

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

9 years ago[dsymutil] MSVC does generate move constructors, but it should accept to default...
Frederic Riss [Thu, 5 Mar 2015 05:17:06 +0000 (05:17 +0000)]
[dsymutil] MSVC does generate move constructors, but it should accept to default them

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

9 years agoAdd a link to the new PerformanceTips docs from the 3.7 release notes
Philip Reames [Thu, 5 Mar 2015 05:11:05 +0000 (05:11 +0000)]
Add a link to the new PerformanceTips docs from the 3.7 release notes

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

9 years agoRevert r231324 "Remove the conditional addition of the execution dependency fixing"
Hans Wennborg [Thu, 5 Mar 2015 03:24:49 +0000 (03:24 +0000)]
Revert r231324 "Remove the conditional addition of the execution dependency fixing"

See PR22799.

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

9 years ago[MBP] Use range based for-loops throughout this code. Several had
Chandler Carruth [Thu, 5 Mar 2015 03:19:05 +0000 (03:19 +0000)]
[MBP] Use range based for-loops throughout this code. Several had
already been added and the inconsistency made choosing names and
changing code more annoying. Plus, wow are they better for this code!

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

9 years ago[MBP] NFC, run clang-format over this code and tweak things to make the
Chandler Carruth [Thu, 5 Mar 2015 02:35:31 +0000 (02:35 +0000)]
[MBP] NFC, run clang-format over this code and tweak things to make the
result reasonable.

This code predated clang-format and so there was a reasonable amount of
crufty formatting that had accumulated. This should ensure that neither
myself nor others end up with formatting-only changes sneaking into
other fixes.

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

9 years ago[MBP] This is no longer 'block-placement2'. ;] The old variants are long
Chandler Carruth [Thu, 5 Mar 2015 02:28:25 +0000 (02:28 +0000)]
[MBP] This is no longer 'block-placement2'. ;] The old variants are long
gone, update this code to reflect that.

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

9 years agoUse the existing begin and end symbol for debug info.
Rafael Espindola [Thu, 5 Mar 2015 02:05:42 +0000 (02:05 +0000)]
Use the existing begin and end symbol for debug info.

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

9 years agoReformat.
NAKAMURA Takumi [Thu, 5 Mar 2015 01:25:19 +0000 (01:25 +0000)]
Reformat.

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

9 years agoRevert r231103, "FullDependenceAnalysis: Avoid using the (deprecated in C++11) copy...
NAKAMURA Takumi [Thu, 5 Mar 2015 01:25:12 +0000 (01:25 +0000)]
Revert r231103, "FullDependenceAnalysis: Avoid using the (deprecated in C++11) copy ctor"

It is miscompiled on msc18.

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

9 years agoRevert r231104, "unique_ptrify FullDependenceAnalysis::DV", to appease msc18 C2280.
NAKAMURA Takumi [Thu, 5 Mar 2015 01:25:06 +0000 (01:25 +0000)]
Revert r231104, "unique_ptrify FullDependenceAnalysis::DV", to appease msc18 C2280.

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

9 years ago[sanitizer] add nosanitize metadata to more coverage instrumentation instructions
Kostya Serebryany [Thu, 5 Mar 2015 01:20:05 +0000 (01:20 +0000)]
[sanitizer] add nosanitize metadata to more coverage instrumentation instructions

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

9 years ago[MBP] Revert r231238 which attempted to fix a nasty bug where MBP is
Chandler Carruth [Thu, 5 Mar 2015 01:07:03 +0000 (01:07 +0000)]
[MBP] Revert r231238 which attempted to fix a nasty bug where MBP is
just arbitrarily interleaving unrelated control flows once they get
moved "out-of-line" (both outside of natural CFG ordering and with
diamonds that cannot be fully laid out by chaining fallthrough edges).

This easy solution doesn't work in practice, and it isn't just a small
bug. It looks like a very different strategy will be required. I'm
working on that now, and it'll again go behind some flag so that
everyone can experiment and make sure it is working well for them.

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

9 years agoScalarEvolution.cpp: Appease g++-4.7. He missed implicit "this" in lambda.
NAKAMURA Takumi [Thu, 5 Mar 2015 01:02:45 +0000 (01:02 +0000)]
ScalarEvolution.cpp: Appease g++-4.7. He missed implicit "this" in lambda.

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

9 years agoRemove the conditional addition of the execution dependency fixing
Eric Christopher [Thu, 5 Mar 2015 00:28:55 +0000 (00:28 +0000)]
Remove the conditional addition of the execution dependency fixing
pass from the ARM backend as the pass itself will detect any use
of the appropriate register class.

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

9 years agoCleanup and remove a chunk of getARMSubtarget calls in the
Eric Christopher [Thu, 5 Mar 2015 00:23:40 +0000 (00:23 +0000)]
Cleanup and remove a chunk of getARMSubtarget calls in the
ARM TargetMachine pass pipeline construction by pushing them down
into the appropriate pass.

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

9 years agoTurn off .debug_pubnames/pubtypes for PS4.
Paul Robinson [Thu, 5 Mar 2015 00:08:27 +0000 (00:08 +0000)]
Turn off .debug_pubnames/pubtypes for PS4.

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

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

9 years agoInitializer lists are supported in MSVC 2013. Since that's our minimum required versi...
Aaron Ballman [Wed, 4 Mar 2015 23:17:31 +0000 (23:17 +0000)]
Initializer lists are supported in MSVC 2013. Since that's our minimum required version, we can move that to the list of acceptable C++11 features.

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

9 years ago[Support] Increase timeout for the LockFileManager back to 5 mins.
Argyrios Kyrtzidis [Wed, 4 Mar 2015 22:54:38 +0000 (22:54 +0000)]
[Support] Increase timeout for the LockFileManager back to 5 mins.

Waiting for just 1 min may not be enough for some contexts.

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

9 years agoImprove test robustness
Matthias Braun [Wed, 4 Mar 2015 22:31:18 +0000 (22:31 +0000)]
Improve test robustness

Improve test robustness in preparation of coming commits:
- Avoid undefs which may get propagated too much.
- Remove several pointless add 0, instructions

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

9 years ago[IndVarSimplify] use the "canonical" way to infer no-wrap.
Sanjoy Das [Wed, 4 Mar 2015 22:24:23 +0000 (22:24 +0000)]
[IndVarSimplify] use the "canonical" way to infer no-wrap.

Summary:
rL225282 introduced an ad-hoc way to promote some additions to nuw or
nsw.  Since then SCEV has become smarter in directly proving no-wrap;
and using the canonical "ext(A op B) == ext(A) op ext(B)" method of
proving no-wrap is just as powerful now.  Rip out the existing
complexity in favor of getting SCEV to do all the heaving lifting
internally.

This change does not add any unit tests because it is supposed to be a
non-functional change.  Tests added in rL225282 and rL226075 are valid
tests for this change.

Reviewers: atrick, majnemer

Subscribers: llvm-commits

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

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

9 years ago[SCEV] make SCEV smarter about proving no-wrap.
Sanjoy Das [Wed, 4 Mar 2015 22:24:17 +0000 (22:24 +0000)]
[SCEV] make SCEV smarter about proving no-wrap.

Summary:
Teach SCEV to prove no overflow for an add recurrence by proving
something about the range of another add recurrence a loop-invariant
distance away from it.

Reviewers: atrick, hfinkel

Subscribers: llvm-commits

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

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

9 years agoProvide an explicit move ctor because MSVC can't synthesize one
David Blaikie [Wed, 4 Mar 2015 22:20:52 +0000 (22:20 +0000)]
Provide an explicit move ctor because MSVC can't synthesize one

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

9 years ago[dsymutil] Add minimal code to emit DIE trees.
Frederic Riss [Wed, 4 Mar 2015 22:07:44 +0000 (22:07 +0000)]
[dsymutil] Add minimal code to emit DIE trees.

This commit adds code to emit DIE trees that have been pruned from the
parts that haven't been marked as kept in the previous pass.

It works by 'cloning' the input DIE tree (as read by libDebugInfoDwarf)
into a tree of DIE objects. Cloning the DIEs means essentially cloning
their attributes. The code in this commit does only handle scalar and
block attributes (scalar because they are trivial, blocks because they
can't be easily replaced by a scalr placeholder), all the other ones
are replaced by placeholder zero values and will be handled in
further commits.

The added tests mostly check that the DIE tree has the correct layout and
also verify that a few chosen scalar and block attributes correctly make
their way into the output.

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

9 years agoDWARFFormValue: Add getAsSignedConstant method.
Frederic Riss [Wed, 4 Mar 2015 22:07:41 +0000 (22:07 +0000)]
DWARFFormValue: Add getAsSignedConstant method.

The implementation accepts explicitely signed forms (DW_FORM_sdata),
but also unsigned forms as long as they fit in an int64_t.

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

9 years agoTeach DIEInteger to emit FORM_strp and FORM_ref_addr attributes.
Frederic Riss [Wed, 4 Mar 2015 22:07:36 +0000 (22:07 +0000)]
Teach DIEInteger to emit FORM_strp and FORM_ref_addr attributes.

To be used/tested by llvm-dsymutil. (llvm-dsymutil does a 'static' link,
no need for relocations for most things, so it'll just emit raw integers
for most attributes)

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

9 years agoMake the DWARFAbbreviationDeclaration::AttributeSpec type public.
Frederic Riss [Wed, 4 Mar 2015 22:07:30 +0000 (22:07 +0000)]
Make the DWARFAbbreviationDeclaration::AttributeSpec type public.

It was already exposed through the iterators anyway.

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

9 years agoUpdate LangRef for explicit type changes to 'load' instruction
David Blaikie [Wed, 4 Mar 2015 22:06:14 +0000 (22:06 +0000)]
Update LangRef for explicit type changes to 'load' instruction

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

9 years agoExpand variables when evaluating absolute expressions.
Rafael Espindola [Wed, 4 Mar 2015 22:03:21 +0000 (22:03 +0000)]
Expand variables when evaluating absolute expressions.

This allows for variables to be used in .size.
This matches gnu AS functionality.

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

9 years agoUpdate LangRef for getelementptr explicit type changes
David Blaikie [Wed, 4 Mar 2015 22:02:58 +0000 (22:02 +0000)]
Update LangRef for getelementptr explicit type changes

Here's a rough/first draft - it at least hits the actual textual IR
examples and some of the phrasing. It's probably worth a full pass over,
but I'm not sure how much these docs should reflect the strange
intermediate state we're in anyway.

Totally open to lots of review/feedback/suggestions.

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

9 years agodon't repeat class / function / variable names in comments; NFC
Sanjay Patel [Wed, 4 Mar 2015 21:49:03 +0000 (21:49 +0000)]
don't repeat class / function / variable names in comments; NFC

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

9 years agoSupport standard DWARF TLS opcode; Darwin and PS4 use it.
Paul Robinson [Wed, 4 Mar 2015 20:55:11 +0000 (20:55 +0000)]
Support standard DWARF TLS opcode; Darwin and PS4 use it.

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

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

9 years agoAdd LLVM support for PPC cryptography builtins
Nemanja Ivanovic [Wed, 4 Mar 2015 20:44:33 +0000 (20:44 +0000)]
Add LLVM support for PPC cryptography builtins
Review: http://reviews.llvm.org/D7955

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

9 years agoTry to satisfy sanitizer lint check
Reid Kleckner [Wed, 4 Mar 2015 20:38:59 +0000 (20:38 +0000)]
Try to satisfy sanitizer lint check

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

9 years agoAdd a FIXME for PR22796, broken ordering of ClassInfo in TableGen
David Blaikie [Wed, 4 Mar 2015 19:56:44 +0000 (19:56 +0000)]
Add a FIXME for PR22796, broken ordering of ClassInfo in TableGen

As discussed (at length) in code review of r222935, with Duncan.

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

9 years agoFix the build of the gold-plugin and examples.
Rafael Espindola [Wed, 4 Mar 2015 19:15:29 +0000 (19:15 +0000)]
Fix the build of the gold-plugin and examples.

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

9 years agoAdd missing <atomic> include to PassRegistry.h
Reid Kleckner [Wed, 4 Mar 2015 19:06:17 +0000 (19:06 +0000)]
Add missing <atomic> include to PassRegistry.h

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

9 years agoAdd a lock() function in PassRegistry to speed up multi-thread synchronization.
Erik Eckstein [Wed, 4 Mar 2015 18:57:11 +0000 (18:57 +0000)]
Add a lock() function in PassRegistry to speed up multi-thread synchronization.

When calling lock() after all passes are registered, the PassRegistry doesn't need a mutex anymore to look up passes.
This speeds up multithreaded llvm execution by ~5% (tested with 4 threads).
In an asserts build of llvm this has an even bigger impact.

Note that it's not required to use the lock function.

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

9 years agoRecommit r231221: "Devirtualize ~parser<T> by making it protected in base classes...
David Blaikie [Wed, 4 Mar 2015 18:52:32 +0000 (18:52 +0000)]
Recommit r231221: "Devirtualize ~parser<T> by making it protected in base classes and making derived classes final"

Reverted in r231254 due to a self-hosting crash of Clang (see Clang
PR22793). Workaround the crash by using {} instead of = default to
define a dtor.

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

9 years agoBring r231132 back with a fix.
Rafael Espindola [Wed, 4 Mar 2015 18:51:45 +0000 (18:51 +0000)]
Bring r231132 back with a fix.

The issue was that we were always printing the remarks. Fix that and add a test
showing that it prints nothing if -pass-remarks is not given.

Original message:
Correctly handle -pass-remarks in the gold plugin.

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

9 years agoMake DataLayout Non-Optional in the Module
Mehdi Amini [Wed, 4 Mar 2015 18:43:29 +0000 (18:43 +0000)]
Make DataLayout Non-Optional in the Module

Summary:
DataLayout keeps the string used for its creation.

As a side effect it is no longer needed in the Module.
This is "almost" NFC, the string is no longer
canonicalized, you can't rely on two "equals" DataLayout
having the same string returned by getStringRepresentation().

Get rid of DataLayoutPass: the DataLayout is in the Module

The DataLayout is "per-module", let's enforce this by not
duplicating it more than necessary.
One more step toward non-optionality of the DataLayout in the
module.

Make DataLayout Non-Optional in the Module

Module->getDataLayout() will never returns nullptr anymore.

Reviewers: echristo

Subscribers: resistor, llvm-commits, jholewinski

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

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

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

9 years agoRevert "unique_ptrify ValID::ConstantStructElts"
Reid Kleckner [Wed, 4 Mar 2015 18:31:10 +0000 (18:31 +0000)]
Revert "unique_ptrify ValID::ConstantStructElts"

This reverts r231200 and r231204. The second one added an explicit move
ctor for MSVC.

This change broke the clang-cl self-host due to weirdness in MSVC's
implementation of std::map::insert. Somehow we lost our rvalue ref-ness
when going through variadic placement new:

  template <class _Objty, class... _Types>
  void construct(_Objty *_Ptr,
                 _Types &&... _Args) { // construct _Objty(_Types...) at _Ptr
    ::new ((void *)_Ptr) _Objty(_STD forward<_Types>(_Args)...);
  }

For some reason, Clang decided to call the deleted std::pair copy
constructor at this point. Needs further investigation, once I can
build.

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

9 years agoRevert the test commit.
Wei Mi [Wed, 4 Mar 2015 17:44:22 +0000 (17:44 +0000)]
Revert the test commit.

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

9 years agoTest commit. It will be reverted in the next commit.
Wei Mi [Wed, 4 Mar 2015 17:41:17 +0000 (17:41 +0000)]
Test commit. It will be reverted in the next commit.

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

9 years agoUpdate the out-of-date dwarf expressions in these testcases.
Adrian Prantl [Wed, 4 Mar 2015 17:39:59 +0000 (17:39 +0000)]
Update the out-of-date dwarf expressions in these testcases.

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

9 years agoFix DwarfExpression::AddMachineRegExpression so it doesn't read past the
Adrian Prantl [Wed, 4 Mar 2015 17:39:33 +0000 (17:39 +0000)]
Fix DwarfExpression::AddMachineRegExpression so it doesn't read past the
end of an expression that ends with DW_OP_plus.
Caught by the ASAN build bots.

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

9 years agoR600/SI: Add an intrinsic for S_FLBIT_I32 / V_FFBH_I32
Marek Olsak [Wed, 4 Mar 2015 17:33:45 +0000 (17:33 +0000)]
R600/SI: Add an intrinsic for S_FLBIT_I32 / V_FFBH_I32

Required by OpenGL (ARB_gpu_shader5).

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

9 years agoTest commit. Removed an unnecessary space
Nemanja Ivanovic [Wed, 4 Mar 2015 17:09:12 +0000 (17:09 +0000)]
Test commit. Removed an unnecessary space

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

9 years agoExplicitly default ilistTest::Node's copy constructor
David Blaikie [Wed, 4 Mar 2015 17:01:18 +0000 (17:01 +0000)]
Explicitly default ilistTest::Node's copy constructor

In the presence of a user-declared dtor, calling an implicit copy ctor
is deprecated in C++11.

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

9 years agoRevert r231221, "Devirtualize ~parser<T> by making it protected in base classes and...
NAKAMURA Takumi [Wed, 4 Mar 2015 16:24:40 +0000 (16:24 +0000)]
Revert r231221, "Devirtualize ~parser<T> by making it protected in base classes and making derived classes final"

It broke seflhosting.

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

9 years agoRevert r231132, "Correctly handle -pass-remarks in the gold plugin.", for now, to...
NAKAMURA Takumi [Wed, 4 Mar 2015 16:24:28 +0000 (16:24 +0000)]
Revert r231132, "Correctly handle -pass-remarks in the gold plugin.", for now, to suppress log floodng in LTO.

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

9 years agoMutate TargetLowering::shouldExpandAtomicRMWInIR to specifically dictate how AtomicRM...
JF Bastien [Wed, 4 Mar 2015 15:47:57 +0000 (15:47 +0000)]
Mutate TargetLowering::shouldExpandAtomicRMWInIR to specifically dictate how AtomicRMWInsts are expanded.

Summary:
In PNaCl, most atomic instructions have their own @llvm.nacl.atomic.* function, each one, with a few exceptions, represents a consistent behaviour across all NaCl-supported targets. Unfortunately, the atomic RMW operations nand, [u]min, and [u]max aren't directly represented by any such @llvm.nacl.atomic.* function. This patch refines shouldExpandAtomicRMWInIR in TargetLowering so that a future `Le32TargetLowering` class can selectively inform the caller how the target desires the atomic RMW instruction to be expanded (ie via load-linked/store-conditional for ARM/AArch64, via cmpxchg for X86/others?, or not at all for Mips) if at all.

This does not represent a behavioural change and as such no tests were added.

Patch by: Richard Diamond.

Reviewers: jfb

Reviewed By: jfb

Subscribers: jfb, aemerson, t.p.northover, llvm-commits

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

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

9 years ago[mips][microMIPS] Make usage of ADDU16 and SUBU16 by code generator
Jozef Kolek [Wed, 4 Mar 2015 15:47:42 +0000 (15:47 +0000)]
[mips][microMIPS] Make usage of ADDU16 and SUBU16 by code generator

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

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

9 years ago[PowerPC] Remove unnecessary and incomplete commentary
Bill Schmidt [Wed, 4 Mar 2015 14:56:05 +0000 (14:56 +0000)]
[PowerPC] Remove unnecessary and incomplete commentary

This "itinerary class map" in PPCSchedule.td is incomplete and
redundant with the actual code.  As it provides no value, we've
decided to remove it.

No functional change.

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

9 years ago[X86][FastISel] Simplify the logic in method X86SelectSIToFP.
Andrea Di Biagio [Wed, 4 Mar 2015 14:23:25 +0000 (14:23 +0000)]
[X86][FastISel] Simplify the logic in method X86SelectSIToFP.

The target-independent selection algorithm in FastISel already knows how
to select a SINT_TO_FP if the target is SSE but not AVX.

On targets that have SSE but not AVX, the tablegen'd 'fastEmit' functions
for ISD::SINT_TO_FP know how to select instruction X86::CVTSI2SSrr
(for an i32 to f32 conversion) and X86::CVTSI2SDrr (for an i32 to f64
conversion).

This patch simplifies the logic in method X86SelectSIToFP knowing that
the code would not be reachable if the subtarget doesn't have AVX.
No functional change intended.

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

9 years agoasan: do not instrument direct inbounds accesses to stack variables
Dmitry Vyukov [Wed, 4 Mar 2015 13:27:53 +0000 (13:27 +0000)]
asan: do not instrument direct inbounds accesses to stack variables

Do not instrument direct accesses to stack variables that can be
proven to be inbounds, e.g. accesses to fields of structs on stack.

But it eliminates 33% of instrumentation on webrtc/modules_unittests
(number of memory accesses goes down from 290152 to 193998) and
reduces binary size by 15% (from 74M to 64M) and improved compilation time by 6-12%.

The optimization is guarded by asan-opt-stack flag that is off by default.

http://reviews.llvm.org/D7583

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

9 years ago[mips] Rename the LA/LI/DLI TableGen definitions and classes. NFC.
Toma Tabacu [Wed, 4 Mar 2015 13:01:14 +0000 (13:01 +0000)]
[mips] Rename the LA/LI/DLI TableGen definitions and classes. NFC.

Summary:
Use more reasonable names for these pseudo-instructions.
As there's only one definition tied to any one of these classes, I named them with abbreviated versions of their respective class' name.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

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

9 years ago[mips] Keep the parameter list of Filler::searchRange() consistent. NFC.
Vasileios Kalintiris [Wed, 4 Mar 2015 12:37:58 +0000 (12:37 +0000)]
[mips] Keep the parameter list of Filler::searchRange() consistent. NFC.

Summary:
Move the "Filler" parameter to the end of the parameter list as it is,
conceptually, the only output parameter of that function.

Reviewers: dsanders

Subscribers: llvm-commits

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

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

9 years ago[MBP] Fix a really horrible bug in MachineBlockPlacement, but behind
Chandler Carruth [Wed, 4 Mar 2015 12:18:08 +0000 (12:18 +0000)]
[MBP] Fix a really horrible bug in MachineBlockPlacement, but behind
a flag for now.

First off, thanks to Daniel Jasper for really pointing out the issue
here. It's been here forever (at least, I think it was there when
I first wrote this code) without getting really noticed or fixed.

The key problem is what happens when two reasonably common patterns
happen at the same time: we outline multiple cold regions of code, and
those regions in turn have diamonds or other CFGs for which we can't
just topologically lay them out. Consider some C code that looks like:

  if (a1()) { if (b1()) c1(); else d1(); f1(); }
  if (a2()) { if (b2()) c2(); else d2(); f2(); }
  done();

Now consider the case where a1() and a2() are unlikely to be true. In
that case, we might lay out the first part of the function like:

  a1, a2, done;

And then we will be out of successors in which to build the chain. We go
to find the best block to continue the chain with, which is perfectly
reasonable here, and find "b1" let's say. Laying out successors gets us
to:

  a1, a2, done; b1, c1;

At this point, we will refuse to lay out the successor to c1 (f1)
because there are still un-placed predecessors of f1 and we want to try
to preserve the CFG structure. So we go get the next best block, d1.

... wait for it ...

Except that the next best block *isn't* d1. It is b2! d1 is waaay down
inside these conditionals. It is much less important than b2. Except
that this is exactly what we didn't want. If we keep going we get the
entire set of the rest of the CFG *interleaved*!!!

  a1, a2, done; b1, c1; b2, c2; d1, f1; d2, f2;

So we clearly need a better strategy here. =] My current favorite
strategy is to actually try to place the block whose predecessor is
closest. This very simply ensures that we unwind these kinds of CFGs the
way that is natural and fitting, and should minimize the number of cache
lines instructions are spread across.

It also happens to be *dead simple*. It's like the datastructure was
specifically set up for this use case or something. We only push blocks
onto the work list when the last predecessor for them is placed into the
chain. So the back of the worklist *is* the nearest next block.

Unfortunately, a change like this is going to cause *soooo* many
benchmarks to swing wildly. So for now I'm adding this under a flag so
that we and others can validate that this is fixing the problems
described, that it seems possible to enable, and hopefully that it fixes
more of our problems long term.

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

9 years ago[mips] Specify the correct value type when combining a CMovFP node.
Vasileios Kalintiris [Wed, 4 Mar 2015 12:10:18 +0000 (12:10 +0000)]
[mips] Specify the correct value type when combining a CMovFP node.

This commit fixes a bug introduced in r230956 where we were creating
CMovFP_{T,F} nodes with multiple return value types (one for each operand).
With this change the return value type of the new node is the same as the
value type of the True/False operands of the original node.

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

9 years agoAdd a flag to experiment with outlining optional branches.
Daniel Jasper [Wed, 4 Mar 2015 11:05:34 +0000 (11:05 +0000)]
Add a flag to experiment with outlining optional branches.

In a CFG with the edges A->B->C and A->C, B is an optional branch.

LLVM's default behavior is to lay the blocks out naturally, i.e. A, B,
C, in order to improve code locality and fallthroughs. However, if a
function contains many of those optional branches only a few of which
are taken, this leads to a lot of unnecessary icache misses. Moving B
out of line can work around this.

Review: http://reviews.llvm.org/D7719

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

9 years agoFix PR22408 - LLVM producing AArch64 TLS relocations that GNU linkers cannot handle...
Kristof Beyls [Wed, 4 Mar 2015 09:12:08 +0000 (09:12 +0000)]
Fix PR22408 - LLVM producing AArch64 TLS relocations that GNU linkers cannot handle yet.

As is described at http://llvm.org/bugs/show_bug.cgi?id=22408, the GNU linkers
ld.bfd and ld.gold currently only support a subset of the whole range of AArch64
ELF TLS relocations. Furthermore, they assume that some of the code sequences to
access thread-local variables are produced in a very specific sequence.
When the sequence is not as the linker expects, it can silently mis-relaxe/mis-optimize
the instructions.
Even if that wouldn't be the case, it's good to produce the exact sequence,
as that ensures that linkers can perform optimizing relaxations.

This patch:

* implements support for 16MiB TLS area size instead of 4GiB TLS area size. Ideally clang
  would grow an -mtls-size option to allow support for both, but that's not part of this patch.
* by default doesn't produce local dynamic access patterns, as even modern ld.bfd and ld.gold
  linkers do not support the associated relocations. An option (-aarch64-elf-ldtls-generation)
  is added to enable generation of local dynamic code sequence, but is off by default.
* makes sure that the exact expected code sequence for local dynamic and general dynamic
  accesses is produced, by making use of a new pseudo instruction. The patch also removes
  two (AArch64ISD::TLSDESC_BLR, AArch64ISD::TLSDESC_CALL) pre-existing AArch64-specific pseudo
  SDNode instructions that are superseded by the new one (TLSDESC_CALLSEQ).

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

9 years ago[Tablegen] Use correct result number variables with the pattern nodes they go with...
Craig Topper [Wed, 4 Mar 2015 09:04:54 +0000 (09:04 +0000)]
[Tablegen] Use correct result number variables with the pattern nodes they go with when handling SDTCisSameAs. No functional change as they are always both 0 unless you try to define a multi result type profile that uses SDTCisSame on one of the other results.

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

9 years agoExplicitly default DenseMapTest::CtorTest::operator=
David Blaikie [Wed, 4 Mar 2015 07:57:45 +0000 (07:57 +0000)]
Explicitly default DenseMapTest::CtorTest::operator=

Using the implicit default copy assignment operator in the presence of a
user-declared copy ctor is deprecated in C++11.

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

9 years agoRemove explicit RNSuccIterator copy assignment in favor of implicit default
David Blaikie [Wed, 4 Mar 2015 07:51:50 +0000 (07:51 +0000)]
Remove explicit RNSuccIterator copy assignment in favor of implicit default

Asserting that the source and destination iterators are from the same
region is unnecessary - there's no reason to disallow reassignment from
any regions, so long as they aren't compared.

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

9 years agouse = default instead of {}
David Blaikie [Wed, 4 Mar 2015 07:35:04 +0000 (07:35 +0000)]
use = default instead of {}

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

9 years agoMake format_object_base explicitly copyable, so format_objects can be copied without...
David Blaikie [Wed, 4 Mar 2015 07:35:02 +0000 (07:35 +0000)]
Make format_object_base explicitly copyable, so format_objects can be copied without relying on the implicit copy ctor

Use of the implicit copy ctor is deprecated in C++11 in the presence of
a user declared dtor.

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