]> granicus.if.org Git - llvm/log
llvm
8 years ago[X86] Add an additional CHECK prefix to a test. Some of the cases used it, but it...
Craig Topper [Sun, 26 Feb 2017 06:45:32 +0000 (06:45 +0000)]
[X86] Add an additional CHECK prefix to a test. Some of the cases used it, but it wasn't on the FileCheck command lines.

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

8 years ago[SCCP] Remove manual folding of terminator instructions.
Xin Tong [Sun, 26 Feb 2017 02:11:24 +0000 (02:11 +0000)]
[SCCP] Remove manual folding of terminator instructions.

Summary:
BranchInst, SwitchInst (with non-default case) with Undef as input is not
possible at this point. As we always default-fold terminator to one target in
ResolvedUndefsIn and set the input accordingly.

So we should only have constantint/blockaddress here.

If ConstantFoldTerminator fails, that could mean 2 things.

1. ConstantFoldTerminator is doing something unexpected, i.e. not folding on constantint
or blockaddress and not making blocks that should be dead dead.
2. This is not a terminator on constantint or blockaddress. Its on a constant or
overdefined, then this block should not be dead.

In both cases, we should assert.

Reviewers: davide, efriedma, sanjoy

Subscribers: llvm-commits

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

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

8 years ago[X86] Clean up test/CodeGen/X86/2006-03-02-InstrSchedBug.ll
David L. Jones [Sun, 26 Feb 2017 01:32:35 +0000 (01:32 +0000)]
[X86] Clean up test/CodeGen/X86/2006-03-02-InstrSchedBug.ll

Summary:
Migrated from grep to FileCheck.
Re-indented code, removed boilerplate comments.
Added 'entry' label at beginning of basic block.

Patch by Jorge Gorbe!

Subscribers: llvm-commits

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

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

8 years agoRevert "In visitSTORE, always use FindBetterChain, rather than only when UseAA is...
Nirav Dave [Sun, 26 Feb 2017 01:27:32 +0000 (01:27 +0000)]
Revert "In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled."

This reverts commit r296252 until 256-bit operations are more efficiently generated in X86.

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

8 years agovec perm can go down either pipeline on P8.
Eric Christopher [Sun, 26 Feb 2017 00:11:58 +0000 (00:11 +0000)]
vec perm can go down either pipeline on P8.
No observable changes, spotted while looking at the scheduling description.

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

8 years agoFix signed-unsigned comparison warning
Sanjoy Das [Sat, 25 Feb 2017 22:25:48 +0000 (22:25 +0000)]
Fix signed-unsigned comparison warning

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

8 years ago[ValueTracking] Don't do an unchecked shift in ComputeNumSignBits
Sanjoy Das [Sat, 25 Feb 2017 20:30:45 +0000 (20:30 +0000)]
[ValueTracking] Don't do an unchecked shift in ComputeNumSignBits

Summary:
Previously we used to return a bogus result, 0, for IR like `ashr %val,
-1`.

I've also added an assert checking that `ComputeNumSignBits` at least
returns 1.  That assert found an already checked in test case where we
were returning a bad result for `ashr %val, -1`.

Fixes PR32045.

Reviewers: spatel, majnemer

Reviewed By: spatel, majnemer

Subscribers: efriedma, mcrosier, llvm-commits

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

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

8 years ago[APInt] Add APInt::extractBits() method to extract APInt subrange (reapplied)
Simon Pilgrim [Sat, 25 Feb 2017 20:01:58 +0000 (20:01 +0000)]
[APInt] Add APInt::extractBits() method to extract APInt subrange (reapplied)

The current pattern for extract bits in range is typically:

Mask.lshr(BitOffset).trunc(SubSizeInBits);

Which can be particularly slow for large APInts (MaskSizeInBits > 64) as they require the allocation of memory for the temporary variable.

This is another of the compile time issues identified in PR32037 (see also D30265).

This patch adds the APInt::extractBits() helper method which avoids the temporary memory allocation.

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

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

8 years ago[AVX-512] Fix the execution domain for scalar FMA instructions.
Craig Topper [Sat, 25 Feb 2017 19:36:28 +0000 (19:36 +0000)]
[AVX-512] Fix the execution domain for scalar FMA instructions.

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

8 years ago[AVX-512] Fix the execution domain on some instructions.
Craig Topper [Sat, 25 Feb 2017 19:18:11 +0000 (19:18 +0000)]
[AVX-512] Fix the execution domain on some instructions.

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

8 years ago[AVX-512] Add an additional test case to show the execution domain for vrqsrtsd is...
Craig Topper [Sat, 25 Feb 2017 19:18:08 +0000 (19:18 +0000)]
[AVX-512] Add an additional test case to show the execution domain for vrqsrtsd is wrong.

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

8 years ago[AVX-512] Use update_llc_test_checks.py to regenerate the avx512er intrinsic test.
Craig Topper [Sat, 25 Feb 2017 19:18:04 +0000 (19:18 +0000)]
[AVX-512] Use update_llc_test_checks.py to regenerate the avx512er intrinsic test.

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

8 years agoreenable accidentally disabled test NFC.
Nirav Dave [Sat, 25 Feb 2017 19:11:53 +0000 (19:11 +0000)]
reenable accidentally disabled test NFC.

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

8 years ago[AVX-512] Remove unnecessary masked versions of VCVTSS2SD and VCVTSD2SS using the...
Craig Topper [Sat, 25 Feb 2017 18:43:42 +0000 (18:43 +0000)]
[AVX-512] Remove unnecessary masked versions of VCVTSS2SD and VCVTSD2SS using the scalar register class. We only have patterns for the masked intrinsics.

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

8 years ago[ExecutionDepsFix] Don't make copies of LiveReg objects when collecting operands...
Craig Topper [Sat, 25 Feb 2017 18:12:25 +0000 (18:12 +0000)]
[ExecutionDepsFix] Don't make copies of LiveReg objects when collecting operands for soft instructions

Summary:
While collecting operands we make copies of the LiveReg objects which are stored in the LiveRegs array. If the instruction uses the same register multiple times we end up with multiple copies. Later we iterate through the collected list of LiveReg objects and merge DomainValues. In the process of doing this the merge function can change the contents of the original LiveReg object in the LiveRegs array, but not the copies that have been made. So when we get to the second usage of the register we end up seeing a stale copy of the LiveReg object.

To fix this I've stopped copying and now just store a pointer to the original LiveReg object. Another option might be to avoid adding the same register to the Regs array twice, but this approach seemed simpler.

The included test case exposes this bug due to an AVX-512 masked OR instruction using the same register for the passthru operand and one of the inputs to the OR operation.

Fixes PR30284.

Reviewers: RKSimon, stoklund, MatzeB, spatel, myatsina

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

8 years agoNo need to copy the variable [NFC]
Artyom Skrobov [Sat, 25 Feb 2017 17:18:09 +0000 (17:18 +0000)]
No need to copy the variable [NFC]

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

8 years agoRevert r296215, "[PDB] General improvements to Stream library." and followings.
NAKAMURA Takumi [Sat, 25 Feb 2017 17:04:23 +0000 (17:04 +0000)]
Revert r296215, "[PDB] General improvements to Stream library." and followings.

r296215, "[PDB] General improvements to Stream library."
r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily."
r296220, "Re-enable BinaryStreamTest.StreamReaderObject."
r296244, "[PDB] Disable some tests that are breaking bots."
r296249, "Add static_cast to silence -Wc++11-narrowing."

std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission.
(Seek discussions around llvm/xray.)

I could substitute s/no_buffer_space/others/g, but I revert whole them ATM.

Could we define and use LLVM errors there?

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

8 years agoUpdate various test's codegen. NFC
Amaury Sechet [Sat, 25 Feb 2017 16:46:47 +0000 (16:46 +0000)]
Update various test's codegen. NFC

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

8 years agoAdd test for known bits in uaddo and saddo.
Amaury Sechet [Sat, 25 Feb 2017 15:58:34 +0000 (15:58 +0000)]
Add test for known bits in uaddo and saddo.

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

8 years agoThe automatic CHECK: to CHECK-LABEL: conversion, back in 2013,
Artyom Skrobov [Sat, 25 Feb 2017 15:17:16 +0000 (15:17 +0000)]
The automatic CHECK: to CHECK-LABEL: conversion, back in 2013,
had missed most labels in this test because they didn't end
with a colon.

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

8 years ago[DebugInfo] Skip implicit_const attributes when dumping .debug_info. NFC.
Victor Leschuk [Sat, 25 Feb 2017 13:15:57 +0000 (13:15 +0000)]
[DebugInfo] Skip implicit_const attributes when dumping .debug_info. NFC.

When dumping .debug_info section we loop through all attributes mentioned in
.debug_abbrev section and dump values using DWARFFormValue::extractValue().
We need to skip implicit_const attributes here as their values are not
really located in .debug_info but directly in .debug_abbrev. This patch fixes
triggered assert() in DWARFFormValue::extractValue() caused by trying to
access implicit_const values from .debug_info.

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

8 years agoIn visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.
Nirav Dave [Sat, 25 Feb 2017 11:43:58 +0000 (11:43 +0000)]
In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.

    Recommiting after fixup of 32-bit aliasing sign offset bug in DAGCombiner.

    * 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@296252 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Doc] Modernize programmers manual
Piotr Padlewski [Sat, 25 Feb 2017 10:33:37 +0000 (10:33 +0000)]
[Doc] Modernize programmers manual

Summary:
Fixed bunch of for loops to range based for loop
and bunch of rendundat types with auto.

Reviewers: echristo, silvas, chandlerc

Subscribers: mehdi_amini, llvm-commits

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

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

8 years agoEmpty line. NFCI
Xin Tong [Sat, 25 Feb 2017 08:10:28 +0000 (08:10 +0000)]
Empty line. NFCI

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

8 years agoAdd static_cast to silence -Wc++11-narrowing.
Daniel Jasper [Sat, 25 Feb 2017 07:53:36 +0000 (07:53 +0000)]
Add static_cast to silence -Wc++11-narrowing.

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

8 years ago[PDB] Disable some tests that are breaking bots.
Zachary Turner [Sat, 25 Feb 2017 05:57:57 +0000 (05:57 +0000)]
[PDB] Disable some tests that are breaking bots.

This has to do with big endian, but I can't fix it until
Monday.  The code itself is fine, just the tests are wrong.
Disabling 3 tests for now.

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

8 years agoAMDGPU/SI: export s_waitcnt builtin
Jan Vesely [Sat, 25 Feb 2017 02:13:32 +0000 (02:13 +0000)]
AMDGPU/SI: export s_waitcnt builtin

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

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

8 years agoMinor code cleanup. NFC.
Junmo Park [Sat, 25 Feb 2017 01:50:45 +0000 (01:50 +0000)]
Minor code cleanup. NFC.

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

8 years agoRe-enable BinaryStreamTest.StreamReaderObject.
Zachary Turner [Sat, 25 Feb 2017 01:20:08 +0000 (01:20 +0000)]
Re-enable BinaryStreamTest.StreamReaderObject.

I had an invalid pointer / size calculation that was causing
a stack smash.  Should be fixed now.

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

8 years agoRemove redundant code. NFC.
Akira Hatanaka [Sat, 25 Feb 2017 00:59:49 +0000 (00:59 +0000)]
Remove redundant code. NFC.

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

8 years agoClean up ObjCARCOpts.cpp. NFC.
Akira Hatanaka [Sat, 25 Feb 2017 00:53:38 +0000 (00:53 +0000)]
Clean up ObjCARCOpts.cpp. NFC.

I removed unused functions and variables and moved variables closer to
their uses.

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

8 years agoDisable BinaryStreamTest.StreamReaderObject temporarily.
Zachary Turner [Sat, 25 Feb 2017 00:52:59 +0000 (00:52 +0000)]
Disable BinaryStreamTest.StreamReaderObject temporarily.

This is crashing on some bots, so I need some time to investigate.

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

8 years ago[PDB] General improvements to Stream library.
Zachary Turner [Sat, 25 Feb 2017 00:44:30 +0000 (00:44 +0000)]
[PDB] General improvements to Stream library.

This adds various new functionality and cleanup surrounding the
use of the Stream library.  Major changes include:

* Renaming of all classes for more consistency / meaningfulness
* Addition of some new methods for reading multiple values at once.
* Full suite of unit tests for reader / writer functionality.
* Full set of doxygen comments for all classes.
* Streams now store their own endianness.
* Fixed some bugs in a few of the classes that were discovered
  by the unit tests.

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

8 years agoRemove svn:eol-style=native from Properties.
Zachary Turner [Sat, 25 Feb 2017 00:41:19 +0000 (00:41 +0000)]
Remove svn:eol-style=native from Properties.

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

8 years ago[PDB] Rename Stream related source files.
Zachary Turner [Sat, 25 Feb 2017 00:33:34 +0000 (00:33 +0000)]
[PDB] Rename Stream related source files.

This is part of a larger effort to get the Stream code moved
up to Support.  I don't want to do it in one large patch, in
part because the changes are so big that it will treat everything
as file deletions and add, losing history in the process.
Aside from that though, it's just a good idea in general to
make small changes.

So this change only changes the names of the Stream related
source files, and applies necessary source fix ups.

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

8 years ago[XRAY] A Color Choosing helper for XRay Graph
Dean Michael Berris [Sat, 25 Feb 2017 00:26:42 +0000 (00:26 +0000)]
[XRAY] A Color Choosing helper for XRay Graph

Summary:
In Preparation for graph comparison, this patch breaks out the color
choice code from xray-graph into a library and adds polynomials for
the Sequential and Difference sets from ColorBrewer.

Depends on D29005

Reviewers: dblaikie, chandlerc, dberris

Reviewed By: dberris

Subscribers: chandlerc, llvm-commits, mgorny

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

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

8 years ago[InlineCost] Move the code in isGEPOffsetConstant to a lambda.
Easwaran Raman [Sat, 25 Feb 2017 00:10:22 +0000 (00:10 +0000)]
[InlineCost] Move the code in isGEPOffsetConstant to a lambda.

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

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

8 years agoMinor code cleanup. NFC.
Junmo Park [Sat, 25 Feb 2017 00:08:53 +0000 (00:08 +0000)]
Minor code cleanup. NFC.

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

8 years ago[PGO] Directory name stripping in global identifier for static functions
Rong Xu [Sat, 25 Feb 2017 00:00:36 +0000 (00:00 +0000)]
[PGO] Directory name stripping in global identifier for static functions

Current internal option -static-func-full-module-prefix keeps all the
directory path the profile counter names for static functions. The default
of this option is false. This strips the directory names from the source
filename which is problematic:

(1) it creates linker errors for profile-generation compilation, exposed in
our internal benchmarks. We are seeing messages like
"warning: relocation refers to discarded section".
This is due to the name conflicts after the stripping.

(2) the stripping only applies to getPGOFuncName.
Current Thin-LTO module importing for the indirect-calls assumes
the source directory name not being stripped. Current default value
for this option can potentially prevent some inter-module
indirect-call-promotions.

This patch turns the default value for -static-func-full-module-prefix to true.

The second part of the patch is to have an alternative implementation under
 the internal option -static-func-strip-dirname-prefix=<value>

This options specifies level of directories to be stripped from the source
filename. Using a large value as the parameter has the same effect as
-static-func-full-module-prefix.

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

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

8 years ago[sancov] extending sancov --help documentation
Mike Aizatsky [Fri, 24 Feb 2017 23:55:18 +0000 (23:55 +0000)]
[sancov] extending sancov --help documentation

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

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

8 years ago[WebAssembly] Add support for using a wasm global for the stack pointer.
Dan Gohman [Fri, 24 Feb 2017 23:46:05 +0000 (23:46 +0000)]
[WebAssembly] Add support for using a wasm global for the stack pointer.

This replaces the __stack_pointer variable which was allocated in linear
memory.

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

8 years ago[Hexagon] Undo shift folding where it could simplify addressing mode
Krzysztof Parzyszek [Fri, 24 Feb 2017 23:34:24 +0000 (23:34 +0000)]
[Hexagon] Undo shift folding where it could simplify addressing mode

For example, avoid (single shift):
  r0 = and(##536870908,lsr(r0,#3))
  r0 = memw(r1+r0<<#0)

in favor of (two shifts):
  r0 = lsr(r0,#5)
  r0 = memw(r1+r0<<#2)

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

8 years ago[WebAssembly] Basic support for Wasm object file encoding.
Dan Gohman [Fri, 24 Feb 2017 23:18:00 +0000 (23:18 +0000)]
[WebAssembly] Basic support for Wasm object file encoding.

With the "wasm32-unknown-unknown-wasm" triple, this allows writing out
simple wasm object files, and is another step in a larger series toward
migrating from ELF to general wasm object support. Note that this code
and the binary format itself is still experimental.

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

8 years ago[.gitignore] Update .gitignore to ignore a nested build directory
Chris Bieneman [Fri, 24 Feb 2017 23:09:30 +0000 (23:09 +0000)]
[.gitignore] Update .gitignore to ignore a nested build directory

Summary:
A number of tools and common workflows include putting a build directory inside the source checkout under the folder "build". Adding this to .gitignore seems useful.

As an example, the CMake Tools plugin for VSCode does this.

Reviewers: chandlerc, echristo, zturner

Reviewed By: zturner

Subscribers: MatzeB, mehdi_amini, llvm-commits, jgosnell

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

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

8 years ago[Hexagon] Prettify code in HexagonDAGToDAGISel::Select
Krzysztof Parzyszek [Fri, 24 Feb 2017 23:00:40 +0000 (23:00 +0000)]
[Hexagon] Prettify code in HexagonDAGToDAGISel::Select

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

8 years agoAMDGPU : Replace FMAD with FMA when denormals are enabled.
Wei Ding [Fri, 24 Feb 2017 23:00:29 +0000 (23:00 +0000)]
AMDGPU : Replace FMAD with FMA when denormals are enabled.

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

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

8 years agoRevert "Correct register pressure calculation in presence of subregs"
Stanislav Mekhanoshin [Fri, 24 Feb 2017 21:56:16 +0000 (21:56 +0000)]
Revert "Correct register pressure calculation in presence of subregs"

This reverts commit r296009. It broke one out of tree target and also
does not account for all partial lines added or removed when calculating
PressureDiff.

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

8 years ago[utils] allow auto-generation of checks for thumb triples
Sanjay Patel [Fri, 24 Feb 2017 21:47:44 +0000 (21:47 +0000)]
[utils] allow auto-generation of checks for thumb triples

If there's some reason not to do this, feel free to revert and/or fix, but
for the cases I'm looking at, the script appears to do fine for these targets.

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

8 years agoDisallow redefinition of section symbols.
Evgeniy Stepanov [Fri, 24 Feb 2017 21:44:58 +0000 (21:44 +0000)]
Disallow redefinition of section symbols.

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

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

8 years agoInitialize MCContext::InlineSrcMgr in the constructor.
Evgeniy Stepanov [Fri, 24 Feb 2017 21:44:52 +0000 (21:44 +0000)]
Initialize MCContext::InlineSrcMgr in the constructor.

Found with ASan (and a local source change) on test/CodeGen/XCore/section-name.ll.

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

8 years ago[ARM] add tests for alternate forms of select-of-constants; NFC
Sanjay Patel [Fri, 24 Feb 2017 21:36:34 +0000 (21:36 +0000)]
[ARM] add tests for alternate forms of select-of-constants; NFC

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

8 years ago[WebAssembly] Define an initial set of relocation types for Wasm.
Dan Gohman [Fri, 24 Feb 2017 21:21:44 +0000 (21:21 +0000)]
[WebAssembly] Define an initial set of relocation types for Wasm.

This set will likely evolve, along with the Wasm linking ABI.

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

8 years agoGlobalISel: check for CImm rather than Imm on G_CONSTANTs.
Tim Northover [Fri, 24 Feb 2017 21:21:38 +0000 (21:21 +0000)]
GlobalISel: check for CImm rather than Imm on G_CONSTANTs.

All G_CONSTANTS created by the MachineIRBuilder have an operand of type CImm
(i.e. a ConstantInt), so that's what the selector needs to look for.

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

8 years ago[ARM] auto-generate complete checks; NFC
Sanjay Patel [Fri, 24 Feb 2017 21:19:09 +0000 (21:19 +0000)]
[ARM] auto-generate complete checks; NFC

The affected test may change with a patch I'm looking at for DAGCombiner,
so I want to make sure it's not a regression.

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

8 years ago[WebAssembly] Handle f16 in fast-isel.
Dan Gohman [Fri, 24 Feb 2017 21:05:35 +0000 (21:05 +0000)]
[WebAssembly] Handle f16 in fast-isel.

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

8 years agoFix Indentation. NFCI
Xin Tong [Fri, 24 Feb 2017 20:59:26 +0000 (20:59 +0000)]
Fix Indentation. NFCI

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

8 years ago[Orc][RPC] Accept both const char* and char* arguments for string serialization.
Lang Hames [Fri, 24 Feb 2017 20:56:43 +0000 (20:56 +0000)]
[Orc][RPC] Accept both const char* and char* arguments for string serialization.

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

8 years ago[CodeGenPrepare] Make -addr-sink-using-gep work with address spaces.
Eli Friedman [Fri, 24 Feb 2017 20:51:36 +0000 (20:51 +0000)]
[CodeGenPrepare] Make -addr-sink-using-gep work with address spaces.

When we construct addressing modes, we use isNoopAddrSpaceCast to ignore
addrspacecast instructions. Make sure we insert the correct addrspacecast
when we reconstruct the addressing mode.

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

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

8 years ago[InstCombine] Fix bug in pointer replacement
Yaxun Liu [Fri, 24 Feb 2017 20:27:25 +0000 (20:27 +0000)]
[InstCombine] Fix bug in pointer replacement

This optimisation was crashing when there was a chain of more than one bitcast
instruction to replace, as a result of the changes in D27283.

Patch by James Price.

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

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

8 years ago[Target/MIPS] Kill dead code, no functional change intended.
Davide Italiano [Fri, 24 Feb 2017 18:48:10 +0000 (18:48 +0000)]
[Target/MIPS] Kill dead code, no functional change intended.

Hopefully placates gcc with -Werror.

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

8 years ago[CGP] Split some critical edges coming out of indirect branches
Michael Kuperstein [Fri, 24 Feb 2017 18:41:32 +0000 (18:41 +0000)]
[CGP] Split some critical edges coming out of indirect branches

Splitting critical edges when one of the source edges is an indirectbr
is hard in general (because it requires changing the memory the indirectbr
reads). But if a block only has a single indirectbr predecessor (which is
the common case), we can simulate splitting that edge by splitting
the destination block, and retargeting the *direct* branches.

This is motivated by the use of computed gotos in python 2.7: PyEval_EvalFrame()
ends up using an indirect branch with ~100 successors, and passing a constant to
each of those. Since MachineSink can't break indirect critical edges on demand
(and doing this in MIR doesn't look feasible), this causes us to emit about ~100
defs of registers containing constants, which we in the predecessor block, where
only one of those constants is used in each successor. So, at each computed goto,
we needlessly spill about a 100 constants to stack. The end result is that a
clang-compiled python interpreter can be about ~2.5x slower on a simple python
reduction loop than a gcc-compiled interpreter.

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

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

8 years agoRevert: r296141 [APInt] Add APInt::extractBits() method to extract APInt subrange
Simon Pilgrim [Fri, 24 Feb 2017 18:31:04 +0000 (18:31 +0000)]
Revert: r296141 [APInt] Add APInt::extractBits() method to extract APInt subrange

The current pattern for extract bits in range is typically:

Mask.lshr(BitOffset).trunc(SubSizeInBits);

Which can be particularly slow for large APInts (MaskSizeInBits > 64) as they require the allocation of memory for the temporary variable.

This is another of the compile time issues identified in PR32037 (see also D30265).

This patch adds the APInt::extractBits() helper method which avoids the temporary memory allocation.

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

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

8 years ago[LV] Merge floating-point and integer induction widening code
Matthew Simpson [Fri, 24 Feb 2017 18:20:12 +0000 (18:20 +0000)]
[LV] Merge floating-point and integer induction widening code

This patch merges the existing floating-point induction variable widening code
into the integer induction variable widening code, creating a single set of
functions for both kinds of inductions. The primary motivation for doing this
is to enable vector phi node creation for floating-point induction variables.

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

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

8 years ago[PowerPC] Use subfic instruction for subtract from immediate
Nemanja Ivanovic [Fri, 24 Feb 2017 18:16:06 +0000 (18:16 +0000)]
[PowerPC] Use subfic instruction for subtract from immediate

Provide a 64-bit pattern to use SUBFIC for subtracting from a 16-bit immediate.
The corresponding pattern already exists for 32-bit integers.

Committing on behalf of Hiroshi Inoue.

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

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

8 years ago[PowerPC] Use rldicr instruction for AND with an immediate if possible
Nemanja Ivanovic [Fri, 24 Feb 2017 18:03:16 +0000 (18:03 +0000)]
[PowerPC] Use rldicr instruction for AND with an immediate if possible

Emit clrrdi (extended mnemonic for rldicr) for AND-ing with masks that
clear bits from the right hand size.

Committing on behalf of Hiroshi Inoue.

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

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

8 years ago[APInt] Add APInt::extractBits() method to extract APInt subrange
Simon Pilgrim [Fri, 24 Feb 2017 17:46:18 +0000 (17:46 +0000)]
[APInt] Add APInt::extractBits() method to extract APInt subrange

The current pattern for extract bits in range is typically:

Mask.lshr(BitOffset).trunc(SubSizeInBits);

Which can be particularly slow for large APInts (MaskSizeInBits > 64) as they require the allocation of memory for the temporary variable.

This is another of the compile time issues identified in PR32037 (see also D30265).

This patch adds the APInt::extractBits() helper method which avoids the temporary memory allocation.

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

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

8 years agoFixed IntOperandMatcher::emitCxxPredicateExpr arguments
Simon Pilgrim [Fri, 24 Feb 2017 17:20:27 +0000 (17:20 +0000)]
Fixed IntOperandMatcher::emitCxxPredicateExpr arguments

Extra const in the StringRef argument meant that MSVC complained about it not correctly overriding from OperandPredicateMatcher::emitCxxPredicateExpr (which didn't have the const)

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

8 years ago[DAGCombiner] add missing folds for scalar select of {-1,0,1}
Sanjay Patel [Fri, 24 Feb 2017 17:17:33 +0000 (17:17 +0000)]
[DAGCombiner] add missing folds for scalar select of {-1,0,1}

The motivation for filling out these select-of-constants cases goes back to D24480,
where we discussed removing an IR fold from add(zext) --> select. And that goes back to:
https://reviews.llvm.org/rL75531
https://reviews.llvm.org/rL159230

The idea is that we should always canonicalize patterns like this to a select-of-constants
in IR because that's the smallest IR and the best for value tracking. Note that we currently
do the opposite in some cases (like the cases in *this* patch). Ie, the proposed folds in
this patch already exist in InstCombine today:
https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/InstCombine/InstCombineSelect.cpp#L1151

As this patch shows, most targets generate better machine code for simple ext/add/not ops
rather than a select of constants. So the follow-up steps to make this less of a patchwork
of special-case folds and missing IR canonicalization:

1. Have DAGCombiner convert any select of constants into ext/add/not ops.
2  Have InstCombine canonicalize in the other direction (create more selects).

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

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

8 years agoRecommit "[mips] Fix atomic compare and swap at O0."
Simon Dardis [Fri, 24 Feb 2017 16:32:18 +0000 (16:32 +0000)]
Recommit "[mips] Fix atomic compare and swap at O0."

This time with the missing files.

Similar to PR/25526, fast-regalloc introduces spills at the end of basic
blocks. When this occurs in between an ll and sc, the store can cause the
atomic sequence to fail.

This patch fixes the issue by introducing more pseudos to represent atomic
operations and moving their lowering to after the expansion of postRA
pseudos.

This resolves PR/32020.

Thanks to James Cowgill for reporting the issue!

Reviewers: slthakur

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

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

8 years agoRevert "[mips] Fix atomic compare and swap at O0."
Simon Dardis [Fri, 24 Feb 2017 16:30:27 +0000 (16:30 +0000)]
Revert "[mips] Fix atomic compare and swap at O0."

This reverts r296132. I forgot to include the tests.

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

8 years ago[mips] Fix atomic compare and swap at O0.
Simon Dardis [Fri, 24 Feb 2017 16:27:45 +0000 (16:27 +0000)]
[mips] Fix atomic compare and swap at O0.

Similar to PR/25526, fast-regalloc introduces spills at the end of basic
blocks. When this occurs in between an ll and sc, the store can cause the
atomic sequence to fail.

This patch fixes the issue by introducing more pseudos to represent atomic
operations and moving their lowering to after the expansion of postRA
pseudos.

This resolves PR/32020.

Thanks to James Cowgill for reporting the issue!

Reviewers: slthakur

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

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

8 years ago[globalisel] Decouple src pattern operands from dst pattern operands.
Daniel Sanders [Fri, 24 Feb 2017 15:43:30 +0000 (15:43 +0000)]
[globalisel] Decouple src pattern operands from dst pattern operands.

Summary:
This isn't testable for AArch64 by itself so this patch also adds
support for constant immediates in the pattern and physical
register uses in the result.

The new IntOperandMatcher matches the constant in patterns such as
'(set $rd:GPR32, (G_XOR $rs:GPR32, -1))'. It's always safe to fold
immediates into an instruction so this is the first rule that will match
across multiple BB's.

The Renderer hierarchy is responsible for adding operands to the result
instruction. Renderers can copy operands (CopyRenderer) or add physical
registers (in particular %wzr and %xzr) to the result instruction
in any order (OperandMatchers now import the operand names from
SelectionDAG to allow renderers to access any operand). This allows us to
emit the result instruction for:
  %1 = G_XOR %0, -1 --> %1 = ORNWrr %wzr, %0
  %1 = G_XOR -1, %0 --> %1 = ORNWrr %wzr, %0
although the latter is untested since the matcher/importer has not been
taught about commutativity yet.

Added BuildMIAction which can build new instructions and mutate them where
possible. W.r.t the mutation aspect, MatchActions are now told the name of
an instruction they can recycle and BuildMIAction will emit mutation code
when the renderers are appropriate. They are appropriate when all operands
are rendered using CopyRenderer and the indices are the same as the matcher.
This currently assumes that all operands have at least one matcher.

Finally, this change also fixes a crash in
AArch64InstructionSelector::select() caused by an immediate operand
passing isImm() rather than isCImm(). This was uncovered by the other
changes and was detected by existing tests.

Depends on D29711

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

Reviewed By: rovka

Subscribers: aemerson, dberris, kristof.beyls, llvm-commits

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

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

8 years ago[X86][SSE] Target shuffle combine can try to combine up to 16 vectors
Simon Pilgrim [Fri, 24 Feb 2017 15:35:52 +0000 (15:35 +0000)]
[X86][SSE] Target shuffle combine can try to combine up to 16 vectors

Noticed while profiling PR32037, the target shuffle ops were being stored in SmallVector<*,8> types but the combiner could store as many as 16 ops at maximum depth (2 per depth).

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

8 years ago[InstCombine] don't try SimplifyDemandedInstructionBits from zext/sext because it...
Sanjay Patel [Fri, 24 Feb 2017 15:18:42 +0000 (15:18 +0000)]
[InstCombine] don't try SimplifyDemandedInstructionBits from zext/sext because it's slow and unnecessary

This one seems more obvious than D30270 that it can't make improvements because an extension always needs
all of the incoming bits. There's one specific transform in SimplifyDemandedInstructionBits of converting
a sext to a zext when the sign-bit is known zero, but that is handled explicitly in visitSext() with
ComputeSignBit().

Like D30270, there are no IR differences (other than instruction names) for the case in PR32037:
https://bugs.llvm.org//show_bug.cgi?id=32037
...and no regression test differences.

Zext/sext are a smaller part of the profile, but this still appears to shave off another 0.5% or so from
'opt -O2'.

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

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

8 years ago[x86] use DAG.getAllOnesConstant(); NFCI
Sanjay Patel [Fri, 24 Feb 2017 15:09:59 +0000 (15:09 +0000)]
[x86] use DAG.getAllOnesConstant(); NFCI

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

8 years agoFix missing call to base class constructor in r296121.
Daniel Sanders [Fri, 24 Feb 2017 14:53:35 +0000 (14:53 +0000)]
Fix missing call to base class constructor in r296121.

The 'Kind' member used in RTTI for InstructionPredicateMatcher was not
initialized but went undetected since I always ended up with the correct value.

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

8 years ago[mips] Handle 64 bit immediate in and/or/xor pseudo instructions on mips64
Simon Dardis [Fri, 24 Feb 2017 14:34:32 +0000 (14:34 +0000)]
[mips] Handle 64 bit immediate in and/or/xor pseudo instructions on mips64

Previously LLVM was assuming 32-bit signed immediates which results in and with
a bitmask that has bit 31 set to incorrectly include bits 63-32 in the result.
After applying this patch I can now compile all of the FreeBSD mips assembly
code with clang.

This issue also affects the nor, slt and sltu macros and I will fix those in a
separate review.

Patch By: Alexander Richardson

Commit message reformatted by sdardis.

Reviewers: atanasyan, theraven, sdardis

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

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

8 years ago[ARM] GlobalISel: Select G_STORE
Diana Picus [Fri, 24 Feb 2017 14:01:27 +0000 (14:01 +0000)]
[ARM] GlobalISel: Select G_STORE

Same as selecting G_LOAD.

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

8 years ago[globalisel] Sort RuleMatchers by priority.
Daniel Sanders [Fri, 24 Feb 2017 13:58:11 +0000 (13:58 +0000)]
[globalisel] Sort RuleMatchers by priority.

Summary:
This makes more important rules have priority over less important rules.
For example, '%a = G_ADD $b:s64, $c:s64' has priority over
'%a = G_ADD $b:s32, $c:s32'. Previously these rules were emitted in the
correct order by chance.

NFC in this patch but it is required to make the next patch work correctly.

Depends on D29710

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

Reviewed By: ab, rovka

Subscribers: javed.absar, dberris, llvm-commits, kristof.beyls

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

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

8 years agoMinor test fix
Diana Picus [Fri, 24 Feb 2017 13:27:55 +0000 (13:27 +0000)]
Minor test fix

The test was using a size of 8 for loading/storing pointers. It should be 4.

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

8 years ago[ARM] GlobalISel: Add reg bank mappings for stores
Diana Picus [Fri, 24 Feb 2017 13:07:25 +0000 (13:07 +0000)]
[ARM] GlobalISel: Add reg bank mappings for stores

Same as the ones for loads.

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

8 years ago[mips][mc] Fix a crash when disassembling odd sized sections
Simon Dardis [Fri, 24 Feb 2017 12:47:41 +0000 (12:47 +0000)]
[mips][mc] Fix a crash when disassembling odd sized sections

Attempt to fix failing test.

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

8 years agoFixup r296105 - only run tests on Mips
Diana Picus [Fri, 24 Feb 2017 12:47:11 +0000 (12:47 +0000)]
Fixup r296105 - only run tests on Mips

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

8 years agoFix signed/unsigned comparison warnings
Simon Pilgrim [Fri, 24 Feb 2017 11:31:00 +0000 (11:31 +0000)]
Fix signed/unsigned comparison warnings

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

8 years ago[ARM] GlobalISel: Legalize stores
Diana Picus [Fri, 24 Feb 2017 11:28:24 +0000 (11:28 +0000)]
[ARM] GlobalISel: Legalize stores

Allow the same types that we allow for loads.

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

8 years ago[mips][mc] Fix a crash when disassembling odd sized sections
Simon Dardis [Fri, 24 Feb 2017 10:51:27 +0000 (10:51 +0000)]
[mips][mc] Fix a crash when disassembling odd sized sections

Corresponding test.

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

8 years ago[mips][mc] Fix a crash when disassembling odd sized sections
Simon Dardis [Fri, 24 Feb 2017 10:50:27 +0000 (10:50 +0000)]
[mips][mc] Fix a crash when disassembling odd sized sections

Make the MIPS disassembler consistent with the other targets in returning
a Size of zero when the input buffer cannot contain an instruction due
to it's size. Previously it reported the minimum instruction size when
it failed due to the buffer not being big enough for an instruction
causing llvm-objdump to crash when disassembling all sections.

Reviewers: slthakur

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

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

8 years agoRevert "[ARM] GlobalISel: Legalize stores"
Diana Picus [Fri, 24 Feb 2017 10:35:39 +0000 (10:35 +0000)]
Revert "[ARM] GlobalISel: Legalize stores"

This reverts commit r296103 because the test broke on one of the bots. Sorry!

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

8 years ago[ARM] GlobalISel: Legalize stores
Diana Picus [Fri, 24 Feb 2017 10:19:23 +0000 (10:19 +0000)]
[ARM] GlobalISel: Legalize stores

Allow the same types that we allow for loads.

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

8 years ago[APInt] Add APInt::setBits() method to set all bits in range
Simon Pilgrim [Fri, 24 Feb 2017 10:15:29 +0000 (10:15 +0000)]
[APInt] Add APInt::setBits() method to set all bits in range

The current pattern for setting bits in range is typically:

Mask |= APInt::getBitsSet(MaskSizeInBits, LoPos, HiPos);

Which can be particularly slow for large APInts (MaskSizeInBits > 64) as they require the allocation memory for the temporary variable.

This is one of the key compile time issues identified in PR32037.

This patch adds the APInt::setBits() helper method which avoids the temporary memory allocation completely, this first implementation uses setBit() internally instead but already significantly reduces the regression in PR32037 (~10% drop). Additional optimization may be possible.

I investigated whether there is need for APInt::clearBits() and APInt::flipBits() equivalents but haven't seen these patterns to be particularly common, but reusing the code would be trivial.

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

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

8 years agoAdd missing initialization for MachineOptimizationRemarkEmitter
Justin Bogner [Fri, 24 Feb 2017 07:42:35 +0000 (07:42 +0000)]
Add missing initialization for MachineOptimizationRemarkEmitter

This was missed in r293110.

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

8 years ago[WebAssembly] Add a README.txt entry for mergeable sections.
Dan Gohman [Fri, 24 Feb 2017 07:33:55 +0000 (07:33 +0000)]
[WebAssembly] Add a README.txt entry for mergeable sections.

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

8 years ago[AVX-512] Separate the fadd/fsub/fmul/fdiv/fmax/fmin with rounding mode ISD opcodes...
Craig Topper [Fri, 24 Feb 2017 07:21:10 +0000 (07:21 +0000)]
[AVX-512] Separate the fadd/fsub/fmul/fdiv/fmax/fmin with rounding mode ISD opcodes into separate packed and scalar opcodes. This is more consistent with the rest of the ISD opcodes. NFC

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

8 years ago[ExecutionDepsFix] Use range-based for loop. NFC
Craig Topper [Fri, 24 Feb 2017 06:38:24 +0000 (06:38 +0000)]
[ExecutionDepsFix] Use range-based for loop. NFC

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

8 years ago[IR][X86] Fix llvm version number in comments in AutoUpgrade. Forgot the next release...
Craig Topper [Fri, 24 Feb 2017 05:35:07 +0000 (05:35 +0000)]
[IR][X86] Fix llvm version number in comments in AutoUpgrade. Forgot the next release is 5.0 not 4.1

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

8 years ago[AVX-512] Remove lzcnt intrinsics and autoupgrade them to generic ctlz intrinsics...
Craig Topper [Fri, 24 Feb 2017 05:35:04 +0000 (05:35 +0000)]
[AVX-512] Remove lzcnt intrinsics and autoupgrade them to generic ctlz intrinsics with select.

Clang has been emitting cltz intrinsics for a while now.

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

8 years ago[AVX-512] Move lzcnt and conflict intrinsic tests to avx512cd intrinsic test file...
Craig Topper [Fri, 24 Feb 2017 05:34:59 +0000 (05:34 +0000)]
[AVX-512] Move lzcnt and conflict intrinsic tests to avx512cd intrinsic test file since that's their feature.

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

8 years ago[AVX-512] Use update_llc_test_checks.py to generate a test.
Craig Topper [Fri, 24 Feb 2017 05:34:57 +0000 (05:34 +0000)]
[AVX-512] Use update_llc_test_checks.py to generate a test.

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

8 years ago[Fuchsia] Use thread-pointer ABI slots for stack-protector and safe-stack
Petr Hosek [Fri, 24 Feb 2017 03:10:10 +0000 (03:10 +0000)]
[Fuchsia] Use thread-pointer ABI slots for stack-protector and safe-stack

The Fuchsia ABI defines slots from the thread pointer where the
stack-guard value for stack-protector, and the unsafe stack pointer
for safe-stack, are stored. This parallels the Android ABI support.

Patch by Roland McGrath

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

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

8 years agoAdd some testcases for bitfields with illegal widths.
Eli Friedman [Fri, 24 Feb 2017 03:04:11 +0000 (03:04 +0000)]
Add some testcases for bitfields with illegal widths.

clang will generate IR like this for input using packed bitfields;
very simple semantically, but it's a bit tricky to actually
generate good code.

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