Commit Graph

150246 Commits

Author SHA1 Message Date
Nirav Dave
1a53953efe [DAG] Improve Store Merge candidate pruning. NFC.
When considering merging stores values are the results of loads only
consider stores whose values come from loads from the same base.

This fixes much of the longer compile times in PR33330.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304934 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 18:51:56 +00:00
Xinliang David Li
7ce64309f9 Fix builin_expect lowering bug
PR33346

Skip cases when expected value is not constant int.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304933 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 18:32:24 +00:00
Eric Fiselier
41609fea49 Add BinaryFormat module definition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 17:16:25 +00:00
Alina Sbirlea
e156d99231 [mssa] Fix case when there is no definition in a block prior to an inserted use.
Summary:
Check that the first access before one being tested is valid.
Before this patch, if there was no definition prior to the Use being tested,
the first time Iter was deferenced, it hit the sentinel.

Reviewers: dberlin, gbiv

Subscribers: sanjoy, Prazek, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304926 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 16:46:53 +00:00
Sanjay Patel
57caaecac3 [CGP] avoid zext/trunc of a memcmp expansion compare
This could be viewed as another shortcoming of the DAGCombiner:
when both operands of a compare are zexted from the same source
type, we should be able to compare the original types.

The effect on PowerPC perf is likely unnoticeable, but there's a
visible regression for x86 if we feed the suboptimal IR for memcmp
expansion to the DAG:

_cmp_eq4_zexted_to_i64:
  movl  (%rdi), %ecx
  movl  (%rsi), %edx
  xorl  %eax, %eax
  cmpq  %rdx, %rcx
  sete  %al

_cmp_eq4_better:
  movl  (%rdi), %ecx
  xorl  %eax, %eax
  cmpl  (%rsi), %ecx
  sete  %al



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 16:16:45 +00:00
Dmitry Preobrazhensky
8848866f05 [AMDGPU][MC] Corrected error message for s_waitcnt helpers
See Bug 32711: https://bugs.llvm.org//show_bug.cgi?id=32711

Reviewers: artem.tamazov

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304922 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 16:08:02 +00:00
Peter Collingbourne
619317ee76 LowerTypeTests: Generate simpler IR for br(llvm.type.test, then, else).
This makes it so that the code quality for CFI checks when compiling
with -O2 and linking with --lto-O0 is similar to that of the rest of
the code.

Reduces the size of a chrome binary built with -O2/--lto-O0 by
about 750KB.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304921 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 15:49:14 +00:00
Sanjay Patel
f16db3ca21 [CGP] pass size as param in MemCmpExpansion; NFCI
Avoid extracting the constant int twice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304920 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 15:05:13 +00:00
Filipe Cabecinhas
6a60571869 PR33331 - opt-viewer.py produces broken output for directories with spaces
Fix: Properly quote href attributes.

Patch by Simon Whittaker!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304919 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 14:57:20 +00:00
Petar Jovanovic
eeb64a67b6 [mips][dsp] Modify repl.ph to accept signed immediate values
Changed immediate type for repl.ph from uimm10 to simm10 as per the specs.
Repl.qb still accepts uimm8. Both instructions now mimic the behaviour of
GNU as.

Patch by Stefan Maksimovic.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304918 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 14:48:46 +00:00
Sanjay Patel
5fbefa5732 [CGP] pass size as param in MemCmpExpansion; NFCI
Avoid extracting the constant int twice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 14:45:49 +00:00
Sanjay Patel
7e504a2322 [CGP] getParent()->getParent() --> getFunction(); NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304916 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 14:29:52 +00:00
Guy Blank
de839bdbf5 [X86] Add test to demonstrate inefficient lowering of v48i8 shuffle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304915 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 14:29:10 +00:00
Jonas Paulsson
68ada83f0c [SystemZ] Propagate MachineMemOperands
In emitCondStore() and emitMemMemWrapper().

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304913 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 14:08:34 +00:00
Simon Pilgrim
f6be5d234a [DAG] Move SelectionDAG::isCommutativeBinOp to TargetLowering.
This will allow commutation of target-specific DAG nodes in future patches

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 14:05:04 +00:00
Tom Stellard
55d2b21ff7 AMDGPU/GlobalISel: Mark 32-bit G_SELECT as legal
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304910 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 13:54:51 +00:00
Sanjay Patel
705f5b195b [x86] avoid flipping sign bits for vector icmp by using known bits
If we know that both operands of an unsigned integer vector comparison are non-negative, 
then it's safe to directly use a signed-compare-greater-than instruction (the only non-equality
integer vector compare predicate provided by SSE/AVX).

We're intentionally not changing the condition code to signed in order to preserve the
existing transforms that use min/max/psubus below here.

This should solve PR33276:
https://bugs.llvm.org/show_bug.cgi?id=33276

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304909 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 13:46:34 +00:00
Sanjay Patel
2b75145d62 [CGP] add helper function for generating compare of load pairs; NFCI
In the special (but also the likely common) case, we can avoid
the multi-block complexity of the general algorithm, so moving
this part off on its own will make it re-usable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304908 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 13:33:00 +00:00
Nemanja Ivanovic
aa74d107f6 [PowerPC] Eliminate integer compare instructions - vol. 5
Adds handling for i64 SETNE comparison (both sign and zero extended).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304907 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 13:18:06 +00:00
Petar Jovanovic
d33e35c927 [mips] do not use FastISel when -mxgot is present
The clang compiler by default uses FastISel when invoked with -O0, which
is also the default. In that case, passing of -mxgot does not get honored,
i.e. the code path that is to deal with large got is not taken.
Clang produces same output regardless of -mxgot being present or not.
This change checks whether -mxgot is passed as an option, and turns off
FastISel if it is.

Patch by Stefan Maksimovic.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304906 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 12:59:53 +00:00
Florian Hahn
82962d847a [ARM] Use FixupKind variable in processFixupValue (cleanup, NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304905 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 12:58:08 +00:00
Sanjay Patel
77c163d8d8 [CGP] fix formatting in MemCmpExpansion; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304903 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 12:44:36 +00:00
Diana Picus
f6257e92c0 [ARM] GlobalISel: Purge G_SEQUENCE
According to the commit message from r296921, G_MERGE_VALUES and
G_INSERT are to be preferred over G_SEQUENCE. Therefore, stop generating
G_SEQUENCE in the ARM backend and remove the code dealing with it.

This boils down to the code breaking up double values for the soft float
calling convention. Use G_MERGE_VALUES + G_UNMERGE_VALUES instead of
G_SEQUENCE + G_EXTRACT for it. This maps very nicely to VMOVDRR +
VMOVRRD and simplifies the code in the instruction selector.

There's one occurence of G_SEQUENCE left in arm-irtranslator.ll, but
that is part of the target-independent code for translating constant
structs. Therefore, it is beyond the scope of this commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 12:35:05 +00:00
Nemanja Ivanovic
3204344f22 [PowerPC] Eliminate integer compare instructions - vol. 3
Adds handling for i32 SETNE comparison (both sign and zero extended).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304901 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 12:23:41 +00:00
Benjamin Kramer
5a998740d1 [FileCheck] Don't scan past the closing CHECK-DAG for CHECK-NOT inside CHECK-DAG
If there's enough data in fron of it the skipped region would just
become arbitrarily large, and we scan for the CHECK-NOT everywhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304900 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 12:06:45 +00:00
Diana Picus
f5c9f95396 [ARM] GlobalISel: Support G_XOR
Same as the other binary operators:
- legalize to 32 bits
- map to GPRs
- select to EORrr via TableGen'erated code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 11:57:30 +00:00
Simon Dardis
b47b55f6d1 evert "[mips] Fix test mips64fpldst.ll with machine verifier enabled"
This reverts commit r301394. It broke some internal buildbots, reverting
while the issue is being investigated.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 11:21:37 +00:00
Simon Pilgrim
39f72a563a [X86][SSE] Fix an issue with PEXTRW/PEXTRB indices during shuffle combining
We were checking that the index was in range of the destination vector type, not the (larger) source vector type


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304894 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 10:30:35 +00:00
Diana Picus
acf87402fa [ARM] GlobalISel: Support G_OR
Same as the other binary operators:
- legalize to 32 bits
- map to GPRs
- select ORRrr thanks to TableGen'erated code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304890 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 10:14:23 +00:00
Florian Hahn
a7783d7708 [Linker] Remove llc usage from link-arm-and-thumb.ll test case.
This fixes a buildbot failure when the ARM target is not built.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 09:59:22 +00:00
Diana Picus
e85cbacb93 [ARM] GlobalISel: Support G_AND
This is identical to the support for the other binary operators:
- widen to s32
- map into GPR
- select ANDrr (via TableGen'erated code)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 09:17:41 +00:00
Florian Hahn
4d6ca73334 [Linker] Remove warning when linking ARM and Thumb IR modules.
Summary:
This patch updates Triple::isCompatibleWith to make armxx and thumbxx
triples compatible, as long as the subarch, vendor, os, envorionment and
object format match. Thumb/ARM code generation should be controlled
using the thumb-mode per-function target feature rather than by the
triple to allow mixing Thumb and ARM functions.

D33448 updates Clang's codegen to add thumb-mode for all functions with
armxx or thumbxx triples.

Reviewers: echristo, t.p.northover, rafael, kristof.beyls, rengolin, tejohnson

Reviewed By: tejohnson

Subscribers: rinon, eugenis, pcc, srhines, aemerson, mehdi_amini, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 09:17:01 +00:00
Florian Hahn
f7b3252791 [ARM] Create relocations for unconditional branches.
Summary:
Relocations are required for unconditional branches to function symbols with
different execution mode. Without this patch, incorrect branches are
generated for tail calls between functions with different execution
mode.


Reviewers: peter.smith, rafael, echristo, kristof.beyls

Reviewed By: peter.smith

Subscribers: aemerson, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 08:54:47 +00:00
Eric Fiselier
6e94e63671 Adjust module.modulemap after r304864
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 08:05:31 +00:00
Craig Topper
5d4bfc7c8b [APInt] Fix the documentation for isOneValue. NFC
I copy and pasted from isNullValue and forgot to update it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 07:40:43 +00:00
Craig Topper
eb370b4757 [InstCombine][InstSimplify] Use APInt::isNullValue/isOneValue to reduce compiled code for comparing APInts with 0 and 1. NFC
These methods are specifically optimized to only counting leading zeros without an additional uint64_t compare.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 07:40:37 +00:00
Craig Topper
e57d4f53f8 [InstCombine] Fix two asserts that were accidentally checking that an APInt pointer is non-zero instead of checking that the APInt self is non-zero.
I believe this code used to use APInt references which would have worked. But then they were changed to pointers to allow m_APInt to be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 07:40:29 +00:00
Galina Kistanova
1a0f861c74 Disable all warning for AlignOfTest.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 06:30:27 +00:00
NAKAMURA Takumi
51444fd7fe Update libdeps to add BinaryFormat, introduced in r304864.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 04:48:49 +00:00
NAKAMURA Takumi
cd0e332e88 Reorder and reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 04:48:45 +00:00
Zachary Turner
b070b915de Add dependency from LibDriver to BinaryFormat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 04:39:50 +00:00
Zachary Turner
ce49018b11 Add dependency from AsmParser to BinaryFormat.
This breaks the MinGW build, but not other builds for some reason.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304866 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 04:24:33 +00:00
Zachary Turner
25d9ac1002 Add #include <system_error>
Hopefully this unbreaks the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 03:55:31 +00:00
Zachary Turner
19ca2b0f9d Move Object format code to lib/BinaryFormat.
This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various types of binary formats like dwarf, coff,
elf, etc as well as the code for identifying a file from its
magic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 03:48:56 +00:00
Craig Topper
d05a5f282d [LazyValueInfo] Remove redundant calls to ConstantRange::contains. The same exact call was made in the if above and we already know it returned true. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:58:09 +00:00
Craig Topper
a26780d808 [Constants] Use isUIntN/isIntN from MathExtras instead of reimplementing the same code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:58:05 +00:00
Craig Topper
c68553cb7f [Constants] Use APInt::isNullValue/isOneValue/uge to simplify some code and take advantage of APInt optimizations. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:58:02 +00:00
Craig Topper
9082d12000 [APInt] Add a isOneValue method that can determine if a number is 1 by only using getActiveBits/countLeadingZeros
Previously you would have to use operator==(uint64_t) which does the getActiveBits call and a uint64_t comparison. But we can get all we need to know from the getActiveBits call.

This method will be used in another commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:57:57 +00:00
Tony Tye
04631fc848 Try to work around possible bugs in version of Shpinx on buildserver.
Builds sucessfully with Sphinx v1.5.5

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304853 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:46:08 +00:00
NAKAMURA Takumi
4e7fb91232 Introduce the new feature "abi-breaking-checks" to satisfy -reverse-iterate in llvm/test/Transforms/Util/PredicateInfo/
A few tests in llvm/test/Transforms/Util/PredicateInfo/ are using -reverse-iterate.
The option -reverse-iterate is enabled with +Asserts in usual cases, but it can be turned on/off regardless of LLVM_ENABLE_ASSERTIONS.

I wonder if this were incompatible to https://reviews.llvm.org/D33908 (r304757).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:22:52 +00:00