OSDN Git Service

android-x86/external-llvm.git
6 years ago[DAGCombiner] When folding fold (sext/zext (and/or/xor (sextload/zextload x), cst...
Craig Topper [Sat, 3 Feb 2018 23:00:31 +0000 (23:00 +0000)]
[DAGCombiner] When folding fold (sext/zext (and/or/xor (sextload/zextload x), cst)) -> (and/or/xor (sextload/zextload x), (sext/zext cst)) make sure we check the legality of the full extended load.

Summary:
If the load is already an extended load we should be using the memory VT for the legality check, not just the VT of the current extension.

I don't have a test case, just noticed it while investigating some load extension improvements.

Reviewers: RKSimon, spatel, niravd

Reviewed By: niravd

Subscribers: llvm-commits

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

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

6 years ago[MIPS] Regenerate vector tests with update script
Simon Pilgrim [Sat, 3 Feb 2018 22:11:22 +0000 (22:11 +0000)]
[MIPS] Regenerate vector tests with update script

Hopefully help make this a lot more maintainable

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

6 years ago[SelectionDAG] Don't use simple VT in generic shuffle code
Simon Pilgrim [Sat, 3 Feb 2018 21:34:42 +0000 (21:34 +0000)]
[SelectionDAG] Don't use simple VT in generic shuffle code

Better to assume that any value type may be commuted, not just MVTs.

No test case right now, but discovered while investigating possible shuffle combines.

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

6 years ago[X86][SSE] Don't chain shuffles together in schedule tests
Simon Pilgrim [Sat, 3 Feb 2018 21:20:19 +0000 (21:20 +0000)]
[X86][SSE] Don't chain shuffles together in schedule tests

This is necessary to prevent the shuffles from being combined/simplified in an upcoming patch.

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

6 years ago[X86] Remove and autoupgrade kand/kandn/kor/kxor/kxnor/knot intrinsics.
Craig Topper [Sat, 3 Feb 2018 20:18:25 +0000 (20:18 +0000)]
[X86] Remove and autoupgrade kand/kandn/kor/kxor/kxnor/knot intrinsics.

Clang already stopped using these a couple months ago.

The test cases aren't great as there is nothing forcing the operations to stay in k-registers so some of them moved back to scalar ops due to the bitcasts being moved around.

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

6 years agoRemove unneeded -debug argument from new test
David Green [Sat, 3 Feb 2018 17:33:50 +0000 (17:33 +0000)]
Remove unneeded -debug argument from new test

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

6 years ago[ORC] Rename NullResolver to NullLegacyResolver.
Lang Hames [Sat, 3 Feb 2018 16:52:48 +0000 (16:52 +0000)]
[ORC] Rename NullResolver to NullLegacyResolver.

This resolver conforms to the LegacyJITSymbolResolver interface, and will be
replaced with a null-returning resolver conforming to the newer
orc::SymbolResolver interface in the near future. This patch renames the class
to avoid a clash.

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

6 years ago[InstCombine] Allow common type conversions to i8/i16/i32
David Green [Sat, 3 Feb 2018 16:51:03 +0000 (16:51 +0000)]
[InstCombine] Allow common type conversions to i8/i16/i32

This, in instcombine, allows conversions to i8/i16/i32 (very
common cases) even if the resulting type is not legal according
to the data layout. This can often open up extra combine
opportunities.

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

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

6 years ago[RISCV] Update two RISCV codegen tests after rL323991
Alex Bradbury [Sat, 3 Feb 2018 13:02:30 +0000 (13:02 +0000)]
[RISCV] Update two RISCV codegen tests after rL323991

From the discussion in D41835 it looks possible the change will be backed out,
but for now let's fix the RISCV tests.

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

6 years agoFix MSVC signed/unsigned comparison warning. NFCI.
Simon Pilgrim [Sat, 3 Feb 2018 12:38:56 +0000 (12:38 +0000)]
Fix MSVC signed/unsigned comparison warning. NFCI.

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

6 years agoFix incorrect usage of std::is_assignable.
Richard Smith [Fri, 2 Feb 2018 22:29:54 +0000 (22:29 +0000)]
Fix incorrect usage of std::is_assignable.

We want to check that we can assign to an lvalue here, not a prvalue.

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

6 years ago[InstCombine] Use getDestAlignment in SimplifyMemSet (NFC)
Daniel Neilson [Fri, 2 Feb 2018 22:03:03 +0000 (22:03 +0000)]
[InstCombine] Use getDestAlignment in SimplifyMemSet (NFC)

Summary:
Small NFC change to change the name of the function used getting and setting
the alignment of a memset.

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

6 years ago[X86] Prefer to create a ISD::SETCC over X86ISD::PCMPEQ in combineVectorSizedSetCCEqu...
Craig Topper [Fri, 2 Feb 2018 21:59:46 +0000 (21:59 +0000)]
[X86] Prefer to create a ISD::SETCC over X86ISD::PCMPEQ in combineVectorSizedSetCCEquality.

This is running pre-legalize, we should try to use target independent nodes. This will give the best opportunity for target independent optimizations.

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

6 years ago[InstCombine] make sure tests are providing coverage for the stated pattern; NFC
Sanjay Patel [Fri, 2 Feb 2018 21:40:54 +0000 (21:40 +0000)]
[InstCombine] make sure tests are providing coverage for the stated pattern; NFC

Without extra instructions and uses, swapMayExposeCSEOpportunities() would change
the icmp (as seen in the check lines), so we were not actually testing patterns
that should be handled by D41480.

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

6 years ago[X86] Pass SDLoc by const reference in a few more places in X86ISelLowering.cpp. NFC
Craig Topper [Fri, 2 Feb 2018 20:32:00 +0000 (20:32 +0000)]
[X86] Pass SDLoc by const reference in a few more places in X86ISelLowering.cpp. NFC

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

6 years ago[X86] Add avx512 command line to ptest.ll to demonstrate that 512-bit vectors are...
Craig Topper [Fri, 2 Feb 2018 20:12:45 +0000 (20:12 +0000)]
[X86] Add avx512 command line to ptest.ll to demonstrate that 512-bit vectors are not handled by LowerVectorAllZeroTest.

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

6 years agoPartially revert r324124 [X86] Add tests for missed opportunities to use ptest for...
Craig Topper [Fri, 2 Feb 2018 20:12:44 +0000 (20:12 +0000)]
Partially revert r324124 [X86] Add tests for missed opportunities to use ptest for all ones comparison.

Turns out I misunderstood the flag behavior of PTEST because I read the documentation for KORTEST which is different than PTEST/KTEST and made a bad assumption.

Keep the test rename though cause that's useful.

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

6 years ago[GISel][NFC]: Move RegisterBankInfo::getSizeInBits into TargetRegisterInfo.
Aditya Nandakumar [Fri, 2 Feb 2018 19:42:07 +0000 (19:42 +0000)]
[GISel][NFC]: Move RegisterBankInfo::getSizeInBits into TargetRegisterInfo.

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

6 years ago[X86] Add tests for missed opportunities to use ptest for all ones comparison.
Craig Topper [Fri, 2 Feb 2018 19:34:10 +0000 (19:34 +0000)]
[X86] Add tests for missed opportunities to use ptest for all ones comparison.

Also rename the test from pr12312.ll to ptest.ll so its more recognizable.

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

6 years agoFix typo
Alex Denisov [Fri, 2 Feb 2018 19:20:37 +0000 (19:20 +0000)]
Fix typo

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

6 years ago[InstCombine] simplify logic for swapMayExposeCSEOpportunities; NFCI
Sanjay Patel [Fri, 2 Feb 2018 19:08:12 +0000 (19:08 +0000)]
[InstCombine] simplify logic for swapMayExposeCSEOpportunities; NFCI

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

6 years ago[InstCombine] fix typos, formatting; NFC
Sanjay Patel [Fri, 2 Feb 2018 18:39:05 +0000 (18:39 +0000)]
[InstCombine] fix typos, formatting; NFC

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

6 years ago[AArch64][GlobalISel] Use getRegClassForTypeOnBank() in selectCopy.
Amara Emerson [Fri, 2 Feb 2018 18:03:30 +0000 (18:03 +0000)]
[AArch64][GlobalISel] Use getRegClassForTypeOnBank() in selectCopy.

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

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

6 years ago[InstCombine] add baseline tests for unsigned saturated sub (D41480); NFC
Sanjay Patel [Fri, 2 Feb 2018 17:43:16 +0000 (17:43 +0000)]
[InstCombine] add baseline tests for unsigned saturated sub (D41480); NFC

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

6 years ago[X86] Remove checks for FeatureAVX512 from the X86 assembly parser. Remove mcpu/mattr...
Craig Topper [Fri, 2 Feb 2018 17:02:58 +0000 (17:02 +0000)]
[X86] Remove checks for FeatureAVX512 from the X86 assembly parser. Remove mcpu/mattr from assembly test command lines.

Summary:
We should always be able to accept AVX512 registers and instructions in llvm-mc. The only subtarget mode that should be checked is 16-bit vs 32-bit vs 64-bit mode.

I've also removed all the mattr/mcpu lines from test RUN lines to be consistent with this. Most were due to AVX512, but a few were for other features.

Fixes PR36202

Reviewers: RKSimon, echristo, bkramer

Reviewed By: echristo

Subscribers: llvm-commits

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

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

6 years agoMake utils/UpdateTestChecks/common.py Python 2/3 compatible and fix print statements.
Fangrui Song [Fri, 2 Feb 2018 16:41:07 +0000 (16:41 +0000)]
Make utils/UpdateTestChecks/common.py Python 2/3 compatible and fix print statements.

Subscribers: llvm-commits

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

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

6 years ago[AMDGPU] Switch to the new addr space mapping by default
Yaxun Liu [Fri, 2 Feb 2018 16:07:16 +0000 (16:07 +0000)]
[AMDGPU] Switch to the new addr space mapping by default

This requires corresponding clang change.

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

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

6 years agoAdd llc tests for comparison chains.
Clement Courbet [Fri, 2 Feb 2018 15:54:17 +0000 (15:54 +0000)]
Add llc tests for comparison chains.

See https://reviews.llvm.org/D42793#996098 for context.

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

6 years agoFix type sizes that were causing incorrect string formatting
James Henderson [Fri, 2 Feb 2018 15:09:31 +0000 (15:09 +0000)]
Fix type sizes that were causing incorrect string formatting

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

6 years ago[ThinLTO] - Add comment. NFC.
George Rimar [Fri, 2 Feb 2018 15:06:09 +0000 (15:06 +0000)]
[ThinLTO] - Add comment. NFC.

Was requested during review of D42798.

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

6 years ago[X86][SSE] Force double domain for SHUFPD stack folding tests
Simon Pilgrim [Fri, 2 Feb 2018 14:55:20 +0000 (14:55 +0000)]
[X86][SSE] Force double domain for SHUFPD stack folding tests

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

6 years ago[Analysis] Support aggregate access types in TBAA
Ivan A. Kosarev [Fri, 2 Feb 2018 14:09:22 +0000 (14:09 +0000)]
[Analysis] Support aggregate access types in TBAA

This patch implements analysis for new-format TBAA access tags
with aggregate types as their final access types.

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

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

6 years agoAdd missing new files from r324077
James Henderson [Fri, 2 Feb 2018 12:45:57 +0000 (12:45 +0000)]
Add missing new files from r324077

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

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

6 years ago[DWARF v5] Add limited support for dumping .debug_rnglists
James Henderson [Fri, 2 Feb 2018 12:35:52 +0000 (12:35 +0000)]
[DWARF v5] Add limited support for dumping .debug_rnglists

This change adds support to llvm-dwarfdump for dumping DWARF5
.debug_rnglists sections in regular ELF files.

It is not complete, in that several DW_RLE_* encodings are currently
not supported, but does dump the headert and the basic ranges for
DW_RLE_start_length and DW_RLE_start_end encodings.

Obvious next steps are to add verbose dumping that dumps the raw
encodings, rather than the interpreted contents, to add -verify support
of the section (e.g. to show that the correct number of offsets are
specified), add dumping of .debug_rnglists.dwo, and to add support for
other encodings.

Reviewed by: dblaikie, JDevlieghere

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

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

6 years ago[LTO] - Simplify. NFC.
George Rimar [Fri, 2 Feb 2018 12:21:26 +0000 (12:21 +0000)]
[LTO] - Simplify. NFC.

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

6 years ago[ThinLTO] - Fix for "ThinLTO inlines variables that should be discarded".
George Rimar [Fri, 2 Feb 2018 12:17:33 +0000 (12:17 +0000)]
[ThinLTO] - Fix for "ThinLTO inlines variables that should be discarded".

This fixes PR36187.

Patch teaches ThinLTO to drop non-prevailing variables,
just like we recently did for functions (in r323633).

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

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

6 years ago[ARM] fixed some tabs/whitespaces in test. NFC.
Sjoerd Meijer [Fri, 2 Feb 2018 11:51:06 +0000 (11:51 +0000)]
[ARM] fixed some tabs/whitespaces in test. NFC.

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

6 years ago[GlobalOpt] Include padding in debug fragments
Mikael Holmen [Fri, 2 Feb 2018 10:34:13 +0000 (10:34 +0000)]
[GlobalOpt] Include padding in debug fragments

Summary:
When creating the debug fragments for a SRA'd variable, use the types'
allocation sizes. This fixes issues where the pass would emit too small
fragments, placed at the wrong offset, for padded types.

An example of this is long double on x86. The type is represented using
x86_fp80, which is 10 bytes, but the value is aligned to 12/16 bytes.
The padding is included in the type's DW_AT_byte_size attribute;
therefore, the fragments should also include that. Newer GCC releases
(I tested 7.2.0) emit 12/16-byte pieces for long double. Earlier
releases, e.g. GCC 5.5.0, behaved as LLVM did, i.e. by emitting a
10-byte piece, followed by an empty 2/6-byte piece for the padding.

Failing to cover all `DW_AT_byte_size' bytes of a value with non-empty
pieces results in the value being printed as <optimized out> by GDB.

Patch by: David Stenberg

Reviewers: aprantl, JDevlieghere

Reviewed By: aprantl, JDevlieghere

Subscribers: llvm-commits

Tags: #debug-info

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

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

6 years ago[SelectionDAG] Consider endianness in scalarizeVectorStore().
Jonas Paulsson [Fri, 2 Feb 2018 08:48:02 +0000 (08:48 +0000)]
[SelectionDAG]  Consider endianness in scalarizeVectorStore().

When handling vectors with non byte-sized elements, reverse the order of the
elements in the built integer if the target is Big-Endian.

SystemZ tests updated.

Review: Eli Friedman, Ulrich Weigand.
https://reviews.llvm.org/D42786

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

6 years ago[SelectionDAG] Add an assert in getNode() for EXTRACT_VECTOR_ELT.
Jonas Paulsson [Fri, 2 Feb 2018 08:21:53 +0000 (08:21 +0000)]
[SelectionDAG]  Add an assert in getNode() for EXTRACT_VECTOR_ELT.

When getNode() is called to create an EXTRACT_VECTOR_ELT, assert that
the result VT is at least as wide as the vector element type.

Review: Eli Friedman

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

6 years ago[SystemZ] Update test case (NFC)
Jonas Paulsson [Fri, 2 Feb 2018 07:52:02 +0000 (07:52 +0000)]
[SystemZ]  Update test case (NFC)

test/CodeGen/SystemZ/vec-trunc-to-i1.ll was marked as a temporary
FAIL when it was previously updated when it needed one more COPY.
This was however wrong, since the loop body had been reduced
significantly, and it was actually an improvement.

Review: Ulrich Weigand.

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

6 years ago[RISCV] Add ELFObjectFileBase::getRISCVFeatures let llvm-objdump could get RISCV...
Shiva Chen [Fri, 2 Feb 2018 06:01:02 +0000 (06:01 +0000)]
[RISCV] Add ELFObjectFileBase::getRISCVFeatures let llvm-objdump could get RISCV target feature

llvm-objdump could get C feature by ELF::EF_RISCV_RVC e_flag,
so then we don't have to add -mattr=+c on the command line.

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

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

6 years ago[X86] Legalize (v64i1 (bitcast (i64 X))) on 32-bit targets by extracting 32-bit halve...
Craig Topper [Fri, 2 Feb 2018 05:59:33 +0000 (05:59 +0000)]
[X86] Legalize (v64i1 (bitcast (i64 X))) on 32-bit targets by extracting 32-bit halves from i32, bitcasting each to v32i1, and concatenating.

This prevents the scalarization that would otherwise occur.

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

6 years ago[X86] Legalize (i64 (bitcast (v64i1 X))) on 32-bit targets by extracting to v32i1...
Craig Topper [Fri, 2 Feb 2018 05:59:31 +0000 (05:59 +0000)]
[X86] Legalize (i64 (bitcast (v64i1 X))) on 32-bit targets by extracting to v32i1 and bitcasting to i32.

This saves a trip through memory and seems to open up other combining opportunities.

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

6 years ago[RISCV] Fix c.addi and c.addi16sp immediate constraints which should be non-zero
Shiva Chen [Fri, 2 Feb 2018 02:43:23 +0000 (02:43 +0000)]
[RISCV] Fix c.addi and c.addi16sp immediate constraints which should be non-zero

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

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

6 years ago[RISCV] Define getSetCCResultType for setting vector setCC type
Shiva Chen [Fri, 2 Feb 2018 02:43:18 +0000 (02:43 +0000)]
[RISCV] Define getSetCCResultType for setting vector setCC type

To avoid trigger "No default SetCC type for vectors!" Assertion

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

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

6 years ago[AArch64][GlobalISel] Fix old use of % sigil in test.
Amara Emerson [Fri, 2 Feb 2018 02:14:42 +0000 (02:14 +0000)]
[AArch64][GlobalISel] Fix old use of % sigil in test.

My rebase had missed the new $ sigil we're using.

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

6 years agoFix debug spelling in ResetMachineFunction pass.
Amara Emerson [Fri, 2 Feb 2018 01:49:59 +0000 (01:49 +0000)]
Fix debug spelling in ResetMachineFunction pass.

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

6 years ago[GlobalISel] Constrain the dest reg of IMPLICT_DEF.
Amara Emerson [Fri, 2 Feb 2018 01:44:43 +0000 (01:44 +0000)]
[GlobalISel] Constrain the dest reg of IMPLICT_DEF.

This fixes a crash where the user is a COPY, which deliberately does not
constrain its source operands, resulting in a vreg without a reg class escaping
selection.

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

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

6 years agoRemove non-modular header containing static utility functions
David Blaikie [Fri, 2 Feb 2018 00:33:50 +0000 (00:33 +0000)]
Remove non-modular header containing static utility functions

The one place that uses these functions isn't particularly
long/complicated, so it's easier to just have these inline at that
location than trying to split it out into a true header. (in part also
because of the use of the DEBUG macros, which make this not really a
standalone header even if the static functions were made inline instead)

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

6 years agoAdd missing includes
David Blaikie [Fri, 2 Feb 2018 00:11:09 +0000 (00:11 +0000)]
Add missing includes

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

6 years agoSplitKit: Fix liveness recomputation in some remat cases.
Matthias Braun [Fri, 2 Feb 2018 00:08:19 +0000 (00:08 +0000)]
SplitKit: Fix liveness recomputation in some remat cases.

Example situation:
```
BB0:
  %0 = ...
  use %0
  ; ...
  condjump BB1
  jmp BB2

BB1:
  %0 = ...   ; rematerialized def from above (from earlier split step)
  jmp BB2

BB2:
  ; ...
  use %0
```

%0 will have a live interval with 3 value numbers (for the BB0, BB1 and
BB2 parts). Now SplitKit tries and succeeds in rematerializing the value
number in BB2 (This only works because it is a secondary split so
SplitKit is can trace this back to a single original def).

We need to recompute all live ranges affected by a value number that we
rematerialize. The case that we missed before is that when the value
that is rematerialized is at a join (Phi VNI) then we also have to
recompute liveness for the predecessor VNIs.

rdar://35699130

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

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

6 years agoFix broken builds due to mismatched min/max types
Vlad Tsyrklevich [Fri, 2 Feb 2018 00:07:14 +0000 (00:07 +0000)]
Fix broken builds due to mismatched min/max types

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

6 years ago[cfi-verify] Add blame context printing, and improved print format.
Vlad Tsyrklevich [Thu, 1 Feb 2018 23:45:18 +0000 (23:45 +0000)]
[cfi-verify] Add blame context printing, and improved print format.

Summary:
This update now allows users to specify `--blame-context` and `--blame-context-all` to print source file blame information for the source of the blame.

Also updates the inline printing to correctly identify the top of the inlining stack for blame information.

Patch by Mitch Phillips!

Reviewers: vlad.tsyrklevich

Subscribers: llvm-commits, kcc, pcc

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

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

6 years ago[X86] Separate the call to LowerVectorAllZeroTest from EmitTest. NFCI
Craig Topper [Thu, 1 Feb 2018 23:21:20 +0000 (23:21 +0000)]
[X86] Separate the call to LowerVectorAllZeroTest from EmitTest. NFCI

Every instruction that has the word TEST in its name seems to have been buried into EmitTest. But that code is largely concerned with trying to reuse the flags from instructions that update flags in a pretty normal way.

PTEST/TESTP/KTEST do not update flags in a normal way. They only update Z and C and the C flag update is non-standard. Rather than try to bend EmitTest's already complex logic to accomodate this, just move the call up to LowerSETCC and replicate the few pre-checks that are needed.

While there add a FIXME for using the C flag for checking for all 1s which we definitely couldn't do from EmitTEST.

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

6 years ago[GlobalISel][Legalizer] Relax a legalization loop detecting assert.
Amara Emerson [Thu, 1 Feb 2018 23:10:57 +0000 (23:10 +0000)]
[GlobalISel][Legalizer] Relax a legalization loop detecting assert.

Legalizing vectors may keep the element type the same but change the number of
elements, the assert didn't take this into account.

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

6 years agoFix check-prefixes typo and line endings.
Simon Pilgrim [Thu, 1 Feb 2018 22:32:41 +0000 (22:32 +0000)]
Fix check-prefixes typo and line endings.

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

6 years ago[X86][SSE] Add SSE41 to variable permute tests
Simon Pilgrim [Thu, 1 Feb 2018 22:05:44 +0000 (22:05 +0000)]
[X86][SSE] Add SSE41 to variable permute tests

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

6 years ago[X86][XOP] Add XOP to variable permute tests
Simon Pilgrim [Thu, 1 Feb 2018 21:57:37 +0000 (21:57 +0000)]
[X86][XOP] Add XOP to variable permute tests

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

6 years ago[InstCombine] allow multi-use values in canEvaluate* if all uses are in 1 inst
Sanjay Patel [Thu, 1 Feb 2018 21:55:53 +0000 (21:55 +0000)]
[InstCombine] allow multi-use values in canEvaluate* if all uses are in 1 inst

This is the enhancement suggested in D42536 to fix a shortcoming in
regular InstCombine's canEvaluate* functionality.
When we have multiple uses of a value, but they're all in one instruction, we can
allow that expression to be narrowed or widened for the same cost as a single-use
value.

AFAICT, this can only matter for multiply: sub/and/or/xor/select would be simplified
away if the operands are the same value; add becomes shl; shifts with a variable shift
amount aren't handled.

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

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

6 years ago[PowerPC] Tell VSX swap removal that scalar conversions are lane-sensitive
Nemanja Ivanovic [Thu, 1 Feb 2018 21:09:04 +0000 (21:09 +0000)]
[PowerPC] Tell VSX swap removal that scalar conversions are lane-sensitive

This is a rather non-controversial change. We were missing these instructions
from the list of instructions that are lane-sensitive. These two put the result
into lane 0 (BE) or 3 (LE) regardless of the input. This patch fixes PR36068.

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

6 years agoCoding Standards: Document library layering requirements & header isolation.
David Blaikie [Thu, 1 Feb 2018 21:03:35 +0000 (21:03 +0000)]
Coding Standards: Document library layering requirements & header isolation.

(I suppose these two pieces could be separated - but seemed related
enough)

As discussed on llvm-dev, this documents the general expectation of how
library layering should be handled. There are a few existing cases where
these constraints are not met, but as with most style guide things -
this is forward looking and provides guidance when cleaning up existing
code, it doesn't immediately require that all previous code be cleaned
up to match. (see: naming conventions, etc)

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

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

6 years ago[DAGCombiner] When folding (insert_subvector undef, (bitcast (extract_subvector N1...
Craig Topper [Thu, 1 Feb 2018 20:48:50 +0000 (20:48 +0000)]
[DAGCombiner] When folding (insert_subvector undef, (bitcast (extract_subvector N1, Idx)), Idx) -> (bitcast N1) make sure that N1 has the same total size as the original output

We were only checking the element count, but not the total width. This could cause illegal bitcasts to be created if for example the output was 512-bits, but N1 is 256 bits, and the extraction size was 128-bits.

Fixes PR36199

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

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

6 years ago[GlobalISel] Fix assert failure when legalizing non-power-2 loads.
Amara Emerson [Thu, 1 Feb 2018 20:47:03 +0000 (20:47 +0000)]
[GlobalISel] Fix assert failure when legalizing non-power-2 loads.

Until we support extending loads properly we're going to fall back for these.
We already handle stores in the same way, so this is just being consistent.

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

6 years ago[CodeView] Class record member counts should include base classes and ...
Brock Wyma [Thu, 1 Feb 2018 20:37:38 +0000 (20:37 +0000)]
[CodeView] Class record member counts should include base classes and ...

Increment the field list member count for base classes and virtual base
classes.

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

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

6 years ago[ADT] Replace sys::MemoryFence with standard atomics.
Benjamin Kramer [Thu, 1 Feb 2018 20:28:33 +0000 (20:28 +0000)]
[ADT] Replace sys::MemoryFence with standard atomics.

This is a bit faster in theory, in practice it's cold code that's only
active in !NDEBUG, so it probably doesn't make a difference. This is one
of the last users of our homegrown Atomic.h.

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

6 years ago[AArch64] remove bogus comment; NFC
Sanjay Patel [Thu, 1 Feb 2018 19:59:33 +0000 (19:59 +0000)]
[AArch64] remove bogus comment; NFC

I added this comment with D42323, but as discussed in D42806, the architecture
does the right thing for denorms. We don't even need the select on 0.0 here?

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

6 years agoRemove CallGraphTraits and use equivalent methods in GraphTraits
Easwaran Raman [Thu, 1 Feb 2018 19:40:35 +0000 (19:40 +0000)]
Remove CallGraphTraits and use equivalent methods in GraphTraits

Summary:
D42698 adds child_edge_{begin|end} and children_edges to GraphTraits
which are used here. The reason for this change is to make it easy to
use count propagation on ModulesummaryIndex. As it stands,
CallGraphTraits is in Analysis while ModuleSummaryIndex is in IR.

Reviewers: davidxl, dberlin

Subscribers: llvm-commits

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

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

6 years ago[MachineCopyPropagation] Extend pass to do COPY source forwarding
Geoff Berry [Thu, 1 Feb 2018 18:54:01 +0000 (18:54 +0000)]
[MachineCopyPropagation] Extend pass to do COPY source forwarding

Summary:
This change extends MachineCopyPropagation to do COPY source forwarding
and adds an additional run of the pass to the default pass pipeline just
after register allocation.

This version of this patch uses the newly added
MachineOperand::isRenamable bit to avoid forwarding registers is such a
way as to violate constraints that aren't captured in the
Machine IR (e.g. ABI or ISA constraints).

This change is a continuation of the work started in D30751.

Reviewers: qcolombet, javed.absar, MatzeB, jonpa, tstellar

Subscribers: tpr, mgorny, mcrosier, nhaehnle, nemanjai, jyknight, hfinkel, arsenm, inouehrs, eraman, sdardis, guyblank, fedor.sergeev, aheejin, dschuff, jfb, myatsina, llvm-commits

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

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

6 years ago[GraphTraits] Add support for iterating over children edges.
Easwaran Raman [Thu, 1 Feb 2018 18:53:23 +0000 (18:53 +0000)]
[GraphTraits] Add support for iterating over children edges.

Summary:
This change is mostly adding comments to GraphTraits describing
interfaces to iterate over children edges of a node. These will
have to be implemented by specializations of GraphTraits. The
non-comment change is the addition of children_edges template
function that returns an iterator range.

The motivation for this is to use it in synthetic count propagation
algorithm and remove the CallGraphTraits class that provide similar
interfaces.

Reviewers: dberlin, davidxl

Subscribers: llvm-commits

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

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

6 years agoAMDGPU/SI: Adjust the encoding family for D16 buffer instructions when the target...
Changpeng Fang [Thu, 1 Feb 2018 18:41:33 +0000 (18:41 +0000)]
AMDGPU/SI: Adjust the encoding family for D16 buffer instructions when the target has UnpackedD16VMem feature.

Reviewers:
  Matt and Brian

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

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

6 years ago[X86][SSE] LowerBUILD_VECTORAsVariablePermute - add support for scaling index vectors
Simon Pilgrim [Thu, 1 Feb 2018 18:10:30 +0000 (18:10 +0000)]
[X86][SSE] LowerBUILD_VECTORAsVariablePermute - add support for scaling index vectors

This allows us to use PSHUFB for v8i16/v4i32 and VPERMD/PERMPS for v4i64/v4f64 variable shuffles.

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

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

6 years ago[AArch64] add tests with sqrt estimate and ieee denorms; NFC
Sanjay Patel [Thu, 1 Feb 2018 17:57:45 +0000 (17:57 +0000)]
[AArch64] add tests with sqrt estimate and ieee denorms; NFC

As noted in D42323, we're not checking for denorms as we should.

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

6 years ago[AArch64] auto-generate complete checks; NFC
Sanjay Patel [Thu, 1 Feb 2018 17:44:50 +0000 (17:44 +0000)]
[AArch64] auto-generate complete checks; NFC

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

6 years ago[X86] Remove custom lowering vXi1 extending loads and truncating stores.
Craig Topper [Thu, 1 Feb 2018 17:08:41 +0000 (17:08 +0000)]
[X86] Remove custom lowering vXi1 extending loads and truncating stores.

Summary: Now that v2i1/v4i1 are legal without VLX. And v32i1 is legalized by splitting rather than widening. And isVectorLoadExtDesirable returns false for vXi1. It appears this handling is dead because the operations simply don't exist.

Reviewers: RKSimon, zvi, guyblank, delena, spatel

Reviewed By: delena

Subscribers: llvm-commits, rengolin

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

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

6 years ago[X86] Turn X86ISD::AND nodes that have no flag users back into ISD::AND just before...
Craig Topper [Thu, 1 Feb 2018 17:08:39 +0000 (17:08 +0000)]
[X86] Turn X86ISD::AND nodes that have no flag users back into ISD::AND just before isel to enable test instruction matching

Summary:
EmitTest sometimes creates X86ISD::AND specifically to hide the AND from DAG combine. But this prevents isel patterns that look for (cmp (and X, Y), 0) from being able to see it. So we end up with an AND and a TEST. The TEST gets removed by compare instruction optimization during the peephole pass.

This patch attempts to fix this by converting X86ISD::AND with no flag users back into ISD::AND during the DAG preprocessing just before isel.

In order to do this correctly I had to make the X86ISD::AND node created by EmitTest in this case really have a flag output. Which arguably it should have had anyway so that the number of operands would be consistent for the opcode in all cases. Then I had to modify the ReplaceAllUsesWith to understand that we might be looking at an instruction with 2 outputs. Though in this case there are no uses to replace since we just created the node, but that's what the code did before so I just made it keep working.

Reviewers: spatel, RKSimon, niravd, deadalnix

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years ago[DAGCombiner] filter out denorm inputs when calculating sqrt estimate (PR34994)
Sanjay Patel [Thu, 1 Feb 2018 16:57:18 +0000 (16:57 +0000)]
[DAGCombiner] filter out denorm inputs when calculating sqrt estimate (PR34994)

As shown in the example in PR34994:
https://bugs.llvm.org/show_bug.cgi?id=34994
...we can return a very wrong answer (inf instead of 0.0) for square root when
using a reciprocal square root estimate instruction.

Here, I've conditionalized the filtering out of denorms based on the function
having "denormal-fp-math"="ieee" in its attributes. The other options for this
attribute are 'preserve-sign' and 'positive-zero'.

So we don't generate this extra code by default with just '-ffast-math' (because
then there's no denormal attribute string at all), but it works if you specify
'-ffast-math -fdenormal-fp-math=ieee' from clang.

As noted in the review, there may be other problems in clang that affect the
results depending on platform (Linux x86 at least), but this should allow
creating the desired codegen.

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

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

6 years ago[SelectionDAG] Fix UpdateChains handling of TokenFactors
Nirav Dave [Thu, 1 Feb 2018 16:11:59 +0000 (16:11 +0000)]
[SelectionDAG] Fix UpdateChains handling of TokenFactors

Summary:
In Instruction Selection UpdateChains replaces all matched Nodes'
chain references including interior token factors and deletes them.
This may allow nodes which depend on these interior nodes but are not
part of the set of matched nodes to be left with a dangling dependence.
Avoid this by doing the replacement for matched non-TokenFactor nodes.

Fixes PR36164.

Reviewers: jonpa, RKSimon, bogner

Subscribers: llvm-commits, hiraditya

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

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

6 years ago[X86][SSE] Add PR26491 horizontal add test
Simon Pilgrim [Thu, 1 Feb 2018 15:30:02 +0000 (15:30 +0000)]
[X86][SSE] Add PR26491 horizontal add test

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

6 years ago[X86][AVX512DQ] Add DQ var permute 256 tests as requested on D42487
Simon Pilgrim [Thu, 1 Feb 2018 14:44:50 +0000 (14:44 +0000)]
[X86][AVX512DQ] Add DQ var permute 256 tests as requested on D42487

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

6 years ago[ARM] FullFP16 LowerReturn Fix
Sjoerd Meijer [Thu, 1 Feb 2018 13:48:40 +0000 (13:48 +0000)]
[ARM] FullFP16 LowerReturn Fix

Commit r323512 introduced an optimisation in LowerReturn for half-precision
return values. A missing check caused a crash when the return value is "undef"
(i.e. a node that has no operands).

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

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

6 years agoRevert commit rL323951
David Green [Thu, 1 Feb 2018 13:05:25 +0000 (13:05 +0000)]
Revert commit rL323951

Looks like it's causing timeouts out on at least ppc64le
buildbots.

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

6 years ago[mips] Include EVA instructions in Std2MicroMips mapping tables
Aleksandar Beserminji [Thu, 1 Feb 2018 12:53:26 +0000 (12:53 +0000)]
[mips] Include EVA instructions in Std2MicroMips mapping tables

This patch includes EVA instructions in the Std2MicroMips mapping
tables, which is required for direct object emission.

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

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

6 years ago[AArch64][NFC] Make all ProcResource definitions include their SchedModel.
Clement Courbet [Thu, 1 Feb 2018 12:12:01 +0000 (12:12 +0000)]
[AArch64][NFC] Make all ProcResource definitions include their SchedModel.

This makes targets ExynosM1,ExynosM3,ThunderX2T99 consistent with all
other targets.

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

6 years ago[ARM] Add support for unpredictable MVN instructions.
Yvan Roux [Thu, 1 Feb 2018 12:06:57 +0000 (12:06 +0000)]
[ARM] Add support for unpredictable MVN instructions.

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

Defines bits {19-16} as zero or unpredictable as specified by the ARM ARM in
sections A8.8.116 and A8.8.117.

It fixes also the usage of PC register as destination register for MVN
register-shifted register version as specified in A8.8.117.

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

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

6 years ago[InstCombine] Allow common type conversions to i8/i16/i32
David Green [Thu, 1 Feb 2018 11:06:18 +0000 (11:06 +0000)]
[InstCombine] Allow common type conversions to i8/i16/i32

This, in instcombine, allows conversions to i8/i16/i32 (very
common cases) even if the resulting type is not legal according
to the data layout. This can often open up extra combine
opportunities.

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

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

6 years ago[NFC] 'DWARFv5' -> 'DWARF v5'
Jonas Devlieghere [Thu, 1 Feb 2018 10:19:56 +0000 (10:19 +0000)]
[NFC] 'DWARFv5' -> 'DWARF v5'

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

6 years agoTest commit: Fix a comment.
Yvan Roux [Thu, 1 Feb 2018 08:39:58 +0000 (08:39 +0000)]
Test commit: Fix a comment.

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

6 years ago[LSR] Don't force bases of foldable formulae to the final type.
Mikael Holmen [Thu, 1 Feb 2018 06:38:34 +0000 (06:38 +0000)]
[LSR] Don't force bases of foldable formulae to the final type.

Summary:
Before emitting code for scaled registers, we prevent
SCEVExpander from hoisting any scaled addressing mode
by emitting all the bases first. However, these bases
are being forced to the final type, resulting in some
odd code.

For example, if the type of the base is an integer and
the final type is a pointer, we will emit an inttoptr
for the base, a ptrtoint for the scale, and then a
'reverse' GEP where the GEP pointer is actually the base
integer and the index is the pointer. It's more intuitive
to use the pointer as a pointer and the integer as index.

Patch by: Bevin Hansson

Reviewers: atrick, qcolombet, sanjoy

Reviewed By: qcolombet

Subscribers: llvm-commits

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

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

6 years ago[XRay][compiler-rt+llvm] Update XRay register stashing semantics
Dean Michael Berris [Thu, 1 Feb 2018 02:21:54 +0000 (02:21 +0000)]
[XRay][compiler-rt+llvm] Update XRay register stashing semantics

Summary:
This change expands the amount of registers stashed by the entry and
`__xray_CustomEvent` trampolines.

We've found that since the `__xray_CustomEvent` trampoline calls can show up in
situations where the scratch registers are being used, and since we don't
typically want to affect the code-gen around the disabled
`__xray_customevent(...)` intrinsic calls, that we need to save and restore the
state of even the scratch registers in the handling of these custom events.

Reviewers: pcc, pelikan, dblaikie, eizan, kpw, echristo, chandlerc

Reviewed By: echristo

Subscribers: chandlerc, echristo, hiraditya, davide, dblaikie, llvm-commits

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

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

6 years ago[MC] Fix assembler infinite loop on EH table using LEB padding.
Rafael Espindola [Thu, 1 Feb 2018 00:25:19 +0000 (00:25 +0000)]
[MC] Fix assembler infinite loop on EH table using LEB padding.

Fix the infinite loop reported in PR35809. It can occur with GCC-style
EH table assembly, where the compiler relies on the assembler to
calculate the offsets in the EH table.

Also see https://sourceware.org/bugzilla/show_bug.cgi?id=4029 for the
equivalent issue in the GNU assembler.

Patch by Ryan Prichard!

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

6 years ago[GlobalOpt] Improve common case efficiency of static global initializer evaluation
Amara Emerson [Wed, 31 Jan 2018 23:56:07 +0000 (23:56 +0000)]
[GlobalOpt] Improve common case efficiency of static global initializer evaluation

For very, very large global initializers which can be statically evaluated, the
code would create vectors of temporary Constants, modifying them in place,
before committing the resulting Constant aggregate to the global's initializer
value. This had effectively O(n^2) complexity in the size of the global
initializer and would cause memory and non-termination issues compiling some
workloads.

This change performs the static initializer evaluation and creation in batches,
once for each global in the evaluated IR memory. The existing code is maintained
as a last resort when the initializers are more complex than simple values in a
large aggregate. This should theoretically by NFC, no test as the example case
is massive. The existing test cases pass with this, as well as the llvm test
suite.

To give an example, consider the following C++ code adapted from the clang
regression tests:
struct S {
 int n = 10;
 int m = 2 * n;
 S(int a) : n(a) {}
};

template<typename T>
struct U {
 T *r = &q;
 T q = 42;
 U *p = this;
};

U<S> e;

The global static constructor for 'e' will need to initialize 'r' and 'p' of
the outer struct, while also initializing the inner 'q' structs 'n' and 'm'
members. This batch algorithm will simply use general CommitValueTo() method
to handle the complex nested S struct initialization of 'q', before
processing the outermost members in a single batch. Using CommitValueTo() to
handle member in the outer struct is inefficient when the struct/array is
very large as we end up creating and destroy constant arrays for each
initialization.
For the above case, we expect the following IR to be generated:

%struct.U = type { %struct.S*, %struct.S, %struct.U* }
%struct.S = type { i32, i32 }
@e = global %struct.U { %struct.S* gep inbounds (%struct.U, %struct.U* @e,
                                                 i64 0, i32 1),
                        %struct.S { i32 42, i32 84 }, %struct.U* @e }
The %struct.S { i32 42, i32 84 } inner initializer is treated as a complex
constant expression, while the other two elements of @e are "simple".

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

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

6 years agoDAG: Fix not truncating when promoting bswap/bitreverse
Matt Arsenault [Wed, 31 Jan 2018 23:54:16 +0000 (23:54 +0000)]
DAG: Fix not truncating when promoting bswap/bitreverse

These need to convert back to the original type, like any
other promotion.

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

6 years agoRevert "[ARM] Lower lower saturate to 0 and lower saturate to -1 using bit-operations"
Evgeniy Stepanov [Wed, 31 Jan 2018 22:55:19 +0000 (22:55 +0000)]
Revert "[ARM] Lower lower saturate to 0 and lower saturate to -1 using bit-operations"

Miscompiles code. Testcase pending.

This reverts commit r323869.

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

6 years agoUtils: Fix DomTree update for entry block
Matt Arsenault [Wed, 31 Jan 2018 22:54:37 +0000 (22:54 +0000)]
Utils: Fix DomTree update for entry block

If SplitBlockPredecessors was used on a function entry block,
it wouldn't update the dominator tree.

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

6 years agoAMDGPU: Fix missing SCC def from s_xor_b64_term
Matt Arsenault [Wed, 31 Jan 2018 22:54:27 +0000 (22:54 +0000)]
AMDGPU: Fix missing SCC def from s_xor_b64_term

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

6 years ago[AggressiveInstCombine] Fixed TruncCombine class to handle TruncInst leaf node correctly.
Amjad Aboud [Wed, 31 Jan 2018 22:39:05 +0000 (22:39 +0000)]
[AggressiveInstCombine] Fixed TruncCombine class to handle TruncInst leaf node correctly.
This covers the case where TruncInst leaf node is a constant expression.
See PR36121 for more details.

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

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

6 years ago[X86] Make the type checks in detectAVX512USatPattern more robust
Craig Topper [Wed, 31 Jan 2018 22:26:31 +0000 (22:26 +0000)]
[X86] Make the type checks in detectAVX512USatPattern more robust

This code currently uses isSimple and getSizeInBits in an attempt to prune types. But isSimple will return true for any type that any target supports natively. I don't think that's a good way to prune types. I also don't think the dest element type checks are very robust since we didn't do an isSimple check on the dest type.

This patch adds a check for the input type being legal to the one caller that didn't already check that. Then we explicitly check the element types for the destination are i8, i16, or i32

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

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

6 years ago[llvm-cov] Fix incorrect usage of .precision specifier in format() call.
Max Moroz [Wed, 31 Jan 2018 22:13:07 +0000 (22:13 +0000)]
[llvm-cov] Fix incorrect usage of .precision specifier in format() call.

Summary: Existing version doesn't work on Windows as it always prints 0.00.

Reviewers: Dor1s

Reviewed By: Dor1s

Subscribers: llvm-commits

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

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

6 years agoFollowup on Proposal to move MIR physical register namespace to '$' sigil.
Puyan Lotfi [Wed, 31 Jan 2018 22:04:26 +0000 (22:04 +0000)]
Followup on Proposal to move MIR physical register namespace to '$' sigil.

Discussed here:

http://lists.llvm.org/pipermail/llvm-dev/2018-January/120320.html

In preparation for adding support for named vregs we are changing the sigil for
physical registers in MIR to '$' from '%'. This will prevent name clashes of
named physical register with named vregs.

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