OSDN Git Service

android-x86/external-llvm.git
6 years ago[X86] [ASM INTEL SYNTAX] fix for incorrect assembler code generation when x86-asm...
Konstantin Belochapka [Mon, 25 Sep 2017 19:26:48 +0000 (19:26 +0000)]
[X86] [ASM INTEL SYNTAX] fix for incorrect assembler code generation when x86-asm-syntax=intel (PR34617).
Fix for incorrect code generation when x86-asm-syntax=intel.
Differential Revision: https://reviews.llvm.org/D37945

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

6 years ago[SelectionDAG] Teach simplifyDemandedBits to handle shifts by constant splat vectors
Craig Topper [Mon, 25 Sep 2017 19:26:08 +0000 (19:26 +0000)]
[SelectionDAG] Teach simplifyDemandedBits to handle shifts by constant splat vectors

This teach simplifyDemandedBits to handle constant splat vector shifts.

This required changing some uses of getZExtValue to getLimitedValue since we can't rely on legalization using getShiftAmountTy for the shift amount.

I believe there may have been a bug in the ((X << C1) >>u ShAmt) handling where we didn't check if the inner shift was too large. I've fixed that here.

I had to add new patterns to ARM because the zext/sext the patterns were trying to look for got turned into an any_extend with this patch. Happy to split that out too, but not sure how to test without this change.

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

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

6 years ago[SLP] Add a test for PR32086, NFC.
Alexey Bataev [Mon, 25 Sep 2017 19:12:59 +0000 (19:12 +0000)]
[SLP] Add a test for PR32086, NFC.

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

6 years ago[Hexagon] Better determination of register classes in bit tracker
Krzysztof Parzyszek [Mon, 25 Sep 2017 19:12:55 +0000 (19:12 +0000)]
[Hexagon] Better determination of register classes in bit tracker

Add two callbacks to MachineEvaluator, so that specific implementations
can specify more details about register classes:
- composeWithSubRegIndex(RC,Idx), to provide the register class for a
  register from RC used in conjunction with a subregister index Idx.
- getPhysRegBitWidth(Reg), to provide the size in bits of the given
  physical register.

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

6 years ago[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.
Artem Belevich [Mon, 25 Sep 2017 18:53:57 +0000 (18:53 +0000)]
[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.

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

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

6 years ago[Hexagon] Make getHexagonSubRegIndex take reference instead of pointer
Krzysztof Parzyszek [Mon, 25 Sep 2017 18:49:42 +0000 (18:49 +0000)]
[Hexagon] Make getHexagonSubRegIndex take reference instead of pointer

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

6 years ago[AVX-512] Replace large number of explicit patterns that check for insert_subvector...
Craig Topper [Mon, 25 Sep 2017 18:43:13 +0000 (18:43 +0000)]
[AVX-512] Replace large number of explicit patterns that check for insert_subvector with zero after masked compares with fewer patterns with predicate

This replaces the large number of patterns that handle every possible case of zeroing after a masked compare with a few simpler patterns that use a predicate to check for a masked compare producer.

This is similar to what we do for detecting free GR32->GR64 zero extends and free xmm->ymm/zmm zero extends.

This shrinks the isel table from ~590k to ~531k. This is a roughly 10% reduction in size.

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

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

6 years ago[SimplifyIndvar] Minor change to refine r314125, NFC
Hongbin Zheng [Mon, 25 Sep 2017 18:10:36 +0000 (18:10 +0000)]
[SimplifyIndvar] Minor change to refine r314125, NFC

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

6 years agoARM: One more fix for swifterror CSR set
Arnold Schwaighofer [Mon, 25 Sep 2017 17:51:33 +0000 (17:51 +0000)]
ARM: One more fix for swifterror CSR set

We use a differently ordered CSR set if the frame pointer is pushed. Add a
matching ..._SwiftError version.

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

6 years ago[SimplifyIndvar] Replace the srem used by IV if we can prove both of its operands...
Hongbin Zheng [Mon, 25 Sep 2017 17:39:40 +0000 (17:39 +0000)]
[SimplifyIndvar] Replace the srem used by IV if we can prove both of its operands are non-negative

Since now SCEV can handle 'urem', an 'urem' is a better canonical form than an 'srem' because it has well-defined behavior

This is a follow up of D34598

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

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

6 years ago[ARM] Fix -Wdangling-else warning.
Benjamin Kramer [Mon, 25 Sep 2017 17:35:38 +0000 (17:35 +0000)]
[ARM] Fix -Wdangling-else warning.

A ternary is clearer here. No functionality change.

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

6 years agoARM: Use the proper swifterror CSR list on platforms other than darwin
Arnold Schwaighofer [Mon, 25 Sep 2017 17:19:50 +0000 (17:19 +0000)]
ARM: Use the proper swifterror CSR list on platforms other than darwin

Noticed by inspection

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

6 years agorevert r314117 because there are bogus clang tests that depend on the optimizer
Sanjay Patel [Mon, 25 Sep 2017 17:00:04 +0000 (17:00 +0000)]
revert r314117 because there are bogus clang tests that depend on the optimizer

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

6 years ago[InstCombine] remove extract-of-select vector transform
Sanjay Patel [Mon, 25 Sep 2017 16:41:34 +0000 (16:41 +0000)]
[InstCombine] remove extract-of-select vector transform

The transform to convert an extract-of-a-select-of-vectors was added at:
rL194013

And a question about the validity of this transform was raised in the review:
https://reviews.llvm.org/D1539:
...but not answered AFAICT>

Most of the motivating cases in that patch are now handled by other combines. These are the tests that were added with
the original commit, but they are not regressing even after we remove the transform in this patch.

The diffs we see after removing this transform cause us to avoid increasing the instruction count, so we don't want to do
those transforms as canonicalizations.

The motivation for not turning a vector-select-of-vectors into a scalar operation is shown in PR33301:
https://bugs.llvm.org/show_bug.cgi?id=33301
...in those cases, we'll get vector ops with this patch rather than the vector/scalar mix that we currently see.

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

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

6 years agoRemove trailing whitespaces.
Michael Liao [Mon, 25 Sep 2017 16:21:21 +0000 (16:21 +0000)]
Remove trailing whitespaces.

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

6 years ago[DebugInfo] Sort the SDDbgValue list before assuming it is in IR order
Reid Kleckner [Mon, 25 Sep 2017 16:14:53 +0000 (16:14 +0000)]
[DebugInfo] Sort the SDDbgValue list before assuming it is in IR order

Summary:
This code iterates the 'Orders' vector in parallel with the DbgValue
list, emitting all DBG_VALUEs that occurred between the last IR order
insertion point and the next insertion point. This assumes the
SDDbgValue list is sorted in IR order, which it usually is. However, it
is not sorted when a node with a debug value is replaced with another
one. When this happens, TransferDbgValues is called, and the new value
is added to the end of the list.

The problem can be solved by stably sorting the list by IR order.

Reviewers: aprantl, Ka-Ka

Reviewed By: aprantl

Subscribers: MatzeB, hiraditya, llvm-commits

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

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

6 years agoUse {} instead of make_pair and an iterator for the insertion point, NFC
Reid Kleckner [Mon, 25 Sep 2017 16:14:39 +0000 (16:14 +0000)]
Use {} instead of make_pair and an iterator for the insertion point, NFC

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

6 years ago[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess (VF8...
Michael Zuckerman [Mon, 25 Sep 2017 14:50:38 +0000 (14:50 +0000)]
[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess (VF8 stride 4):

This patch expands the support of lowerInterleavedStore to 8x8i stride 4.

LLVM creates suboptimal shuffle code-gen for AVX2.
In overall, this patch is a specific fix for the pattern (Strid=4 VF=8) and we plan to include more patterns in the future.

The patch goal is to optimize the following sequence:
At the end of the computation, we have xmm2, xmm0, xmm12 and xmm3 holding
each 8 chars:

c0, c1, , c7
m0, m1, , m7
y0, y1, , y7
k0, k1, ., k7

And these need to be transposed/interleaved and stored like so:

c0 m0 y0 k0 c1 m1 y1 k1 c2 m2 y2 k2 c3 m3 y3 k3 ....

Reviewers
DavidKreitzer
Farhana
zvi
igorb
guyblank
RKSimon
Ayal

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

Change-Id: I3cc5c2ca5d6318901c192a4428493b99ef424c32

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

6 years ago[PowerPC] Eliminate compares - add i64 sext/zext handling for SETLT/SETGT
Nemanja Ivanovic [Mon, 25 Sep 2017 14:05:46 +0000 (14:05 +0000)]
[PowerPC] Eliminate compares - add i64 sext/zext handling for SETLT/SETGT

As mentioned in https://reviews.llvm.org/D33718, this simply adds another
pattern to the compare elimination sequence and is committed without a
differential review.

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

6 years ago[AArch64] Add basic support for Qualcomm's Saphira CPU.
Chad Rosier [Mon, 25 Sep 2017 14:05:00 +0000 (14:05 +0000)]
[AArch64] Add basic support for Qualcomm's Saphira CPU.

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

6 years agoAdding missing feature to goldmont.
Michael Zuckerman [Mon, 25 Sep 2017 13:45:31 +0000 (13:45 +0000)]
Adding missing feature to goldmont.

Change-Id: I1ddc619169fae6a56308deef8dae5db3da702cf4

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

6 years ago[SLP] Support for horizontal min/max reduction.
Alexey Bataev [Mon, 25 Sep 2017 13:34:59 +0000 (13:34 +0000)]
[SLP] Support for horizontal min/max reduction.

Summary:
SLP vectorizer supports horizontal reductions for Add/FAdd binary operations. Patch adds support for horizontal min/max reductions.
Function getReductionCost() is split to getArithmeticReductionCost() for binary operation reductions and getMinMaxReductionCost() for min/max reductions.
Patch fixes PR26956.

Reviewers: spatel, mkuper, hfinkel, RKSimon

Subscribers: llvm-commits

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

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

6 years ago[CodeGenPrepare][NFC] Rename TargetTransformInfo::expandMemCmp -> TargetTransformInfo...
Clement Courbet [Mon, 25 Sep 2017 06:35:16 +0000 (06:35 +0000)]
[CodeGenPrepare][NFC] Rename TargetTransformInfo::expandMemCmp -> TargetTransformInfo::enableMemCmpExpansion.

Summary:
Right now there are two functions with the same name, one does the work
and the other one returns true if expansion is needed. Rename
TargetTransformInfo::expandMemCmp to make it more consistent with other
members of TargetTransformInfo.

Remove the unused Instruction* parameter.

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

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

6 years ago[X86] Make IFMA instructions during isel so we can fold broadcast loads.
Craig Topper [Sun, 24 Sep 2017 19:30:55 +0000 (19:30 +0000)]
[X86] Make IFMA instructions during isel so we can fold broadcast loads.

This required changing the ISD opcode for these instructions to have the commutable operands first and the addend last. This way tablegen can autogenerate the additional patterns for us.

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

6 years ago[X86] Add tests to show missed opportunities to fold broadcast loads into IFMA instru...
Craig Topper [Sun, 24 Sep 2017 19:30:54 +0000 (19:30 +0000)]
[X86] Add tests to show missed opportunities to fold broadcast loads into IFMA instructions when the load is on operand1 of the instrinsic.

We need to enable commuting during isel to catch this since the load folding tables can't handle broadcasts.

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

6 years ago[X86] Add IFMA instructions to the load folding tables and make them commutable for...
Craig Topper [Sun, 24 Sep 2017 17:28:14 +0000 (17:28 +0000)]
[X86] Add IFMA instructions to the load folding tables and make them commutable for the multiply operands.

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

6 years agoFix signed/unsigned warning
Simon Pilgrim [Sun, 24 Sep 2017 14:00:52 +0000 (14:00 +0000)]
Fix signed/unsigned warning

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

6 years ago[X86][SSE] Add more tests for shuffle combining with extracted vector elements (PR22415)
Simon Pilgrim [Sun, 24 Sep 2017 13:45:49 +0000 (13:45 +0000)]
[X86][SSE] Add more tests for shuffle combining with extracted vector elements (PR22415)

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

6 years ago[X86][SSE] Add support for extending bool vectors bitcasted from scalars
Simon Pilgrim [Sun, 24 Sep 2017 13:42:31 +0000 (13:42 +0000)]
[X86][SSE] Add support for extending bool vectors bitcasted from scalars

This patch acts as a reverse to combineBitcastvxi1 - bitcasting a scalar integer to a boolean vector and extending it 'in place' to the requested legal type.

Currently this doesn't handle AVX512 at all - but the current mask register approach is lacking for some cases.

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

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

6 years ago[PowerPC] Eliminate compares - add i64 sext/zext handling for SETLE/SETGE
Nemanja Ivanovic [Sun, 24 Sep 2017 05:48:11 +0000 (05:48 +0000)]
[PowerPC] Eliminate compares - add i64 sext/zext handling for SETLE/SETGE

As mentioned in https://reviews.llvm.org/D33718, this simply adds another
pattern to the compare elimination sequence and is committed without a
differential review.

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

6 years ago[AVX-512] Add pattern for selecting masked version of v8i32/v8f32 compare instruction...
Craig Topper [Sun, 24 Sep 2017 05:24:52 +0000 (05:24 +0000)]
[AVX-512] Add pattern for selecting masked version of v8i32/v8f32 compare instructions when VLX isn't available.

We use a v16i32/v16f32 compare instead and truncate the result. We already did this for the unmasked version, but were missing the version with 'and'.

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

6 years ago[X86] Make sure we still mark the full register as implicitly defined when we shrink...
Craig Topper [Sun, 24 Sep 2017 05:24:51 +0000 (05:24 +0000)]
[X86] Make sure we still mark the full register as implicitly defined when we shrink 256/512 bit zeroing xors to 128-bit.

Not sure if anything really cares, but this seems like the right thing to do.

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

6 years ago[AVR] Implement getCmpLibcallReturnType().
Dylan McKay [Sun, 24 Sep 2017 01:07:26 +0000 (01:07 +0000)]
[AVR] Implement getCmpLibcallReturnType().

This fixes the avr-rust issue (#75) with floating-point comparisons generating broken code.
By default, LLVM assumes these comparisons return 32-bit values, but ours are 8-bit.

Patch By Thomas Backman.

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

6 years ago[Verifier] Stop accepting broken DIGlobalVariable(s).
Davide Italiano [Sun, 24 Sep 2017 01:06:35 +0000 (01:06 +0000)]
[Verifier] Stop accepting broken DIGlobalVariable(s).

The code wasn't yelling at the user when there's a reference
from a DIGlobalVariableExpression. Thanks to Adrian for the
reduced testcase. Fixes PR34672.

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

6 years ago[X86] Regenerate i64 to v2f32 bitcast test
Simon Pilgrim [Sat, 23 Sep 2017 19:18:29 +0000 (19:18 +0000)]
[X86] Regenerate i64 to v2f32 bitcast test

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

6 years ago[x86] reduce 64-bit mask constant to 32-bits by right shifting
Sanjay Patel [Sat, 23 Sep 2017 14:32:07 +0000 (14:32 +0000)]
[x86] reduce 64-bit mask constant to 32-bits by right shifting

This is a follow-up from D38181 (r314023). We have to put 64-bit
constants into a register using a separate instruction, so we
should try harder to avoid that.

From what I see, we're not likely to encounter this pattern in the
DAG because the upstream setcc combines from this don't (usually?)
produce this pattern. If we fix that, then this will become more
relevant. Since the cost of handling this case is just loosening
the predicate of the existing fold, we might as well do it now.

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

6 years ago[x86] add an add+shift test for follow-up suggestion from D38181; NFC
Sanjay Patel [Sat, 23 Sep 2017 14:24:07 +0000 (14:24 +0000)]
[x86] add an add+shift test for follow-up suggestion from D38181; NFC

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

6 years ago[PowerPC] Eliminate compares - add i32 sext/zext handling for SETULT/SETUGT
Nemanja Ivanovic [Sat, 23 Sep 2017 12:53:03 +0000 (12:53 +0000)]
[PowerPC] Eliminate compares - add i32 sext/zext handling for SETULT/SETUGT

As mentioned in https://reviews.llvm.org/D33718, this simply adds another
pattern to the compare elimination sequence and is committed without a
differential revision.

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

6 years ago[PowerPC] Eliminate compares - add i32 sext/zext handling for SETULE/SETUGE
Nemanja Ivanovic [Sat, 23 Sep 2017 09:50:12 +0000 (09:50 +0000)]
[PowerPC] Eliminate compares - add i32 sext/zext handling for SETULE/SETUGE

As mentioned in https://reviews.llvm.org/D33718, this simply adds another
pattern to the compare elimination sequence and is committed without a
differential revision.

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

6 years ago[X86] Move the getInsertVINSERTImmediate and getExtractVEXTRACTImmediate helper funct...
Craig Topper [Sat, 23 Sep 2017 05:34:07 +0000 (05:34 +0000)]
[X86] Move the getInsertVINSERTImmediate and getExtractVEXTRACTImmediate helper functions over to X86ISelDAGToDAG.cpp

Redefine them to call getI8Imm and return that directly.

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

6 years ago[X86] Remove is the isVINSERT*Index/isVEXTRACT*Index predicates from isel.
Craig Topper [Sat, 23 Sep 2017 05:34:06 +0000 (05:34 +0000)]
[X86] Remove is the isVINSERT*Index/isVEXTRACT*Index predicates from isel.

The only insert_subvector/extract_subvector nodes that make it to isel are guaranteed to match.

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

6 years ago[PowerPC] Eliminate compares - add i32 sext/zext handling for SETLT/SETGT
Nemanja Ivanovic [Sat, 23 Sep 2017 04:41:34 +0000 (04:41 +0000)]
[PowerPC] Eliminate compares - add i32 sext/zext handling for SETLT/SETGT

As mentioned in https://reviews.llvm.org/D33718, this simply adds another
pattern to the compare elimination sequence and is committed without a
differential revision.

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

6 years agoCommit missing fixes for tool_file_rename
Reid Kleckner [Sat, 23 Sep 2017 01:04:42 +0000 (01:04 +0000)]
Commit missing fixes for tool_file_rename

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

6 years ago[Support] Rename tool_output_file to ToolOutputFile, NFC
Reid Kleckner [Sat, 23 Sep 2017 01:03:17 +0000 (01:03 +0000)]
[Support] Rename tool_output_file to ToolOutputFile, NFC

This class isn't similar to anything from the STL, so it shouldn't use
the STL naming conventions.

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

6 years ago[CodeGen] Fix build bots which uses old Clang broken in r314046. (NFC)
Eugene Zelenko [Fri, 22 Sep 2017 23:55:32 +0000 (23:55 +0000)]
[CodeGen] Fix build bots which uses old Clang broken in r314046. (NFC)

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

6 years ago[CodeGen] Fix some Clang-tidy modernize-use-default-member-init and Include What...
Eugene Zelenko [Fri, 22 Sep 2017 23:46:57 +0000 (23:46 +0000)]
[CodeGen] Fix some Clang-tidy modernize-use-default-member-init and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[X86] [MC] fixed non optimal encoding of instruction memory operand (PR24038).
Konstantin Belochapka [Fri, 22 Sep 2017 23:37:48 +0000 (23:37 +0000)]
[X86] [MC] fixed non optimal encoding of instruction memory operand (PR24038).
Fixed suboptimal encoding of instruction memory operand when assembler is used to select 32 bit fixup rather than 8 bit immediate for encoding memory offset value.
Differential Revision: https://reviews.llvm.org/D38117

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

6 years agoFix uninteneded fallthrough detected by GCC warning
Reid Kleckner [Fri, 22 Sep 2017 23:19:52 +0000 (23:19 +0000)]
Fix uninteneded fallthrough detected by GCC warning

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

6 years ago[InstCombine] Teach foldICmpUsingKnownBits to simplify SLE/SGE/ULE/UGE to equality...
Craig Topper [Fri, 22 Sep 2017 21:47:22 +0000 (21:47 +0000)]
[InstCombine] Teach foldICmpUsingKnownBits to simplify SLE/SGE/ULE/UGE to equality comparisons when the min/max ranges intersect in a single value.

This is the inverse of what we do for SGT/SLT/UGT/ULT.

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

6 years ago[InstCombine] Add test cases for known bits simplifications for comparisons that...
Craig Topper [Fri, 22 Sep 2017 21:47:21 +0000 (21:47 +0000)]
[InstCombine] Add test cases for known bits simplifications for comparisons that don't depend on constant RHS. NFC

This shows some missing simplifications for sge/sle/uge/ule relative to their non-equality counterparts.

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

6 years ago[InstCombine] Remove a FIXME from a test that was fixed in r314025.
Craig Topper [Fri, 22 Sep 2017 21:47:20 +0000 (21:47 +0000)]
[InstCombine] Remove a FIXME from a test that was fixed in r314025.

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

6 years agoFixed broken links in docs.
Ilya Biryukov [Fri, 22 Sep 2017 21:10:37 +0000 (21:10 +0000)]
Fixed broken links in docs.

Replaced references to `llvm.org/klaus` with `git.llvm.org/klaus`.

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

6 years ago[x86] remove over-specified platform from test config
Sanjay Patel [Fri, 22 Sep 2017 21:07:13 +0000 (21:07 +0000)]
[x86] remove over-specified platform from test config

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

6 years ago[PowerPC] Mark P9 scheduling model complete
Stefan Pintilie [Fri, 22 Sep 2017 20:17:25 +0000 (20:17 +0000)]
[PowerPC] Mark P9 scheduling model complete

This patch just adds the missing information to the P9 scheduling model to allow
the model to be marked as complete.

The model has been verified against P9 documentation. The model was verified
with utils/schedcover.py.

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

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

6 years ago[InstCombine] Add constant splat handling to one of the ICMP_SLT/SGT cases in foldICm...
Craig Topper [Fri, 22 Sep 2017 19:54:15 +0000 (19:54 +0000)]
[InstCombine] Add constant splat handling to one of the ICMP_SLT/SGT cases in foldICmpUsingKnownBits.

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

6 years ago[x86] shiftRightAlgebraic -> shiftRightArithmetic; NFC
Sanjay Patel [Fri, 22 Sep 2017 19:49:37 +0000 (19:49 +0000)]
[x86] shiftRightAlgebraic -> shiftRightArithmetic; NFC

x86 re-education camp is in session. The LLVM LangRef agrees with x86 too.
The DAG nodes are undocumented and ambiguous as always. :)

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

6 years ago[x86] swap order of srl (and X, C1), C2 when it saves size
Sanjay Patel [Fri, 22 Sep 2017 19:37:21 +0000 (19:37 +0000)]
[x86] swap order of srl (and X, C1), C2 when it saves size

The (non-)obvious win comes from saving 3 bytes by using the 0x83 'and' opcode variant instead of 0x81.
There are also better improvements based on known-bits that allow us to eliminate the mask entirely.

As noted, this could be extended. There are potentially other wins from always shifting first, but doing
that reveals a tangle of problems in other pattern matching. We do this transform generically in
instcombine, but we often have icmp IR that doesn't match that pattern, so we must account for this
in the backend.

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

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

6 years ago[InstCombine] Move the call to isSignBitCheck into getDemandedBitsLHSMask instead...
Craig Topper [Fri, 22 Sep 2017 18:57:23 +0000 (18:57 +0000)]
[InstCombine] Move the call to isSignBitCheck into getDemandedBitsLHSMask instead of calling it outside and passing its result through a flag. NFCI

The result of the isSignBitCheck isn't used anywhere else and this allows us to share the m_APInt call in the likely case that it isn't a sign bit check.

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

6 years ago[InstCombine] Simplify check for RHS being a splat constant in foldICmpUsingKnownBits...
Craig Topper [Fri, 22 Sep 2017 18:57:22 +0000 (18:57 +0000)]
[InstCombine] Simplify check for RHS being a splat constant in foldICmpUsingKnownBits by just checking Op1Min==Op1Max rather than going through m_APInt.

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

6 years ago[InstCombine] Make cases for ICMP_UGT/ICMP_ULT use similar formatting since they...
Craig Topper [Fri, 22 Sep 2017 18:57:20 +0000 (18:57 +0000)]
[InstCombine] Make cases for ICMP_UGT/ICMP_ULT use similar formatting since they use similar code. NFC

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

6 years agoMove code to a helper function. NFC.
Rafael Espindola [Fri, 22 Sep 2017 18:40:14 +0000 (18:40 +0000)]
Move code to a helper function. NFC.

Part of a patch by Jake Ehrlich!

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

6 years agollvm-ar: align the first archive member consistently.
Rafael Espindola [Fri, 22 Sep 2017 18:36:00 +0000 (18:36 +0000)]
llvm-ar: align the first archive member consistently.

Before we were aligning the member after the symbol table to 4 but
other members to 8.

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

6 years ago[XRay] support conditional return on PPC.
Tim Shen [Fri, 22 Sep 2017 18:30:02 +0000 (18:30 +0000)]
[XRay] support conditional return on PPC.

Summary: Conditional returns were not taken into consideration at all. Implement them by turning them into jumps and normal returns. This means there is a slightly higher performance penalty for conditional returns, but this is the best we can do, and it still disturbs little of the rest.

Reviewers: dberris, echristo

Subscribers: sanjoy, nemanjai, hiraditya, kbarton, llvm-commits

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

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

6 years ago[TableGen] Replace InfoByHwMode::getAsString with writeToStream
Krzysztof Parzyszek [Fri, 22 Sep 2017 18:29:37 +0000 (18:29 +0000)]
[TableGen] Replace InfoByHwMode::getAsString with writeToStream

Also add operator<< for use with raw_ostream to InfoByHwMode and its
derived classes.

Recommitting r313989 with the fix for unresolved references: explicitly
define the operator<< in namespace llvm.

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

6 years ago[TargetTransformInfo] Handle intrinsic call in getInstructionLatency()
Guozhi Wei [Fri, 22 Sep 2017 18:25:53 +0000 (18:25 +0000)]
[TargetTransformInfo] Handle intrinsic call in getInstructionLatency()

Usually an intrinsic is a simple target instruction, it should have a small latency. A real function call has much larger latency. So handle the intrinsic call in function getInstructionLatency().

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

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

6 years agollvm-ar: Don't add an unnecessary alignment in gnu mode.
Rafael Espindola [Fri, 22 Sep 2017 18:16:13 +0000 (18:16 +0000)]
llvm-ar: Don't add an unnecessary alignment in gnu mode.

This is mostly for getting stricter testing in preparation for future
changes.

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

6 years ago [Falkor] Add falkor CPU to host detection
Balaram Makam [Fri, 22 Sep 2017 17:46:36 +0000 (17:46 +0000)]
[Falkor] Add falkor CPU to host detection

    This returns "falkor" for Falkor CPU.

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

6 years agoRemove trailing whitespace. NFCI.
Simon Pilgrim [Fri, 22 Sep 2017 16:57:28 +0000 (16:57 +0000)]
Remove trailing whitespace. NFCI.

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

6 years agoCheck vector elements for equivalence in the HexagonVectorLoopCarriedReuse pass
Pranav Bhandarkar [Fri, 22 Sep 2017 16:43:31 +0000 (16:43 +0000)]
Check vector elements for equivalence in the HexagonVectorLoopCarriedReuse pass

If the two instructions being compared for equivalence have corresponding operands
that are integer constants, then check their values to determine equivalence.

Patch by Suyog Sarda!

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

6 years agoRevert "[TableGen] Replace InfoByHwMode::getAsString with writeToStream"
Krzysztof Parzyszek [Fri, 22 Sep 2017 16:18:35 +0000 (16:18 +0000)]
Revert "[TableGen] Replace InfoByHwMode::getAsString with writeToStream"

This reverts commit r313989: it breaks Windows bots.

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

6 years ago[TableGen] Replace InfoByHwMode::getAsString with writeToStream
Krzysztof Parzyszek [Fri, 22 Sep 2017 16:06:35 +0000 (16:06 +0000)]
[TableGen] Replace InfoByHwMode::getAsString with writeToStream

Also add operator<< for use with raw_ostream to InfoByHwMode and its
derived classes.

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

6 years ago[SCEV] Generalize folding of trunc(x)+n*trunc(y) into folding m*trunc(x)+n*trunc(y)
Daniel Neilson [Fri, 22 Sep 2017 15:47:57 +0000 (15:47 +0000)]
[SCEV] Generalize folding of trunc(x)+n*trunc(y) into folding m*trunc(x)+n*trunc(y)

Summary:
A SCEV such as:
 {%v2,+,((-1 * (trunc i64 (-1 * %v1) to i32)) + (-1 * (trunc i64 %v1 to i32)))}<%loop>

can be folded into, simply, {%v2,+,0}. However, the current code in ::getAddExpr()
will not try to apply the simplification m*trunc(x)+n*trunc(y) -> trunc(trunc(m)*x+trunc(n)*y)
because it only keys off having a non-multiplied trunc as the first term in the simplification.

This patch generalizes this code to try to do a more generic fold of these trunc
expressions.

Reviewers: sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

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

6 years ago[x86] remove unnecessary OS specifier from test
Sanjay Patel [Fri, 22 Sep 2017 14:38:57 +0000 (14:38 +0000)]
[x86] remove unnecessary OS specifier from test

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

6 years ago[x86] auto-generate complete checks; NFC
Sanjay Patel [Fri, 22 Sep 2017 14:30:52 +0000 (14:30 +0000)]
[x86] auto-generate complete checks; NFC

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

6 years ago[x86] update test to use FileCheck; NFC
Sanjay Patel [Fri, 22 Sep 2017 14:29:47 +0000 (14:29 +0000)]
[x86] update test to use FileCheck; NFC

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

6 years ago[TableGen] Return StringRef from ValueTypeByHwMode::getMVTName
Simon Pilgrim [Fri, 22 Sep 2017 13:32:26 +0000 (13:32 +0000)]
[TableGen] Return StringRef from ValueTypeByHwMode::getMVTName

Avoid unnecessary std::string creations during TypeSetByHwMode::writeToStream.

Found during investigations into PR28222

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

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

6 years ago[X86] Combining CMOVs with [ANY,SIGN,ZERO]_EXTEND for cases where CMOV has constant...
Alexander Ivchenko [Fri, 22 Sep 2017 13:21:39 +0000 (13:21 +0000)]
[X86] Combining CMOVs with [ANY,SIGN,ZERO]_EXTEND for cases where CMOV has constant arguments

Combine CMOV[i16]<-[SIGN,ZERO,ANY]_EXTEND to [i32,i64] into CMOV[i32,i64].
One example of where it is useful is:

before (20 bytes)
    <foo>:
    test $0x1,%dil
    mov $0x307e,%ax
    mov $0xffff,%cx
    cmovne %ax,%cx
    movzwl %cx,%eax
    retq

after (18 bytes)
    <foo>:
    test $0x1,%dil
    mov $0x307e,%ecx
    mov $0xffff,%eax
    cmovne %ecx,%eax
    retq

Reviewers: craig.topper, aaboud, spatel, RKSimon, zvi

Reviewed By: spatel

Subscribers: llvm-commits

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

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

6 years agoRework loop predication pass
Artur Pilipenko [Fri, 22 Sep 2017 13:13:57 +0000 (13:13 +0000)]
Rework loop predication pass

We've found a serious issue with the current implementation of loop predication.
The current implementation relies on SCEV and this turned out to be problematic.
To fix the problem we had to rework the pass substantially. We have had the
reworked implementation in our downstream tree for a while. This is the initial
patch of the series of changes to upstream the new implementation.

For now the transformation is limited to the following case:
  * The loop has a single latch with either ult or slt icmp condition.
  * The step of the IV used in the latch condition is 1.
  * The IV of the latch condition is the same as the post increment IV of the guard condition.
  * The guard condition is ult.

See the review or the LoopPredication.cpp header for the details about the
problem and the new implementation.

Reviewed By: sanjoy, mkazantsev

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

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

6 years agoRemove the default clause from a fully-covering switch
Nemanja Ivanovic [Fri, 22 Sep 2017 12:26:00 +0000 (12:26 +0000)]
Remove the default clause from a fully-covering switch
to appease bots that use a compiler that warns about this
and use -Werror.

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

6 years ago[ARM] Fix assembly and disassembly for VMRS/VMSR
Andre Vieira [Fri, 22 Sep 2017 12:17:42 +0000 (12:17 +0000)]
[ARM] Fix assembly and disassembly for VMRS/VMSR

Reviewed by: t.p.northover
Differential Revision: https://reviews.llvm.org/D36306

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

6 years agoRecommit r310809 with a fix for the spill problem
Nemanja Ivanovic [Fri, 22 Sep 2017 11:50:25 +0000 (11:50 +0000)]
Recommit r310809 with a fix for the spill problem

This patch re-commits the patch that was pulled out due to a
problem it caused, but with a fix for the problem. The fix
was reviewed separately by Eric Christopher and Hal Finkel.

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

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

6 years ago[ARM] Add missing selection patterns for vnmla
Simon Pilgrim [Fri, 22 Sep 2017 09:50:52 +0000 (09:50 +0000)]
[ARM] Add missing selection patterns for vnmla

For the following function:

  double fn1(double d0, double d1, double d2) {
    double a = -d0 - d1 * d2;
    return a;
  }

on ARM, LLVM generates code along the lines of

  vneg.f64  d0, d0
  vmls.f64  d0, d1, d2

i.e., a negate and a multiply-subtract.

The attached patch adds instruction selection patterns to allow it to generate the single instruction

  vnmla.f64  d0, d1, d2

(multiply-add with negation) instead, like GCC does.

Committed on behalf of @gergo- (Gergö Barany)

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

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

6 years ago[dwarfdump] Fix ambiguous call to make_unique
Jonas Devlieghere [Fri, 22 Sep 2017 09:38:52 +0000 (09:38 +0000)]
[dwarfdump] Fix ambiguous call to make_unique

Fix buildbot failures:
 - http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/13153
 - http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/13566

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

6 years ago[obj2yaml] Don't crash for input files without symbol table
Alexander Richardson [Fri, 22 Sep 2017 09:30:40 +0000 (09:30 +0000)]
[obj2yaml] Don't crash for input files without symbol table

Summary: Previously we would dereference Symtab without checking for null.

Reviewers: davide, atanasyan, rafael

Reviewed By: davide, atanasyan

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

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

6 years ago[dwarfdump] Add support for redirecting output to a file
Jonas Devlieghere [Fri, 22 Sep 2017 09:20:57 +0000 (09:20 +0000)]
[dwarfdump] Add support for redirecting output to a file

This patch adds the -o and --out-file options for compatibility with
Darwin's dwarfdump.

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

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

6 years ago[mips] clang-format MipsTargetMachine.cpp
Alexander Richardson [Fri, 22 Sep 2017 08:52:03 +0000 (08:52 +0000)]
[mips] clang-format MipsTargetMachine.cpp

This is my test commit as it only changes two lines

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

6 years ago[AVR] Remove the 'IsN64' argument to 'MCELFObjectWriter'
Dylan McKay [Fri, 22 Sep 2017 06:32:23 +0000 (06:32 +0000)]
[AVR] Remove the 'IsN64' argument to 'MCELFObjectWriter'

This has since been removed.

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

6 years ago[X86] Updating the test case for FMF propagation.
Jatin Bhateja [Fri, 22 Sep 2017 05:48:20 +0000 (05:48 +0000)]
[X86] Updating the test case for FMF propagation.

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

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

6 years agobpf: initial 32-bit ALU encoding support in assembler
Yonghong Song [Fri, 22 Sep 2017 04:36:36 +0000 (04:36 +0000)]
bpf: initial 32-bit ALU encoding support in assembler

This patch adds instruction patterns for operations in BPF_ALU. After this,
assembler could recognize some 32-bit ALU statement. For example, those listed
int the unit test file.

Separate MOV patterns are unnecessary as MOV is ALU operation that could reuse
ALU encoding infrastructure, this patch removed those redundant patterns.

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313961 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agobpf: add 32bit register set
Yonghong Song [Fri, 22 Sep 2017 04:36:35 +0000 (04:36 +0000)]
bpf: add 32bit register set

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313960 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agobpf: refactor inst patterns with better inheritance
Yonghong Song [Fri, 22 Sep 2017 04:36:34 +0000 (04:36 +0000)]
bpf: refactor inst patterns with better inheritance

Arithmetic and jump instructions, load and store instructions are sharing
the same 8-bit code field encoding,

A better instruction pattern implemention could be the following inheritance
relationships, and each layer only encoding those fields which start to
diverse from that layer. This avoids some redundant code.

  InstBPF -> TYPE_ALU_JMP -> ALU/JMP
  InstBPF -> TYPE_LD_ST -> Load/Store

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313959 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agobpf: refactor inst patterns with more mnemonics
Yonghong Song [Fri, 22 Sep 2017 04:36:32 +0000 (04:36 +0000)]
bpf: refactor inst patterns with more mnemonics

Currently, eBPF backend is using some constant directly in instruction patterns,
This patch replace them with mnemonics and removed some unnecessary temparary
variables.

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313958 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAArch64: support SwiftCC properly on AAPCS64
Saleem Abdulrasool [Fri, 22 Sep 2017 04:31:44 +0000 (04:31 +0000)]
AArch64: support SwiftCC properly on AAPCS64

The previous SwiftCC support for AAPCS64 was partially correct.  It
setup swiftself parameters in the proper register but failed to setup
swifterror in the correct register.  This would break compilation of
swift code for non-Darwin AAPCS64 conforming environments.

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

6 years agoRename markAsErased to erase, as pointed out in a previous review; NFC
Sanjoy Das [Fri, 22 Sep 2017 01:47:41 +0000 (01:47 +0000)]
Rename markAsErased to erase, as pointed out in a previous review; NFC

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

6 years agoHexagonVectorLoopCarriedReuse.cpp: Apply LLVM_ATTRIBUTE_UNUSED. [-Wunused-function]
NAKAMURA Takumi [Fri, 22 Sep 2017 01:01:33 +0000 (01:01 +0000)]
HexagonVectorLoopCarriedReuse.cpp: Apply LLVM_ATTRIBUTE_UNUSED. [-Wunused-function]

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

6 years agoReformat.
NAKAMURA Takumi [Fri, 22 Sep 2017 01:01:31 +0000 (01:01 +0000)]
Reformat.

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

6 years agoFix unused variable warning.
Richard Trieu [Thu, 21 Sep 2017 23:48:01 +0000 (23:48 +0000)]
Fix unused variable warning.

Move function call into debug macro to suppress unused variable warning
in non-debug builds.

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

6 years ago[CodeGen] Fix some Clang-tidy modernize-use-bool-literals and Include What You Use...
Eugene Zelenko [Thu, 21 Sep 2017 23:20:16 +0000 (23:20 +0000)]
[CodeGen] Fix some Clang-tidy modernize-use-bool-literals and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoFix a bug in a historic bitcode testcase.
Adrian Prantl [Thu, 21 Sep 2017 23:14:55 +0000 (23:14 +0000)]
Fix a bug in a historic bitcode testcase.

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

6 years agoFix a bug in a historic bitcode testcase. NFC.
Adrian Prantl [Thu, 21 Sep 2017 23:14:52 +0000 (23:14 +0000)]
Fix a bug in a historic bitcode testcase. NFC.

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