OSDN Git Service

android-x86/external-llvm.git
7 years agoIn visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.
Nirav Dave [Thu, 2 Feb 2017 14:39:42 +0000 (14:39 +0000)]
In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.

    Recommiting after fixing X86 inc/dec chain bug.

    * Simplify Consecutive Merge Store Candidate Search

    Now that address aliasing is much less conservative, push through
    simplified store merging search and chain alias analysis which only
    checks for parallel stores through the chain subgraph. This is cleaner
    as the separation of non-interfering loads/stores from the
    store-merging logic.

    When merging stores search up the chain through a single load, and
    finds all possible stores by looking down from through a load and a
    TokenFactor to all stores visited.

    This improves the quality of the output SelectionDAG and the output
    Codegen (save perhaps for some ARM cases where we correctly constructs
    wider loads, but then promotes them to float operations which appear
    but requires more expensive constant generation).

    Some minor peephole optimizations to deal with improved SubDAG shapes (listed below)

    Additional Minor Changes:

      1. Finishes removing unused AliasLoad code

      2. Unifies the chain aggregation in the merged stores across code
         paths

      3. Re-add the Store node to the worklist after calling
         SimplifyDemandedBits.

      4. Increase GatherAllAliasesMaxDepth from 6 to 18. That number is
         arbitrary, but seems sufficient to not cause regressions in
         tests.

      5. Remove Chain dependencies of Memory operations on CopyfromReg
         nodes as these are captured by data dependence

      6. Forward loads-store values through tokenfactors containing
          {CopyToReg,CopyFromReg} Values.

      7. Peephole to convert buildvector of extract_vector_elt to
         extract_subvector if possible (see
         CodeGen/AArch64/store-merge.ll)

      8. Store merging for the ARM target is restricted to 32-bit as
         some in some contexts invalid 64-bit operations are being
         generated. This can be removed once appropriate checks are
         added.

    This finishes the change Matt Arsenault started in r246307 and
    jyknight's original patch.

    Many tests required some changes as memory operations are now
    reorderable, improving load-store forwarding. One test in
    particular is worth noting:

      CodeGen/PowerPC/ppc64-align-long-double.ll - Improved load-store
      forwarding converts a load-store pair into a parallel store and
      a memory-realized bitcast of the same value. However, because we
      lose the sharing of the explicit and implicit store values we
      must create another local store. A similar transformation
      happens before SelectionDAG as well.

    Reviewers: arsenm, hfinkel, tstellarAMD, jyknight, nhaehnle

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

7 years ago[X86,ISEL] Fix X86 increment chain dependence calculation
Nirav Dave [Thu, 2 Feb 2017 14:39:26 +0000 (14:39 +0000)]
[X86,ISEL] Fix X86 increment chain dependence calculation

Merging Load-add-store pattern into a increment op previously dropped
the load's chain from the instructions dependence if the store is
chained to a TokenFactor.

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

7 years ago[ARM] GlobalISel: Lower pointer args and returns
Diana Picus [Thu, 2 Feb 2017 14:01:00 +0000 (14:01 +0000)]
[ARM] GlobalISel: Lower pointer args and returns

It is important to change the ArgInfo's type from pointer to integer, otherwise
the CC assign function won't know what to do. Instead of hacking it up, we use
ComputeValueVTs and introduce some of the helpers that we will need later on for
lowering more complex types.

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

7 years ago[ARM] GlobalISel: Error out instead of asserting
Diana Picus [Thu, 2 Feb 2017 14:00:54 +0000 (14:00 +0000)]
[ARM] GlobalISel: Error out instead of asserting

Allow unknown types in TLI.getValueType, otherwise we get asserts for certain
types that we do not support yet (instead of returning that we don't support
them and falling through the normal error path).

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

7 years ago[LICM] Hoist loads that are dominated by invariant.start intrinsic, and are invariant...
Anna Thomas [Thu, 2 Feb 2017 13:22:03 +0000 (13:22 +0000)]
[LICM] Hoist loads that are dominated by invariant.start intrinsic, and are invariant in the loop.

Summary:
We can hoist out loads that are dominated by invariant.start, to the preheader.
We conservatively assume the load is variant, if we see a corresponding
use of invariant.start (it could be an invariant.end or an escaping
call).

Reviewers: mkuper, sanjoy, reames

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29331

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

7 years ago[ARM] GlobalISel: Legalize loading pointers
Diana Picus [Thu, 2 Feb 2017 13:20:49 +0000 (13:20 +0000)]
[ARM] GlobalISel: Legalize loading pointers

Make it legal to load pointer values. Also check that pointers are assigned
to the GPR reg bank by default.

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

7 years ago[ARM] GlobalISel: Test default banks for load results. NFC.
Diana Picus [Thu, 2 Feb 2017 13:00:24 +0000 (13:00 +0000)]
[ARM] GlobalISel: Test default banks for load results. NFC.

Check that all scalars are loaded into the GPR by default.

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

7 years ago[X86][SSE] Use MOVMSK for all_of/any_of reduction patterns
Simon Pilgrim [Thu, 2 Feb 2017 11:52:33 +0000 (11:52 +0000)]
[X86][SSE] Use MOVMSK for all_of/any_of reduction patterns

This is a first attempt at using the MOVMSK instructions to replace all_of/any_of reduction patterns (i.e. an and/or + shuffle chain).

So far this only matches patterns where we are reducing an all/none bits source vector (i.e. a comparison result) but we should be able to expand on this in conjunction with improvements to 'bool vector' handling both in the x86 backend as well as the vectorizers etc.

Differential Revision: https://reviews.llvm.org/D28810

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

7 years agoDIBuilder.h: Fix a typo. [-Wdocumentation]
NAKAMURA Takumi [Thu, 2 Feb 2017 09:55:22 +0000 (09:55 +0000)]
DIBuilder.h: Fix a typo. [-Wdocumentation]

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

7 years ago[X86] Remove some unused DAGCombinerInfo parameters. NFC
Craig Topper [Thu, 2 Feb 2017 08:03:23 +0000 (08:03 +0000)]
[X86] Remove some unused DAGCombinerInfo parameters. NFC

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

7 years ago[X86] Move some INSERT_SUBVECTOR optimizations from legalize to DAG combine.
Craig Topper [Thu, 2 Feb 2017 08:03:20 +0000 (08:03 +0000)]
[X86] Move some INSERT_SUBVECTOR optimizations from legalize to DAG combine.

This moves creation of SUBV_BROADCAST and merging of adjacent loads that are being inserted together.

This is a step towards removing legalizing of INSERT_SUBVECTOR except for vXi1 cases.

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

7 years ago[opt-viewer] HTML-escape function names
Adam Nemet [Thu, 2 Feb 2017 05:49:02 +0000 (05:49 +0000)]
[opt-viewer] HTML-escape function names

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

7 years ago[opt-viewer] Alternating row background colors on index page
Adam Nemet [Thu, 2 Feb 2017 05:49:00 +0000 (05:49 +0000)]
[opt-viewer] Alternating row background colors on index page

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

7 years ago[LV] Also port failure remarks to new OptimizationRemarkEmitter API
Adam Nemet [Thu, 2 Feb 2017 05:41:51 +0000 (05:41 +0000)]
[LV] Also port failure remarks to new OptimizationRemarkEmitter API

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

7 years agoLTO: Link non-prevailing weak_odr or linkonce_odr globals into the combined module...
Peter Collingbourne [Thu, 2 Feb 2017 05:22:42 +0000 (05:22 +0000)]
LTO: Link non-prevailing weak_odr or linkonce_odr globals into the combined module with available_externally linkage.

These linkages mean that the ultimately prevailing symbol will have the same
semantics as any non-prevailing copy of the symbol, so we are free to ignore
the linker's resolution.

Differential Revision: https://reviews.llvm.org/D29367

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

7 years agoLinker: Move special casing for available_externally in IRMover to clients. NFCI.
Peter Collingbourne [Thu, 2 Feb 2017 05:12:15 +0000 (05:12 +0000)]
Linker: Move special casing for available_externally in IRMover to clients. NFCI.

The goal is to simplify the semantic model for clients of IRMover.

Differential Revision: https://reviews.llvm.org/D29435

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

7 years ago[AVX-512] Fix the implicit defs for VZEROALL/VZEROUPPER to include YMM16-YMM31.
Craig Topper [Thu, 2 Feb 2017 04:17:18 +0000 (04:17 +0000)]
[AVX-512] Fix the implicit defs for VZEROALL/VZEROUPPER to include YMM16-YMM31.

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

7 years ago[AVX-512] Add test case demonstrating that we have an incomplete implicit def list...
Craig Topper [Thu, 2 Feb 2017 04:17:15 +0000 (04:17 +0000)]
[AVX-512] Add test case demonstrating that we have an incomplete implicit def list for VZEROALL/VZEROUPPER. YMM16-YMM31 should also be defs.

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

7 years ago[X86] Use update_llc_test_checks.py to regenerate a test.
Craig Topper [Thu, 2 Feb 2017 04:17:12 +0000 (04:17 +0000)]
[X86] Use update_llc_test_checks.py to regenerate a test.

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

7 years agoInferAddressSpaces: Handle more cases with constant select operands
Matt Arsenault [Thu, 2 Feb 2017 03:37:22 +0000 (03:37 +0000)]
InferAddressSpaces: Handle more cases with constant select operands

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

7 years agoAMDGPU: Use source modifiers with f16->f32 conversions
Matt Arsenault [Thu, 2 Feb 2017 02:27:04 +0000 (02:27 +0000)]
AMDGPU: Use source modifiers with f16->f32 conversions

The operand types were defined to fit the fp16_to_fp node, which
has the half as an integer type. v_cvt_f32_f16 does support
source modifiers, so change this to have an FP type and modifiers.

For targets without legal f16, this requires recognizing the
bit operations and trying to produce them.

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

7 years agoRegisterCoalescer: Cleanup joinReservedPhysReg(); NFC
Matthias Braun [Thu, 2 Feb 2017 02:23:27 +0000 (02:23 +0000)]
RegisterCoalescer: Cleanup joinReservedPhysReg(); NFC

- Factor out a common subexpression
- Add some helpful comments
- Fix printing of a register in a debug message

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

7 years agoAArch64RegisterInfo: Simplify getReservedReg(); NFC
Matthias Braun [Thu, 2 Feb 2017 02:23:25 +0000 (02:23 +0000)]
AArch64RegisterInfo: Simplify getReservedReg(); NFC

After marking a 32bit register and all its super registers the 64bit
register does not need to be marked again.

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

7 years agoRefactor the gmlt tests. (NFC)
Dehao Chen [Thu, 2 Feb 2017 01:21:13 +0000 (01:21 +0000)]
Refactor the gmlt tests. (NFC)

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

7 years agoNVPTX: Fix not preserving volatile when expanding memset
Matt Arsenault [Thu, 2 Feb 2017 01:20:34 +0000 (01:20 +0000)]
NVPTX: Fix not preserving volatile when expanding memset

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

7 years agoFix LLDB Android AArch64 GCC debug info build
Omair Javaid [Thu, 2 Feb 2017 01:17:49 +0000 (01:17 +0000)]
Fix LLDB Android AArch64 GCC debug info build

Committing after fixing suggested changes and tested release/debug builds on
x86_64-linux and arm/aarch64 builds.

Differential revision: https://reviews.llvm.org/D29042

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

7 years agoRe-submit r293820: Return Error instead of bool from mergeTypeStreams().
Rui Ueyama [Thu, 2 Feb 2017 00:47:10 +0000 (00:47 +0000)]
Re-submit r293820: Return Error instead of bool from mergeTypeStreams().

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

7 years ago[IPSCCP] Restore the old behaviour (pre r293799).
Davide Italiano [Thu, 2 Feb 2017 00:46:54 +0000 (00:46 +0000)]
[IPSCCP] Restore the old behaviour (pre r293799).

It's not clear the change I made a good idea, and it definitely needs
further discussion. Thanks to Eli for pointing out.

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

7 years agoX86: Produce @ABS8 symbol modifiers for absolute symbols in range [0,128).
Peter Collingbourne [Thu, 2 Feb 2017 00:32:03 +0000 (00:32 +0000)]
X86: Produce @ABS8 symbol modifiers for absolute symbols in range [0,128).

Differential Revision: https://reviews.llvm.org/D28689

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

7 years agoInferAddressSpaces: clang-format some things
Matt Arsenault [Thu, 2 Feb 2017 00:28:25 +0000 (00:28 +0000)]
InferAddressSpaces: clang-format some things

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

7 years ago[dsymutil] Fix __LINKEDIT vmsize in dsymutil upgrade path
Steven Wu [Thu, 2 Feb 2017 00:00:13 +0000 (00:00 +0000)]
[dsymutil] Fix __LINKEDIT vmsize in dsymutil upgrade path

Summary:
dsymutil upgrade path can change the size of segment and it needs to update
the vmsize of the segment to reflect the size change.

rdar://problem/30290714

Reviewers: friss

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29433

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

7 years agoRemove an assertion that doesn't hold when mixing -g and -gmlt through
Paul Robinson [Wed, 1 Feb 2017 23:51:56 +0000 (23:51 +0000)]
Remove an assertion that doesn't hold when mixing -g and -gmlt through
LTO.  Replace it with a related assertion, ensuring that abstract
variables appear only in abstract scopes.
Part of PR31437.

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

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

7 years agoRemove XFAIL for test/DebugInfo/Generic/gmlt_profiling.ll
Dehao Chen [Wed, 1 Feb 2017 23:28:55 +0000 (23:28 +0000)]
Remove XFAIL for test/DebugInfo/Generic/gmlt_profiling.ll

Summary: test/DebugInfo/Generic/gmlt_profiling.ll will also pass on darwin, so we should remove the XFAIL in the test.

Reviewers: dblaikie, aprantl

Reviewed By: dblaikie

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29431

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

7 years ago[AMDGPU] Account workgroup size in LDS occupancy limits
Stanislav Mekhanoshin [Wed, 1 Feb 2017 22:59:50 +0000 (22:59 +0000)]
[AMDGPU] Account workgroup size in LDS occupancy limits

Functions matching LDS use to occupancy return results for a workgroup
of 64 workitems. The numbers has to be adjusted for bigger workgroups.
For example a workgroup of size 256 already occupies 4 waves just by
itself. Given that all numbers of LDS use in the compiler are per
workgroup, occupancy shall be multiplied by 4 in this case. Each 64
workitems still limited by the same number, but 4 subrgoups 64 workitems
each can afford 4 times more LDS to get the same occupancy.

In addition change initializes LDS size in the subtarget to a real value
for SI+ targets. This is required since LDS size is a variable in these
calculations.

Differential Revision: https://reviews.llvm.org/D29423

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

7 years ago[AArch64] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Wed, 1 Feb 2017 22:56:06 +0000 (22:56 +0000)]
[AArch64] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoChange debug-info-for-profiling from a TargetOption to a function attribute.
Dehao Chen [Wed, 1 Feb 2017 22:45:09 +0000 (22:45 +0000)]
Change debug-info-for-profiling from a TargetOption to a function attribute.

Summary: LTO requires the debug-info-for-profiling to be a function attribute.

Reviewers: echristo, mehdi_amini, dblaikie, probinson, aprantl

Reviewed By: mehdi_amini, dblaikie, aprantl

Subscribers: aprantl, probinson, ahatanak, llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D29203

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

7 years ago[libFuzzer] Disable afl tests on non-posix systems.
Marcos Pividori [Wed, 1 Feb 2017 22:40:50 +0000 (22:40 +0000)]
[libFuzzer] Disable afl tests on non-posix systems.

AflDriver is not supported on non posix systems.

Differential Revision: https://reviews.llvm.org/D29422

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

7 years ago[libFuzzer] Disable equivalence tests on non posix systems.
Marcos Pividori [Wed, 1 Feb 2017 22:40:45 +0000 (22:40 +0000)]
[libFuzzer] Disable equivalence tests on non posix systems.

We can not run this test until we implement shared memory on Windows.

Differential Revision: https://reviews.llvm.org/D29421

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

7 years ago[libFuzzer] Isolate merge tests that require posix.
Marcos Pividori [Wed, 1 Feb 2017 22:40:40 +0000 (22:40 +0000)]
[libFuzzer] Isolate merge tests that require posix.

Differential Revision: https://reviews.llvm.org/D29420

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

7 years ago[libFuzzer] Add features `windows` and `posix` for lit tests.
Marcos Pividori [Wed, 1 Feb 2017 22:40:34 +0000 (22:40 +0000)]
[libFuzzer] Add features `windows` and `posix` for lit tests.

Add 2 features: posix and windows.
Sometimes we want some specific tests only for posix and we use:
 REQUIRES: posix
Sometimes we want some specific tests only for windows and we use:
 REQUIRES: windows

Differential Revision: https://reviews.llvm.org/D29418

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

7 years ago[libFuzzer] Accept different extensions.
Marcos Pividori [Wed, 1 Feb 2017 22:40:29 +0000 (22:40 +0000)]
[libFuzzer] Accept different extensions.

Differential Revision: https://reviews.llvm.org/D29417

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

7 years ago[libFuzzer] Fix test because cmd prompt does not expand wildcard.
Marcos Pividori [Wed, 1 Feb 2017 22:39:55 +0000 (22:39 +0000)]
[libFuzzer] Fix test because cmd prompt does not expand wildcard.

Commands should expand the wildcards on Windows, the cmd prompt doesn't.
Because of that sancov was not finding the needed file.
To deal with this, we use ls and xargs from gnu win utils.

Differential Revision: https://reviews.llvm.org/D29374

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

7 years agoRevert r293820: Return Error instead of bool from mergeTypeStreams().
Rui Ueyama [Wed, 1 Feb 2017 22:28:43 +0000 (22:28 +0000)]
Revert r293820: Return Error instead of bool from mergeTypeStreams().

It broke buildbots.

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

7 years ago[ValueTracking] remove a FIXME for something we don't want to do; NFC
Sanjay Patel [Wed, 1 Feb 2017 22:27:34 +0000 (22:27 +0000)]
[ValueTracking] remove a FIXME for something we don't want to do; NFC

The comment was added with:
https://reviews.llvm.org/rL293773
...but there would be a cost to implement this and possibly no payoff.

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

7 years agoReturn Error instead of bool from mergeTypeStreams().
Rui Ueyama [Wed, 1 Feb 2017 22:09:34 +0000 (22:09 +0000)]
Return Error instead of bool from mergeTypeStreams().

Previously, mergeTypeStreams returns only true or false, so it was
impossible to know the reason if it failed. This patch changes the
function signature so that it returns an Error object.

Differential Revision: https://reviews.llvm.org/D29362

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

7 years agoRemove an assertion that doesn't hold when mixing -g and -gmlt through
Paul Robinson [Wed, 1 Feb 2017 21:54:50 +0000 (21:54 +0000)]
Remove an assertion that doesn't hold when mixing -g and -gmlt through
LTO.  Part of PR31437.

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

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

7 years agofix typos; NFC
Sanjay Patel [Wed, 1 Feb 2017 21:38:32 +0000 (21:38 +0000)]
fix typos; NFC

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

7 years ago[InstCombine] move folds for shift-shift pairs; NFCI
Sanjay Patel [Wed, 1 Feb 2017 21:31:34 +0000 (21:31 +0000)]
[InstCombine] move folds for shift-shift pairs; NFCI

Although this is 'no-functional-change-intended', I'm adding tests
for shl-shl and lshr-lshr pairs because there is no existing test
coverage for those folds.

It seems like we should be able to remove some code from foldShiftedShift()
at this point because we're handling those patterns on the general path.

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

7 years agoShut up another GCC warning about operator precedence. NFC.
Michael Kuperstein [Wed, 1 Feb 2017 21:06:33 +0000 (21:06 +0000)]
Shut up another GCC warning about operator precedence. NFC.

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

7 years agoAMDGPU: Allow clustering flat memory operations
Matt Arsenault [Wed, 1 Feb 2017 20:22:51 +0000 (20:22 +0000)]
AMDGPU: Allow clustering flat memory operations

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

7 years ago[JumpThread] No need to erase BB from LoopHeaders. NFC.
Jun Bum Lim [Wed, 1 Feb 2017 19:06:55 +0000 (19:06 +0000)]
[JumpThread] No need to erase BB from LoopHeaders. NFC.

Summary: No need to try to ease BB from LoopHeaders as we already know that BB is not in LoopHeaders.

Reviewers: hsung, majnemer, mcrosier, haicheng, rengolin

Reviewed By: rengolin

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29232

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

7 years ago[SCCP] Make sure we get this case right without noinline.
Davide Italiano [Wed, 1 Feb 2017 19:03:46 +0000 (19:03 +0000)]
[SCCP] Make sure we get this case right without noinline.

Thanks to Hal for pointing out in the post-commit review of
r293727.

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

7 years ago[IPSCCP] Don't propagate return values of functions marked as noinline.
Davide Italiano [Wed, 1 Feb 2017 18:52:20 +0000 (18:52 +0000)]
[IPSCCP] Don't propagate return values of functions marked as noinline.

This tries to address what Hal defined (in the post-commit review of
r293727) a long-standing problem with noinline, where we end up
de facto inlining trivial functions e.g.

__attribute__((noinline)) int patatino(void) { return 5; }

because of return value propagation.

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

7 years ago[mips] Parse the 'bopt' and 'nobopt' directives in IAS.
Simon Dardis [Wed, 1 Feb 2017 18:50:24 +0000 (18:50 +0000)]
[mips] Parse the 'bopt' and 'nobopt' directives in IAS.

The GAS assembler supports the ".set bopt" directive but according
to the sources it doesn't do anything. It's supposed to optimize
branches by filling the delay slot of a branch with it's target.

This patch teaches the MIPS asm parser to accept both and warn in
the case of 'bopt' that the bopt directive is unsupported.

This resolves PR/31841.

Thanks to Sean Bruno for reporting the issue!

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

7 years ago[pdb] Add a new command for analyzing hash collisions.
Zachary Turner [Wed, 1 Feb 2017 18:30:22 +0000 (18:30 +0000)]
[pdb] Add a new command for analyzing hash collisions.

This introduces the `analyze` subcommand.  For now there is only
one option, to analyze hash collisions in the type streams.  In
the future, however, we could add many more things here, such
as performing size analyses, compacting, and statistics about
the type of records etc.

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

7 years ago[X86] Extend single-source shuffle cost test to test more arches. NFC.
Michael Kuperstein [Wed, 1 Feb 2017 18:09:47 +0000 (18:09 +0000)]
[X86] Extend single-source shuffle cost test to test more arches. NFC.

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

7 years ago[libFuzzer] Do not use llvm-objdump for disassembling a DSO.
Marcos Pividori [Wed, 1 Feb 2017 17:59:23 +0000 (17:59 +0000)]
[libFuzzer] Do not use llvm-objdump for disassembling a DSO.

When disassembling a DSO, for calls to functions from the PLT, llvm-objdump only
prints the offset from the PLT, like: <.plt+0x30>.

While objdump and dumpbin print the function name, like:
<__sanitizer_cov_trace_pc_guard@plt>

When analyzing the coverage in libFuzzer we dissasemble and look for the calls
to __sanitizer_cov_trace_pc_guard.

So, this fails when using llvm-objdump on a DSO.

Differential Revision: https://reviews.llvm.org/D29372

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

7 years ago[libFuzzer] Properly check if we can use dumpbin.
Marcos Pividori [Wed, 1 Feb 2017 17:59:19 +0000 (17:59 +0000)]
[libFuzzer] Properly check if we can use dumpbin.

The flag "/sumary" is necessary, otherwise it returns a non-zero value.

Differential Revision: https://reviews.llvm.org/D29371

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

7 years ago[ImplicitNullChecks] NFC Fix the implicit-null-checks.mir test
Sanjoy Das [Wed, 1 Feb 2017 17:50:40 +0000 (17:50 +0000)]
[ImplicitNullChecks] NFC Fix the implicit-null-checks.mir test

Summary:
Currently the test implicit-null-checks.mir crashes if we run llc with
-enable-implicit-null-checks -start-before implicit-null-checks
options. Change fixes the RET instruction causing the crash.

Patch by Serguei Katkov!

Reviewers: sanjoy, reames

Reviewed By: sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29390

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

7 years ago[LV] Move interleaved access helper functions to VectorUtils (NFC)
Matthew Simpson [Wed, 1 Feb 2017 17:45:46 +0000 (17:45 +0000)]
[LV] Move interleaved access helper functions to VectorUtils (NFC)

This patch moves some helper functions related to interleaved access
vectorization out of LoopVectorize.cpp and into VectorUtils.cpp. We would like
to use these functions in a follow-on patch that improves interleaved load and
store lowering in (ARM/AArch64)ISelLowering.cpp. One of the functions was
already duplicated there and has been removed.

Differential Revision: https://reviews.llvm.org/D29398

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

7 years agoMake test case resilient to \ or / directory separators
David Blaikie [Wed, 1 Feb 2017 17:34:41 +0000 (17:34 +0000)]
Make test case resilient to \ or / directory separators

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

7 years agoAdd missing test cases from r293697/D29094
David Blaikie [Wed, 1 Feb 2017 17:15:24 +0000 (17:15 +0000)]
Add missing test cases from r293697/D29094

Differential Revision: https://reviews.llvm.org/D29368

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

7 years ago[InstCombine] Allow InstCombine to merge adjacent guards
Sanjoy Das [Wed, 1 Feb 2017 16:34:55 +0000 (16:34 +0000)]
[InstCombine] Allow InstCombine to merge adjacent guards

Summary:
If there are two adjacent guards with different conditions, we can
remove one of them and include its condition into the condition of
another one. This patch allows InstCombine to merge them by the
following pattern:

    guard(a); guard(b) -> guard(a & b).

Reviewers: reames, apilipenko, igor-laevsky, anna, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29378

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

7 years ago[X86][SSE] Remove unused argument. NFCI.
Simon Pilgrim [Wed, 1 Feb 2017 16:34:50 +0000 (16:34 +0000)]
[X86][SSE] Remove unused argument. NFCI.

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

7 years agoAMDGPU: Improve nsw/nuw/exact when promoting uniform i16 ops
Matt Arsenault [Wed, 1 Feb 2017 16:25:23 +0000 (16:25 +0000)]
AMDGPU: Improve nsw/nuw/exact when promoting uniform i16 ops

These were simply preserving the flags of the original operation,
which was too conservative in most cases and incorrect for mul.

nsw/nuw may be needed for some combines to cleanup messes when
intermediate sext_inregs are introduced later.

Tested valid combinations with alive.

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

7 years ago[ImplicitNullCheck] Extend canReorder scope
Sanjoy Das [Wed, 1 Feb 2017 16:04:21 +0000 (16:04 +0000)]
[ImplicitNullCheck] Extend canReorder scope

Summary:
This change allows a re-order of two intructions if their uses
are overlapped.

Patch by Serguei Katkov!

Reviewers: reames, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29120

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

7 years ago[ValueTracking] avoid crashing from bad assumptions (PR31809)
Sanjay Patel [Wed, 1 Feb 2017 15:41:32 +0000 (15:41 +0000)]
[ValueTracking] avoid crashing from bad assumptions (PR31809)

A program may contain llvm.assume info that disagrees with other analysis.
This may be caused by UB in the program, so we must not crash because of that.

As noted in the code comments:
https://llvm.org/bugs/show_bug.cgi?id=31809
...we can do better, but this at least avoids the assert/crash in the bug report.

Differential Revision: https://reviews.llvm.org/D29395

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

7 years ago[mips] Fix an initialization issue with MipsABIInfo in MipsTargetELFStreamer
Simon Dardis [Wed, 1 Feb 2017 15:39:23 +0000 (15:39 +0000)]
[mips] Fix an initialization issue with MipsABIInfo in MipsTargetELFStreamer

DebugInfoDWARFTests is the only user so far which initializes the
MCObjectStreamer without initializing the ASMParser. The MIPS backend
relies on the ASMParser to initialize the MipsABIInfo object and to
update the target streamer with it. This should turn the mips buildbots
green.

Reviewers: atanasyan, zoran.jovanovic

Differential Revision: https://reviews.llvm.org/D28025

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

7 years ago[PowerPC] Fix sjlj pseduo instructions to use G8RC_NOX0 register class
Kit Barton [Wed, 1 Feb 2017 14:33:57 +0000 (14:33 +0000)]
[PowerPC] Fix sjlj pseduo instructions to use G8RC_NOX0 register class

The the following instructions:
  - LD/LWZ (expanded from sjLj pseudo-instructions)
  - LXVL/LXVLL vector loads
  - STXVL/STXVLL vector stores
all require G8RC_NO0X class registers for RA.

Differential Revision: https://reviews.llvm.org/D29289

Committed for Lei Huang

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

7 years ago[X86][SSE] Merge SSE2 PINSRW lowering with SSE41 PINSRB/PINSRW lowering. NFCI.
Simon Pilgrim [Wed, 1 Feb 2017 13:32:19 +0000 (13:32 +0000)]
[X86][SSE] Merge SSE2 PINSRW lowering with SSE41 PINSRB/PINSRW lowering. NFCI.

These are identical apart from the extra SSE41 guard for PINSRB.

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

7 years ago [legalizetypes] Push fp16 -> fp32 extension node to worklist.
Florian Hahn [Wed, 1 Feb 2017 13:01:33 +0000 (13:01 +0000)]
 [legalizetypes] Push fp16 -> fp32 extension node to worklist.

Summary:
This way, the type legalization machinery will take care of registering
the result of this node properly.

This patches fixes all failing fp16 test cases  with expensive checks.
(CodeGen/ARM/fp16-promote.ll, CodeGen/ARM/fp16.ll, CodeGen/X86/cvt16.ll
CodeGen/X86/soft-fp.ll)

Reviewers: t.p.northover, baldrick, olista01, bogner, jmolloy, davidxl, ab, echristo, hfinkel

Reviewed By: hfinkel

Subscribers: mehdi_amini, hfinkel, davide, RKSimon, aemerson, llvm-commits

Differential Revision: https://reviews.llvm.org/D28195

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

7 years ago[ARM] const cast fix for ARMAttributeParser test
Sam Parker [Wed, 1 Feb 2017 12:58:57 +0000 (12:58 +0000)]
[ARM] const cast fix for ARMAttributeParser test

GCC 4.8 produced a cast qualifier warning, so replaced with C++ style
const cast.

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

7 years ago[LoopPredication] Add a new line to debug output in LoopPredication pass
Artur Pilipenko [Wed, 1 Feb 2017 12:25:38 +0000 (12:25 +0000)]
[LoopPredication] Add a new line to debug output in LoopPredication pass

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

7 years ago[ARM] Enable Cortex-M23 and Cortex-M33 support.
Javed Absar [Wed, 1 Feb 2017 11:55:03 +0000 (11:55 +0000)]
[ARM] Enable Cortex-M23 and Cortex-M33 support.

Add both cores to the target parser and TableGen. Test that eabi
attributes are set correctly for both cores. Additionally, test the
absence and presence of MOVT in Cortex-M23 and Cortex-M33, respectively.

Committed on behalf of Sanne Wouda.
Reviewers : rengolin, olista01.

Differential Revision: https://reviews.llvm.org/D29073

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

7 years ago[globalisel] Make the MatchAction hierarchy consistent with the matchers. NFC.
Daniel Sanders [Wed, 1 Feb 2017 10:53:10 +0000 (10:53 +0000)]
[globalisel] Make the MatchAction hierarchy consistent with the matchers. NFC.

Reviewers: aditya_nandakumar, rovka, t.p.northover, qcolombet, ab

Subscribers: dberris, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D29321

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

7 years ago[LoopUnroll] Use addClonedBlockToLoopInfo to add loop header to LI (NFC).
Florian Hahn [Wed, 1 Feb 2017 10:39:35 +0000 (10:39 +0000)]
[LoopUnroll] Use addClonedBlockToLoopInfo to add loop header to LI (NFC).

Summary:
I have a similar patch up for review already (D29173). If you prefer I
can squash them both together.

Also I think there more potential for code sharing between
LoopUnroll.cpp and LoopUnrollRuntime.cpp. Do you think patches for
that would be worthwhile?

Reviewers: mkuper, mzolotukhin

Reviewed By: mkuper, mzolotukhin

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29311

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

7 years ago*MacroFusion.cpp: Suppress warnings to eliminate \param(s). [-Wdocumentation]
NAKAMURA Takumi [Wed, 1 Feb 2017 07:30:46 +0000 (07:30 +0000)]
*MacroFusion.cpp: Suppress warnings to eliminate \param(s). [-Wdocumentation]

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

7 years ago[X86] For AVX1/AVX2 isel, don't use FP move instructions for 128-bit loads/stores...
Craig Topper [Wed, 1 Feb 2017 07:17:16 +0000 (07:17 +0000)]
[X86] For AVX1/AVX2 isel, don't use FP move instructions for 128-bit loads/stores of integer types.

For SSE we use fp because of the smaller encoding, but that doesn't apply to AVX. So just do the natural thing so we don't have to explain why we aren't. We can't do this for 256-bit loads/stores since integer loads and stores aren't available in AVX1 so we need fallback patterns since the integer types are legal.

This doesn't affect any tests because execution domain fixing freely converts the instructions anyway. Honestly, we could probably rely on it for the SSE size optimization too.

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

7 years ago[AArch64] Add new target feature to fuse literal generation
Evandro Menezes [Wed, 1 Feb 2017 02:54:42 +0000 (02:54 +0000)]
[AArch64] Add new target feature to fuse literal generation

This feature enables the fusion of such operations on Cortex A57, as
recommended in its Software Optimisation Guide, sections 4.14 and 4.15.

Differential revision: https://reviews.llvm.org/D28698

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

7 years ago[AArch64] Add new subtarget feature to fuse AES crypto operations
Evandro Menezes [Wed, 1 Feb 2017 02:54:39 +0000 (02:54 +0000)]
[AArch64] Add new subtarget feature to fuse AES crypto operations

This feature enables the fusion of such operations on Cortex A57, as
recommended in its Software Optimisation Guide, section 4.13, and on Exynos
M1.

Differential revision: https://reviews.llvm.org/D28491

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

7 years ago[CodeGen] Move MacroFusion to the target
Evandro Menezes [Wed, 1 Feb 2017 02:54:34 +0000 (02:54 +0000)]
[CodeGen] Move MacroFusion to the target

This patch moves the class for scheduling adjacent instructions,
MacroFusion, to the target.

In AArch64, it also expands the fusion to all instructions pairs in a
scheduling block, beyond just among the predecessors of the branch at the
end.

Differential revision: https://reviews.llvm.org/D28489

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

7 years ago[ImplicitNullCheck] NFC isSuitableMemoryOp cleanup
Sanjoy Das [Wed, 1 Feb 2017 02:49:25 +0000 (02:49 +0000)]
[ImplicitNullCheck] NFC isSuitableMemoryOp cleanup

Summary:
isSuitableMemoryOp method is repsonsible for verification
that instruction is a candidate to use in implicit null check.
Additionally it checks that base register is not re-defined before.
In case base has been re-defined it just returns false and lookup
is continued while any suitable instruction will not succeed this check
as well. This results in redundant further operations.

So when we found that base register has been re-defined we just
stop.

Patch by Serguei Katkov!

Reviewers: reames, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29119

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

7 years agoSanitizerCoverage: Support sanitizer guard section on darwin
Justin Bogner [Wed, 1 Feb 2017 02:38:39 +0000 (02:38 +0000)]
SanitizerCoverage: Support sanitizer guard section on darwin

MachO's sections need a segment as well as a section name, and the
section start and end symbols are spelled differently than on ELF.

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

7 years agoMCMacho: Allow __thread_ptr section after dwarf sections
Matthias Braun [Wed, 1 Feb 2017 01:31:36 +0000 (01:31 +0000)]
MCMacho: Allow __thread_ptr section after dwarf sections

Differential Revision: https://reviews.llvm.org/D29315

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

7 years ago[Mips] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 1 Feb 2017 01:22:51 +0000 (01:22 +0000)]
[Mips] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoFix regalloc assignment of overlapping registers
Stanislav Mekhanoshin [Wed, 1 Feb 2017 01:18:36 +0000 (01:18 +0000)]
Fix regalloc assignment of overlapping registers

SplitEditor::defFromParent() can create a register copy.
If register is a tuple of other registers and not all lanes are used
a copy will be done on a full tuple regardless. Later register unit
for an unused lane will be considered free and another overlapping
register tuple can be assigned to a different value even though first
register is live at that point. That is because interference only look at
liveness info, while full register copy clobbers all lanes, even unused.

This patch fixes copy to only cover used lanes.

Differential Revision: https://reviews.llvm.org/D29105

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

7 years ago[IPSCCP] Teach how to not propagate return values of naked functions.
Davide Italiano [Wed, 1 Feb 2017 01:01:22 +0000 (01:01 +0000)]
[IPSCCP] Teach how to not propagate return values of naked functions.

Differential Revision:  https://reviews.llvm.org/D29360

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

7 years agoAMDGPU: Cleanup fmin/fmax legacy function
Matt Arsenault [Wed, 1 Feb 2017 00:42:40 +0000 (00:42 +0000)]
AMDGPU: Cleanup fmin/fmax legacy function

Use a more specific subtarget check and combine hasOneUse checks

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

7 years ago[XRay] Use std::errc::invalid_argument instead of std::errc::bad_message
Dean Michael Berris [Wed, 1 Feb 2017 00:22:20 +0000 (00:22 +0000)]
[XRay] Use std::errc::invalid_argument instead of std::errc::bad_message

This change should appease the mingw32 builds.

Follow-up to D29319.

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

7 years agoInferAddressSpaces: Handle select
Matt Arsenault [Wed, 1 Feb 2017 00:08:53 +0000 (00:08 +0000)]
InferAddressSpaces: Handle select

This fails to handle some cases where one of the inputs is
a constant to be fixed in a later commit.

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

7 years ago[libFuzzer] increase the default size for shmem
Kostya Serebryany [Wed, 1 Feb 2017 00:07:47 +0000 (00:07 +0000)]
[libFuzzer] increase the default size for shmem

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

7 years ago[XRay] Define the InstrumentationMap type
Dean Michael Berris [Wed, 1 Feb 2017 00:05:29 +0000 (00:05 +0000)]
[XRay] Define the InstrumentationMap type

Summary:
This change implements the instrumentation map loading library which can
understand both YAML-defined instrumentation maps, and ELF 64-bit object
files that have the XRay instrumentation map section. We break it out
into a library on its own to allow for other applications to deal with
the XRay instrumentation map defined in XRay-instrumented binaries.

This type provides both raw access to the logical representation of the
instrumentation map entries as well as higher level functions for
converting a function ID into a function address.

At this point we only support ELF64 binaries and YAML-defined XRay
instrumentation maps. Future changes should extend this to support
32-bit ELF binaries, as well as other binary formats (like MachO).

As part of this change we also migrate all uses of the extraction logic
that used to be defined in tools/llvm-xray/ to use this new type and
interface for loading from files. We also remove the flag from the
`llvm-xray` tool that required users to specify the type of the
instrumentation map file being provided to instead make the library
auto-detect the file type.

Reviewers: dblaikie

Subscribers: mgorny, varno, llvm-commits

Differential Revision: https://reviews.llvm.org/D29319

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

7 years agoInferAddressSpaces: Remove dead declaration
Matt Arsenault [Tue, 31 Jan 2017 23:57:20 +0000 (23:57 +0000)]
InferAddressSpaces: Remove dead declaration

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

7 years agoInferAddressSpaces: Avoid double map lookup
Matt Arsenault [Tue, 31 Jan 2017 23:48:44 +0000 (23:48 +0000)]
InferAddressSpaces: Avoid double map lookup

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

7 years agoInferAddressSpaces: Fix broken casting of constants
Matt Arsenault [Tue, 31 Jan 2017 23:48:40 +0000 (23:48 +0000)]
InferAddressSpaces: Fix broken casting of constants

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

7 years agoAMDGPU: Fix warning
Matt Arsenault [Tue, 31 Jan 2017 23:48:37 +0000 (23:48 +0000)]
AMDGPU: Fix warning

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

7 years agoCodeGen: Allow small copyable blocks to "break" the CFG.
Kyle Butt [Tue, 31 Jan 2017 23:48:32 +0000 (23:48 +0000)]
CodeGen: Allow small copyable blocks to "break" the CFG.

When choosing the best successor for a block, ordinarily we would have preferred
a block that preserves the CFG unless there is a strong probability the other
direction. For small blocks that can be duplicated we now skip that requirement
as well, subject to some simple frequency calculations.

Differential Revision: https://reviews.llvm.org/D28583

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

7 years agoMove more code to helper functions. NFC.
Rafael Espindola [Tue, 31 Jan 2017 23:26:32 +0000 (23:26 +0000)]
Move more code to helper functions. NFC.

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

7 years ago[NVPTX] Compute approx sqrt as 1/rsqrt(x) rather than x*rsqrt(x).
Justin Lebar [Tue, 31 Jan 2017 23:08:57 +0000 (23:08 +0000)]
[NVPTX] Compute approx sqrt as 1/rsqrt(x) rather than x*rsqrt(x).

x*rsqrt(x) returns NaN for x == 0, whereas 1/rsqrt(x) returns 0, as
desired.

Verified that the particular nvptx approximate instructions here do in
fact return 0 for x = 0.

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

7 years agoMove some code to a helper function. NFC.
Rafael Espindola [Tue, 31 Jan 2017 23:07:08 +0000 (23:07 +0000)]
Move some code to a helper function. NFC.

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