]> granicus.if.org Git - llvm/log
llvm
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

6 years ago[libFuzzer] update docs
Kostya Serebryany [Thu, 31 Jan 2019 01:47:29 +0000 (01:47 +0000)]
[libFuzzer] update docs

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

6 years ago[InstCombine] Expand testing for Windows (NFC)
Evandro Menezes [Thu, 31 Jan 2019 01:41:39 +0000 (01:41 +0000)]
[InstCombine] Expand testing for Windows (NFC)

Added the checks to the existing cases when the target is Win64.

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

6 years agoGlobalISel: Fix creating MMOs with align 0
Matt Arsenault [Thu, 31 Jan 2019 01:38:47 +0000 (01:38 +0000)]
GlobalISel: Fix creating MMOs with align 0

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

6 years ago[X86] Add a 32-bit command line to avx512-intrinsics.ll. Move all 64-bit mode only...
Craig Topper [Thu, 31 Jan 2019 00:49:40 +0000 (00:49 +0000)]
[X86] Add a 32-bit command line to avx512-intrinsics.ll. Move all 64-bit mode only intrinsics to avx512-intrinsics-x86_64.ll.

Most of the other intrinsic tests have a 32-bit command lines.

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

6 years ago[InstCombine] Simplify check clauses in test (NFC)
Evandro Menezes [Thu, 31 Jan 2019 00:49:27 +0000 (00:49 +0000)]
[InstCombine] Simplify check clauses in test (NFC)

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

6 years agoReland "gn build: Add BPF target."
Peter Collingbourne [Thu, 31 Jan 2019 00:42:02 +0000 (00:42 +0000)]
Reland "gn build: Add BPF target."

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

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

6 years agolit: Let lit.util.which() return a normcase()ed path
Nico Weber [Thu, 31 Jan 2019 00:40:43 +0000 (00:40 +0000)]
lit: Let lit.util.which() return a normcase()ed path

LLVMConfig.with_environment() uses os.path.normcase(os.path.normpath(x)) to
normalize temporary env vars. LLVMConfig.use_clang() uses with_environment() to
temporarily set PATH and then look for clang there. This means that on Windows,
clang will be run with a path like c:\foo\bin\clang.EXE (with a lower-case
"C:").

lit.util.which() used to not do this, which means the executables added in
clang/test/lit.cfg.py (e.g. c-index-test) were run with a path like
C:\foo\bin\c-index-test.EXE (because both CMake and GN happen to write
clang_tools_dir with an upper-case C to lit.site.cfg.py).

clang/test/Index/pch-from-libclang.c requires that both c-index-test and clang
use _exactly_ the same resource dir path (same case and everything), because a
hash of the resource directory is used as module cache path.

This patch is necessary but not sufficient to make pch-from-libclang.c pass on
Windows.

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

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

6 years ago[LegalizeVectorTypes] Allow illegal indices when splitting extract_vector_elt
Thomas Lively [Thu, 31 Jan 2019 00:35:37 +0000 (00:35 +0000)]
[LegalizeVectorTypes] Allow illegal indices when splitting extract_vector_elt

Summary:
Fixes PR40267, in which the removed assertion was triggering on
perfectly valid IR. As far as I can tell, constant out of bounds
indices should be allowed when splitting extract_vector_elt, since
they will simply be propagated as out of bounds indices in the
resulting split vector and handled appropriately elsewhere.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya

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

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

6 years ago[LegalizeTypes] Use report_fatal_error instead of llvm_unreachable in the default...
Craig Topper [Thu, 31 Jan 2019 00:04:48 +0000 (00:04 +0000)]
[LegalizeTypes] Use report_fatal_error instead of llvm_unreachable in the default case of some type legalization handlers that can be reached with intrinsics with result or operands that aren't legal types.

These can be triggered by mistakenly using a 64-bit mode only intrinsics with a -mtriple=i686. Using report_fatal_error gives a better experience for this mistake in release builds instead of probably crashing.

We already do this for some of the vector type legalization handles.

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

6 years ago[X86] Remove handling of ISD::INTRINSIC_WO_CHAIN in ReplaceNodeResults.
Craig Topper [Thu, 31 Jan 2019 00:04:46 +0000 (00:04 +0000)]
[X86] Remove handling of ISD::INTRINSIC_WO_CHAIN in ReplaceNodeResults.

I believe this was there to handle avx512bw intrinsics that returned i64 type in 32-bit mode. But all those intrinsics have since been changed to v64i1 results or replaced with generic IR.

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

6 years ago[X86] Add test case for pr40539. NFC
Craig Topper [Thu, 31 Jan 2019 00:04:42 +0000 (00:04 +0000)]
[X86] Add test case for pr40539. NFC

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

6 years ago[WebAssembly] Remove TODO on wasm.extract.exception intrinsic (NFC)
Heejin Ahn [Wed, 30 Jan 2019 23:53:36 +0000 (23:53 +0000)]
[WebAssembly] Remove TODO on wasm.extract.exception intrinsic (NFC)

Summary:
We planned to delete this intrinsic and do custom lowering from
`wasm.get.exception`, which has a token argument, to
`EXTRACT_EXCEPTION`, a wasm pseudo instruction that simulates popping a
value from the wasm stack.

To do that, we need to introduce a new `WebAssemblyISD` node for this,
which itself is not a problem, but also have to introduce the
`WebAssemblyISD` namespace in SelectionDAGBuilder.cpp. I don't think any
other targets are doing that in the file. And also putting a
target-specific intrinsic in the common file is a little weird too. (All
other intrinsic functions in this `visitIntrinsicCall` functions are not
target-specific ones. Other target-specific intrinsics are usually
handled in `lib/Target/[TargetName]/[TargetName]ISelLowering.cpp`. The
reason we can't do this is it has a token argument.

Anyway, so I think I prefer the current code with one redundant
intrinsic more than adding one more `WebAssemblyISD` node and
also introducing the `WebAssemblyISD` namespace into
SelectionDAGBuilder.cpp. What do you think?

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

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

6 years ago[RuntimeDyld] Don't try to allocate sections with align 0.
Zachary Turner [Wed, 30 Jan 2019 23:52:32 +0000 (23:52 +0000)]
[RuntimeDyld] Don't try to allocate sections with align 0.

ELF sections allow 0 for the alignment, which is specified to
be the same as 1.  However many clients do not expect this and
will behave poorly in the presence of a 0-aligned section (for
example by trying to modulo something by the section alignment).
We can be more polite by making sure that we always pass a
non-zero value to clients.

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

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

6 years ago[GlobalISel][AArch64] Select G_FEXP
Jessica Paquette [Wed, 30 Jan 2019 23:46:15 +0000 (23:46 +0000)]
[GlobalISel][AArch64] Select G_FEXP

This teaches the legalizer to handle G_FEXP in AArch64. As a result, it also
allows us to select G_FEXP.

It...

- Updates the legalizer-info tests
- Adds a test for legalizing exp
- Updates the existing fp tests to show that we can now select G_FEXP

https://reviews.llvm.org/D57483

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