Commit Graph

100333 Commits

Author SHA1 Message Date
John Brawn
4042b8120e [ARM] LSL #0 is an alias of MOV
Currently we handle this correctly in arm, but in thumb we don't which leads to
an unpredictable instruction being emitted for LSL #0 in an IT block and SP not
being permitted in some cases when it should be.

For the thumb2 LSL we can handle this by making LSL #0 an alias of MOV in the
.td file, but for thumb1 we need to handle it in checkTargetMatchPredicate to
get the IT handling right. We also need to adjust the handling of
MOV rd, rn, LSL #0 to avoid generating the 16-bit encoding in an IT block. We
should also adjust it to allow SP in the same way that it is allowed in
MOV rd, rn, but I haven't done that here because it looks like it would take
quite a lot of work to get right.

Additionally correct the selection of the 16-bit shift instructions in
processInstruction, where it was checking if the two registers were equal when
it should have been checking if they were low. It appears that previously this
code was never executed and the 16-bit encoding was selected by default, but
the other changes I've done here have somehow made it start being used.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 14:40:51 +00:00
Artur Pilipenko
85f508cd9d [DAGCombine] Fix for a load combine bug with non-zero offset patterns on BE targets
This pattern is essentially a i16 load from p+1 address:

  %p1.i16 = bitcast i8* %p to i16*
  %p2.i8 = getelementptr i8, i8* %p, i64 2
  %v1 = load i16, i16* %p1.i16
  %v2.i8 = load i8, i8* %p2.i8
  %v2 = zext i8 %v2.i8 to i16
  %v1.shl = shl i16 %v1, 8
  %res = or i16 %v1.shl, %v2

Current implementation would identify %v1 load as the first byte load and would mistakenly emit a i16 load from %p1.i16 address. This patch adds a check that the first byte is loaded from a non-zero offset of the first load address. This way this address can be used as the base address for the combined value. Otherwise just give up combining.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296336 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 13:04:23 +00:00
Artur Pilipenko
f85432589b [DAGCombine] NFC. MatchLoadCombine extract MemoryByteOffset lambda helper
This refactoring will simplify the upcoming change to fix the bug in folding patterns with non-zero offsets on BE targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296332 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 11:42:54 +00:00
Artur Pilipenko
0003ac947f [DAGCombine] NFC. MatchLoadCombine remember the first byte provider, not the load node
This refactoring will simplify the upcoming change to fix a bug in folding patterns with non-zero offsets on BE targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296331 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 11:40:14 +00:00
Sjoerd Meijer
b9ae988ece AArch64AsmParser: don't try to parse “[1]” for non-vector register operands
There are no instructions that have "[1]" as part of the assembly string;
FMOVXDhighr is out of date. This removes dead code.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296327 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 10:51:11 +00:00
Konstantin Zhuravlyov
9995ddddac [AMDGPU] Runtime metadata fixes:
- Verify that runtime metadata is actually valid runtime metadata when assembling, otherwise we could accept the following when assembling, but ocl runtime will reject it:
    .amdgpu_runtime_metadata
    { amd.MDVersion: [ 2, 1 ], amd.RandomUnknownKey, amd.IsaInfo: ...
  - Make IsaInfo optional, and always emit it.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296324 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 07:55:17 +00:00
Craig Topper
08d480dc77 [X86] Check for less than 0 rather than explicit compare with -1. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 06:05:30 +00:00
Xin Tong
e76fd06806 Update comments. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296298 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 19:08:44 +00:00
Daniel Jasper
e5e8f2aec1 Revert "[CGP] Split some critical edges coming out of indirect branches"
This reverts commit r296149 as it leads to crashes when compiling for
PPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296295 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 11:09:12 +00:00
Davide Italiano
1aaf55cfbf [LoopDeletion] Modernize and simplify a bit. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296294 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 07:08:20 +00:00
Craig Topper
ca75ea33bc [X86] Fix execution domain for cmpss/sd instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296293 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 06:45:59 +00:00
Craig Topper
bcfde2ad75 [AVX-512] Fix execution domain for scalar commutable min/max instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 06:45:56 +00:00
Craig Topper
d9d761585e [AVX-512] Fix execution domain for vmovhpd/lpd/hps/lps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296291 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 06:45:54 +00:00
Craig Topper
f46e01bb23 [AVX-512] Fix the execution domain for AVX-512 integer broadcasts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296290 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 06:45:51 +00:00
Craig Topper
b64325c5da [AVX-512] Disable the redundant patterns in the VPBROADCASTBr_Alt and VPBROADCASTWr_Alt instructions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296289 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 06:45:48 +00:00
Craig Topper
b1620f1be0 [AVX-512] Fix execution domain for VPMADD52 instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296288 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 06:45:45 +00:00
Craig Topper
3703247296 [AVX-512] Fix the execution domain for VSCALEF instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296286 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 06:45:40 +00:00
Craig Topper
bb0ec0e4f5 [AVX-512] Fix execution domain of scalar VRANGE/REDUCE/GETMANT with sae.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296285 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 06:45:37 +00:00
Craig Topper
914a8e7fd7 [X86] Fix the execution domain for scalar SQRT intrinsic instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-26 06:45:35 +00:00
Xin Tong
650a66fb4c [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
2017-02-26 02:11:24 +00:00
Nirav Dave
b89cc7e5e3 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
2017-02-26 01:27:32 +00:00
Eric Christopher
0ef3663fb8 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
2017-02-26 00:11:58 +00:00
Sanjoy Das
9b2526d03d [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
2017-02-25 20:30:45 +00:00
Simon Pilgrim
95d021ba68 [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
2017-02-25 20:01:58 +00:00
Craig Topper
955b35337f [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
2017-02-25 19:36:28 +00:00
Craig Topper
5d138fe5d3 [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
2017-02-25 19:18:11 +00:00
Craig Topper
d63ab8f4ea [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
2017-02-25 18:43:42 +00:00
Craig Topper
6a0edd3bec [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
2017-02-25 18:12:25 +00:00
Artyom Skrobov
cc3dbb4073 No need to copy the variable [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296259 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 17:18:09 +00:00
NAKAMURA Takumi
96678fa6d8 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
2017-02-25 17:04:23 +00:00
Victor Leschuk
532cb32214 [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
2017-02-25 13:15:57 +00:00
Nirav Dave
32147cef64 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
2017-02-25 11:43:58 +00:00
Xin Tong
51d41dcad2 Empty line. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296250 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 08:10:28 +00:00
Junmo Park
c236d01938 Minor code cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 01:50:45 +00:00
Akira Hatanaka
1613664c57 Remove redundant code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296219 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 00:59:49 +00:00
Akira Hatanaka
cf0aa991df 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
2017-02-25 00:53:38 +00:00
Zachary Turner
5433d115a4 [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
2017-02-25 00:44:30 +00:00
Zachary Turner
40ea28492e [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
2017-02-25 00:33:34 +00:00
Easwaran Raman
da9c4a6e9a [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
2017-02-25 00:10:22 +00:00
Junmo Park
8435ebc657 Minor code cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296207 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 00:08:53 +00:00
Rong Xu
dd2b6c53e8 [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
2017-02-25 00:00:36 +00:00
Dan Gohman
8f5a7d69cc [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
2017-02-24 23:46:05 +00:00
Krzysztof Parzyszek
cdc2ace692 [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
2017-02-24 23:34:24 +00:00
Dan Gohman
53ff96ab08 [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
2017-02-24 23:18:00 +00:00
Krzysztof Parzyszek
d2a98e0ac0 [Hexagon] Prettify code in HexagonDAGToDAGISel::Select
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296187 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 23:00:40 +00:00
Wei Ding
5d1e915557 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
2017-02-24 23:00:29 +00:00
Stanislav Mekhanoshin
fef0dbe59c 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
2017-02-24 21:56:16 +00:00
Evgeniy Stepanov
89efd71a88 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
2017-02-24 21:44:58 +00:00
Evgeniy Stepanov
5982b2c089 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
2017-02-24 21:44:52 +00:00
Tim Northover
e3a136c5b5 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
2017-02-24 21:21:38 +00:00
Dan Gohman
3d2ef31552 [WebAssembly] Handle f16 in fast-isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 21:05:35 +00:00
Xin Tong
8ff565073e Fix Indentation. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296169 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 20:59:26 +00:00
Eli Friedman
0ee8e563c9 [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
2017-02-24 20:51:36 +00:00
Yaxun Liu
3afc883be9 [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
2017-02-24 20:27:25 +00:00
Davide Italiano
de428a4c0b [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
2017-02-24 18:48:10 +00:00
Michael Kuperstein
98ee128c8e [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
2017-02-24 18:41:32 +00:00
Simon Pilgrim
0ab7c7b1f0 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
2017-02-24 18:31:04 +00:00
Matthew Simpson
aceef6fa37 [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
2017-02-24 18:20:12 +00:00
Nemanja Ivanovic
ab05c2009d [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
2017-02-24 18:16:06 +00:00
Nemanja Ivanovic
92606b3cc6 [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
2017-02-24 18:03:16 +00:00
Simon Pilgrim
30e6a76a6a [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
2017-02-24 17:46:18 +00:00
Sanjay Patel
9a9478ccb0 [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
2017-02-24 17:17:33 +00:00
Simon Dardis
f64a815fb7 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
2017-02-24 16:32:18 +00:00
Simon Dardis
3a8812c0db 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
2017-02-24 16:30:27 +00:00
Simon Dardis
2468c7d5ea [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
2017-02-24 16:27:45 +00:00
Daniel Sanders
bf21af7b42 [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
2017-02-24 15:43:30 +00:00
Simon Pilgrim
d94a711b82 [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
2017-02-24 15:35:52 +00:00
Sanjay Patel
f2553ab900 [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
2017-02-24 15:18:42 +00:00
Sanjay Patel
e1076e670b [x86] use DAG.getAllOnesConstant(); NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296128 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 15:09:59 +00:00
Simon Dardis
2d2498f022 [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
2017-02-24 14:34:32 +00:00
Diana Picus
27abbacf66 [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
2017-02-24 14:01:27 +00:00
Diana Picus
11601c0bd3 [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
2017-02-24 13:07:25 +00:00
Diana Picus
29289da775 [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
2017-02-24 11:28:24 +00:00
Simon Dardis
20c78ede7e [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
2017-02-24 10:50:27 +00:00
Diana Picus
269c5fd3e9 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
2017-02-24 10:35:39 +00:00
Diana Picus
03012a011d [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
2017-02-24 10:19:23 +00:00
Simon Pilgrim
02e6cb0f2d [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
2017-02-24 10:15:29 +00:00
Justin Bogner
dde79d7c7b 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
2017-02-24 07:42:35 +00:00
Dan Gohman
b1d145173f [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
2017-02-24 07:33:55 +00:00
Craig Topper
26bc091674 [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
2017-02-24 07:21:10 +00:00
Craig Topper
732985157f [ExecutionDepsFix] Use range-based for loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296093 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 06:38:24 +00:00
Craig Topper
c908a7f8b4 [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
2017-02-24 05:35:07 +00:00
Craig Topper
474a418aa7 [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
2017-02-24 05:35:04 +00:00
Petr Hosek
193856a80c [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
2017-02-24 03:10:10 +00:00
Xin Tong
30d4f6571e Fix an iterator invalidation bug when simplifying LIC user.
LoopUnswitch/simplify-with-nonvalness.ll is the test case for this.
The LIC has 2 users and deleting the 1st user when it can be simplified
invalidated the iterator for the 2nd user.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 01:43:36 +00:00
Michael Kuperstein
969577f54d Revert r269060 to pacify bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296064 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 01:22:19 +00:00
Michael Kuperstein
8981fc9888 [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@296060 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 00:56:21 +00:00
Ahmed Bougacha
8959f2e32f [GlobalISel] Use the same name for all remarks.
While there, switch to the explicit ctor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296059 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 00:34:47 +00:00
Ahmed Bougacha
abdb8cba99 [GlobalISel] Use the DISubprogram for translation failure remarks.
Justin added support for DISubprogram locs in r295531 and r296052.
Use that instead of no-loc for constants and arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296058 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 00:34:44 +00:00
Ahmed Bougacha
0108464498 [GlobalISel] Remove now-unnecessary variable. NFC.
Since r296047, we're able to return early on failures.
Don't track whether we succeeded.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 00:34:41 +00:00
Justin Bogner
52ab9f0e65 OptDiag: Summarize the instruction count in asm-printer
Add an optimization remark to asm-printer that summarizes the number
of instructions emitted per function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296053 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 00:19:22 +00:00
Evgeniy Stepanov
734e4c3bd4 [msan] Fix instrumentation of array allocas.
Before this, MSan poisoned exactly one element of any array alloca,
even if the number of elements was zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296050 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 00:13:17 +00:00
Adrian McCarthy
93e76ec3ca Implement some methods for NativeRawSymbol
This allows the ability to call IPDBSession::getGlobalScope with a NativeSession and
to then query it for some basic fields from the PDB's InfoStream.
Note that the symbols now have non-const references back to the Session so that
NativeRawSymbol can access the PDBFile through the Session.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296049 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 00:10:47 +00:00
Ahmed Bougacha
d6d9a85ff1 [GlobalISel] Don't translate other blocks when one failed.
We were stopping the translation of the parent block when the
translation of an instruction failed, but we were still trying to
translate the other blocks of the parent function.

Don't do that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296047 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 23:57:36 +00:00
Ahmed Bougacha
141a873c65 [GlobalISel] Finalize translated function on scope exit. NFC.
This is the compromise between having a per-function IRTranslator
and manually managing the per-function state.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296046 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 23:57:28 +00:00
Adrian Prantl
d58d81ffa6 fix 80-column violation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296045 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 23:54:29 +00:00
Xin Tong
37db8a701d Delete outdated comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296043 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 23:47:10 +00:00
Xin Tong
3addda9e5e LoopUnswitch - Simplify based on known not to a be constant.
Summary: In case we do not know what the condition is in an unswitched loop, but we know its definitely NOT a known constant. We can perform simplifcations based on this information.

Reviewers: sanjoy, hfinkel, chenli, efriedma

Reviewed By: efriedma

Subscribers: david2050, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296041 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 23:42:19 +00:00
Adam Nemet
0f085888b6 [OptDiag] Hide legacy remark ctors
These are only used when emitting remarks without ORE directly using the free
functions emitOptimizationRemark*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296037 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 23:11:11 +00:00
Sanjoy Das
9e36975287 [IR] Add a Instruction::dropPoisonGeneratingFlags helper
Summary:
The helper will be used in a later change.  This change itself is NFC
since the only user of this new function is its unit test.

Reviewers: majnemer, efriedma

Reviewed By: efriedma

Subscribers: efriedma, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296035 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 22:50:52 +00:00
Artem Belevich
6bc216ccf6 [NVPTX] Added support for .f16x2 instructions.
This patch enables support for .f16x2 operations.

Added new register type Float16x2.
Added support for .f16x2 instructions.
Added handling of vectorized loads/stores of v2f16 values.

Differential Revision: https://reviews.llvm.org/D30057
Differential Revision: https://reviews.llvm.org/D30310

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296032 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 22:38:24 +00:00
Tim Northover
a328146a75 ARM: make sure FastISel bails on f64 operations for Cortex-M4.
FastISel wasn't checking the isFPOnlySP subtarget feature before emitting
double-precision operations, so it got completely invalid CodeGen for doubles
on Cortex-M4F.

The normal ISel testing wasn't spectacular either so I added a second RUN line
to improve that while I was in the area.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296031 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 22:35:00 +00:00
Hans Wennborg
b20570e647 Revert r282872 "CVP. Turn marking adds as no wrap on by default"
While not CVP's fault, this caused miscompiles (PR31181). Reverting
until those are resolved.

(This also reverts the follow-ups r288154 and r288161 which removed the
flag.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296030 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 22:29:00 +00:00
Dehao Chen
8580d5005b Add call branch annotation for ICP promoted direct call in SamplePGO mode.
Summary: SamplePGO uses branch_weight annotation to represent callsite hotness. When ICP promotes an indirect call to direct call, we need to make sure the direct call is annotated with branch_weight in SamplePGO mode, so that downstream function inliner can use hot callsite heuristic.

Reviewers: davidxl, eraman, xur

Reviewed By: davidxl, xur

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296028 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 22:15:18 +00:00
Krzysztof Parzyszek
9bb4f10172 [Hexagon] Handle saturations in Hexagon bit tracker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296026 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 22:11:52 +00:00
Krzysztof Parzyszek
c5dd216734 [Hexagon] Allow setting register in BitVal without storing into map
In the bit tracker, references to other bit values in which the register
is 0 are prohibited. This means that generating self-referential register
cells like { w:32 [0-15]:s[0-15] [16-31]:s[15] } is impossible. In order
to get a self-referential cell, it had to be stored into a map and then
reloaded from it. To avoid this step, add a function that will set the
register to a given value without going through the map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296025 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 22:08:50 +00:00
Stanislav Mekhanoshin
186113f5c1 [AMDGPU] Shut the warning "getRegUnitWeight hides overload...". NFC.
Clang issues warning about hidden overload. That was intended, so
add "using AMDGPUGenRegisterInfo::getRegUnitWeight;" to mute it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296021 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 21:51:28 +00:00
Adam Nemet
d77942232b [ORE] Remove ORE.emit{{.+}} functions
Last use was killed in my previous patch. The preferred way is now to
construct the remark, pipe things to it and pass it to ORE.emit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296019 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 21:32:53 +00:00
Kyle Butt
9e601a405e CodeGen: MachineBlockPlacement: Rename member to more general name. NFC.
Rename ComputedTrellisEdges to ComputedEdges to allow for other methods of
pre-computing edges.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296018 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 21:22:24 +00:00
Adam Nemet
d7e57f0502 [LAA] Remove unused LoopAccessReport
The need for this removed when I converted everything to use the opt-remark
classes directly with the streaming interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296017 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 21:17:36 +00:00
Adam Nemet
66f6b76187 [LV] Remove unused VectorizationReport
The need for this removed when I converted everything to use the opt-remark
classes directly with the streaming interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 21:17:31 +00:00
Evgeniy Stepanov
23c98ecd0f Disable TLS for stack protector on Android API<17.
The TLS slot did not exist back then.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 21:06:35 +00:00
Ahmed Bougacha
65d76e1285 [GlobalISel] Emit opt remarks on isel fallbacks.
Having more fine-grained information on the specific construct that
caused us to fallback is valuable for large-scale data collection.

We still have the fallback warning, that's also used for FastISel.
We still need to remove the fallback warning, and teach FastISel to also
emit remarks (it currently has a combination of the warning, stats, and
debug prints: the remarks could unify all three).

The abort-on-fallback path could also be better handled using remarks:
one could imagine a "-Rpass-error", analoguous to "-Werror", which would
promote missed/failed remarks to errors.  It's not clear whether that
would be useful for other remarks though, so we're not there yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296013 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 21:05:42 +00:00
Ahmed Bougacha
75fdc3a2ae [CodeGen] Teach opt remarks how to print MI instructions.
This will be used with GISel opt remarks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296012 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 21:05:33 +00:00
Ahmed Bougacha
8b200ec55e [CodeGen] Print MI without a newline when skipping debugloc. NFC.
This matches the behavior for skip-operands. While there, document it.
This is a follow-up to r296007.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296011 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 21:05:29 +00:00
Stanislav Mekhanoshin
0bf4d71d50 Correct register pressure calculation in presence of subregs
If a subreg is used in an instruction it counts as a whole superreg
for the purpose of register pressure calculation. This patch corrects
improper register pressure calculation by examining operand's lane mask.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296009 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 20:19:44 +00:00
Ahmed Bougacha
5487126153 [ORE] Use const CodeRegions in the remark diagnostics. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296008 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 19:17:34 +00:00
Ahmed Bougacha
9628c84c3f [CodeGen] Add a way to SkipDebugLoc in MachineInstr::print(). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296007 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 19:17:31 +00:00
Ahmed Bougacha
33f4d46446 [GlobalISel] Simplify Select type cleanup using a ScopeExit. NFC.
This lets us use more natural early-returns when selection fails.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296006 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 19:17:24 +00:00
Adrian Prantl
84277628a6 Revert "Teach the IR verifier to reject conflicting debug info for function arguments."
This reverts commit r295749 while investigating PR32042.

It looks like this check uncovered a problem in the frontend that
needs to be fixed before the check can be enabled again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296005 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 19:13:48 +00:00
Sanjay Patel
b41562fd38 [DAG] add convenience function to get -1 constant; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296004 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 19:02:33 +00:00
Chad Rosier
b81558a8e1 [Reassociate] Add negated value of negative constant to the Duplicates list.
In OptimizeAdd, we scan the operand list to see if there are any common factors
between operands that can be factored out to reduce the number of multiplies
(e.g., 'A*A+A*B*C+D' -> 'A*(A+B*C)+D'). For each operand of the operand list, we
only consider unique factors (which is tracked by the Duplicate set). Now if we
find a factor that is a negative constant, we add the negated value as a factor
as well, because we can percolate the negate out. However, we mistakenly don't
add this negated constant to the Duplicates set.

Consider the expression A*2*-2 + B. Obviously, nothing to factor.

For the added value A*2*-2 we over count 2 as a factor without this change,
which causes the assert reported in PR30256.  The problem is that this code is
assuming that all the multiply operands of the add are already reassociated.
This change avoids the issue by making OptimizeAdd tolerate multiplies which
haven't been completely optimized; this sort of works, but we're doing wasted
work: we'll end up revisiting the add later anyway.

Another possible approach would be to enforce RPO iteration order more strongly.
If we have RedoInsts, we process them immediately in RPO order, rather than
waiting until we've finished processing the whole function. Intuitively, it
seems like the natural approach: reassociation works on expression trees, so
the optimization only works in one direction. That said, I'm not sure how
practical that is given the current Reassociate; the "optimal" form for an
expression depends on its use list (see all the uses of "user_back()"), so
Reassociate is really an iterative optimization of sorts, so any changes here
would probably get messy.

PR30256

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296003 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 18:49:03 +00:00
Dehao Chen
aa262b8b29 Use base discriminator in sample pgo profile matching.
Summary: The discriminator has been encoded, and only the base discriminator should be used during profile matching.

Reviewers: dblaikie, davidxl

Reviewed By: dblaikie, davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 18:27:45 +00:00
Krzysztof Parzyszek
ab761176c9 [Hexagon] Avoid IMPLICIT_DEFs as new-value producers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295997 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 17:47:34 +00:00
Adam Nemet
e73243639a [LazyMachineBFI] Reimplement with getAnalysisIfAvailable
Since LoopInfo is not available in machine passes as universally as in IR
passes, using the same approach for OptimizationRemarkEmitter as we did for IR
will run LoopInfo and DominatorTree unnecessarily.  (LoopInfo is not used
lazily by ORE.)

To fix this, I am modifying the approach I took in D29836.  LazyMachineBFI now
uses its client passes including MachineBFI itself that are available or
otherwise compute them on the fly.

So for example GreedyRegAlloc, since it's already using MBFI, will reuse that
instance.  On the other hand, AsmPrinter in Justin's patch will generate DT,
LI and finally BFI on the fly.

(I am of course wondering now if the simplicity of this approach is even
preferable in IR.  I will do some experiments.)

Testing is provided by an updated version of D29837 which requires Justin's
patch to bring ORE to the AsmPrinter.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 17:30:01 +00:00
Filipe Cabecinhas
c5d447ad77 [AddressSanitizer] Add PS4 offset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295994 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 17:10:28 +00:00
Sanjay Patel
243d7e32bc [InstCombine] use loop instead of recursion to peek through FPExt; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295992 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 16:39:51 +00:00
Sanjay Patel
8add37f8a7 [InstCombine] use 'match' to reduce code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295991 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 16:26:03 +00:00
Jan Vesely
dae323db22 AMDGPU/SI: Fix trunc i16 pattern
Hit on ASICs that support 16bit instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295990 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 16:12:21 +00:00
Simon Pilgrim
65875f1c7e Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295989 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 16:07:04 +00:00
Krzysztof Parzyszek
69d8d82e3c [Hexagon] Patterns for CTPOP, BSWAP and BITREVERSE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295981 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 15:02:09 +00:00
Diana Picus
31d09e83a5 [ARM] GlobalISel: Lower call returns
Introduce a common ValueHandler for call returns and formal arguments, and
inherit two different versions for handling the differences (at the moment the
only difference is the way physical registers are marked as used).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295973 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 14:18:41 +00:00
Alexey Bataev
bfa45208ee [SLP] Fix for PR32036: Vectorized horizontal reduction returning wrong
result

Summary:
If the same value is used several times as an extra value, SLP
vectorizer takes it into account only once instead of actual number of
using.
For example:
```
int val = 1;
for (int y = 0; y < 8; y++) {
  for (int x = 0; x < 8; x++) {
    val = val + input[y * 8 + x] + 3;
  }
}
```
We have 2 extra rguments: `1` - initial value of horizontal reduction
and `3`, which is added 8*8 times to the reduction. Before the patch we
added `1` to the reduction value and added once `3`, though it must be
added 64 times.

Reviewers: mkuper, mzolotukhin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295972 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 13:37:09 +00:00
Diana Picus
5e98318841 [ARM] GlobalISel: Lower call parameters in regs
Add support for lowering calls with parameters than can fit into regs.  Use the
same ValueHandler that we used for function returns, but rename it to match its
new, extended purpose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295971 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 13:25:43 +00:00
Ayman Musa
6f30b9797e [X86][AVX] Disable VCVTSS2SD & VCVTSD2SS memory folding and fix the register class of their first input when creating node in fast-isel.
(Quick fix to buildbot failure after rL295940 commit).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295970 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 13:15:44 +00:00
Simon Dardis
fd4603cd6b [mips][ias] Further relax operands of certain assembly instructions
This patch adjusts the most relaxed predicate of immediate operands to accept
immediate forms such as ~(0xf0000000|0x000f00000). Previously these forms
would be accepted by GAS and rejected by IAS.

This partially resolves PR/30383.

Thanks to Sean Bruno for reporting the issue!

Reviewers: slthakur, seanbruno

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295965 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 12:40:58 +00:00
Kristof Beyls
93418eeb1d Fix assertion failure in ARMConstantIslandPass.
The ARMConstantIslandPass didn't have support for handling accesses to
constant island objects through ARM::t2LDRBpci instructions. This adds
support for that.

This fixes PR31997.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295964 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 12:24:55 +00:00
Simon Pilgrim
ee4b4ec8cc Fix signed/unsigned comparison warning on MSVC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295962 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 12:00:34 +00:00
Alexey Bataev
8188e22176 Revert "[SLP] Fix for PR32036: Vectorized horizontal reduction returning wrong"
This reverts commit 7c5141e577d9efd1c8e3087566a38ce6b3a41a84.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295957 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 11:09:35 +00:00
Alexey Bataev
4ef753a118 [SLP] Fix for PR32036: Vectorized horizontal reduction returning wrong
result

Summary:
If the same value is used several times as an extra value, SLP
vectorizer takes it into account only once instead of actual number of
using.
For example:
```
int val = 1;
for (int y = 0; y < 8; y++) {
  for (int x = 0; x < 8; x++) {
    val = val + input[y * 8 + x] + 3;
  }
}
```
We have 2 extra rguments: `1` - initial value of horizontal reduction
and `3`, which is added 8*8 times to the reduction. Before the patch we
added `1` to the reduction value and added once `3`, though it must be
added 64 times.

Reviewers: mkuper, mzolotukhin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 10:57:15 +00:00
Alexey Bataev
8d04a8701d Revert "[SLP] Fix for PR32036: Vectorized horizontal reduction returning wrong"
This reverts commit d83c81ee6a8dea662808ac22b396d1bb0595c89d.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 09:59:29 +00:00
Alexey Bataev
29965753c8 [SLP] Fix for PR32036: Vectorized horizontal reduction returning wrong
result

Summary:
If the same value is used several times as an extra value, SLP
vectorizer takes it into account only once instead of actual number of
using.
For example:
```
int val = 1;
for (int y = 0; y < 8; y++) {
  for (int x = 0; x < 8; x++) {
    val = val + input[y * 8 + x] + 3;
  }
}
```
We have 2 extra rguments: `1` - initial value of horizontal reduction
and `3`, which is added 8*8 times to the reduction. Before the patch we
added `1` to the reduction value and added once `3`, though it must be
added 64 times.

Reviewers: mkuper, mzolotukhin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295949 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 09:40:38 +00:00
Ayman Musa
ff35eecd7d [X86][AVX512] Remove VCVTSS2SDZ & VCVTSD2SSZ from memory folding tables as they introduce new read dependency when folding.
(Quick fix to buildbot fail). 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295946 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 08:13:36 +00:00
Ayman Musa
70ad23eba8 [X86][AVX512] Change VCVTSS2SD and VCVTSD2SS node types to keep consistency between VEX/EVEX versions.
AVX versions of the converts work on f32/f64 types, while AVX512 version work on vectors.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295940 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 07:24:21 +00:00
Matt Arsenault
210095c5c9 LoadStoreVectorizer: Split even sized illegal chains properly
Implement isLegalToVectorizeLoadChain for AMDGPU to avoid
producing private address spaces accesses that will need to be
split up later. This was doing the wrong thing in the case
where the queried chain was an even number of elements.

A possible <4 x i32> store was being split into
store <2 x i32>
store i32
store i32

rather than
store <2 x i32>
store <2 x i32>

when legal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295933 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 03:58:53 +00:00
Craig Topper
59900325da [X86][IR] In AutoUpgrade, check explicitly for xop.vpcmov and xop.vpcmov.256 instead of anything starting with xop.vpcmov
There were some older intrinsics that only existed for less than a month in 2012 that still exist in some out of tree test files that start with this string, but aren't able to be handled by the current upgrade code and fire an assert. Now we'll go back to treating them as not intrinsics at all and just passing them through to output.

Fixes PR32041, sort of.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295930 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 03:22:14 +00:00
Matt Arsenault
5925762682 AMDGPU: Replace disabled exp inputs with undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295914 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 00:44:03 +00:00
Matt Arsenault
32a81bbff2 AMDGPU: Add another BFE pattern
This is the pattern that falls out of the instruction's
definition if offset == 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295912 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 00:23:43 +00:00
Matt Arsenault
cd39b42cab AMDGPU: Use clamp with f64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295908 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 23:53:37 +00:00
Michael Kuperstein
c6527c8786 Revert r295868 because it breaks a different SLP lit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295906 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 23:35:13 +00:00
Matt Arsenault
e184e01dd7 AMDGPU: Fold FP clamp as modifier bit
The manual is unclear on the details of this. It's not
clear to me if denormals are not allowed with clamp,
or if that is only omod. Not allowing denorms for
fp16 or fp64 isn't useful so I also question if that
is really a restriction. Same with whether this is valid
without IEEE mode enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295905 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 23:27:53 +00:00
Wei Ding
1cfed01e02 AMDGPU : Update TrapCode based on Trap Handler ABI.
Differential Revision: http://reviews.llvm.org/D30232

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 23:22:19 +00:00
Justin Bogner
af8c7cedc1 [libFuzzer] Update traces hooks test after r293741
This test now passes on darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 23:12:36 +00:00
Justin Bogner
28c53fa4a0 [libFuzzer] Mark a test that infinite loops as unsupported
We need to investigate this, but for now it just causes too much
headache when trying to run these tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295900 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 23:05:17 +00:00
Matt Arsenault
c2d34b5027 AMDGPU: Add replacement bfe intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295899 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 23:04:58 +00:00
Sanjay Patel
9ba3c4dd5a [InstCombine] don't try SimplifyDemandedInstructionBits from add/sub because it's slow and unlikely to succeed
Notably, no regression tests change when we remove these calls, and these are expensive calls.

The motivation comes from the general acknowledgement that the compiler is getting slower:
http://lists.llvm.org/pipermail/llvm-dev/2017-January/109188.html
http://lists.llvm.org/pipermail/llvm-dev/2016-December/108279.html

And specifically the test case attached to PR32037:
https://bugs.llvm.org//show_bug.cgi?id=32037

Profiling the middle-end (opt) part of the compile:
$ ./opt -O2 row_common.bc -o /dev/null

...visitAdd and visitSub are near the top of the instcombine list, and the calls to SimplifyDemandedInstructionBits()
are high within each of those. Those calls account for 1%+ of the opt time in either debug or release profiles. And 
that's the rough win I see from this patch when testing opt built release from r295864 on an iMac with Haswell 4GHz
(model 4790K).

It seems unlikely that we'd be able to eliminate add/sub or change their operands given that add/sub normally affect
all bits, and the PR32037 example shows no IR difference after this change using -O2.

Also worth noting - the code comment in visitAdd:
// This handles stuff like (X & 254)+1 -> (X&254)|1
...isn't true. That transform is handled later with a call to haveNoCommonBitsSet().

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 23:01:12 +00:00
Eugene Zelenko
096e40d35f [CodeGen] 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@295893 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 22:32:51 +00:00
Krzysztof Parzyszek
e9d7ca1b92 [Hexagon] Implement @llvm.readcyclecounter()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295892 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 22:28:47 +00:00
Matt Arsenault
206dfa3c0d AMDGPU: Don't add emergency stack slot if all spills are SGPR->VGPR
This should avoid reporting any stack needs to be allocated in the
case where no stack is truly used. An unused stack slot is still
left around in other cases where there are real stack objects
but no spilling occurs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295891 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 22:23:32 +00:00
Daniel Berlin
4ddfe6915d PredicateInfo: Support switch statements
Summary:
Depends on D29606 and D29682

Makes us pass GVN's edge.ll (we also will pass a few other testcases
they just need cleaning up).

Thoughts on the Predicate* hiearchy of classes especially welcome :)
(it's not clear to me how best to organize it, and currently, the getBlock* seems ... uglier than maybe wasting a field somewhere or something).

Reviewers: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 22:20:58 +00:00
Daniel Berlin
188bef38fc Move updating functions to MemorySSAUpdater.
Add updater to passes that now need it.
Move around code in MemorySSA to expose needed functions.

Summary: Mostly cleanup

Reviewers: george.burgess.iv

Subscribers: llvm-commits, Prazek

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295887 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 22:19:55 +00:00
Wei Mi
3e13826e61 [LSR] Canonicalize formula and put recursive Reg related with current loop in ScaledReg.
After rL294814, LSR formula can have multiple SCEVAddRecExprs inside of its BaseRegs.
Previous canonicalization will swap the first SCEVAddRecExpr in BaseRegs with ScaledReg.
But now we want to swap the SCEVAddRecExpr Reg related with current loop with ScaledReg.
Otherwise, we may generate code like this: RegA + lsr.iv + RegB, where loop invariant
parts RegA and RegB are not grouped together and cannot be promoted outside of loop.
With this patch, it will ensure lsr.iv to be generated later in the expr:
RegA + RegB + lsr.iv, so that RegA + RegB can be promoted outside of loop.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:47:08 +00:00
Krzysztof Parzyszek
4085aa22cf [RDF] Support for partial structural aliases in RegisterAggr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:42:15 +00:00
Zachary Turner
a6cf40b584 [Support] Re-add the special OSX flags on mmap.
The problem appears to be that these flags can only be used
when mapping a file for read-only, not for readwrite.  So
we do that here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295880 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:24:06 +00:00
Krzysztof Parzyszek
7af390a681 [Hexagon] Add intrinsics for masked vector stores
Patch by Harsha Jagasia.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295879 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:23:09 +00:00
Matt Arsenault
c1d17d5f71 AMDGPU: Don't look at chain users when adjusting writemask
Fixes not adjusting using new intrinsics with chains.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:16:41 +00:00
Matt Arsenault
138d429065 AMDGPU: Always allocate emergency stack slot at offset 0
This allows us to ensure that 0 is never a valid pointer
to a user object, and ensures that the offset is always legal
without needing a register to access it. This comes at the cost
of usable offsets and wasted stack space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 21:05:25 +00:00
Matt Arsenault
1b020b3be5 AMDGPU: Change exp with compr bit printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 20:37:12 +00:00
Wei Ding
9b1c9472f5 Revert "AMDGPU : Update TrapCode based on Trap Handler ABI."
This reverts commit r295867.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 20:29:22 +00:00
Alexey Bataev
d6db829b03 [SLP] Fix for PR32036: Vectorized horizontal reduction returning wrong result
Summary:
If the same value is used several times as an extra value, SLP
vectorizer takes it into account only once instead of actual number of
using.
For example:
```
int val = 1;
for (int y = 0; y < 8; y++) {
  for (int x = 0; x < 8; x++) {
    val = val + input[y * 8 + x] + 3;
  }
}
```
We have 2 extra rguments: `1` - initial value of horizontal reduction
and `3`, which is added 8*8 times to the reduction. Before the patch we
added `1` to the reduction value and added once `3`, though it must be
added 64 times.

Reviewers: mkuper, mzolotukhin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 20:06:40 +00:00
Wei Ding
d70493f450 AMDGPU : Update TrapCode based on Trap Handler ABI.
Differential Revision: http://reviews.llvm.org/D30232

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 20:05:06 +00:00
Rafael Espindola
2504ec9f08 Move llvm_unreachable out of switch.
This should make gcc happy and still produce a clang warning if we add
another value to the enum.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 19:42:14 +00:00
Geoff Berry
6b494b30f2 [AArch64] Extend AArch64RedundantCopyElimination to do simple copy propagation.
Summary:
Extend AArch64RedundantCopyElimination to catch cases where the register
that is known to be zero is COPY'd in the predecessor block.  Before
this change, this pass would catch cases like:

      CBZW %W0, <BB#1>
  BB#1:
      %W0 = COPY %WZR // removed

After this change, cases like the one below are also caught:

      %W0 = COPY %W1
      CBZW %W1, <BB#1>
  BB#1:
      %W0 = COPY %WZR // removed

This change results in a 4% increase in static copies removed by this
pass when compiling the llvm test-suite.  It also fixes regressions
caused by doing post-RA copy propagation (a separate change to be put up
for review shortly).

Reviewers: junbuml, mcrosier, t.p.northover, qcolombet, MatzeB

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 19:10:45 +00:00
Davide Italiano
33b82ff8c4 [ModuleSummaryAnalysis] Don't crash when referencing unnamed globals.
Instead, just be conservative as these are unfrequent enough. Thanks
to Peter Collingbourne for the discussion about this on IRC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295861 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:53:38 +00:00
Dan Gohman
6d5b578789 [WebAssembly] Implement the wasm binary container header.
Also, update the version number to 0x1, which is what engines are now
expecting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295860 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:50:20 +00:00
Karl-Johan Karlsson
29fec22c97 [LoopVectorize] Added address space check when analysing interleaved accesses
Prevent memory objects of different address spaces to be part of
the same load/store groups when analysing interleaved accesses.

This is fixing pr31900.

Reviewers: HaoLiu, mssimpso, mkuper

Reviewed By: mssimpso, mkuper

Subscribers: llvm-commits, efriedma, mzolotukhin

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

This reverts r295042 (re-applies r295038) with an additional fix for the
buildbot problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:37:36 +00:00
Dan Gohman
2be1878c67 [WebAssembly] Define a table of function signatures for runtime library calls.
LLVM CodeGen emits references to external symbols that are never declared in
LLVM IR level, so they have no declared signature. However, WebAssembly requires
all functions be declared with signatures. This patch adds a table for providing
signatures for known runtime libcalls that will be used in subsequent patches to
emit declarations for such functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:34:16 +00:00
Krzysztof Parzyszek
e2af082e44 [RDF] Skip undef uses when calculating kill flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:29:16 +00:00
Krzysztof Parzyszek
c5ffa24bc1 [RDF] Only access block live-ins when tracking liveness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:27:36 +00:00
Michal Gorny
39b10e911b [Support] Provide linux/magic.h fallback for older kernels
The function for distinguishing local and remote files added in r295768
unconditionally uses linux/magic.h header to provide necessary
filesystem magic numbers. However, in kernel headers predating 2.6.18
the magic numbers are spread throughout multiple include files.
Furthermore, LLVM did not require kernel headers being installed so far.

To increase the portability across different versions of Linux kernel
and different Linux systems, add CMake header checks for linux/magic.h
and -- if it is missing -- the linux/nfs_fs.h and linux/smb.h headers
which contained the numbers previously.

Furthermore, since the numbers are static and the feature does not seem
critical enough to make LLVM require kernel headers at all, add fallback
constants for the case when none of the necessary headers is available.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 18:09:15 +00:00
Dehao Chen
94ebcf7e5e Fix an obvious bug in SampleProfileReaderGCC.
Summary: The CallTargetProfile should be added to FProfile to be consistent with other profile readers.

Reviewers: dnovillo, davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 17:27:21 +00:00
Dan Gohman
61ce026358 [WebAssembly] Configure codegen to legalize f16 values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295850 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 16:28:00 +00:00
Bill Seurer
6ef315bddb [DAGCombiner] revert r295336
r295336 causes a bootstrapped clang to fail for many compilations on
powerpc BE.  See 
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/2315
for example.

Reverting as per the developer's request.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 16:27:33 +00:00
Simon Pilgrim
458f2a48cd [X86][SSE] getTargetConstantBitsFromNode - insert constant bits directly into masks.
Minor optimization, don't create temporary mask APInts that are just going to be OR'd into the accumulate masks - insert directly instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 15:38:13 +00:00
Simon Pilgrim
5eef3502f8 [X86][SSE] Use APInt::getBitsSet() instead of APInt::getLowBitsSet().shl() separately. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 15:04:55 +00:00
Simon Pilgrim
d10ce4865f Fix -Wunused-but-set-variable warning by removing unused 'aggregateIsPacked' checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 13:37:31 +00:00
Benjamin Kramer
8218b76114 [GlobalISel] Fix compiler warnings and make assert assert something.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295827 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 12:59:47 +00:00
Alexey Bataev
2a5165d7dc [SLP] Remove unused initial value from the variable, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295826 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 12:57:58 +00:00
Igor Breger
8ae3570fa8 [X86][GlobalISel] Initial implementation , select G_ADD gpr, gpr
Summary: Initial implementation for X86InstructionSelector. Handle selection COPY and G_ADD/G_SUB gpr, gpr .

Reviewers: qcolombet, rovka, zvi, ab

Reviewed By: rovka

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 12:25:09 +00:00
Roger Ferrer Ibanez
296acceca1 [ARM] Fix constant islands pass.
The pass tries to fix a spill of LR that turns out to be unnecessary.
So it removes the tPOP but forgets to remove tPUSH.
This causes the stack be misaligned upon returning the function.

Thus, remove the tPUSH as well in this case.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 09:06:21 +00:00
Ayman Musa
7f45e918f8 [X86] Fix memory operands definition for some instructions.
Change integer memory operands to FP memory operands to some FP instructions.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 08:06:29 +00:00
Justin Bogner
3d433ea2e3 OptDiag: Add const to some interfaces that don't modify anything. NFC
This needed a const_cast for the dominator tree recalculation in
OptimizationRemarkEmitter, but we do that all over the place already
and it's safe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 07:38:17 +00:00
Javed Absar
6badf185b6 [ARM] Classification Improvements to ARM Sched-Models. NFCI.
This patch adds missing sched classes for Thumb2 instructions.
This has been missing so far, and as a consequence, machine
scheduler models for individual sub-targets have tended to
be larger than they needed to be. These patches should help
write schedulers better and faster in the future
for ARM sub-targets.

Reviewer: Diana Picus
Differential Revision: https://reviews.llvm.org/D29953



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295811 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 07:22:57 +00:00
Craig Topper
544076881b [AVX-512] Allow legacy scalar min/max intrinsics to select EVEX instructions when available
This patch introduces new X86ISD::FMAXS and X86ISD::FMINS opcodes. The legacy intrinsics now lower to this node. As do the AVX-512 masked intrinsics when the rounding mode is CUR_DIRECTION.

I've merged a copy of the tablegen multiclass avx512_fp_scalar into avx512_fp_scalar_sae. avx512_fp_scalar still needs to support CUR_DIRECTION appearing as a rounding mode for X86ISD::FADD_ROUND and others.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 06:54:18 +00:00
Sanjoy Das
7e76879901 [ValueTracking] Make poison propagation more aggressive
Summary:
Motivation: fix PR31181 without regression (the actual fix is still in
progress).  However, the actual content of PR31181 is not relevant
here.

This change makes poison propagation more aggressive in the following
cases:

 1. poision * Val == poison, for any Val.  In particular, this changes
    existing intentional and documented behavior in these two cases:
     a. Val is 0
     b. Val is 2^k * N
 2. poison << Val == poison, for any Val
 3. getelementptr is poison if any input is poison

I think all of these are justified (and are axiomatically true in the
new poison / undef model):

1a: we need poison * 0 to be poison to allow transforms like these:

  A * (B + C) ==> A * B + A * C

If poison * 0 were 0 then the above transform could not be allowed
since e.g. we could have A = poison, B = 1, C = -1, making the LHS

  poison * (1 + -1) = poison * 0 = 0

and the RHS

  poison * 1 + poison * -1 = poison + poison = poison

1b: we need e.g. poison * 4 to be poison since we want to allow

  A * 4 ==> A + A + A + A

If poison * 4 were a value with all of their bits poison except the
last four; then we'd not be able to do this transform since then if A
were poison the LHS would only be "partially" poison while the RHS
would be "full" poison.

2: Same reasoning as (1b), we'd like have the following kinds
transforms be legal:

  A << 1 ==> A + A

Reviewers: majnemer, efriedma

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 06:52:32 +00:00
Sean Silva
0b39c0f14b Use const-ref in range-loop for to avoid copying pairs of std::string
No reason to create temporaries.

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

Patch by sergio.martins!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295807 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 06:34:04 +00:00
Dan Gohman
d660a5d68c [WebAssembly] Add skeleton MC support for the Wasm container format
This just adds the basic skeleton for supporting a new object file format.
All of the actual encoding will be implemented in followup patches.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295803 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 01:23:18 +00:00
Rui Ueyama
9a736108d4 Fix -Wcovered-switch-default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295799 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 01:01:45 +00:00
Matt Arsenault
7d65faa5cc AMDGPU: Add cvt.pkrtz intrinsic
Convert llvm.SI.packf16 test uses

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 00:27:34 +00:00
Michael Kuperstein
2b21febc6b [LoopUnroll] Enable PGO-based loop peeling by default.
This enables peeling of loops with low dynamic iteration count by default,
when profile information is available.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295796 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 00:27:34 +00:00