OSDN Git Service
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Rafael Espindola [Thu, 21 Sep 2017 23:13:36 +0000 (23:13 +0000)]
Convert the archive writer to use Error.
This found one place in lld that was not checking the error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313937
91177308-0d34-0410-b5e6-
96231b3b80d8
Pranav Bhandarkar [Thu, 21 Sep 2017 23:11:28 +0000 (23:11 +0000)]
[Hexagon] - Fix testcase for the HexagonVectorLoopCarriedReuse pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313936
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 21 Sep 2017 23:06:23 +0000 (23:06 +0000)]
Use raw_ostream in functions that don't need to seek. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313935
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 21 Sep 2017 23:00:55 +0000 (23:00 +0000)]
Simplify the logic for truncating UID and GID. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313933
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 21 Sep 2017 22:57:43 +0000 (22:57 +0000)]
Revert "Add a testfile that I missed in a previous commit that added HexagonVectorLoopCarriedReuse pass"
This reverts commit r313926.
It was failing in some bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313931
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 21 Sep 2017 22:16:40 +0000 (22:16 +0000)]
Resubmit "[lit] Refactor out some more common lit configuration code."
There were two issues, one Python 3 specific related to Unicode,
and another which is that the tool substitution for lld no longer
rejected matches where a / preceded the tool name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313928
91177308-0d34-0410-b5e6-
96231b3b80d8
Pranav Bhandarkar [Thu, 21 Sep 2017 21:52:24 +0000 (21:52 +0000)]
Add a testfile that I missed in a previous commit that
added HexagonVectorLoopCarriedReuse pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313926
91177308-0d34-0410-b5e6-
96231b3b80d8
Pranav Bhandarkar [Thu, 21 Sep 2017 21:48:23 +0000 (21:48 +0000)]
Enable the reuse of values computed in a previous loop iteration.
This patch adds a pass that removes the computation of provably redundant
expressions that have been computed earlier in a previous iteration. It
relies on the use of PHIs to identify loop carried dependences.
This is scalar replacement for vector types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313925
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 21 Sep 2017 21:45:45 +0000 (21:45 +0000)]
Revert "[lit] Refactor out some more common lit configuration code."
This is breaking several bots. I have enough information to
investigate, so I'm reverting to green until I get it figured
out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313922
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 21 Sep 2017 21:45:02 +0000 (21:45 +0000)]
Fix a bug in llvm-objdump when disassembling using the wrong default CPU
in the second slice of a Mach-O universal file.
The code in llvm-objdump in in DisassembleMachO() was getting the default
CPU then incorrectly setting into the global variable used for the -mcpu option
if that was not set. This caused a second call to DisassembleMachO() to use
the wrong default CPU when disassembling the next slice in a Mach-O universal
file. And would result in bad disassembly and an error message about an
recognized processor for the target:
% llvm-objdump -d -m -arch all fat.macho-armv7s-arm64
fat.macho-armv7s-arm64 (architecture armv7s):
(__TEXT,__text) section
armv7:
0: 60 47 bx r12
fat.macho-armv7s-arm64 (architecture arm64):
'cortex-a7' is not a recognized processor for this target (ignoring processor)
'cortex-a7' is not a recognized processor for this target (ignoring processor)
(__TEXT,__text) section
___multc3:
0: .long 0x1e620810
rdar://
34439149
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313921
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 21 Sep 2017 21:27:31 +0000 (21:27 +0000)]
[lit] Refactor out some more common lit configuration code.
debuginfo-tests has need to reuse a lot of common configuration
from clang and lld, and in general it seems like all of the
projects which are tightly coupled (e.g. lld, clang, llvm, lldb,
etc) can benefit from knowing about one other. For example,
lldb needs to know various things about how to run clang in its
test suite. Since there's a lot of common substitutions and
operations that need to be shared among projects, sinking this
up into LLVM makes sense.
In addition, this patch introduces a function add_tool_substitution
which handles all the dirty intricacies of matching tool names
which was previously copied around the various config files. This
is now a simple straightforward interface which is hard to mess
up.
Differential Revision: https://reviews.llvm.org/D37944
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313919
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 21 Sep 2017 21:27:11 +0000 (21:27 +0000)]
[lit] Actually do normalize the case of files in the config map.
This has gone back and forth, but it seems this is necessary
after all. realpath is not sufficient because if you have a
file named 'C:\foo.txt', then both realpath('c:\foo.txt') and
realpath(C:\foo.txt') return the string that was passed to them
exactly as is, meaning the case of the drive-letter won't match.
The problem before was not that we were normalizing the case of
items going into the config map, but rather that we were
normalizing the case of something we needed to print. The value
that is used to key on the config map should never be printed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313918
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Thu, 21 Sep 2017 21:10:06 +0000 (21:10 +0000)]
[AArch64] Fix bug in store of vector 0 DAGCombine.
Summary:
Avoid using XZR/WZR directly as operands to split stores of zero
vectors. Doing so can lead to the XZR/WZR being used by an instruction
that doesn't allow it (e.g. add).
Fixes bug 34674.
Reviewers: t.p.northover, efriedma, MatzeB
Subscribers: aemerson, rengolin, javed.absar, mcrosier, eraman, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D38146
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313916
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Sokolowski [Thu, 21 Sep 2017 20:36:38 +0000 (20:36 +0000)]
[llvm-readobj] Fix big-endian byte swap in WindowsResourceDumper.
The previous version of dumper implemented UTF-16 byte swap incorrectly
on big-endian machines. This now gets fixed.
Thanks to Bill Seurer for testing the patch locally.
Differential Review: https://reviews.llvm.org/D38150
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313912
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Thu, 21 Sep 2017 20:15:30 +0000 (20:15 +0000)]
[dwarfdump] Add verbose output for .debug-line section
This patch adds dumping of line table instructions as well as the final
state at each specified pc value in verbose mode. This is essentially
the same as the default in Darwin's dwarfdump. Dumping the actual line
table opcodes can be particularly useful for something like debugging a
bad `.debug_line` section.
Differential revision: https://reviews.llvm.org/D37971
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313910
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Sep 2017 20:12:19 +0000 (20:12 +0000)]
[DAGCombiner] Slightly simplify some code by using APInt::isMask() and countTrailingOnes instead of getting active bits and checking if all the bits below that make a mask.
At least for the 64-bit and less case, we should be able to determine if we even have a mask without counting any bits. This also removes the need to explicitly check for 0 active bits, isMask will return false for 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313908
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 21 Sep 2017 19:52:03 +0000 (19:52 +0000)]
Re-land r313825: "[IR] Add llvm.dbg.addr, a control-dependent version of llvm.dbg.declare"
The fix is to avoid invalidating our insertion point in
replaceDbgDeclare:
Builder.insertDeclare(NewAddress, DIVar, DIExpr, Loc, InsertBefore);
+ if (DII == InsertBefore)
+ InsertBefore = &*std::next(InsertBefore->getIterator());
DII->eraseFromParent();
I had to write a unit tests for this instead of a lit test because the
use list order matters in order to trigger the bug.
The reduced C test case for this was:
void useit(int*);
static inline void inlineme() {
int x[2];
useit(x);
}
void f() {
inlineme();
inlineme();
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313905
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjorn Pettersson [Thu, 21 Sep 2017 18:52:08 +0000 (18:52 +0000)]
[SelectionDAG] Pick correct frame index in LowerArguments
Summary:
SelectionDAGISel::LowerArguments is associating arguments
with frame indices (FuncInfo->setArgumentFrameIndex). That
information is later on used by EmitFuncArgumentDbgValue to
create DBG_VALUE instructions that denotes that a variable
can be found on the stack.
I discovered that for our (big endian) out-of-tree target
the association created by SelectionDAGISel::LowerArguments
sometimes is wrong. I've seen this happen when a 64-bit value
is passed on the stack. The argument will occupy two stack
slots (frame index X, and frame index X+1). The fault is
that a call to setArgumentFrameIndex is associating the
64-bit argument with frame index X+1. The effect is that the
debug information (DBG_VALUE) will point at the least significant
part of the arguement on the stack. When printing the
argument in a debugger I will get the wrong value.
I managed to create a test case for PowerPC that seems to
show the same kind of problem.
The bugfix will look at the datalayout, taking endianness into
account when examining a BUILD_PAIR node, assuming that the
least significant part is in the first operand of the BUILD_PAIR.
For big endian targets we should use the frame index from
the second operand, as the most significant part will be stored
at the lower address (using the highest frame index).
Reviewers: bogner, rnk, hfinkel, sdardis, aprantl
Reviewed By: aprantl
Subscribers: nemanjai, aprantl, llvm-commits, igorb
Differential Revision: https://reviews.llvm.org/D37740
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313901
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 21 Sep 2017 18:52:03 +0000 (18:52 +0000)]
llvm-dwarfdump support --debug-frame=<offset> and --eh-frame=<offset>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313900
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Belevich [Thu, 21 Sep 2017 18:44:49 +0000 (18:44 +0000)]
[NVPTX] Implemented bar.warp.sync, barrier.sync, and vote{.sync} instructions/intrinsics/builtins.
Differential Revision: https://reviews.llvm.org/D38148
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313898
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 21 Sep 2017 17:51:07 +0000 (17:51 +0000)]
Use ArrayRef. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313895
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 21 Sep 2017 17:40:58 +0000 (17:40 +0000)]
[x86] add more tests for node-level FMF; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313893
91177308-0d34-0410-b5e6-
96231b3b80d8