]> granicus.if.org Git - llvm/log
llvm
6 years agoFix some sphinx doc errors.
James Y Knight [Fri, 1 Feb 2019 17:06:41 +0000 (17:06 +0000)]
Fix some sphinx doc errors.

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

6 years ago[InstCombine] Refactor test checks (NFC)
Evandro Menezes [Fri, 1 Feb 2019 16:57:53 +0000 (16:57 +0000)]
[InstCombine] Refactor test checks (NFC)

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

6 years ago[AMDGPU] Fix for vector element insertion
Tim Corringham [Fri, 1 Feb 2019 16:51:09 +0000 (16:51 +0000)]
[AMDGPU] Fix for vector element insertion

Summary:
Incorrect code was generated when lowering insertelement operations
for vectors with 8 or 16 bit elements.  The value being inserted was
not adjusted for the position of the element within the 32 bit word
and so only the low element within each 32 bit word could receive
the intended value.

Fixed by simply replicating the value to each element of a
congruent vector before the mask and or operation used to
update the intended element.

A number of affected LIT tests have been updated appropriately.

before the mask & or into the intended

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

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

Tags: #llvm

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

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

6 years ago[SDAG] improve variable names; NFC
Sanjay Patel [Fri, 1 Feb 2019 16:06:53 +0000 (16:06 +0000)]
[SDAG] improve variable names; NFC

The version of FoldConstantArithmetic() that takes arbitrary nodes
was confusingly naming those nodes as constants when they might
not be; also "Cst" reads like "Cast".

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

6 years ago[X86][SSE] Use PSLLDQ/PSRLDQ to mask out zeroable ends of a shuffle
Simon Pilgrim [Fri, 1 Feb 2019 16:02:12 +0000 (16:02 +0000)]
[X86][SSE] Use PSLLDQ/PSRLDQ to mask out zeroable ends of a shuffle

As suggested on PR40318, this patch uses PSLLDQ/PSRLDQ to lower shuffles to zero out the ends of a vector, leaving a sequential inner section.

For pre-SSSE3 we do this for shuffles with zeros at either end (requiring up to 3 shifts), but once PSHUFB is available I've limited this to shuffles with a single zeroable end (2 shifts).

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

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

6 years ago[TargetLowering] try harder to determine undef elements of vector binops
Sanjay Patel [Fri, 1 Feb 2019 15:35:12 +0000 (15:35 +0000)]
[TargetLowering] try harder to determine undef elements of vector binops

This might be the start of tracking all vector element constants generally if we take it to its
logical conclusion, but let's stop here and make sure this is correct/beneficial so far.

The affected tests require a convoluted path before they get simplified currently because we
don't call SimplifyDemandedVectorElts() from binops directly and don't modify the binop operands
directly in SimplifyDemandedVectorElts().

That's why the tests all have a trailing shuffle to induce a chain reaction of transforms. So
something like this is happening:

1. Improve the knowledge of undefs in the binop via a SimplifyDemandedVectorElts() call that
   originates from a shuffle.
2. Transfer that undef knowledge back to the shuffle mask user as more undef lanes.
3. Combine the modified shuffle by calling SimplifyDemandedVectorElts() again.
4. Translate the improved shuffle mask as undemanded lanes of build vector constants causing
   those to become full undef constants.
5. Simplify the binop now that it has a full undef operand.

As we can see from the unchanged 'and' and 'or' tests, tracking undefs alone isn't a full solution.
We would need to track zero and all-ones constants to improve those opcodes. We'd probably need to
track NaN for FP ops too (assuming we don't have fast-math-flags set).

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

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

6 years ago[X86][AVX] Combine INSERT_SUBVECTOR(SRC0, BITCAST(SHUFFLE(EXTRACT_SUBVECTOR(SRC1)))
Simon Pilgrim [Fri, 1 Feb 2019 15:31:01 +0000 (15:31 +0000)]
[X86][AVX] Combine INSERT_SUBVECTOR(SRC0, BITCAST(SHUFFLE(EXTRACT_SUBVECTOR(SRC1)))

Enable peeking through one use bitcasts to the subvector shuffle.

This still depends on the subvector being the same scalar-size but D57514 has already helped with the more tricky patterns

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

6 years ago[llvm-strip] Implement --keep-file-symbols
Eugene Leviant [Fri, 1 Feb 2019 15:25:15 +0000 (15:25 +0000)]
[llvm-strip] Implement --keep-file-symbols

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

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

6 years ago[llvm-objcopy][NFC] Propagate errors in removeSymbols/removeSectionReferences
Jordan Rupprecht [Fri, 1 Feb 2019 15:20:36 +0000 (15:20 +0000)]
[llvm-objcopy][NFC] Propagate errors in removeSymbols/removeSectionReferences

Reviewers: jhenderson, alexshap, jakehehrlich, espindola

Reviewed By: jhenderson

Subscribers: emaste, arichardson, llvm-commits

Tags: #llvm

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

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

6 years ago[InstCombine] reduce duplicate code; NFC
Sanjay Patel [Fri, 1 Feb 2019 14:37:49 +0000 (14:37 +0000)]
[InstCombine] reduce duplicate code; NFC

An unused variable problem was introduced with rL352870
and stubbed out with rL352871, but we can make a better
fix by actually using the local variable in code rather
than just the assert.

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

6 years ago[InstCombine] Fix -Wunused-variable when -DLLVM_ENABLE_ASSERTIONS=off
Fangrui Song [Fri, 1 Feb 2019 14:22:02 +0000 (14:22 +0000)]
[InstCombine] Fix -Wunused-variable when -DLLVM_ENABLE_ASSERTIONS=off

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

6 years ago[InstCombine] try to reduce x86 addcarry to generic uaddo intrinsic
Sanjay Patel [Fri, 1 Feb 2019 14:14:47 +0000 (14:14 +0000)]
[InstCombine] try to reduce x86 addcarry to generic uaddo intrinsic

If we can reduce the x86-specific intrinsic to the generic op, it allows existing
simplifications and value tracking folds. AFAICT, this always results in identical
x86 codegen in the non-reduced case...which should be true because we semi-generically
(too aggressively IMO) convert to llvm.uadd.with.overflow in CGP, so the DAG/isel must
already combine/lower this intrinsic as expected.

This isn't quite what was requested in:
https://bugs.llvm.org/show_bug.cgi?id=40486
...but we want to have these kinds of folds early for efficiency and to enable greater
simplifications. For the case in the bug report where we have:
_addcarry_u64(0, ahi, 0, &ahi)
...this gets completely simplified away in IR.

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

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

6 years ago[CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON
Stefan Granitz [Fri, 1 Feb 2019 13:08:09 +0000 (13:08 +0000)]
[CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON

Summary: D56606 was only appending target names to the `LLVM_EXPORTS`/`LLVM_EXPORTS_BUILDTREE_ONLY` properties. Targets showed up correctly in the build-tree `LLVMExports.cmake`, but they were missing in the installed one (as we found in https://bugs.llvm.org/show_bug.cgi?id=40443), because install did not register them explicitly.

Reviewers: mgorny, smeenai, beanz, gottesmm, dschuff, tstellar, serge-sans-paille

Reviewed By: smeenai

Subscribers: llvm-commits

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

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

6 years ago[AArch64] Optimize floating point materialization
Adhemerval Zanella [Fri, 1 Feb 2019 12:26:06 +0000 (12:26 +0000)]
[AArch64] Optimize floating point materialization

This patch changes isFPImmLegal to return if the value can be enconded
as the immediate operand of a logical instruction besides checking if
for immediate field for fmov.

This optimizes some floating point materization, inclusive values
used on isinf lowering.

Reviewed By: rengolin, efriedma, evandro

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

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

6 years agoDisable tidy checks with too many hits
Ilya Biryukov [Fri, 1 Feb 2019 11:20:13 +0000 (11:20 +0000)]
Disable tidy checks with too many hits

Summary:
Some tidy checks have too many hits in the codebase, making it hard to spot
other results from clang-tidy, therefore rendering the tool less useful.

Two checks were disabled:
  - misc-non-private-member-variable-in-classes in the whole LLVM monorepo,
    it is very common to have those in LLVM and the style guide does not forbid
    them.
  - readability-identifier-naming in the clang subtree. There are thousands of
    violations in 'Sema.h' alone.

Before the change, 'Sema.h' had >1000 tidy warnings, after the change the number
dropped to 3 warnings (unterminated namespace comments).

Reviewers: alexfh, hokein

Reviewed By: hokein

Subscribers: llvm-commits, cfe-commits

Tags: #clang, #llvm

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

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

6 years ago[X86][BdVer2] Transfer delays from the integer to the floating point unit.
Roman Lebedev [Fri, 1 Feb 2019 11:15:13 +0000 (11:15 +0000)]
[X86][BdVer2] Transfer delays from the integer to the floating point unit.

Summary:
I'm unable to find this number in the "AMD SOG for family 15h".
llvm-exegesis measures the latencies of these instructions as `2`,
which matches the latencies specified in "AMD SOG for family 15h".

However if we look at Agner, Microarchitecture, "AMD Bulldozer, Piledriver,
Steamroller and Excavator pipeline", "Data delay between different execution
domains", the int->ivec transfer is listed as `8`..`10`cy of additional latency.

Also, Agner's "Instruction tables", for Piledriver, lists their latencies as `12`,
which is consistent with `2cy` from exegesis / AMD SOG + `10cy` transfer delay.

Additional data point comes from the fact that Agner's "Instruction tables",
for Jaguar, lists their latencies as `8`; and "AMD SOG for family 16h" does
state the `+6cy` int->ivec delay, which is consistent with instr latency of `1` or `2`.

Reviewers: andreadb, RKSimon, craig.topper

Reviewed By: andreadb

Subscribers: gbedwell, courbet, llvm-commits

Tags: #llvm

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

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

6 years agoProvide reason messages for unviable inlining
Yevgeny Rouban [Fri, 1 Feb 2019 10:44:43 +0000 (10:44 +0000)]
Provide reason messages for unviable inlining

InlineCost's isInlineViable() is changed to return InlineResult
instead of bool. This provides messages for failure reasons and
allows to get more specific messages for cases where callsites
are not viable for inlining.

Reviewed By: xbolva00, anemet

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

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

6 years agoRevert r352750.
James Henderson [Fri, 1 Feb 2019 10:38:40 +0000 (10:38 +0000)]
Revert r352750.

This was causing a build bot failure:
http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/15346/

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

6 years ago[llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer
James Henderson [Fri, 1 Feb 2019 10:24:55 +0000 (10:24 +0000)]
[llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer

Prior to this change, there are a few tests called llvm-symbolizer* in
the DebugInfo test area. These really were testing either the DebugInfo
or Symbolizer library, rather than the llvm-symbolizer tool itself, so
this patch renames them to be clearer that they aren't explicitly tests
for llvm-symbolizer (such tests belong in test/tools/llvm-symbolizer).

This patch also reinstates the copying of a DWO file, removed previously
in r352752. The test needs this so that it could possibly fail.

Finally, some of the tests have been simplified slightly by removing
unnecessary switches and/or unused check-prefixes.

Reviewed by: dblaikie

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

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

6 years ago[doc]Update String Error documentation in Programmer Manual
James Henderson [Fri, 1 Feb 2019 10:02:42 +0000 (10:02 +0000)]
[doc]Update String Error documentation in Programmer Manual

A while back, createStringError was added to provide easier construction
of StringError instances, especially with formatting options. Prior to
this patch, that the documentation only mentions the standard method of
using it. Since createStringError is slightly shorter to type, and also
provides the formatting options, this patch updates the Programmer's
Manual to use the new function in its examples, and to mention the
printf formatting options. It also fixes a small typo in one of the
examples and removes the unnecessary make_error_code call.

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

6 years ago[CodeGen] Don't scavenge non-saved regs in exception throwing functions
Oliver Stannard [Fri, 1 Feb 2019 09:23:51 +0000 (09:23 +0000)]
[CodeGen] Don't scavenge non-saved regs in exception throwing functions

Previously, LiveRegUnits was assuming that if a block has no successors
and does not return, then no registers are live at the end of it
(because the end of the block is unreachable). This was causing the
register scavenger to use callee-saved registers to materialise stack
frame addresses without saving them in the prologue. This would normally
be fine, because the end of the block is unreachable, but this is not
legal if the block ends by throwing a C++ exception. If this happens,
the scratch register will be modified, but its previous value won't be
preserved, so it doesn't get restored by the exception unwinder.

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

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

6 years ago[obj2yaml] - Merge dumpRelSection and dumpRelaSection. NFC.
George Rimar [Fri, 1 Feb 2019 07:50:08 +0000 (07:50 +0000)]
[obj2yaml] - Merge dumpRelSection and dumpRelaSection. NFC.

These methods are very similar, patch merge them into one.

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

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

6 years ago[SLPVectorizer] Get rid of IndexQueue array from vectorizeStores. NFCI.
Yevgeny Rouban [Fri, 1 Feb 2019 06:44:08 +0000 (06:44 +0000)]
[SLPVectorizer] Get rid of IndexQueue array from vectorizeStores. NFCI.

Indices are checked as they are generated. No need to fill the whole array of indices.

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

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

6 years agoRevert "Bump minimum toolchain version"
JF Bastien [Fri, 1 Feb 2019 04:44:39 +0000 (04:44 +0000)]
Revert "Bump minimum toolchain version"

Looks like we still have a few bots that are sad. Let try to get them fixed!

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

6 years agoBump minimum toolchain version
JF Bastien [Fri, 1 Feb 2019 04:33:21 +0000 (04:33 +0000)]
Bump minimum toolchain version

Summary:
The RFC on moving past C++11 got good traction:
  http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html

This patch therefore bumps the toolchain versions according to our policy:
  llvm.org/docs/DeveloperPolicy.html#toolchain

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane

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

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

6 years ago[RISCV] Implement RV64D codegen
Alex Bradbury [Fri, 1 Feb 2019 03:53:30 +0000 (03:53 +0000)]
[RISCV] Implement RV64D codegen

This patch:
* Adds necessary RV64D codegen patterns
* Modifies CC_RISCV so it will properly handle f64 types (with soft float ABI)

Note that in general there is no reason to try to select fcvt.w[u].d rather than fcvt.l[u].d for i32 conversions because fptosi/fptoui produce poison if the input won't fit into the target type.

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

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

6 years ago[SelectionDAG] Support promotion of the FPOWI integer operand
Alex Bradbury [Fri, 1 Feb 2019 03:46:28 +0000 (03:46 +0000)]
[SelectionDAG] Support promotion of the FPOWI integer operand

For targets where i32 is not a legal type (e.g. 64-bit RISC-V),
LegalizeIntegerTypes must promote the integer operand of ISD::FPOWI. As this
is a signed value, this should be sign-extended.

This patch enables all tests in test/CodeGen/RISCVfloat-intrinsics.ll for
RV64, as prior to this patch that file couldn't be compiled for RV64 due to an
assertion when performing codegen for fpowi.

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

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

6 years agoFix compilation of examples after 13680223b9d8 / r352827
James Y Knight [Fri, 1 Feb 2019 03:23:42 +0000 (03:23 +0000)]
Fix compilation of examples after 13680223b9d8 / r352827

Who knew...they're not built by default or as part of the tests.

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

6 years ago[opaque pointer types] Add a FunctionCallee wrapper type, and use it.
James Y Knight [Fri, 1 Feb 2019 02:28:03 +0000 (02:28 +0000)]
[opaque pointer types] Add a FunctionCallee wrapper type, and use it.

Recommit r352791 after tweaking DerivedTypes.h slightly, so that gcc
doesn't choke on it, hopefully.

Original Message:
The FunctionCallee type is effectively a {FunctionType*,Value*} pair,
and is a useful convenience to enable code to continue passing the
result of getOrInsertFunction() through to EmitCall, even once pointer
types lose their pointee-type.

Then:
- update the CallInst/InvokeInst instruction creation functions to
  take a Callee,
- modify getOrInsertFunction to return FunctionCallee, and
- update all callers appropriately.

One area of particular note is the change to the sanitizer
code. Previously, they had been casting the result of
`getOrInsertFunction` to a `Function*` via
`checkSanitizerInterfaceFunction`, and storing that. That would report
an error if someone had already inserted a function declaraction with
a mismatching signature.

However, in general, LLVM allows for such mismatches, as
`getOrInsertFunction` will automatically insert a bitcast if
needed. As part of this cleanup, cause the sanitizer code to do the
same. (It will call its functions using the expected signature,
however they may have been declared.)

Finally, in a small number of locations, callers of
`getOrInsertFunction` actually were expecting/requiring that a brand
new function was being created. In such cases, I've switched them to
Function::Create instead.

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

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

6 years ago[x86] adjust test to show both add/inc options; NFC
Sanjay Patel [Fri, 1 Feb 2019 00:07:20 +0000 (00:07 +0000)]
[x86] adjust test to show both add/inc options; NFC

If we're optimizing for size, that overrides the subtarget
feature, so we would always produce 'inc' if we matched
this pattern.

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

6 years ago[x86] add test for missed opportunity to use 'inc'; NFC
Sanjay Patel [Thu, 31 Jan 2019 23:46:58 +0000 (23:46 +0000)]
[x86] add test for missed opportunity to use 'inc'; NFC

Another pattern exposed in D57516.

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

6 years ago[sanitizer-coverage] prune trace-cmp instrumentation for CMP isntructions that feed...
Kostya Serebryany [Thu, 31 Jan 2019 23:43:00 +0000 (23:43 +0000)]
[sanitizer-coverage] prune trace-cmp instrumentation for CMP isntructions that feed into the backedge branch. Instrumenting these CMP instructions is almost always useless (and harmful) for fuzzing

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

6 years agoGlobalISel: Fix MMO creation with non-power-of-2 mem size
Matt Arsenault [Thu, 31 Jan 2019 23:41:23 +0000 (23:41 +0000)]
GlobalISel: Fix MMO creation with non-power-of-2 mem size

It should probably just be mandatory for getTgtMemIntrinsic to return
the alignment.

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

6 years agoRevert "Bump minimum toolchain version"
JF Bastien [Thu, 31 Jan 2019 23:29:39 +0000 (23:29 +0000)]
Revert "Bump minimum toolchain version"

A handful of bots are still breaking, either because I missed them in my audit,
they were offline, or something else. I'm contacting their authors, but I'll
revert for now and re-commit later.

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

6 years ago[WebAssembly] Fix a regression selecting negative build_vector lanes
Thomas Lively [Thu, 31 Jan 2019 23:22:39 +0000 (23:22 +0000)]
[WebAssembly] Fix a regression selecting negative build_vector lanes

Summary:
The custom lowering introduced in rL352592 creates build_vector nodes
with negative i32 operands, but these operands did not meet the value
range constraints necessary to match build_vector nodes. This CL fixes
the issue by removing the unnecessary constraints.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish

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

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

6 years agoDeveloperPolicy: update toolchain with sample RFC / patch
JF Bastien [Thu, 31 Jan 2019 23:18:11 +0000 (23:18 +0000)]
DeveloperPolicy: update toolchain with sample RFC / patch

As was suggested when the policy originally went in.

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

6 years agoBump minimum toolchain version
JF Bastien [Thu, 31 Jan 2019 23:13:10 +0000 (23:13 +0000)]
Bump minimum toolchain version

Summary:
The RFC on moving past C++11 got good traction:
  http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html

This patch therefore bumps the toolchain versions according to our policy:
  llvm.org/docs/DeveloperPolicy.html#toolchain

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane

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

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

6 years agoFixed hasLinkerPrivateGlobalPrefix treating StringRef as C String.
Wouter van Oortmerssen [Thu, 31 Jan 2019 23:03:48 +0000 (23:03 +0000)]
Fixed hasLinkerPrivateGlobalPrefix treating StringRef as C String.

Reviewers: jgravelle-google, sbc100

Subscribers: aheejin, llvm-commits

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

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

6 years ago[RISCV] Add RV64F codegen support
Alex Bradbury [Thu, 31 Jan 2019 22:48:38 +0000 (22:48 +0000)]
[RISCV] Add RV64F codegen support

This requires a little extra work due tothe fact i32 is not a legal type. When
call lowering happens post-legalisation (e.g. when an intrinsic was inserted
during legalisation). A bitcast from f32 to i32 can't be introduced. This is
similar to the challenges with RV32D. To handle this, we introduce
target-specific DAG nodes that perform bitcast+anyext for f32->i64 and
trunc+bitcast for i64->f32.

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

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

6 years ago[WebAssembly] MC: Fix for outputing wasm object to /dev/null
Sam Clegg [Thu, 31 Jan 2019 22:38:22 +0000 (22:38 +0000)]
[WebAssembly] MC: Fix for outputing wasm object to /dev/null

Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

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

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

6 years ago[x86] add test for missed opportunity to use 'inc'; NFC
Sanjay Patel [Thu, 31 Jan 2019 22:33:11 +0000 (22:33 +0000)]
[x86] add test for missed opportunity to use 'inc'; NFC

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

6 years ago[Hexagon] Rename textually included file from .h to .inc
Richard Trieu [Thu, 31 Jan 2019 21:58:42 +0000 (21:58 +0000)]
[Hexagon] Rename textually included file from .h to .inc

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

6 years agoRevert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it."
James Y Knight [Thu, 31 Jan 2019 21:51:58 +0000 (21:51 +0000)]
Revert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it."

This reverts commit f47d6b38c7a61d50db4566b02719de05492dcef1 (r352791).

Seems to run into compilation failures with GCC (but not clang, where
I tested it). Reverting while I investigate.

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

6 years agoFix compilation error with GCC after r352791.
James Y Knight [Thu, 31 Jan 2019 21:21:57 +0000 (21:21 +0000)]
Fix compilation error with GCC after r352791.

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

6 years ago[EarlyCSE & MSSA] Cleanup special handling for removing MemoryAccesses.
Alina Sbirlea [Thu, 31 Jan 2019 21:12:41 +0000 (21:12 +0000)]
[EarlyCSE & MSSA] Cleanup special handling for removing MemoryAccesses.

Summary: Moving special handling to MemorySSAUpdater in D57199.

Reviewers: gberry, george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

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

6 years ago[WebAssembly] Add bulk memory target feature
Thomas Lively [Thu, 31 Jan 2019 21:02:19 +0000 (21:02 +0000)]
[WebAssembly] Add bulk memory target feature

Summary: Also clean up some preexisting target feature code.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, jfb

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

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

6 years ago[DAGCombine] Avoid CombineZExtLogicopShiftLoad if there is free ZEXT
Guozhi Wei [Thu, 31 Jan 2019 20:46:42 +0000 (20:46 +0000)]
[DAGCombine] Avoid CombineZExtLogicopShiftLoad if there is free ZEXT

This patch fixes pr39098.

For the attached test case, CombineZExtLogicopShiftLoad can optimize it to

t25: i64 = Constant<1099511627775>
t35: i64 = Constant<0>
  t0: ch = EntryToken
t57: i64,ch = load<(load 4 from `i40* undef`, align 8), zext from i32> t0, undef:i64, undef:i64
    t58: i64 = srl t57, Constant:i8<1>
  t60: i64 = and t58, Constant:i64<524287>
t29: ch = store<(store 5 into `i40* undef`, align 8), trunc to i40> t57:1, t60, undef:i64, undef:i64

But later visitANDLike transforms it to

t25: i64 = Constant<1099511627775>
t35: i64 = Constant<0>
  t0: ch = EntryToken
t57: i64,ch = load<(load 4 from `i40* undef`, align 8), zext from i32> t0, undef:i64, undef:i64
      t61: i32 = truncate t57
    t63: i32 = srl t61, Constant:i8<1>
  t64: i32 = and t63, Constant:i32<524287>
t65: i64 = zero_extend t64
    t58: i64 = srl t57, Constant:i8<1>
  t60: i64 = and t58, Constant:i64<524287>
t29: ch = store<(store 5 into `i40* undef`, align 8), trunc to i40> t57:1, t60, undef:i64, undef:i64

And it triggers CombineZExtLogicopShiftLoad again, causes a dead loop.

Both forms should generate same instructions, CombineZExtLogicopShiftLoad generated IR looks cleaner. But it looks more difficult to prevent visitANDLike to do the transform, so I prevent CombineZExtLogicopShiftLoad to do the transform if the ZExt is free.

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

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

6 years ago[opaque pointer types] Add a FunctionCallee wrapper type, and use it.
James Y Knight [Thu, 31 Jan 2019 20:35:56 +0000 (20:35 +0000)]
[opaque pointer types] Add a FunctionCallee wrapper type, and use it.

The FunctionCallee type is effectively a {FunctionType*,Value*} pair,
and is a useful convenience to enable code to continue passing the
result of getOrInsertFunction() through to EmitCall, even once pointer
types lose their pointee-type.

Then:
- update the CallInst/InvokeInst instruction creation functions to
  take a Callee,
- modify getOrInsertFunction to return FunctionCallee, and
- update all callers appropriately.

One area of particular note is the change to the sanitizer
code. Previously, they had been casting the result of
`getOrInsertFunction` to a `Function*` via
`checkSanitizerInterfaceFunction`, and storing that. That would report
an error if someone had already inserted a function declaraction with
a mismatching signature.

However, in general, LLVM allows for such mismatches, as
`getOrInsertFunction` will automatically insert a bitcast if
needed. As part of this cleanup, cause the sanitizer code to do the
same. (It will call its functions using the expected signature,
however they may have been declared.)

Finally, in a small number of locations, callers of
`getOrInsertFunction` actually were expecting/requiring that a brand
new function was being created. In such cases, I've switched them to
Function::Create instead.

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

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

6 years ago[cmake] Note future cleanup in comment. NFC
Shoaib Meenai [Thu, 31 Jan 2019 20:32:45 +0000 (20:32 +0000)]
[cmake] Note future cleanup in comment. NFC

CMake 3.6 introduced CMAKE_TRY_COMPILE_PLATFORM_VARIABLES, which solves
precisely the problem that necessitated init_user_prop, so we can switch
over whenever we bump our minimum CMake requirement.

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

6 years ago[MemorySSA] Extend removeMemoryAccess API to optimize MemoryPhis.
Alina Sbirlea [Thu, 31 Jan 2019 20:13:47 +0000 (20:13 +0000)]
[MemorySSA] Extend removeMemoryAccess API to optimize MemoryPhis.

Summary:
EarlyCSE needs to optimize MemoryPhis after an access is removed and has
special handling for it. This should be handled by MemorySSA instead.
The default remains that MemoryPhis are *not* optimized after an access
is removed.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, llvm-commits, Prazek

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

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

6 years ago[DAG][SystemZ] Define unwrapAddress for PCREL_WRAPPER.
Nirav Dave [Thu, 31 Jan 2019 19:58:34 +0000 (19:58 +0000)]
[DAG][SystemZ] Define unwrapAddress for PCREL_WRAPPER.

Summary:
Like with X86, this allows better DAG-level alias analysis and
alignment inference for wrapped addresses.

Reviewers: jonpa, uweigand

Reviewed By: uweigand

Subscribers: hiraditya, llvm-commits

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

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

6 years ago[ELF] Return the section name when calling getSymbolName on a section symbol.
Matt Davis [Thu, 31 Jan 2019 19:42:21 +0000 (19:42 +0000)]
[ELF] Return the section name when calling getSymbolName on a section symbol.

Summary:
Previously, llvm-nm would report symbols for .debug and .note sections as: '?' with an empty  section name:

```
00000000 ?
00000000 ?
...
```

With this patch the output more closely resembles GNU nm:
```
00000000 N .debug_abbrev
00000000 n .note.GNU-stack
...
```

This patch calls `getSectionName` for sections that belong to symbols of type `ELF::STT_SECTION`, which returns the name of the section from the section string table.

Reviewers: Bigcheese, davide, jhenderson

Reviewed By: davide, jhenderson

Subscribers: rupprecht, jhenderson, llvm-commits

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

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

6 years ago[DAG] Aggressively cleanup dangling node in CombineZExtLogicopShiftLoad.
Nirav Dave [Thu, 31 Jan 2019 19:35:14 +0000 (19:35 +0000)]
[DAG] Aggressively cleanup dangling node in CombineZExtLogicopShiftLoad.

While dangling nodes will eventually be pruned when they are
considered, leaving them disables combines requiring single-use.

Reviewers: Carrot, spatel, craig.topper, RKSimon, efriedma

Subscribers: hiraditya, llvm-commits

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

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

6 years ago[Intrinsic] Expand SMULFIX to MUL, MULH[US], or [US]MUL_LOHI on vector arguments
Leonard Chan [Thu, 31 Jan 2019 19:15:37 +0000 (19:15 +0000)]
[Intrinsic] Expand SMULFIX to MUL, MULH[US], or [US]MUL_LOHI on vector arguments

r zero scale SMULFIX, expand into MUL which produces better code for X86.

For vector arguments, expand into MUL if SMULFIX is provided with a zero scale.
Otherwise, expand into MULH[US] or [US]MUL_LOHI.

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

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

6 years agoRevert "[X86] Mark EMMS and FEMMS as clobbering MM0-7 and ST0-7."
Craig Topper [Thu, 31 Jan 2019 19:05:22 +0000 (19:05 +0000)]
Revert "[X86] Mark EMMS and FEMMS as clobbering MM0-7 and ST0-7."

This is causing a failure in chromium

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

6 years agoLower widenable_conditions in CGP
Philip Reames [Thu, 31 Jan 2019 18:45:46 +0000 (18:45 +0000)]
Lower widenable_conditions in CGP

This ensures that if we make it to the backend w/o lowering widenable_conditions first, that we generate correct code. Doing it in CGP - instead of isel - let's us fold control flow before hitting block local instruction selection.

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

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

6 years agoGlobalISel: Fix handling of vectors of pointers in clamp{Min,Max}NumElements
Matt Arsenault [Thu, 31 Jan 2019 18:01:49 +0000 (18:01 +0000)]
GlobalISel: Fix handling of vectors of pointers in clamp{Min,Max}NumElements

This avoids hitting the assert added in r352636 in a future commit.

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

6 years ago[ADT] Fix a typo in isOSVersionLT that breaks the Micro version check
Bob Wilson [Thu, 31 Jan 2019 17:58:59 +0000 (17:58 +0000)]
[ADT] Fix a typo in isOSVersionLT that breaks the Micro version check

The original commit of this function (r129800 in 2011) had a typo where
part of the "Micro" version check was actually comparing against the "Minor"
version number.

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

6 years agoTrim trailing whitespace. NFCI.
Simon Pilgrim [Thu, 31 Jan 2019 17:49:25 +0000 (17:49 +0000)]
Trim trailing whitespace. NFCI.

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

6 years ago[X86][AVX] Fold concat(broadcast(x),broadcast(x)) -> broadcast(x)
Simon Pilgrim [Thu, 31 Jan 2019 17:48:35 +0000 (17:48 +0000)]
[X86][AVX] Fold concat(broadcast(x),broadcast(x)) -> broadcast(x)

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

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

6 years ago[X86][AVX] insert_subvector(bitcast(v), bitcast(s), c1) -> bitcast(insert_subvector...
Simon Pilgrim [Thu, 31 Jan 2019 17:38:10 +0000 (17:38 +0000)]
[X86][AVX] insert_subvector(bitcast(v), bitcast(s), c1) -> bitcast(insert_subvector(v,s,c2))

Similar to what we already do in DAGCombiner, but this version also handles bitcasts from types with different scalar sizes, which x86 is better at handling.

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

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

6 years ago[CallSite removal] Remove CallSite uses from InstCombine.
Craig Topper [Thu, 31 Jan 2019 17:23:29 +0000 (17:23 +0000)]
[CallSite removal] Remove CallSite uses from InstCombine.

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: llvm-commits

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

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

6 years agoRecommit "[ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT leader"
Teresa Johnson [Thu, 31 Jan 2019 17:18:11 +0000 (17:18 +0000)]
Recommit "[ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT leader"

Recommit of r352763 with fix for use after free.

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

6 years agorevert r352766: [PatternMatch] add special-case uaddo matching for increment-by-one
Sanjay Patel [Thu, 31 Jan 2019 16:48:42 +0000 (16:48 +0000)]
revert r352766: [PatternMatch] add special-case uaddo matching for increment-by-one

Missed some regression test updates when testing this.

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

6 years agoRevert "[ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT leader"
Teresa Johnson [Thu, 31 Jan 2019 16:46:14 +0000 (16:46 +0000)]
Revert "[ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT leader"

This reverts commit r352763.

Causing a couple bot failures, root cause pointed to by sanitizer bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/28909/steps/annotate/logs/stdio

Use after free. I understand the issue but will revert and test with fix
before recommitting.

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

6 years ago[llvm-objcopy] Skip --localize-symbol for undefined symbols
Jordan Rupprecht [Thu, 31 Jan 2019 16:45:16 +0000 (16:45 +0000)]
[llvm-objcopy] Skip --localize-symbol for undefined symbols

Summary:
Include the symbol being defined in the list of requirements for using --localize-symbol.

This is used, for example, when someone is depending on two different projects that have the same (or close enough) method defined in each library, and using "-L sym" for a conflicting symbol in one of the libraries so that the definition from the other one is used. However, the library may have internal references to the symbol, which cause program crashes when those are used, i.e.:

```
$ cat foo.c
int foo() { return 5; }
$ cat bar.c
int foo();
int bar() { return 2 * foo(); }
$ cat foo2.c
int foo() { /* Safer implementation */ return 42; }
$ cat main.c
int bar();
int main() {
  __builtin_printf("bar = %d\n", bar());
  return 0;
}
$ ar rcs libfoo.a foo.o bar.o
$ ar rcs libfoo2.a foo2.o
# Picks the wrong foo() impl
$ clang main.o -lfoo -lfoo2 -L. -o main
# Picks the right foo() impl
$ objcopy -L foo libfoo.a && clang main.o -lfoo -lfoo2 -L. -o main
# Links somehow, but crashes at runtime
$ llvm-objcopy -L foo libfoo.a && clang main.o -lfoo -lfoo2 -L. -o main
```

Reviewers: jhenderson, alexshap, jakehehrlich, espindola

Subscribers: emaste, arichardson

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

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

6 years ago[PatternMatch] add special-case uaddo matching for increment-by-one
Sanjay Patel [Thu, 31 Jan 2019 16:40:07 +0000 (16:40 +0000)]
[PatternMatch] add special-case uaddo matching for increment-by-one

This is the most important uaddo problem mentioned in PR31754:
https://bugs.llvm.org/show_bug.cgi?id=31754

We were failing to match the canonicalized pattern when it's an 'add 1' operation.
Pattern matching, however, shouldn't assume that we have canonicalized IR, so we
match 4 commuted variants of uaddo.

There's also a test with a crazy type to show that the existing CGP transform
based on this matcher is not limited by target legality checks, but that's a
different problem.

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

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

6 years ago[ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT leader
Teresa Johnson [Thu, 31 Jan 2019 16:00:15 +0000 (16:00 +0000)]
[ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT leader

Summary:
COFF requires that COMDAT name match that of the leader. When we promote
and rename an internal leader in ThinLTO due to an import, ensure we
subsequently rename the associated COMDAT. Similar to D31963 which did
this during ThinLTO module splitting.

Fixes PR40414.

Reviewers: pcc, inglorion

Subscribers: mehdi_amini, dexonsmith, dmajor, llvm-commits

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

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

6 years ago[CGP] add more tests for uaddo; NFC
Sanjay Patel [Thu, 31 Jan 2019 15:48:46 +0000 (15:48 +0000)]
[CGP] add more tests for uaddo; NFC

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

6 years agogn build: Merge r352483
Nico Weber [Thu, 31 Jan 2019 15:23:02 +0000 (15:23 +0000)]
gn build: Merge r352483

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

6 years agogn build: Merge r352681, r352739
Nico Weber [Thu, 31 Jan 2019 14:45:40 +0000 (14:45 +0000)]
gn build: Merge r352681, r352739

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

6 years ago[llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#3)
James Henderson [Thu, 31 Jan 2019 14:22:50 +0000 (14:22 +0000)]
[llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#3)

This is the fourth (and final for now) of a series of patches
simplifying llvm-symbolizer tests. See r352752, r352753 and 352754 for
the previous ones. This patch splits out several more distinct test
cases from llvm-symbolizer.test into separate tests, and simplifies them
in various ways including:

1) Building a test case for spaces in path from source, rather than
   using a pre-canned binary. This allows deleting of said binary and the
   source it was built from.
2) Switching to specifying addresses and objects directly on the
   command-line rather than via stdin.

This also adds an explict test for the ability to specify a file and
address as a line in stdin, since the majority of the tests have been
migrated away from this approach, leaving this largely untested.

Reviewed by: dblaikie

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

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

6 years ago[llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#2)
James Henderson [Thu, 31 Jan 2019 14:17:33 +0000 (14:17 +0000)]
[llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#2)

This is the third of a series of patches simplifying llvm-symbolizer
tests. See r352752 and r352753 for the previous two. This patch splits
out a number of distinct test cases from llvm-symbolizer.test into
separate tests, and simplifies them in various ways including:

1) using --obj/positional arguments for the input file and addresses
   instead of stdin,
2) using runtime-generated inputs rather than a pre-canned binary, and
3) testing more specifically (i.e. checking only what is interesting to
   the behaviour changed in the original commit for that test case).

This patch also removes the test case for using --obj. The
tools/llvm-symbolizer/basic.s test already tests this case. Finally,
this patch adds a simple test case to the demangle switch test case to
show that demangling happens by default.

See https://bugs.llvm.org/show_bug.cgi?id=40070#c1 for the motivation.

Reviewed by: dblaikie

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

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

6 years ago[llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#1)
James Henderson [Thu, 31 Jan 2019 14:11:17 +0000 (14:11 +0000)]
[llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#1)

This is the second of a series of patches simplifying llvm-symbolizer
tests. See r352752 for the first. This one splits out 5 distinct test
cases from llvm-symbolizer.test into separate tests, and simplifies them
slightly by using --obj/positional arguments for the input file and
addresses instead of stdin.

See https://bugs.llvm.org/show_bug.cgi?id=40070#c1 for the motivation.

Reviewed by: dblaikie

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

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

6 years ago[llvm-symbolizer][test] Simplify test input reading
James Henderson [Thu, 31 Jan 2019 14:04:47 +0000 (14:04 +0000)]
[llvm-symbolizer][test] Simplify test input reading

This change migrates most llvm-symbolizer tests away from reading input
via stdin and instead using --obj + positional arguments for the file
and addresses respectively, which makes the tests easier to read.

One exception is the test test/tools/llvm-symbolizer/pdb/pdb.test, which
was doing some manipulation on the input addresses. This patch
simplifies this somewhat, but it still reads from stdin.

More changes to follow to simplify/break-up other tests.

Reviewed by: dblaikie

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

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

6 years ago[X86][AVX] Fold broadcast(bitcast(src)) -> bitcast(broadcast(src))
Simon Pilgrim [Thu, 31 Jan 2019 14:04:07 +0000 (14:04 +0000)]
[X86][AVX] Fold broadcast(bitcast(src)) -> bitcast(broadcast(src))

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

6 years ago[CommandLine] Improve help text for cl::values style options
James Henderson [Thu, 31 Jan 2019 13:58:48 +0000 (13:58 +0000)]
[CommandLine] Improve help text for cl::values style options

In order to make an option value truly optional, both the ValueOptional
and an empty-named value are required. This empty-named value appears in
the command-line help text, which is not ideal.

This change improves the help text for these sort of options in a number
of ways:
1) ValueOptional options with an empty-named value now print their help
text twice: both without and then with '=<value>' after the name. The
latter version then lists the allowed values after it.
2) Empty-named values with no help text in ValueOptional options are not
listed in the permitted values.
3) Otherwise empty-named options are printed as =<empty> rather than
simply '='.
4) Option values without help text do not have the '-' separator
printed.

It also tweaks the llvm-symbolizer -functions help text to not print a
trailing ':' as that looks bad combined with 1) above.

Reviewed by: thopre, ruiu

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

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

6 years ago[X86][AVX] Add PR34394 subvector broadcast test cases
Simon Pilgrim [Thu, 31 Jan 2019 13:32:09 +0000 (13:32 +0000)]
[X86][AVX] Add PR34394 subvector broadcast test cases

Tidyup check-prefixes at the same time

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

6 years ago[llvm-strip] Add --strip-symbol
Eugene Leviant [Thu, 31 Jan 2019 12:16:20 +0000 (12:16 +0000)]
[llvm-strip] Add --strip-symbol

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

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

6 years ago[X86] combineExtractWithShuffle - more aggressively peek through bitcasts
Simon Pilgrim [Thu, 31 Jan 2019 11:55:30 +0000 (11:55 +0000)]
[X86] combineExtractWithShuffle - more aggressively peek through bitcasts

Fixes regression introduced by rL352743

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

6 years ago[X86][AVX] Enable AVX1 broadcasts in shuffle combining
Simon Pilgrim [Thu, 31 Jan 2019 11:41:10 +0000 (11:41 +0000)]
[X86][AVX] Enable AVX1 broadcasts in shuffle combining

Enables 32/64-bit scalar load broadcasts on AVX1 targets

The extractelement-load.ll regression will be fixed shortly in a followup commit.

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

6 years ago[X86][AVX] Fold vt1 concat_vectors(vt2 undef, vt2 broadcast(x)) --> vt1 broadcast(x)
Simon Pilgrim [Thu, 31 Jan 2019 11:15:05 +0000 (11:15 +0000)]
[X86][AVX] Fold vt1 concat_vectors(vt2 undef, vt2 broadcast(x)) --> vt1 broadcast(x)

If we're not inserting the broadcast into the lowest subvector then we can avoid the insertion by just performing a larger broadcast.

Avoids a regression when we enable AVX1 broadcasts in shuffle combining

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

6 years agoDefault lowering for experimental.widenable.condition
Max Kazantsev [Thu, 31 Jan 2019 09:10:17 +0000 (09:10 +0000)]
Default lowering for experimental.widenable.condition

Introduces a pass that provides default lowering strategy for the
`experimental.widenable.condition` intrinsic, replacing all its uses with
`i1 true`.

Differential Revision: https://reviews.llvm.org/D56096
Reviewed By: reames

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

6 years agoTest commit. NFCI.
Yevgeny Rouban [Thu, 31 Jan 2019 08:49:20 +0000 (08:49 +0000)]
Test commit. NFCI.

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

6 years ago[ARM] Thumb2: ConstantMaterializationCost
Sjoerd Meijer [Thu, 31 Jan 2019 08:38:06 +0000 (08:38 +0000)]
[ARM] Thumb2: ConstantMaterializationCost

Constants can also be materialised using the negated value and a MVN, and this
case seem to have been missed for Thumb2. To check the constant materialisation
costs, we now call getT2SOImmVal twice, once for the original constant and then
also for its negated value, and this function checks if the constant can both
be splatted or rotated.

This was revealed by a test that optimises for minsize: instead of a LDR
literal pool load and having a literal pool entry, just a MVN with an immediate
is smaller (and also faster).

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

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

6 years ago[SelectionDAG] Codesize: don't expand SHIFT to SHIFT_PARTS
Sjoerd Meijer [Thu, 31 Jan 2019 08:07:30 +0000 (08:07 +0000)]
[SelectionDAG] Codesize: don't expand SHIFT to SHIFT_PARTS

And instead just generate a libcall. My motivating example on ARM was a simple:

  shl i64 %A, %B

for which the code bloat is quite significant. For other targets that also
accept __int128/i128 such as AArch64 and X86, it is also beneficial for these
cases to generate a libcall when optimising for minsize. On these 64-bit targets,
the 64-bits shifts are of course unaffected because the SHIFT/SHIFT_PARTS
lowering operation action is not set to custom/expand.

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

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

6 years agoFixup test after r352704 since it changes how paths may be emitted.
Douglas Yung [Thu, 31 Jan 2019 07:58:34 +0000 (07:58 +0000)]
Fixup test after r352704 since it changes how paths may be emitted.

On Unix/Mac OS X, normpath() returns the path unchanged (FileCheck), but
on case-insensitive filesystems (like NTFS on Windows), it converts the
path to lowercase (filecheck) which was causing the test to fail.

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

6 years agoCommit tests for changes in revision D41940
Dmitry Venikov [Thu, 31 Jan 2019 07:38:19 +0000 (07:38 +0000)]
Commit tests for changes in revision D41940

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

6 years agoRevert "[CMake] Unify scripts for generating VCS headers"
Petr Hosek [Thu, 31 Jan 2019 07:12:43 +0000 (07:12 +0000)]
Revert "[CMake] Unify scripts for generating VCS headers"

This reverts commits r352729 and r352731: this broke Sanitizer Windows bots

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

6 years ago[InstCombine] Missed optimization in math expression: simplify calls exp functions
Dmitry Venikov [Thu, 31 Jan 2019 06:28:10 +0000 (06:28 +0000)]
[InstCombine] Missed optimization in math expression: simplify calls exp functions

Summary: This patch enables folding following expressions under -ffast-math flag: exp(X) * exp(Y) -> exp(X + Y), exp2(X) * exp2(Y) -> exp2(X + Y). Motivation: https://bugs.llvm.org/show_bug.cgi?id=35594

Reviewers: hfinkel, spatel, efriedma, lebedev.ri

Reviewed By: spatel, lebedev.ri

Subscribers: lebedev.ri, llvm-commits

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

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

6 years ago[CMake] Unify scripts for generating VCS headers
Petr Hosek [Thu, 31 Jan 2019 06:21:01 +0000 (06:21 +0000)]
[CMake] Unify scripts for generating VCS headers

Previously, there were two different scripts for generating VCS headers:
one used by LLVM and one used by Clang. They were both similar, but
different. They were both broken in their own ways, for example the one
used by Clang didn't properly handle monorepo resulting in an incorrect
version information reported by Clang.

This change unifies two the scripts by introducing a new script that's
used from both LLVM and Clang, ensures that the new script supports both
monorepo and standalone SVN and Git setups, and removes the old scripts.

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

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

6 years ago[SCEV] Prohibit SCEV transformations for huge SCEVs
Max Kazantsev [Thu, 31 Jan 2019 06:19:25 +0000 (06:19 +0000)]
[SCEV] Prohibit SCEV transformations for huge SCEVs

Currently SCEV attempts to limit transformations so that they do not work with
big SCEVs (that may take almost infinite compile time). But for this, it uses heuristics
such as recursion depth and number of operands, which do not give us a guarantee
that we don't actually have big SCEVs. This situation is still possible, though it is not
likely to happen. However, the bug PR33494 showed a bunch of simple corner case
tests where we still produce huge SCEVs, even not reaching big recursion depth etc.

This patch introduces a concept of 'huge' SCEVs. A SCEV is huge if its expression
size (intoduced in D35989) exceeds some threshold value. We prohibit optimizing
transformations if any of SCEVs we are dealing with is huge. This gives us a reliable
check that we don't spend too much time working with them.

As the next step, we can possibly get rid of old limiting mechanisms, such as recursion
depth thresholds.

Differential Revision: https://reviews.llvm.org/D35990
Reviewed By: reames

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

6 years agoAdd namespace to some types.
Richard Trieu [Thu, 31 Jan 2019 04:33:11 +0000 (04:33 +0000)]
Add namespace to some types.

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

6 years agoFix missing C++ mode comment in header
Matt Arsenault [Thu, 31 Jan 2019 04:27:17 +0000 (04:27 +0000)]
Fix missing C++ mode comment in header

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

6 years agoRevert "Reapply "[CGP] Check for existing inttotpr before creating new one""
David L. Jones [Thu, 31 Jan 2019 03:28:46 +0000 (03:28 +0000)]
Revert "Reapply "[CGP] Check for existing inttotpr before creating new one""

This change reverts r351626.

The changes in r351626 cause quadratic work in several cases. (See r351626 thread on llvm-commits for details.)

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

6 years agoGlobalISel: Handle odd splits in fewerElementsVector for load/store
Matt Arsenault [Thu, 31 Jan 2019 02:46:05 +0000 (02:46 +0000)]
GlobalISel: Handle odd splits in fewerElementsVector for load/store

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

6 years agoGlobalISel: Implement narrowScalar for bswap
Matt Arsenault [Thu, 31 Jan 2019 02:34:03 +0000 (02:34 +0000)]
GlobalISel: Implement narrowScalar for bswap

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

6 years agoGlobalISel: Don't call changingInstruction before giving up
Matt Arsenault [Thu, 31 Jan 2019 02:22:39 +0000 (02:22 +0000)]
GlobalISel: Don't call changingInstruction before giving up

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

6 years agoGlobalISel: Allow bitcount ops to have different result type
Matt Arsenault [Thu, 31 Jan 2019 02:09:57 +0000 (02:09 +0000)]
GlobalISel: Allow bitcount ops to have different result type

For AMDGPU the result is always 32-bit for 64-bit inputs.

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

6 years agoGlobalISel: Use helper function for MMO splitting
Matt Arsenault [Thu, 31 Jan 2019 01:49:58 +0000 (01:49 +0000)]
GlobalISel: Use helper function for MMO splitting

Also fix an alignment bug getMachineMemOperand. If the
tracked value is null, the offset isn't tracked so the
base alignment needs to be reduced.

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