OSDN Git Service

android-x86/external-llvm.git
6 years ago[cmake] Pass CMAKE_MAKE_PROGRAM to native configure
Shoaib Meenai [Mon, 8 Jan 2018 21:52:58 +0000 (21:52 +0000)]
[cmake] Pass CMAKE_MAKE_PROGRAM to native configure

If the make program isn't in the path, the native configure will fail.
Pass CMAKE_MAKE_PROGRAM to the native configure explicitly to remedy
this, similar to what's already done for external project configuration.
Explicitly set CMAKE_MAKE_PROGRAM before the user flags so that they can
override it for the native build if they desire (though I can't fathom
why that would be useful).

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

6 years agoFix uninitialized read error reported by MSAN.
Zachary Turner [Mon, 8 Jan 2018 21:38:50 +0000 (21:38 +0000)]
Fix uninitialized read error reported by MSAN.

The problem was that our Obj -> Yaml dumper had not been taught
to handle certain types of records.  This meant that when I
generated the test input files, the records were still there but
none of its fields were filled out.  So when it did the
Yaml -> Obj conversion as part of the test, it generated records
with garbage in them.

The patch here fixes the Obj <-> Yaml converter, and additionally
updates the test file with fresh Yaml generated by the fixed
converter.

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

6 years agoArgPromotion: Allow setting MaxElements in the new-style pass
Justin Bogner [Mon, 8 Jan 2018 21:13:35 +0000 (21:13 +0000)]
ArgPromotion: Allow setting MaxElements in the new-style pass

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

6 years agoAdd lit.local.cfg in test/DebugInfo/MIR/Mips/
Petar Jovanovic [Mon, 8 Jan 2018 19:44:03 +0000 (19:44 +0000)]
Add lit.local.cfg in test/DebugInfo/MIR/Mips/

Add test/DebugInfo/MIR/Mips/lit.local.cfg so no tests are run if Mips is
not a supported target.
This should resolve buildbot failures seen after r322015.

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

6 years ago[ValueTracking] remove overzealous assert
Sanjay Patel [Mon, 8 Jan 2018 18:31:13 +0000 (18:31 +0000)]
[ValueTracking] remove overzealous assert

The test is derived from a failing fuzz test:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5008

Credit to @rksimon for pointing out the problem.

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

6 years ago[LiveDebugValues] Change condition for block termination recognition
Petar Jovanovic [Mon, 8 Jan 2018 18:21:15 +0000 (18:21 +0000)]
[LiveDebugValues] Change condition for block termination recognition

The last iterator of MBB should be recognized as MBB.end() not as
MBB.instr_end() which could return bundled instruction that is not iterable
with basic iterator.

Patch by Nikola Prica.

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

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

6 years ago[TargetLibraryInfo] fix finite mathlib function availability
Sanjay Patel [Mon, 8 Jan 2018 17:38:09 +0000 (17:38 +0000)]
[TargetLibraryInfo] fix finite mathlib function availability

This patch was part of:
https://reviews.llvm.org/D41338
...but we can expose the bug in IR via constant propagation
as shown in the test. Unless the triple includes 'linux', we
should not fold these because the functions don't exist on
other platforms (yet?).

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

6 years agoFixed spelling mistake. NFCI.
Simon Pilgrim [Mon, 8 Jan 2018 17:16:59 +0000 (17:16 +0000)]
Fixed spelling mistake. NFCI.

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

6 years agoRevert "Emit Function IDs table for Control Flow Guard"
Adrian McCarthy [Mon, 8 Jan 2018 17:12:01 +0000 (17:12 +0000)]
Revert "Emit Function IDs table for Control Flow Guard"

The new test fails on the Hexagon bot.  Reverting while I investigate.

This reverts https://reviews.llvm.org/rL322005

This reverts commit b7e0026b4385180c378edc658ec91a39566f2942.

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

6 years ago[mips] Remove duplicated R6 EVA instructions
Aleksandar Beserminji [Mon, 8 Jan 2018 16:50:33 +0000 (16:50 +0000)]
[mips] Remove duplicated R6 EVA instructions

This patch removes duplicated EVA instructions in R6.

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

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

6 years ago[CVP] Replace incoming values from unreachable blocks with undef.
Davide Italiano [Mon, 8 Jan 2018 16:34:06 +0000 (16:34 +0000)]
[CVP] Replace incoming values from unreachable blocks with undef.

This is an attempt of fixing PR35807.
Due to the non-standard definition of dominance in LLVM, where uses in
unreachable blocks are dominated by anything, you can have, in an
unreachable block:

  %patatino = OP1 %patatino, CONSTANT

When `SimplifyInstruction` receives a PHI where an incoming value is of
the aforementioned form, in some cases, loops indefinitely.

What I propose here instead is keeping track of the incoming values
from unreachable blocks, and replacing them with undef. It fixes this
case, and it seems to be good regardless (even if we can't prove that
the value is constant, as it's coming from an unreachable block, we
can ignore it).

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

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

6 years agoEmit Function IDs table for Control Flow Guard
Adrian McCarthy [Mon, 8 Jan 2018 16:33:42 +0000 (16:33 +0000)]
Emit Function IDs table for Control Flow Guard

Adds option /guard:cf to clang-cl and -cfguard to cc1 to emit function IDs
of functions that have their address taken into a section named .gfids$y for
compatibility with Microsoft's Control Flow Guard feature.

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

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

6 years ago[mips] Improve diagnostics for instruction mapping
Aleksandar Beserminji [Mon, 8 Jan 2018 16:25:40 +0000 (16:25 +0000)]
[mips] Improve diagnostics for instruction mapping

This patch improves diagnostic for case when mapped instruction
does not contain a field listed under RowFields.

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

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

6 years ago[DAG] Teach BaseIndexOffset to correctly handle with indexed operations
Nirav Dave [Mon, 8 Jan 2018 16:21:35 +0000 (16:21 +0000)]
[DAG] Teach BaseIndexOffset to correctly handle with indexed operations

BaseIndexOffset address analysis incorrectly ignores offsets folded
into indexed memory operations causing potential errors in alias
analysis of pre-indexed operations.

Reviewers: efriedma, RKSimon, hfinkel, jyknight

Subscribers: hiraditya, javed.absar, llvm-commits

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

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

6 years ago[InstCombine] fold min/max tree with common operand (PR35717)
Sanjay Patel [Mon, 8 Jan 2018 15:05:34 +0000 (15:05 +0000)]
[InstCombine] fold min/max tree with common operand (PR35717)

There is precedence for factorization transforms in instcombine for FP ops with fast-math.
We also have similar logic in foldSPFofSPF().

It would take more work to add this to reassociate because that's specialized for binops,
and min/max are not binops (or even single instructions). Also, I don't have evidence that
larger min/max trees than this exist in real code, but if we find that's true, we might
want to reorganize where/how we do this optimization.

In the motivating example from https://bugs.llvm.org/show_bug.cgi?id=35717 , we have:

int test(int xc, int xm, int xy) {
  int xk;
  if (xc < xm)
    xk = xc < xy ? xc : xy;
  else
    xk = xm < xy ? xm : xy;
  return xk;
}

This patch solves that problem because we recognize more min/max patterns after rL321672

https://rise4fun.com/Alive/Qjne
https://rise4fun.com/Alive/3yg

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

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

6 years ago[ARM] Fix PR35379 - incorrect unwind information when compiling with -Oz
Momchil Velikov [Mon, 8 Jan 2018 14:47:19 +0000 (14:47 +0000)]
[ARM] Fix PR35379 - incorrect unwind information when compiling with -Oz

The patch makes the unwind information not mention registers, which were pushed
solely for the purpose of saving stack adjustment instructions.

Differential revision: https://reviews.llvm.org/D41300
Fixes https://bugs.llvm.org/show_bug.cgi?id=35379

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

6 years ago[SLP] Fix PR35777: Incorrect handling of aggregate values.
Alexey Bataev [Mon, 8 Jan 2018 14:43:06 +0000 (14:43 +0000)]
[SLP] Fix PR35777: Incorrect handling of aggregate values.

Summary:
Fixes the bug with incorrect handling of InsertValue|InsertElement
instrucions in SLP vectorizer. Currently, we may use incorrect
ExtractElement instructions as the operands of the original
InsertValue|InsertElement instructions.

Reviewers: mkuper, hfinkel, RKSimon, spatel

Subscribers: llvm-commits

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

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

6 years ago[SLP] Fix PR35628: Count external uses on extra reduction arguments.
Alexey Bataev [Mon, 8 Jan 2018 14:33:11 +0000 (14:33 +0000)]
[SLP] Fix PR35628: Count external uses on extra reduction arguments.

Summary:
If the vectorized value is marked as extra reduction argument, its users
are not considered as external users. Patch fixes this.

Reviewers: mkuper, hfinkel, RKSimon, spatel

Subscribers: llvm-commits

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

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

6 years ago[DAGCombine] Fix for PR35761
Sam Parker [Mon, 8 Jan 2018 13:21:24 +0000 (13:21 +0000)]
[DAGCombine] Fix for PR35761

I had falsely assumed that constant operands would be operand(1) of
the bin ops that may need their constant operand to be masked.

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

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

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

6 years ago[SystemZ] Comment fix in SystemZElimCompare.cpp
Jonas Paulsson [Mon, 8 Jan 2018 12:52:40 +0000 (12:52 +0000)]
[SystemZ]  Comment fix in SystemZElimCompare.cpp

NFC

Review: Ulrich Weigand

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

6 years ago[ARM] Fix PR35481
Momchil Velikov [Mon, 8 Jan 2018 11:32:37 +0000 (11:32 +0000)]
[ARM] Fix PR35481

This patch allows `r7` to be used, regardless of its use as a frame pointer, as
a temporary register when popping `lr`, and also falls back to using a high
temporary register if, for some reason, we weren't able to find a suitable low
one.

Differential revision: https://reviews.llvm.org/D40961
Fixes https://bugs.llvm.org/show_bug.cgi?id=35481

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

6 years ago[X86] Renamed CodeGen test
Sam Parker [Mon, 8 Jan 2018 10:56:44 +0000 (10:56 +0000)]
[X86] Renamed CodeGen test

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

6 years ago[X86] Remove side-effects from determineCalleeSaves
Francis Visoiu Mistrih [Mon, 8 Jan 2018 10:46:05 +0000 (10:46 +0000)]
[X86] Remove side-effects from determineCalleeSaves

(Target)FrameLowering::determineCalleeSaves can be called multiple
times. I don't think it should have side-effects as creating stack
objects and setting global MachineFunctionInfo state as it is doing
today (in other back-ends as well).

This moves the creation of stack objects from determineCalleeSaves to
assignCalleeSavedSpillSlots.

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

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

6 years ago[X86] Replace CVT2MASK ISD opcode with PCMPGTM compared to zero.
Craig Topper [Mon, 8 Jan 2018 06:53:54 +0000 (06:53 +0000)]
[X86] Replace CVT2MASK ISD opcode with PCMPGTM compared to zero.

CVT2MASK is just checking the sign bit which can be represented with a comparison with zero.

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

6 years ago[X86] Add patterns to allow 512-bit BWI compare instructions to be used for 128/256...
Craig Topper [Mon, 8 Jan 2018 06:53:52 +0000 (06:53 +0000)]
[X86] Add patterns to allow 512-bit BWI compare instructions to be used for 128/256-bit compares when VLX is not available.

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

6 years agoDon't try to run MCJIT/OrcJIT EH tests when C++ library is statically linked
Petr Hosek [Mon, 8 Jan 2018 02:48:41 +0000 (02:48 +0000)]
Don't try to run MCJIT/OrcJIT EH tests when C++ library is statically linked

These tests assumes availability of external symbols provided by the
C++ library, but those won't be available in case when the C++ library
is statically linked because lli itself doesn't need these.

This uses llvm-readobj -needed-libs to check if C++ library is linked as
shared library and exposes that information as a feature to lit.

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

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

6 years ago[llvm-readobj] Support -needed-libs option for Mach-O files
Petr Hosek [Mon, 8 Jan 2018 02:23:10 +0000 (02:23 +0000)]
[llvm-readobj] Support -needed-libs option for Mach-O files

This implements the -needed-libs option in Mach-O dumper.

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

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

6 years ago[X86] Simplify some code in lower1BitVectorShuffle by relying on getNode's ability...
Craig Topper [Sun, 7 Jan 2018 23:56:37 +0000 (23:56 +0000)]
[X86] Simplify some code in lower1BitVectorShuffle by relying on getNode's ability to constant fold vector SIGN_EXTEND.

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

6 years ago[X86] Add VSHUFF32X4 and similar instructions to load folding tables.
Craig Topper [Sun, 7 Jan 2018 23:30:20 +0000 (23:30 +0000)]
[X86] Add VSHUFF32X4 and similar instructions to load folding tables.

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

6 years agoRevert "[SCCP] Manually fold branches on undef."
Davide Italiano [Sun, 7 Jan 2018 22:09:44 +0000 (22:09 +0000)]
Revert "[SCCP] Manually fold branches on undef."

I thought this was responsible for PR35723, but I was
wrong, the issue lies elsewhere. Revert while I debug.

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

6 years ago[SLPVectorizer] Reintroduce std::stable_sort(properlyDominates()).
Davide Italiano [Sun, 7 Jan 2018 22:06:24 +0000 (22:06 +0000)]
[SLPVectorizer] Reintroduce std::stable_sort(properlyDominates()).

The approach was never discussed, I wasn't able to reproduce this
non-determinism, and the original author went AWOL.
After a discussion on the ML, Philip suggested to revert this.

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

6 years ago[X86] Revert accidental change to CMakeLists.txt in r321952
Craig Topper [Sun, 7 Jan 2018 21:03:43 +0000 (21:03 +0000)]
[X86] Revert accidental change to CMakeLists.txt in r321952

I had removed the qualifiers around the autogenerated folding table so I could compare with the manual table, but didn't intend to commit the change.

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

6 years agoX86 Tests: Add Tests for PMADDWD selection. NFC.
Zvi Rackover [Sun, 7 Jan 2018 20:21:10 +0000 (20:21 +0000)]
X86 Tests: Add Tests for PMADDWD selection. NFC.

Support for ISel to be added.

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

6 years ago[DAG] Fix for Bug PR34620 - Allow SimplifyDemandedBits to look through bitcasts
Simon Pilgrim [Sun, 7 Jan 2018 19:09:40 +0000 (19:09 +0000)]
[DAG] Fix for Bug PR34620 - Allow SimplifyDemandedBits to look through bitcasts

Allow SimplifyDemandedBits to use TargetLoweringOpt::computeKnownBits to look through bitcasts. This can help simplifying in some cases where bitcasts of constants generated during or after legalization can't be folded away, and thus didn't get picked up by SimplifyDemandedBits. This fixes PR34620, where a redundant pand created during legalization from lowering and lshr <16xi8> wasn't being simplified due to the presence of a bitcasted build_vector as an operand.

Committed on the behalf of @sameconrad (Sam Conrad)

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

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

6 years ago[X86] Remove unneeded code from combineGatherScatter that used to delte SIGN_EXTEND_I...
Craig Topper [Sun, 7 Jan 2018 18:34:08 +0000 (18:34 +0000)]
[X86] Remove unneeded code from combineGatherScatter that used to delte SIGN_EXTEND_INREG nodes created during legalization of v2i1/v4i1 masks on KNL.

v2i1/v4i1 are now legal on KNL so no sign_extend_inreg is generated.

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

6 years ago[X86] Make v2i1 and v4i1 legal types without VLX
Craig Topper [Sun, 7 Jan 2018 18:20:37 +0000 (18:20 +0000)]
[X86] Make v2i1 and v4i1 legal types without VLX

Summary:
There are few oddities that occur due to v1i1, v8i1, v16i1 being legal without v2i1 and v4i1 being legal when we don't have VLX. Particularly during legalization of v2i32/v4i32/v2i64/v4i64 masked gather/scatter/load/store. We end up promoting the mask argument to these during type legalization and then have to widen the promoted type to v8iX/v16iX and truncate it to get the element size back down to v8i1/v16i1 to use a 512-bit operation. Since need to fill the upper bits of the mask we have to fill with 0s at the promoted type.

It would be better if we could just have the v2i1/v4i1 types as legal so they don't undergo any promotion. Then we can just widen with 0s directly in a k register. There are no real v4i1/v2i1 instructions anyway. Everything is done on a larger register anyway.

This also fixes an issue that we couldn't implement a masked vextractf32x4 from zmm to xmm properly.

We now have to support widening more compares to 512-bit to get a mask result out so new tablegen patterns got added.

I had to hack the legalizer for widening the operand of a setcc a bit so it didn't try create a setcc returning v4i32, extract from it, then try to promote it using a sign extend to v2i1. Now we create the setcc with v4i1 if the original setcc's result type is v2i1. Then extract that and don't sign extend it at all.

There's definitely room for improvement with some follow up patches.

Reviewers: RKSimon, zvi, guyblank

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years ago[LV][VPlan] NFC patch to move LoopVectorizationPlanner class out of LoopVectorize.cpp
Hal Finkel [Sun, 7 Jan 2018 16:02:58 +0000 (16:02 +0000)]
[LV][VPlan] NFC patch to move LoopVectorizationPlanner class out of LoopVectorize.cpp

Another small step forward to move VPlan stuff outside of LoopVectorize.cpp.

VPlanBuilder.h is renamed to LoopVectorizationPlanner.h
LoopVectorizationPlanner class is moved from LoopVectorize.cpp to
LoopVectorizationPlanner.h LoopVectorizationCostModel::VectorizationFactor
class is moved to LoopVectorizationPlanner.h (used by the planner class) ---
this needs further streamlining work in later patches and thus all I did was
take it out of the CostModel class and moved to the header file.  The callback
function had to stay inside LoopVectorize.cpp since it calls an
InnerLoopVectorizer member function declared in it.  Next Steps: Make
InnerLoopVectorizer, LoopVectorizationCostModel, and other classes more modular
and more aligned with VPlan direction, in small increments.

Previous step was: r320900 (https://reviews.llvm.org/D41045)

Patch by Hideki Saito, thanks!

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

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

6 years ago[CodeExtractor] Use subset of function attributes for extracted function.
Florian Hahn [Sun, 7 Jan 2018 11:22:25 +0000 (11:22 +0000)]
[CodeExtractor] Use subset of function attributes for extracted function.

In addition to target-dependent attributes, we can also preserve a
white-listed subset of target independent function attributes. The white-list
excludes problematic attributes, most prominently:

* attributes related to memory accesses, as alloca instructions
  could be moved in/out of the extracted block

* control-flow dependent attributes, like no_return or thunk, as the
  relerelevant instructions might or might not get extracted.

Thanks @efriedma and @aemerson for providing a set of attributes that cannot be
propagated.

Reviewers: efriedma, davidxl, davide, silvas

Reviewed By: efriedma

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

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

6 years ago[PowerPC] Add an ISD::TRUNCATE to the legalization for ppc_is_decremented_ctr_nonzero
Craig Topper [Sun, 7 Jan 2018 07:51:36 +0000 (07:51 +0000)]
[PowerPC] Add an ISD::TRUNCATE to the legalization for ppc_is_decremented_ctr_nonzero

Summary:
I believe legalization is really expecting that ReplaceNodeResults will return something with the same type as the thing that's being legalized. Ultimately, it uses the output to replace the uses in the DAG so the type should match to make that work.

There are two relevant cases here. When crbits are enabled, then i1 is a legal type and getSetCCResultType should return i1. In this case, the truncate will be between i1 and i1 and should be removed (SelectionDAG::getNode does this). Otherwise, getSetCCResultType will be i32 and the legalizer will promote the truncate to be i32 -> i32 which will be similarly removed.

With this fixed we can remove some code from PromoteIntRes_SETCC that seemed to only exist to deal with the intrinsic being replaced with a larger type without changing the other operand. With the truncate being used for connectivity this doesn't happen anymore.

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: nemanjai, llvm-commits, kbarton

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

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

6 years ago[X86] Add the 16 and 8-bit CRC32 instructions to the load folding tables.
Craig Topper [Sun, 7 Jan 2018 06:48:20 +0000 (06:48 +0000)]
[X86] Add the 16 and 8-bit CRC32 instructions to the load folding tables.

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

6 years ago[X86] Correct the load folding flags for xmm fp->mmx conversion instructions.
Craig Topper [Sun, 7 Jan 2018 06:24:30 +0000 (06:24 +0000)]
[X86] Correct the load folding flags for xmm fp->mmx conversion instructions.

The instructions that load 64-bits or an xmm register should be TB_NO_REVERSE to avoid the load being widened during unfold. The instructions that load 128-bits need to ensure 128-bit alignment.

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

6 years ago[X86] Add TB_NO_REVERSE to some scalar intrinsic instructions in the load folding...
Craig Topper [Sun, 7 Jan 2018 06:24:29 +0000 (06:24 +0000)]
[X86] Add TB_NO_REVERSE to some scalar intrinsic instructions in the load folding table.

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

6 years ago[X86] Don't put any EVEX_B instructions in the tablegen generated load folding tables.
Craig Topper [Sun, 7 Jan 2018 06:24:28 +0000 (06:24 +0000)]
[X86] Don't put any EVEX_B instructions in the tablegen generated load folding tables.

EVEX_B means different things for memory and register forms. The instructions should not be considered equivalent.

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

6 years ago[X86] Add 128 and 256-bit VPOPCNTD/Q instructions to load folding tables.
Craig Topper [Sun, 7 Jan 2018 06:24:27 +0000 (06:24 +0000)]
[X86] Add 128 and 256-bit VPOPCNTD/Q instructions to load folding tables.

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

6 years ago[X86] Add some 8 and 16-bit instructions to the load folding tables.
Craig Topper [Sun, 7 Jan 2018 06:24:25 +0000 (06:24 +0000)]
[X86] Add some 8 and 16-bit instructions to the load folding tables.

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

6 years ago[X86] Add EVEX vcvtph2ps to the load folding tables.
Craig Topper [Sun, 7 Jan 2018 06:24:24 +0000 (06:24 +0000)]
[X86] Add EVEX vcvtph2ps to the load folding tables.

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

6 years ago[X86] Remove cvtps2ph xmm->xmm from store folding tables. Add the evex versions of...
Craig Topper [Sun, 7 Jan 2018 06:24:23 +0000 (06:24 +0000)]
[X86] Remove cvtps2ph xmm->xmm from store folding tables. Add the evex versions of cvtps2ph to the store folding tables.

The memory form of the xmm->xmm version only writes 64-bits. If we use it in the folding tables and its get used for a stack spill, only half the slot will be written. Then a reload may read all 128-bits which will pull in garbage. But without the spill the upper bits of the register would have been zero. By not folding we would preserve the zeros.

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

6 years ago[X86] Add CMP8ri8 to load folding tables.
Craig Topper [Sun, 7 Jan 2018 06:24:21 +0000 (06:24 +0000)]
[X86] Add CMP8ri8 to load folding tables.

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

6 years ago[X86] Remove assembler predicates from all AVX512 related feature flags.
Craig Topper [Sat, 6 Jan 2018 21:45:30 +0000 (21:45 +0000)]
[X86] Remove assembler predicates from all AVX512 related feature flags.

We don't do fine grained feature control like this on features prior to AVX512.

We do still have checks in place in the assembly parser itself that prevents %zmm references or %xmm16-31 from being parsed without at least -mattr=avx512f. Same for rounding control and mask operands. That will prevent the table matcher from matching for any instructions that need those features and that's probably good enough.

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

6 years ago[X86] Remove memory forms of EVEX encoded vcvttss2si/vcvttsd2si from asm matcher...
Craig Topper [Sat, 6 Jan 2018 21:27:25 +0000 (21:27 +0000)]
[X86] Remove memory forms of EVEX encoded vcvttss2si/vcvttsd2si from asm matcher table.

This is also needed to fix PR35837.

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

6 years ago[X86] Add load folding pattern to EVEX vcvttss2si/vcvtsd2si.
Craig Topper [Sat, 6 Jan 2018 21:02:26 +0000 (21:02 +0000)]
[X86] Add load folding pattern to EVEX vcvttss2si/vcvtsd2si.

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

6 years ago[X86] Remove an unnecessary VCVTTSD2SIrrb/VCVTSS2SIrrb instruction with no isel patte...
Craig Topper [Sat, 6 Jan 2018 21:02:22 +0000 (21:02 +0000)]
[X86] Remove an unnecessary VCVTTSD2SIrrb/VCVTSS2SIrrb instruction with no isel pattern that only existed for the assembler. Use VCVTTSD2SIrrb_Int instead.

For consistency use the _Int version of VCVTTSD2SIrr_Int and VCVTTSD2SIrm_Int for the assembler as well.

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

6 years ago[InlineFunction] Preserve calling convention when forwarding VarArgs.
Florian Hahn [Sat, 6 Jan 2018 20:56:27 +0000 (20:56 +0000)]
[InlineFunction] Preserve calling convention when forwarding VarArgs.

Reviewers: efriedma, rnk, davide

Reviewed By: rnk, davide

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

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

6 years ago[InlineFunction] Preserve attributes when forwarding VarArgs.
Florian Hahn [Sat, 6 Jan 2018 20:46:00 +0000 (20:46 +0000)]
[InlineFunction] Preserve attributes when forwarding VarArgs.

Reviewers: rnk, efriedma

Reviewed By: rnk

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

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

6 years ago[ORC] Remove AsynchronousSymbolQuery while I debug an issue on one of the
Lang Hames [Sat, 6 Jan 2018 20:14:22 +0000 (20:14 +0000)]
[ORC] Remove AsynchronousSymbolQuery while I debug an issue on one of the
builders.

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

6 years ago[InlineFunction] Inline vararg functions that do not access varargs.
Florian Hahn [Sat, 6 Jan 2018 19:45:40 +0000 (19:45 +0000)]
[InlineFunction] Inline vararg functions that do not access varargs.

If the varargs are not accessed by a function, we can inline the
function.

Reviewers: dblaikie, chandlerc, davide, efriedma, rnk, hfinkel

Reviewed By: efriedma

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

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

6 years ago[X86] Remove memory forms of EVEX encoded vcvtsd2si/vcvtss2si from the assembler...
Craig Topper [Sat, 6 Jan 2018 19:20:33 +0000 (19:20 +0000)]
[X86] Remove memory forms of EVEX encoded vcvtsd2si/vcvtss2si from the assembler matcher table

We should always prefer the VEX encoded version of these instructions. There is no advantage to the EVEX version.

Fixes PR35837.

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

6 years ago[TableGen] Make the ambiguous match debug messages from the AsmMatcherEmitter slightl...
Craig Topper [Sat, 6 Jan 2018 19:20:32 +0000 (19:20 +0000)]
[TableGen] Make the ambiguous match debug messages from the AsmMatcherEmitter slightly more useful.

Don't report ambiguous matches on different variants. Print the variant number in the output.

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

6 years ago[InstCombine] relax use constraint for min/max (~a, ~b) --> ~min/max(a, b)
Sanjay Patel [Sat, 6 Jan 2018 17:34:22 +0000 (17:34 +0000)]
[InstCombine] relax use constraint for min/max (~a, ~b) --> ~min/max(a, b)

In the minimal case, this won't remove instructions, but it still improves
uses of existing values.

In the motivating example from PR35834, it does remove instructions, and
sets that case up to be optimized by something like D41603:
https://reviews.llvm.org/D41603

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

6 years ago[InstCombine] add more tests for max(~a, ~b) and PR35834; NFC
Sanjay Patel [Sat, 6 Jan 2018 17:14:46 +0000 (17:14 +0000)]
[InstCombine] add more tests for max(~a, ~b) and PR35834; NFC

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

6 years ago[x86, MemCmpExpansion] allow 2 pairs of loads per block (PR33325)
Sanjay Patel [Sat, 6 Jan 2018 16:16:04 +0000 (16:16 +0000)]
[x86, MemCmpExpansion] allow 2 pairs of loads per block (PR33325)

This is the last step needed to fix PR33325:
https://bugs.llvm.org/show_bug.cgi?id=33325

We're trading branch and compares for loads and logic ops.
This makes the code smaller and hopefully faster in most cases.

The 24-byte test shows an interesting construct: we load the trailing scalar
elements into vector registers and generate the same pcmpeq+movmsk code that
we expected for a pair of full vector elements (see the 32- and 64-byte tests).

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

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

6 years ago[X86] Rename the EVEX encoded GFNI instructions to start with a 'V'. NFC
Craig Topper [Sat, 6 Jan 2018 07:18:08 +0000 (07:18 +0000)]
[X86] Rename the EVEX encoded GFNI instructions to start with a 'V'. NFC

This makes the names consistent with the mnemonics like every other instruction.

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

6 years ago[X86] When parsing rounding mode operands, provide a proper end location so we don...
Craig Topper [Sat, 6 Jan 2018 06:41:07 +0000 (06:41 +0000)]
[X86] When parsing rounding mode operands, provide a proper end location so we don't crash when trying to print an error message using it.

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

6 years ago[X86] Call lowerShuffleAsRepeatedMaskAndLanePermute from lowerV4I64VectorShuffle.
Craig Topper [Sat, 6 Jan 2018 06:08:04 +0000 (06:08 +0000)]
[X86] Call lowerShuffleAsRepeatedMaskAndLanePermute from lowerV4I64VectorShuffle.

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

6 years ago[X86] Run dos2unix on a test file. NFC
Craig Topper [Sat, 6 Jan 2018 06:08:02 +0000 (06:08 +0000)]
[X86] Run dos2unix on a test file. NFC

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

6 years ago[ORC] Yet more debugging output to diagnose test failures.
Lang Hames [Sat, 6 Jan 2018 05:19:07 +0000 (05:19 +0000)]
[ORC] Yet more debugging output to diagnose test failures.

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

6 years ago[ORC] Fix the counter type on SymbolStringPool entries.
Lang Hames [Sat, 6 Jan 2018 05:19:06 +0000 (05:19 +0000)]
[ORC] Fix the counter type on SymbolStringPool entries.

Hopefully this will fix the build failure in
http://lab.llvm.org:8011/builders/llvm-mips-linux/builds/3417

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

6 years ago[ORC] More debugging output to track down tester failures.
Lang Hames [Sat, 6 Jan 2018 04:35:51 +0000 (04:35 +0000)]
[ORC] More debugging output to track down tester failures.

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

6 years ago[ORC] Temporarily adding some redundant asserts / debug output to aid in
Lang Hames [Sat, 6 Jan 2018 01:06:07 +0000 (01:06 +0000)]
[ORC] Temporarily adding some redundant asserts / debug output to aid in
debugging a tester failure.

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

6 years ago[ORC] Fix a think-o in the current AsynchronousSymbolQuery test.
Lang Hames [Sat, 6 Jan 2018 01:06:05 +0000 (01:06 +0000)]
[ORC] Fix a think-o in the current AsynchronousSymbolQuery test.

This *should* be a no-op as far as the current failure is concerned, but needs
to be fixed anyway.

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

6 years ago[Debugify] Handled unsized types
Vedant Kumar [Sat, 6 Jan 2018 00:37:01 +0000 (00:37 +0000)]
[Debugify] Handled unsized types

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

6 years ago[Utils] Simplify salvageDebugInfo, NFCI
Vedant Kumar [Fri, 5 Jan 2018 23:27:02 +0000 (23:27 +0000)]
[Utils] Simplify salvageDebugInfo, NFCI

Having a single call to findDbgUsers() allows salvageDebugInfo() to
return earlier.

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

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

6 years ago[X86] Add vcvtsd2sil/vcvtsd2siq etc. InstAliases to the EVEX-encoded instructions.
Craig Topper [Fri, 5 Jan 2018 23:13:54 +0000 (23:13 +0000)]
[X86] Add vcvtsd2sil/vcvtsd2siq etc. InstAliases to the EVEX-encoded instructions.

This matches their VEX equivalents.

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

6 years agoRe-land "Fix faulty assertion in debug info"
Adrian McCarthy [Fri, 5 Jan 2018 23:01:04 +0000 (23:01 +0000)]
Re-land "Fix faulty assertion in debug info"

This had been reverted because the new test failed on non-X86 bots.  I moved
the new test to the appropriate subdirectory to correct this.

Differential Revision: https://reviews.llvm.org/D41264
Original submission:  r321122 (which was reverted by r321125)

This reverts commit 3c1639b5703c387a0d8cba2862803b4e68dff436.

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

6 years ago[ORC] Re-apply just the AsynchronousSymbolLookup class from r321838 while I
Lang Hames [Fri, 5 Jan 2018 22:50:43 +0000 (22:50 +0000)]
[ORC] Re-apply just the AsynchronousSymbolLookup class from r321838 while I
investigate builder / test failures.

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

6 years ago[Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors
Krzysztof Parzyszek [Fri, 5 Jan 2018 22:31:11 +0000 (22:31 +0000)]
[Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors

Recommit r321897 with updated testcases.

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

6 years ago[DebugInfo] Align comments in debug_loc section
Bjorn Pettersson [Fri, 5 Jan 2018 22:20:30 +0000 (22:20 +0000)]
[DebugInfo] Align comments in debug_loc section

Summary:
This commit updates the BufferByteStreamer, used by DebugLocStream
to buffer bytes/comments to put in the debug_loc section, to
make sure that the Buffer and Comments vectors are synced.
Previously, when an SLEB128 or ULEB128 was emitted together with
a comment, the vectors could be out-of-sync if the LEB encoding
added several entries to the Buffer vectors, while we only added
a single entry to the Comments vector.

The goal with this is to get the comments in the debug_loc
section in the .s file correctly aligned.

Example (using ARM as target):
Instead of

  .byte 144                     @ sub-register DW_OP_regx
  .byte 128                     @ 256
  .byte 2                       @ DW_OP_piece
  .byte 147                     @ 8
  .byte 8                       @ sub-register DW_OP_regx
  .byte 144                     @ 257
  .byte 129                     @ DW_OP_piece
  .byte 2                       @ 8
  .byte 147                     @
  .byte 8                       @

we now get

  .byte 144                     @ sub-register DW_OP_regx
  .byte 128                     @ 256
  .byte 2                       @
  .byte 147                     @ DW_OP_piece
  .byte 8                       @ 8
  .byte 144                     @ sub-register DW_OP_regx
  .byte 129                     @ 257
  .byte 2                       @
  .byte 147                     @ DW_OP_piece
  .byte 8                       @ 8

Reviewers: JDevlieghere, rnk, aprantl

Reviewed By: aprantl

Subscribers: davide, Ka-Ka, uabelho, aemerson, javed.absar, kristof.beyls, llvm-commits, JDevlieghere

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

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

6 years agoFix some opt-viewer test issues and disable on Windows.
Zachary Turner [Fri, 5 Jan 2018 22:05:13 +0000 (22:05 +0000)]
Fix some opt-viewer test issues and disable on Windows.

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

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

6 years agoRevert r321894: it requires a part of another commit that is not ready yet
Krzysztof Parzyszek [Fri, 5 Jan 2018 21:57:43 +0000 (21:57 +0000)]
Revert r321894: it requires a part of another commit that is not ready yet

Commit message:
[Hexagon] Add patterns for sext_inreg of HVX vector types

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

6 years ago[X86] Add InstAliases for 'vmovd' with GR64 registers to select EVEX encoded instruct...
Craig Topper [Fri, 5 Jan 2018 21:57:23 +0000 (21:57 +0000)]
[X86] Add InstAliases for 'vmovd' with GR64 registers to select EVEX encoded instructions as well.

Without this we allow "vmovd %rax, %xmm0", but not "vmovd %rax, %xmm16"

This exists due to continue a silly bug where really old versions of the GNU assembler required movd instead of movq on these instructions. This compatibility hack then crept forward to avx version too, but we didn't propagate it to avx512.

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

6 years agoRevert r321897: affected testcases were not updated
Krzysztof Parzyszek [Fri, 5 Jan 2018 21:50:15 +0000 (21:50 +0000)]
Revert r321897: affected testcases were not updated

Commit message:
[Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors

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

6 years agodwarfdump: Match the --uuid output with that of Darwin dwarfdump.
Adrian Prantl [Fri, 5 Jan 2018 21:44:17 +0000 (21:44 +0000)]
dwarfdump: Match the --uuid output with that of Darwin dwarfdump.
This option is widely used by scripts and there is no reason to break them.

rdar://problem/36032398

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

6 years ago[X86] Stop printing moves between VR64 and GR64 with 'movd' mnemonic. Use 'movq'...
Craig Topper [Fri, 5 Jan 2018 20:55:12 +0000 (20:55 +0000)]
[X86] Stop printing moves between VR64 and GR64 with 'movd' mnemonic. Use 'movq' instead.

This behavior existed to work with an old version of the gnu assembler on MacOS that only accepted this form. Newer versions of GNU assembler and the current LLVM derived version of the assembler on MacOS support movq as well.

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

6 years ago[Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:49:26 +0000 (20:49 +0000)]
[Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors

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

6 years ago[Hexagon] Add patterns for truncating HVX vector types
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:48:03 +0000 (20:48 +0000)]
[Hexagon] Add patterns for truncating HVX vector types

Only non-bool vectors.

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

6 years ago[Hexagon] Add patterns for sext_inreg of HVX vector types
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:46:41 +0000 (20:46 +0000)]
[Hexagon] Add patterns for sext_inreg of HVX vector types

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

6 years ago[Hexagon] Add a bitcast to required type in LowerHvxMul
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:45:34 +0000 (20:45 +0000)]
[Hexagon] Add a bitcast to required type in LowerHvxMul

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

6 years ago[Hexagon] Add pattern for vsplat to v8i8
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:43:56 +0000 (20:43 +0000)]
[Hexagon] Add pattern for vsplat to v8i8

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

6 years ago[Hexagon] Set boolean contents in HexagonISelLowering
Krzysztof Parzyszek [Fri, 5 Jan 2018 20:41:50 +0000 (20:41 +0000)]
[Hexagon] Set boolean contents in HexagonISelLowering

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

6 years ago[llvm-cov] Change test to use FileCheck instead of grep.
Douglas Yung [Fri, 5 Jan 2018 20:00:18 +0000 (20:00 +0000)]
[llvm-cov] Change test to use FileCheck instead of grep.

Reviewed by Paul Robinson

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

6 years agoFix -Wsign-compare warnings on Windows
Reid Kleckner [Fri, 5 Jan 2018 19:53:51 +0000 (19:53 +0000)]
Fix -Wsign-compare warnings on Windows

These arise because enums are 'int' by default.

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

6 years agoLimit size of non-GlobalValue name
Serge Guelton [Fri, 5 Jan 2018 19:41:19 +0000 (19:41 +0000)]
Limit size of non-GlobalValue name

Otherwise, in some extreme test case, very long names are created and the
compiler consumes large amount of memory. Size limit is set to a relatively
high value not to disturb debugging.

Compiler flag -non-global-value-max-name-size=<value> can be used to customize
the size.

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

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

6 years ago[llvm-objcopy] Add --localize-hidden option
Jake Ehrlich [Fri, 5 Jan 2018 19:19:09 +0000 (19:19 +0000)]
[llvm-objcopy] Add --localize-hidden option

This change adds support in llvm-objcopy for GNU objcopy's --localize-hidden
option. This option changes every hidden or internal symbol into a local symbol.

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

6 years ago[PDB] Correctly link S_FILESTATIC records.
Zachary Turner [Fri, 5 Jan 2018 19:12:40 +0000 (19:12 +0000)]
[PDB] Correctly link S_FILESTATIC records.

This is not a record type that clang currently generates,
but it is a record that is encountered in object files generated
by cl.  This record is unusual in that it refers directly to
the string table instead of indirectly to the string table via
the FileChecksums table.  Because of this, it was previously
overlooked and we weren't remapping the string indices at all.
This would lead to crashes in MSVC when trying to display a
variable whose debug info involved an S_FILESTATIC.

Original bug report by Alexander Ganea

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

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

6 years ago[InstCombine] add folds for min(~a, b) --> ~max(a, b)
Sanjay Patel [Fri, 5 Jan 2018 19:01:17 +0000 (19:01 +0000)]
[InstCombine] add folds for min(~a, b) --> ~max(a, b)

Besides the bug of omitting the inverse transform of max(~a, ~b) --> ~min(a, b),
the use checking and operand creation were off. We were potentially creating
repeated identical instructions of existing values. This led to infinite
looping after I added the extra folds.

By using the simpler m_Not matcher and not creating new 'not' ops for a and b,
we avoid that problem. It's possible that not using IsFreeToInvert() here is
more limiting than the simpler matcher, but there are no tests for anything
more exotic. It's also possible that we should relax the use checking further
to handle a case like PR35834:
https://bugs.llvm.org/show_bug.cgi?id=35834
...but we can make that a follow-up if it is needed.

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

6 years ago[llvm-mt] Remove platform-specific path in test
Brian Gesiak [Fri, 5 Jan 2018 18:23:22 +0000 (18:23 +0000)]
[llvm-mt] Remove platform-specific path in test

Summary:
Remove a platform-specific path separator added to the llvm-mt help text test
in https://reviews.llvm.org/D41732.

Test Plan: `check-llvm`

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

6 years ago[MSF] Fix FPM interval calcluation
Zachary Turner [Fri, 5 Jan 2018 18:12:14 +0000 (18:12 +0000)]
[MSF] Fix FPM interval calcluation

We have some code to try to determine how many pieces an MSF
Free Page Map is split into, and this code had an off by one
error which would cause the calculation to be incorrect when
there were exactly 4096*k + 1 blocks in an MSF file.

Original investigation and patch outline by Colden Cullen.

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

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

6 years agoRegionInfo: Use report_fatal_error instead of llvm_unreachable
Matt Arsenault [Fri, 5 Jan 2018 17:51:36 +0000 (17:51 +0000)]
RegionInfo: Use report_fatal_error instead of llvm_unreachable

Otherwise when using -verify-region-info in a release build the
error won't be emitted.

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

6 years ago[Option] Add 'findNearest' method to catch typos
Brian Gesiak [Fri, 5 Jan 2018 17:10:39 +0000 (17:10 +0000)]
[Option] Add 'findNearest' method to catch typos

Summary:
Add a method `OptTable::findNearest`, which allows users of OptTable to
check user input for misspelled options. In addition, have llvm-mt
check for misspelled options. For example, if a user invokes
`llvm-mt /oyt:foo`, the error message will indicate that while an
option named `/oyt:` does not exist, `/out:` does.

The method ports the functionality of the `LookupNearestOption` method
from LLVM CommandLine to libLLVMOption. This allows tools like Clang
and Swift, which do not use CommandLine, to use this functionality to
suggest similarly spelled options.

As room for future improvement, the new method as-is cannot yet properly suggest
nearby "joined" options -- that is, for an option string "-FozBar", where
"-Foo" is the correct option name and "Bar" is the value being passed along
with the misspelled option, this method will calculate an edit distance of 4,
by deleting "Bar" and changing "z" to "o". It should instead calculate an edit
distance of just 1, by changing "z" to "o" and recognizing "Bar" as a
value. This commit includes a disabled test that expresses this limitation.

Test Plan: `check-llvm`

Reviewers: yamaguchi, v.g.vassilev, teemperor, ruiu, jroelofs

Reviewed By: jroelofs

Subscribers: jroelofs, llvm-commits

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

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

6 years ago[llvm-cov] Temporarily disable multithreaded-report.test on Windows.
Max Moroz [Fri, 5 Jan 2018 16:43:24 +0000 (16:43 +0000)]
[llvm-cov] Temporarily disable multithreaded-report.test on Windows.

Summary: The test is failing because Windows do not support "diff -r".

Reviewers: Dor1s

Reviewed By: Dor1s

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

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