OSDN Git Service

android-x86/external-llvm.git
6 years ago[X86] Remove setOperationAction Promote for ISD::SINT_TO_FP MVT::v8i16/v16i8/v16i16.
Craig Topper [Wed, 29 Nov 2017 08:19:36 +0000 (08:19 +0000)]
[X86] Remove setOperationAction Promote for ISD::SINT_TO_FP MVT::v8i16/v16i8/v16i16.

A DAG combine ensures these ops are always promoted to vXi32.

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

6 years ago[SCEV][NFC] Remove condition that can never happen due to check few lines above
Max Kazantsev [Wed, 29 Nov 2017 06:10:36 +0000 (06:10 +0000)]
[SCEV][NFC] Remove condition that can never happen due to check few lines above

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

6 years ago[CGP] Fix common type handling in optimizeMemoryInst
Serguei Katkov [Wed, 29 Nov 2017 05:51:26 +0000 (05:51 +0000)]
[CGP] Fix common type handling in optimizeMemoryInst

If common type is different we should bail out due to we will not be
able to create a select or Phi of these values.

Basically it is done in ExtAddrMode::compare however it does not work
if we handle the null first and then two values of different types.
so add a check in initializeMap as well. The check in ExtAddrMode::compare
is used as earlier bail out.

Reviewers: reames, john.brawn
Reviewed By: john.brawn
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D40479

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

6 years ago[PowerPC] Relax the checking on AND/AND8 in isSignOrZeroExtended.
Sean Fertile [Wed, 29 Nov 2017 04:09:29 +0000 (04:09 +0000)]
[PowerPC] Relax the checking on AND/AND8 in isSignOrZeroExtended.

Separate the handling of AND/AND8 out from PHI/OR/ISEL checking. The reasoning
is the others need all their operands to be sign/zero extended for their output
to also be sign/zero extended. This is true for AND and sign-extension, but for
zero-extension we only need at least one of the input operands to be zero
extended for the result to also be zero extended.

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

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

6 years agoAMDGPU: Use stricter regexes for add instructions
Matt Arsenault [Wed, 29 Nov 2017 02:25:14 +0000 (02:25 +0000)]
AMDGPU: Use stricter regexes for add instructions

Match the entire _co as one optional piece rather than
a set of characters to match multiple times.

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

6 years ago[Modules] Add textual headers for recently added .def files
Bruno Cardoso Lopes [Wed, 29 Nov 2017 01:53:49 +0000 (01:53 +0000)]
[Modules] Add textual headers for recently added .def files

Keep module.modulemap up to date and get rid of -Wincomplete-umbrella warnings

rdar://problem/35711925

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

6 years agoDAG: Add nuw when splitting loads and stores
Matt Arsenault [Wed, 29 Nov 2017 01:25:12 +0000 (01:25 +0000)]
DAG: Add nuw when splitting loads and stores

The object can't straddle the address space
wrap around, so I think it's OK to assume any
offsets added to the base object pointer can't
overflow. Similar logic already appears to be
applied in SelectionDAGBuilder when lowering
aggregate returns.

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

6 years agollvm-dwarfdump: honor the --show-children option when dumping a specific DIE.
Adrian Prantl [Wed, 29 Nov 2017 01:12:22 +0000 (01:12 +0000)]
llvm-dwarfdump: honor the --show-children option when dumping a specific DIE.

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

6 years agoAMDGPU: Select DS insts without m0 initialization
Matt Arsenault [Wed, 29 Nov 2017 00:55:57 +0000 (00:55 +0000)]
AMDGPU: Select DS insts without m0 initialization

GFX9 stopped using m0 for most DS instructions. Select
a different instruction without the use. I think this will
be less error prone than trying to manually maintain m0
uses as needed.

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

6 years agoRollback r319176.
Don Hinton [Wed, 29 Nov 2017 00:47:16 +0000 (00:47 +0000)]
Rollback r319176.

The ';' separators in LLVM_TARGETS_TO_BUILD disappear when list
variables are evaluated in custom commands.

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

6 years ago[X86] Promote fp_to_sint v16f32->v16i16/v16i8 to avoid scalarization.
Craig Topper [Wed, 29 Nov 2017 00:32:09 +0000 (00:32 +0000)]
[X86] Promote fp_to_sint v16f32->v16i16/v16i8 to avoid scalarization.

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

6 years agoFix a warning.
Zachary Turner [Wed, 29 Nov 2017 00:13:44 +0000 (00:13 +0000)]
Fix a warning.

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

6 years agoRevert "Add opt-viewer testing"
Adam Nemet [Wed, 29 Nov 2017 00:10:48 +0000 (00:10 +0000)]
Revert "Add opt-viewer testing"

This reverts commit r319188.

Breaks when c++filt is not available.

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

6 years ago[X86] Add test cases for fptosi v16f32->v16i8/v16i16 to show scalarization.
Craig Topper [Wed, 29 Nov 2017 00:02:22 +0000 (00:02 +0000)]
[X86] Add test cases for fptosi v16f32->v16i8/v16i16 to show scalarization.

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

6 years ago[NFC] Minor cleanups in CodeView TypeTableBuilder.
Zachary Turner [Tue, 28 Nov 2017 23:57:13 +0000 (23:57 +0000)]
[NFC] Minor cleanups in CodeView TypeTableBuilder.

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

6 years ago[X86] Mark ISD::FP_TO_UINT v16i8/v16i16 as Promote under AVX512 instead of legal...
Craig Topper [Tue, 28 Nov 2017 23:56:02 +0000 (23:56 +0000)]
[X86] Mark ISD::FP_TO_UINT v16i8/v16i16 as Promote under AVX512 instead of legal. Fix infinite loop in op legalization when promotion requires 2 steps.

Previously we had an isel pattern to add the truncate. Instead use Promote to add the truncate to the DAG before isel.

The Promote legalization code had to be updated to prevent an infinite loop if promotion took multiple steps because it wasn't remembering the previously tried value.

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

6 years ago[X86] Regenerate avx512-schedule test.
Craig Topper [Tue, 28 Nov 2017 23:55:59 +0000 (23:55 +0000)]
[X86] Regenerate avx512-schedule test.

For some reason some sqrt instructions were missing the scheduling comments.

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

6 years agoAMDGPU: Enable IPRA
Matt Arsenault [Tue, 28 Nov 2017 23:40:12 +0000 (23:40 +0000)]
AMDGPU: Enable IPRA

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

6 years ago[X86] Tag CLFLUSHOPT with same scheduling behaviour as CLFLUSH
Simon Pilgrim [Tue, 28 Nov 2017 23:25:42 +0000 (23:25 +0000)]
[X86] Tag CLFLUSHOPT with same scheduling behaviour as CLFLUSH

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

6 years ago[globalisel][tablegen] Fix PR35375 by sign-extending the table value to match getCons...
Daniel Sanders [Tue, 28 Nov 2017 23:18:54 +0000 (23:18 +0000)]
[globalisel][tablegen] Fix PR35375 by sign-extending the table value to match getConstantVRegVal()

Summary:
From the bug report:
> The problem is that it fails when trying to compare -65536 (or 4294901760) to 0xFFFF,0000. This is because the
> constant in the instruction is sign extended to 64 bits (0xFFFF,FFFF,FFFF,0000) and then compared to the non
> extended 64 bit version expected by TableGen.
>
> In contrast, the DAGISelEmitter generates special code for AND immediates (OPC_CheckAndImm), which does not
> sign extend.

This patch doesn't introduce the special case for AND (and OR) immediates since the majority of it is related to handling known bits that have no effect on the result and GlobalISel doesn't detect known-bits at this time. Instead this patch just ensures that the immediate is extended consistently on both sides of the check.

Thanks to Diana Picus for the detailed bug report.

Reviewers: rovka

Reviewed By: rovka

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

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

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

6 years ago[X86] Add CLFLUSHOPT schedule tests
Simon Pilgrim [Tue, 28 Nov 2017 23:12:12 +0000 (23:12 +0000)]
[X86] Add CLFLUSHOPT schedule tests

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

6 years ago[X86][SSE] Add SSE_SHUFP OpndItins
Simon Pilgrim [Tue, 28 Nov 2017 23:09:18 +0000 (23:09 +0000)]
[X86][SSE] Add SSE_SHUFP OpndItins

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

Will be reused in the AVX512 equivalents.

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

6 years ago[X86] Test clflushopt intrinsic on 32 and 64-bit targets
Simon Pilgrim [Tue, 28 Nov 2017 23:04:42 +0000 (23:04 +0000)]
[X86] Test clflushopt intrinsic on 32 and 64-bit targets

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

6 years ago[X86][SSE] Add SSE_UNPCK/SSE_PUNPCK OpndItins
Simon Pilgrim [Tue, 28 Nov 2017 22:55:08 +0000 (22:55 +0000)]
[X86][SSE] Add SSE_UNPCK/SSE_PUNPCK OpndItins

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

Will be reused in the AVX512 equivalents.

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

6 years ago[X86][SSE] Use SSE_PACK OpndItins in PACKSS/PACKUS instruction definitions
Simon Pilgrim [Tue, 28 Nov 2017 22:47:45 +0000 (22:47 +0000)]
[X86][SSE] Use SSE_PACK OpndItins in PACKSS/PACKUS instruction definitions

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

SSE_PACK will be reused in the AVX512 equivalents.

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

6 years agoRemove this test
Adam Nemet [Tue, 28 Nov 2017 22:39:38 +0000 (22:39 +0000)]
Remove this test

After r319235, we no longer generate this remark.

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

6 years agoFix VS2017 narrowing conversion warning. NFCI
Simon Pilgrim [Tue, 28 Nov 2017 22:32:43 +0000 (22:32 +0000)]
Fix VS2017 narrowing conversion warning. NFCI

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

6 years ago[X86] Remove unused variable.
Craig Topper [Tue, 28 Nov 2017 22:28:23 +0000 (22:28 +0000)]
[X86] Remove unused variable.

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

6 years agoDemote this opt remark to DEBUG.
Adam Nemet [Tue, 28 Nov 2017 22:11:00 +0000 (22:11 +0000)]
Demote this opt remark to DEBUG.

From a random opt-stat output:

Top 10 remarks:
  tailcallelim/tailcall          53%
  inline/AlwaysInline            13%
  gvn/LoadClobbered              13%
  inline/Inlined                  8%
  inline/TooCostly                2%
  inline/NoDefinition             2%
  licm/LoadWithLoopInvariantAddressInvalidated  2%
  licm/Hoisted                    1%
  asm-printer/InstructionCount    1%
  prologepilog/StackSize          1%

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

6 years ago[X86] Remove code from combineUIntToFP that tried to favor UINT_TO_FP if legal when...
Craig Topper [Tue, 28 Nov 2017 22:08:51 +0000 (22:08 +0000)]
[X86] Remove code from combineUIntToFP that tried to favor UINT_TO_FP if legal when zero extending from vXi8/vX816.

The UINT_TO_FP is immediately converted to SINT_TO_FP when the node is re-evaluated because we'll detect that the sign bit is zero.

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

6 years ago[X86] Remove custom lowering for uint_to_fp from vXi8/vXi16.
Craig Topper [Tue, 28 Nov 2017 22:08:48 +0000 (22:08 +0000)]
[X86] Remove custom lowering for uint_to_fp from vXi8/vXi16.

We have a DAG combine that uses a zero extend that should prevent this from ever occurring now.

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

6 years ago[globalisel][tablegen] Add support for importing G_ATOMIC_CMPXCHG, G_ATOMICRMW_*...
Daniel Sanders [Tue, 28 Nov 2017 22:07:05 +0000 (22:07 +0000)]
[globalisel][tablegen] Add support for importing G_ATOMIC_CMPXCHG, G_ATOMICRMW_* rules from SelectionDAG.

GIM_CheckNonAtomic has been replaced by GIM_CheckAtomicOrdering to allow it to support a wider
range of orderings. This has then been used to import patterns using nodes such
as atomic_cmp_swap, atomic_swap, and atomic_load_*.

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

6 years agoSROA: Don't create variable fragments that are outside of the variable.
Adrian Prantl [Tue, 28 Nov 2017 21:30:38 +0000 (21:30 +0000)]
SROA: Don't create variable fragments that are outside of the variable.

An alloca may be larger than a variable that is described to be stored
there. Don't create a dbg.value for fragments that are outside of the
variable.

This fixes PR35447.
https://bugs.llvm.org/show_bug.cgi?id=35447

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

6 years ago[cmake] Pass LLVM_USE_LINKER flag when building host tools, e.g.,
Don Hinton [Tue, 28 Nov 2017 21:23:30 +0000 (21:23 +0000)]
[cmake] Pass LLVM_USE_LINKER flag when building host tools, e.g.,
LLVM_OPTIMIZED_TABLEGEN=ON, and not crosscompiling.

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

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

6 years ago[SLP] Additional test for PR35354, NFC.
Alexey Bataev [Tue, 28 Nov 2017 20:48:24 +0000 (20:48 +0000)]
[SLP] Additional test for PR35354, NFC.

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

6 years ago[Hexagon] Use stable sort for HexagonShuffler to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 28 Nov 2017 20:48:10 +0000 (20:48 +0000)]
[Hexagon] Use stable sort for HexagonShuffler to remove non-deterministic ordering

Summary:
This fixes failures in the following tests uncovered by D39245:
        LLVM :: CodeGen/Hexagon/args.ll
        LLVM :: CodeGen/Hexagon/constp-extract.ll
        LLVM :: CodeGen/Hexagon/expand-condsets-basic.ll
        LLVM :: CodeGen/Hexagon/gp-rel.ll
        LLVM :: CodeGen/Hexagon/packetize_cond_inst.ll
        LLVM :: CodeGen/Hexagon/simple_addend.ll
        LLVM :: CodeGen/Hexagon/swp-stages4.ll
        LLVM :: CodeGen/Hexagon/swp-vmult.ll
        LLVM :: CodeGen/Hexagon/swp-vsum.ll
        LLVM :: MC/Hexagon/align.s
        LLVM :: MC/Hexagon/asmMap.s
        LLVM :: MC/Hexagon/dis-duplex-p0.s
        LLVM :: MC/Hexagon/double-vector-producer.s
        LLVM :: MC/Hexagon/inst_select.ll
        LLVM :: MC/Hexagon/instructions/j.s

Reviewers: colinl, kparzysz, adasgupt, slarin

Reviewed By: kparzysz

Subscribers: llvm-commits

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

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

6 years ago[aarch64][globalisel] Add missing tests from r319216
Daniel Sanders [Tue, 28 Nov 2017 20:27:59 +0000 (20:27 +0000)]
[aarch64][globalisel] Add missing tests from r319216

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

6 years ago[PowerPC] Allow tail calls of fastcc functions from C CallingConv functions.
Sean Fertile [Tue, 28 Nov 2017 20:25:58 +0000 (20:25 +0000)]
[PowerPC] Allow tail calls of fastcc functions from C CallingConv functions.

Allow fastcc callees to be tail-called from ccc callers.

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

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

6 years ago[aarch64][globalisel] Define G_ATOMIC_CMPXCHG and G_ATOMICRMW_* and make them legal
Daniel Sanders [Tue, 28 Nov 2017 20:21:15 +0000 (20:21 +0000)]
[aarch64][globalisel] Define G_ATOMIC_CMPXCHG and G_ATOMICRMW_* and make them legal

The IRTranslator cannot generate these instructions at the moment so there's no
issue with not having implemented ISel for them yet. D40092 will add
G_ATOMIC_CMPXCHG_WITH_SUCCESS and G_ATOMICRMW_* to the IRTranslator and a
further patch will add support for lowering G_ATOMIC_CMPXCHG_WITH_SUCCESS into
G_ATOMIC_CMPXCHG with an external success check via the `Lower` action.

The separation of G_ATOMIC_CMPXCHG_WITH_SUCCESS and G_ATOMIC_CMPXCHG is
to import SelectionDAG rules while still supporting targets that prefer to
custom lower the original LLVM-IR-like operation.

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

6 years ago[SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 28 Nov 2017 19:55:54 +0000 (19:55 +0000)]
[SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering

Summary:
Recommitting this with the correct sorting predicate. The Low field of Clusters is a ConstantInt and
cannot be directly compared. So we needed to invoke slt (signed less than) to compare correctly.

This fixes failures in the following tests uncovered by D39245:

LLVM :: CodeGen/ARM/ifcvt3.ll
LLVM :: CodeGen/ARM/switch-minsize.ll
LLVM :: CodeGen/X86/switch.ll
LLVM :: CodeGen/X86/switch-bt.ll
LLVM :: CodeGen/X86/switch-density.ll

Reviewers: hans, fhahn

Reviewed By: hans

Subscribers: aemerson, llvm-commits, kristof.beyls

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

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

6 years ago[X86][SSE] Add SSE_HADDSUB/SSE_PABS/SSE_PALIGN OpndItins
Simon Pilgrim [Tue, 28 Nov 2017 19:39:47 +0000 (19:39 +0000)]
[X86][SSE] Add SSE_HADDSUB/SSE_PABS/SSE_PALIGN OpndItins

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

Will be reused in the AVX512 equivalents.

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

6 years ago[X86] In lowerVectorShuffleAsElementInsertion, if were able to find a scalar i8 or...
Craig Topper [Tue, 28 Nov 2017 19:25:45 +0000 (19:25 +0000)]
[X86] In lowerVectorShuffleAsElementInsertion, if were able to find a scalar i8 or i16 and need to zero extend it, make sure we use a vXi32 type of the full vector width.

Previously, this was hardcoded to v4i32, but if the input type is 256 bits we need to use v8i32.

Fixes PR35443

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

6 years ago[CodeGen] Fix doxygen \file comment style
Francis Visoiu Mistrih [Tue, 28 Nov 2017 19:23:39 +0000 (19:23 +0000)]
[CodeGen] Fix doxygen \file comment style

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

6 years ago[CodeGen] Fix doxygen
Francis Visoiu Mistrih [Tue, 28 Nov 2017 19:15:46 +0000 (19:15 +0000)]
[CodeGen] Fix doxygen

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

6 years ago[InstCombine] auto-generate complete test checks; NFC
Sanjay Patel [Tue, 28 Nov 2017 19:13:23 +0000 (19:13 +0000)]
[InstCombine] auto-generate complete test checks; NFC

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

6 years ago[Hexagon] Make sure to zero-extend bytes before building a vector
Krzysztof Parzyszek [Tue, 28 Nov 2017 19:13:17 +0000 (19:13 +0000)]
[Hexagon] Make sure to zero-extend bytes before building a vector

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

6 years ago[InstCombine] auto-generate complete test checks; NFC
Sanjay Patel [Tue, 28 Nov 2017 19:07:28 +0000 (19:07 +0000)]
[InstCombine] auto-generate complete test checks; NFC

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

6 years ago[mir] Print/Parse both MOLoad and MOStore when they occur together.
Daniel Sanders [Tue, 28 Nov 2017 18:57:02 +0000 (18:57 +0000)]
[mir] Print/Parse both MOLoad and MOStore when they occur together.

Summary:
They're not always mutually exclusive. read-modify-write atomics are both
at the same time. One example of this is the SWP instructions on AArch64.
Another example is GlobalISel's G_ATOMICRMW_* generic instructions which
will be added in a later patch.

Reviewers: arphaman, aemerson

Reviewed By: aemerson

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

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

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

6 years agoFix non assert build warnings.
Rafael Espindola [Tue, 28 Nov 2017 18:50:08 +0000 (18:50 +0000)]
Fix non assert build warnings.

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

6 years agoEntryExitInstrumenter: set DebugLocs on the inserted call instructions (PR35412)
Hans Wennborg [Tue, 28 Nov 2017 18:44:26 +0000 (18:44 +0000)]
EntryExitInstrumenter: set DebugLocs on the inserted call instructions (PR35412)

Apparently the verifier requires that inlineable calls in a function
with debug info have debug locations.

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

6 years ago[CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.
Zachary Turner [Tue, 28 Nov 2017 18:33:17 +0000 (18:33 +0000)]
[CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.

The motivation behind this patch is that future directions require us to
be able to compute the hash value of records independently of actually
using them for de-duplication.

The current structure of TypeSerializer / TypeTableBuilder being a
single entry point that takes an unserialized type record, and then
hashes and de-duplicates it is not flexible enough to allow this.

At the same time, the existing TypeSerializer is already extremely
complex for this very reason -- it tries to be too many things. In
addition to serializing, hashing, and de-duplicating, ti also supports
splitting up field list records and adding continuations. All of this
functionality crammed into this one class makes it very complicated to
work with and hard to maintain.

To solve all of these problems, I've re-written everything from scratch
and split the functionality into separate pieces that can easily be
reused. The end result is that one class TypeSerializer is turned into 3
new classes SimpleTypeSerializer, ContinuationRecordBuilder, and
TypeTableBuilder, each of which in isolation is simple and
straightforward.

A quick summary of these new classes and their responsibilities are:

- SimpleTypeSerializer : Turns a non-FieldList leaf type into a series of
  bytes. Does not do any hashing. Every time you call it, it will
  re-serialize and return bytes again. The same instance can be re-used
  over and over to avoid re-allocations, and in exchange for this
  optimization the bytes returned by the serializer only live until the
  caller attempts to serialize a new record.

- ContinuationRecordBuilder : Turns a FieldList-like record into a series
  of fragments. Does not do any hashing. Like SimpleTypeSerializer,
  returns references to privately owned bytes, so the storage is
  invalidated as soon as the caller tries to re-use the instance. Works
  equally well for LF_FIELDLIST as it does for LF_METHODLIST, solving a
  long-standing theoretical limitation of the previous implementation.

- TypeTableBuilder : Accepts sequences of bytes that the user has already
  serialized, and inserts them by de-duplicating with a hash table. For
  the sake of convenience and efficiency, this class internally stores a
  SimpleTypeSerializer so that it can accept unserialized records. The
  same is not true of ContinuationRecordBuilder. The user is required to
  create their own instance of ContinuationRecordBuilder.

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

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

6 years ago[X86][X87] Tag FP_TO_INT_IN_MEM pseudos with hasNoSchedulingInfo
Simon Pilgrim [Tue, 28 Nov 2017 18:10:29 +0000 (18:10 +0000)]
[X86][X87] Tag FP_TO_INT_IN_MEM pseudos with hasNoSchedulingInfo

We don't need scheduling info for pseudos

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

6 years ago[CodeGen] Separate MachineOperand implementation from MachineInstr
Francis Visoiu Mistrih [Tue, 28 Nov 2017 17:58:43 +0000 (17:58 +0000)]
[CodeGen] Separate MachineOperand implementation from MachineInstr

Move the implementation to its own file.

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

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

6 years ago[CodeGen] Cleanup MachineOperand
Francis Visoiu Mistrih [Tue, 28 Nov 2017 17:58:38 +0000 (17:58 +0000)]
[CodeGen] Cleanup MachineOperand

* clang-format
* move doxygen from the implementation to headers
* remove duplicate doxygen

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

6 years agoAMDGPU: Add num spilled s/vgprs to metadata
Konstantin Zhuravlyov [Tue, 28 Nov 2017 17:51:08 +0000 (17:51 +0000)]
AMDGPU: Add num spilled s/vgprs to metadata

This was requested by tools.

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

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

6 years agoAdd opt-viewer testing
Adam Nemet [Tue, 28 Nov 2017 17:26:28 +0000 (17:26 +0000)]
Add opt-viewer testing

Detects whether we have the Python modules (pygments, yaml) required by
opt-viewer and hooks this up to REQUIRES.

This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer
testing).

It's also related to https://github.com/apple/swift/pull/12938 and the idea is
to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake.

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

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

6 years ago[CodeGen] Print register names in lowercase in both MIR and debug output
Francis Visoiu Mistrih [Tue, 28 Nov 2017 17:15:09 +0000 (17:15 +0000)]
[CodeGen] Print register names in lowercase in both MIR and debug output

As part of the unification of the debug format and the MIR format,
always print registers as lowercase.

* Only debug printing is affected. It now follows MIR.

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

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

6 years ago[WebAssembly] Support bitcasted function addresses with varargs.
Dan Gohman [Tue, 28 Nov 2017 17:15:03 +0000 (17:15 +0000)]
[WebAssembly] Support bitcasted function addresses with varargs.

Generalize FixFunctionBitcasts to handle varargs functions. This in
particular fixes the case where clang bitcasts away a varargs when
calling a K&R-style function.

This avoids interacting with tricky ABI details because it operates
at the LLVM IR level before varargs ABI details are exposed.

This fixes PR35385.

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

6 years agoDAG: Legalize truncstores to illegal int types
Matt Arsenault [Tue, 28 Nov 2017 17:11:30 +0000 (17:11 +0000)]
DAG: Legalize truncstores to illegal int types

Truncate to a legal int type, and produce a new
truncstore from a narrower type.

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

6 years ago[X86][X87] Tag FTST x87 instruction scheduler class
Simon Pilgrim [Tue, 28 Nov 2017 16:57:20 +0000 (16:57 +0000)]
[X86][X87] Tag FTST x87 instruction scheduler class

Looking through Agner, FTST is very similar to generic float compare behaviour, so I've added them to the existing IIC_FCOMI (WriteFAdd) tags.

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

6 years ago[InstCombine] add tests from D39421 to show current transforms; NFC
Sanjay Patel [Tue, 28 Nov 2017 16:40:30 +0000 (16:40 +0000)]
[InstCombine] add tests from D39421 to show current transforms; NFC

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

6 years ago[Support] Add unit test for printLowerCase
Francis Visoiu Mistrih [Tue, 28 Nov 2017 16:11:56 +0000 (16:11 +0000)]
[Support] Add unit test for printLowerCase

Add test case for the function added in r319171.

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

6 years ago[cmake] Remove redundant call to cmake when building host tools.
Don Hinton [Tue, 28 Nov 2017 16:08:57 +0000 (16:08 +0000)]
[cmake] Remove redundant call to cmake when building host tools.

Summary:
Remove the redundant, config-time call to cmake when
building host tools for cross compiles or optimized tablegen..

The config-time call to cmake is redundant because it will always get
called again when the CONFIGURE_LLVM_${target_name} target fires at
build-time.  This speeds up initial configuration, but has no affect
on build behavior.

Reviewers: beanz

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

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

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

6 years ago[X86][X87] Tag FABS/FCHS/FSQRT/FSIN/FCOS x87 instruction scheduler classes
Simon Pilgrim [Tue, 28 Nov 2017 15:03:42 +0000 (15:03 +0000)]
[X86][X87] Tag FABS/FCHS/FSQRT/FSIN/FCOS x87 instruction scheduler classes

Atom's FABS/FCHS/FSQRT latencies taken from Agner.

Note: I just added FSIN and FCOS to the existing IIC_FSINCOS itinerary, which is actually a more costly instruction.

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

6 years agoUse getStoreSize() in various places instead of 'BitSize >> 3'.
Jonas Paulsson [Tue, 28 Nov 2017 14:44:32 +0000 (14:44 +0000)]
Use getStoreSize() in various places instead of 'BitSize >> 3'.

This is needed for cases when the memory access is not as big as the width of
the data type. For instance, storing i1 (1 bit) would be done in a byte (8
bits).

Using 'BitSize >> 3' (or '/ 8') would e.g. give the memory access of an i1 a
size of 0, which for instance makes alias analysis return NoAlias even when
it shouldn't.

There are no tests as this was done as a follow-up to the bugfix for the case
where this was discovered (r318824). This handles more similar cases.

Review: Björn Petterson
https://reviews.llvm.org/D40339

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

6 years ago[X86][X86] Add some x87 schedule tests
Simon Pilgrim [Tue, 28 Nov 2017 14:35:52 +0000 (14:35 +0000)]
[X86][X86] Add some x87 schedule tests

Still missing some instructions: mainly loads/stores/system ops, all flagged as TODO.

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

6 years ago[Support] Merge toLower / toUpper implementations
Francis Visoiu Mistrih [Tue, 28 Nov 2017 14:22:27 +0000 (14:22 +0000)]
[Support] Merge toLower / toUpper implementations

Merge the ones from StringRef and StringExtras.

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

6 years ago[CodeGen] Rename functions PrintReg* to printReg*
Francis Visoiu Mistrih [Tue, 28 Nov 2017 12:42:37 +0000 (12:42 +0000)]
[CodeGen] Rename functions PrintReg* to printReg*

LLVM Coding Standards:
  Function names should be verb phrases (as they represent actions), and
  command-like function should be imperative. The name should be camel
  case, and start with a lower case letter (e.g. openFile() or isFoo()).

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

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

6 years ago[X86][3DNow] Add instruction itinerary and scheduling classes for femms/prefetch...
Simon Pilgrim [Tue, 28 Nov 2017 12:37:35 +0000 (12:37 +0000)]
[X86][3DNow] Add instruction itinerary and scheduling classes for femms/prefetch/prefetchw

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

6 years ago[ARM][AArch64] Workaround ARM/AArch64 peculiarity in clearing icache.
Peter Smith [Tue, 28 Nov 2017 12:34:05 +0000 (12:34 +0000)]
[ARM][AArch64] Workaround ARM/AArch64 peculiarity in clearing icache.

Certain ARM implementations treat icache clear instruction as a memory read,
and CPU segfaults on trying to clear cache on !PROT_READ page.
We workaround this in Memory::protectMappedMemory by adding
PROT_READ to affected pages, clearing the cache, and then setting
desired protection.

This fixes "AllocationTests/MappedMemoryTest.***/3" unit-tests on
affected hardware.

Reviewers: psmith, zatrazz, kristof.beyls, lhames

Reviewed By: lhames

Subscribers: llvm-commits, krytarowski, peter.smith, jgreenhalgh, aemerson,
             rengolin

Patch by maxim-kuvrykov!

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

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

6 years agoAdd a new pass to speculate around PHI nodes with constant (integer) operands when...
Chandler Carruth [Tue, 28 Nov 2017 11:32:31 +0000 (11:32 +0000)]
Add a new pass to speculate around PHI nodes with constant (integer) operands when profitable.

The core idea is to (re-)introduce some redundancies where their cost is
hidden by the cost of materializing immediates for constant operands of
PHI nodes. When the cost of the redundancies is covered by this,
avoiding materializing the immediate has numerous benefits:
1) Less register pressure
2) Potential for further folding / combining
3) Potential for more efficient instructions due to immediate operand

As a motivating example, consider the remarkably different cost on x86
of a SHL instruction with an immediate operand versus a register
operand.

This pattern turns up surprisingly frequently, but is somewhat rarely
obvious as a significant performance problem.

The pass is entirely target independent, but it does rely on the target
cost model in TTI to decide when to speculate things around the PHI
node. I've included x86-focused tests, but any target that sets up its
immediate cost model should benefit from this pass.

There is probably more that can be done in this space, but the pass
as-is is enough to get some important performance on our internal
benchmarks, and should be generally performance neutral, but help with
more extensive benchmarking is always welcome.

One awkward part is that this pass has to be scheduled after
*everything* that can eliminate these kinds of redundancies. This
includes SimplifyCFG, GVN, etc. I'm open to suggestions about better
places to put this. We could in theory make it part of the codegen pass
pipeline, but there doesn't really seem to be a good reason for that --
it isn't "lowering" in any sense and only relies on pretty standard cost
model based TTI queries, so it seems to fit well with the "optimization"
pipeline model. Still, further thoughts on the pipeline position are
welcome.

I've also only implemented this in the new pass manager. If folks are
very interested, I can try to add it to the old PM as well, but I didn't
really see much point (my use case is already switched over to the new
PM).

I've tested this pretty heavily without issue. A wide range of
benchmarks internally show no change outside the noise, and I don't see
any significant changes in SPEC either. However, the size class
computation in tcmalloc is substantially improved by this, which turns
into a 2% to 4% win on the hottest path through tcmalloc for us, so
there are definitely important cases where this is going to make
a substantial difference.

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

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

6 years ago[TailRecursionElimination] Skip debug intrinsics.
Florian Hahn [Tue, 28 Nov 2017 09:32:25 +0000 (09:32 +0000)]
[TailRecursionElimination] Skip debug intrinsics.

Summary:
I think we do not need to analyze debug intrinsics here, as they should
not impact codegen. This has 2 benefits: 1) slightly less work to do and
2) avoiding generating optimization remarks for converting calls to
debug intrinsics to tail calls, which are not really helpful for users.

Based on work by Sander de Smalen.

Reviewers: davide, trentxintong, aprantl

Reviewed By: aprantl

Subscribers: llvm-commits, JDevlieghere

Tags: #debug-info

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

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

6 years agoAMDGPU: Re-organize the outer loop of SILoadStoreOptimizer
Nicolai Haehnle [Tue, 28 Nov 2017 08:42:46 +0000 (08:42 +0000)]
AMDGPU: Re-organize the outer loop of SILoadStoreOptimizer

Summary:
The entire algorithm operates per basic-block, so for cache locality
it should be better to re-optimize a basic-block immediately rather than
in a separate loop.

I don't have performance measurements.

Change-Id: I85106570bd623c4ff277faaa50ee43258e1ddcc5

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

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

6 years agoAMDGPU: Consistently check for immediates in SIInstrInfo::FoldImmediate
Nicolai Haehnle [Tue, 28 Nov 2017 08:41:50 +0000 (08:41 +0000)]
AMDGPU: Consistently check for immediates in SIInstrInfo::FoldImmediate

Summary:
The PeepholeOptimizer pass calls this function solely based on checking
DefMI->isMoveImmediate(), which only checks the MoveImm bit of the
instruction description. So it's up to FoldImmediate itself to properly
check that DefMI *actually* moves from an immediate.

I don't have a separate test case for this, but the next patch introduces
a test case which happens to crash without this change.

This error is caught by the assertion in MachineOperand::getImm().

Change-Id: I88e7cdbcf54d75e1a296822e6fe5f9a5f095bbf8

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years ago[SCEV][NFC] More efficient caching in CompareValueComplexity
Max Kazantsev [Tue, 28 Nov 2017 08:26:43 +0000 (08:26 +0000)]
[SCEV][NFC] More efficient caching in CompareValueComplexity

Currently, we use a set of pairs to cache responces like `CompareValueComplexity(X, Y) == 0`. If we had
proved that `CompareValueComplexity(S1, S2) == 0` and `CompareValueComplexity(S2, S3) == 0`,
this cache does not allow us to prove that `CompareValueComplexity(S1, S3)` is also `0`.

This patch replaces this set with `EquivalenceClasses` that merges Values into equivalence sets so that
any two values from the same set are equal from point of `CompareValueComplexity`. This, in particular,
allows us to prove the fact from example above.

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

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

6 years ago[COFF] Implement constructor priorities
Martin Storsjo [Tue, 28 Nov 2017 08:07:18 +0000 (08:07 +0000)]
[COFF] Implement constructor priorities

The priorities in the section name suffixes are zero padded,
allowing the linker to just do a lexical sort.

Add zero padding for .ctors sections in ELF as well.

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

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

6 years ago[SCEV][NFC] More efficient caching in CompareSCEVComplexity
Max Kazantsev [Tue, 28 Nov 2017 07:48:12 +0000 (07:48 +0000)]
[SCEV][NFC] More efficient caching in CompareSCEVComplexity

Currently, we use a set of pairs to cache responces like `CompareSCEVComplexity(X, Y) == 0`. If we had
proved that `CompareSCEVComplexity(S1, S2) == 0` and `CompareSCEVComplexity(S2, S3) == 0`,
this cache does not allow us to prove that `CompareSCEVComplexity(S1, S3)` is also `0`.

This patch replaces this set with `EquivalenceClasses` any two values from the same set are equal from
point of `CompareSCEVComplexity`. This, in particular, allows us to prove the fact from example above.

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

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

6 years ago[GVN] Prevent ScalarPRE from hoisting across instructions that don't pass control...
Max Kazantsev [Tue, 28 Nov 2017 07:07:55 +0000 (07:07 +0000)]
[GVN] Prevent ScalarPRE from hoisting across instructions that don't pass control flow to successors

This is to address a problem similar to those in D37460 for Scalar PRE. We should not
PRE across an instruction that may not pass execution to its successor unless it is safe
to speculatively execute it.

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

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

6 years agoRevert "Add opt-viewer testing"
Adam Nemet [Tue, 28 Nov 2017 06:22:29 +0000 (06:22 +0000)]
Revert "Add opt-viewer testing"

This reverts commit r319073.

Bot fails with a mismatch that looks like pygments-generated HTML.

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

6 years ago[WebAssembly] Handle errors better in fast-isel.
Dan Gohman [Tue, 28 Nov 2017 05:36:42 +0000 (05:36 +0000)]
[WebAssembly] Handle errors better in fast-isel.

Fast-isel routines need to bail out in the case that fast-isel
fails on the operands.

This fixes https://bugs.llvm.org/show_bug.cgi?id=35064

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

6 years ago[X86] Remove some unused pattern fragments from td file. NFC
Craig Topper [Tue, 28 Nov 2017 05:23:57 +0000 (05:23 +0000)]
[X86] Remove some unused pattern fragments from td file. NFC

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

6 years ago[DAGCombine] Disable finding better chains for stores at O0
Simon Dardis [Tue, 28 Nov 2017 04:07:59 +0000 (04:07 +0000)]
[DAGCombine] Disable finding better chains for stores at O0

Unoptimized IR can have linear sequences of stores to an array, where the
initial GEP for the first store is formed from the pointer to the array, and the
GEP for each store after the first is formed from the previous GEP with some
offset in an inductive fashion.

The (large) resulting DAG when analyzed by DAGCombine undergoes an excessive
number of combines as each store node is examined every time its' offset node
is combined with any child of the offset. One of the transformations is
findBetterNeighborChains which assists MergeConsecutiveStores. The former
relies on repeated chain walking to do its' work, however MergeConsecutiveStores
is disabled at O0 which makes the transformation redundant.

Any optimization level other than O0 would invoke InstCombine which would
resolve the chain of GEPs into flat base + offset GEP for each store which
does not exhibit the repeated examination of each store to the array.

Disabling this optimization fixes an excessive compile time issue (30~ minutes
for the test case provided) at O0.

Reviewers: niravd, craig.topper, t.p.northover

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

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

6 years agoMachineVerifier: Improve register operand checks
Matthias Braun [Tue, 28 Nov 2017 03:54:20 +0000 (03:54 +0000)]
MachineVerifier: Improve register operand checks

This fixes cases where we wouldn't perform various register operand
checks just because we didn't happen to have a definition in the
MCInstrDesc. This changes the code to only skip the tests that actually
depend on the MCInstrDesc definition.

This makes the machine verifier spot the problem from
https://llvm.org/PR33071 after the pass that actually caused it.

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

6 years agoMachineVerifier: Improve PHI operand checking
Matthias Braun [Tue, 28 Nov 2017 03:54:19 +0000 (03:54 +0000)]
MachineVerifier: Improve PHI operand checking

Additional checks for phi operands:
- first operand should be a virtual register def. It should not be
  tied, implicit, internalread, earlyclobber or a read.
- The other operands should be register/mbb operands next to each other
- The register operands should not be implicit, internalread,
  earlyclobber, debug or tied.
- We can perform most of the PHI checks even for unreachable blocks.

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

6 years agolit: Bring back -Dtool=xxx feature lost in r313928
Matthias Braun [Tue, 28 Nov 2017 03:23:07 +0000 (03:23 +0000)]
lit: Bring back -Dtool=xxx feature lost in r313928

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

6 years agoUse FILE_FLAG_DELETE_ON_CLOSE for TempFile on windows.
Rafael Espindola [Tue, 28 Nov 2017 01:41:22 +0000 (01:41 +0000)]
Use FILE_FLAG_DELETE_ON_CLOSE for TempFile on windows.

We won't see the temp file no more.

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

6 years ago[X86] Make zero extend from v16i1/v8i1 to v16i8/v8i16/v16i16 not scalarize under...
Craig Topper [Tue, 28 Nov 2017 01:36:33 +0000 (01:36 +0000)]
[X86] Make zero extend from v16i1/v8i1 to v16i8/v8i16/v16i16 not scalarize under AVX512.

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

6 years ago[X86] Add command line without AVX512BW/AVX512VL to bitcast-int-to-vector-bool-zext.ll.
Craig Topper [Tue, 28 Nov 2017 01:36:31 +0000 (01:36 +0000)]
[X86] Add command line without AVX512BW/AVX512VL to bitcast-int-to-vector-bool-zext.ll.

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

6 years agoMove code. NFC.
Rafael Espindola [Tue, 28 Nov 2017 01:34:20 +0000 (01:34 +0000)]
Move code. NFC.

This moves the TempFile implementation so that it can use system
specific code.

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

6 years agoReland r319090, "COFF: Do not create SectionChunks for discarded comdat sections...
Peter Collingbourne [Tue, 28 Nov 2017 01:30:07 +0000 (01:30 +0000)]
Reland r319090, "COFF: Do not create SectionChunks for discarded comdat sections." with a fix for debug sections.

If /debug was not specified, readSection will return a null
pointer for debug sections. If the debug section is associative with
another section, we need to make sure that the section returned from
readSection is not a null pointer before adding it as an associative
section.

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

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

6 years agoThis reverts commit r319096 and r319097.
Rafael Espindola [Tue, 28 Nov 2017 01:25:38 +0000 (01:25 +0000)]
This reverts commit r319096 and r319097.

Revert "[SROA] Propagate !range metadata when moving loads."
Revert "[Mem2Reg] Clang-format unformatted parts of this file. NFCI."

Davide says they broke a bot.

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

6 years agoARM: Fix PR32578
Matthias Braun [Tue, 28 Nov 2017 01:17:52 +0000 (01:17 +0000)]
ARM: Fix PR32578

https://llvm.org/PR32578

I simplified and converted the reproducer into a lit test.

Patch by Vedant Kumar!

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

6 years ago[WebAssembly] Fix trapping behavior in fptosi/fptoui.
Dan Gohman [Tue, 28 Nov 2017 01:13:40 +0000 (01:13 +0000)]
[WebAssembly] Fix trapping behavior in fptosi/fptoui.

This adds code to protect WebAssembly's `trunc_s` family of opcodes
from values outside their domain. Even though such conversions have
full undefined behavior in C/C++, LLVM IR's `fptosi` and `fptoui` do
not, and only return undef.

This also implements the proposed non-trapping float-to-int conversion
feature and uses that instead when available.

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

6 years agoSROA: Avoid creating a fragment expression that covers the entire variable.
Adrian Prantl [Tue, 28 Nov 2017 00:57:53 +0000 (00:57 +0000)]
SROA: Avoid creating a fragment expression that covers the entire variable.

Fixes PR35416.

https://bugs.llvm.org/show_bug.cgi?id=35416

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

6 years agoMove getVariableSize from Verifier.cpp into DIVariable::getSize() (NFC)
Adrian Prantl [Tue, 28 Nov 2017 00:57:51 +0000 (00:57 +0000)]
Move getVariableSize from Verifier.cpp into DIVariable::getSize() (NFC)

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

6 years ago[X86] Remove unnecessary fp<->int setOperationAction lines from a hasVLX block. NFCI
Craig Topper [Tue, 28 Nov 2017 00:41:12 +0000 (00:41 +0000)]
[X86] Remove unnecessary fp<->int setOperationAction lines from a hasVLX block. NFCI

These lines all exist identically either under SSE2, AVX2 or AVX512. Given that VLX implies all of those, these aren't providing anything new.

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

6 years ago[X86] Remove duplicate calls to setOperationAction. NFCI
Craig Topper [Tue, 28 Nov 2017 00:16:42 +0000 (00:16 +0000)]
[X86] Remove duplicate calls to setOperationAction. NFCI

These same calls exist a few lines down.

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

6 years agoAdd an F_Delete flag.
Rafael Espindola [Tue, 28 Nov 2017 00:12:44 +0000 (00:12 +0000)]
Add an F_Delete flag.

For now this only changes the handle Access.

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

6 years ago[DAGCombiner] Don't combine aext(setcc) if the setcc is already using the target...
Craig Topper [Mon, 27 Nov 2017 23:51:40 +0000 (23:51 +0000)]
[DAGCombiner] Don't combine aext(setcc) if the setcc is already using the target's preferred result type.

With AVX512 vXi1 types are legal so we shouldn't be extending them.

This change is similar to existing code in the zext(setcc) combine.

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

6 years ago[DAGCombiner] Use EVT::changeVectorElementTypeToInteger() instead of implementing...
Craig Topper [Mon, 27 Nov 2017 23:51:31 +0000 (23:51 +0000)]
[DAGCombiner] Use EVT::changeVectorElementTypeToInteger() instead of implementing manually.

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