OSDN Git Service

android-x86/external-llvm.git
5 years agogn build: Create a template for unix toolchains.
Peter Collingbourne [Fri, 11 Jan 2019 22:57:57 +0000 (22:57 +0000)]
gn build: Create a template for unix toolchains.

Also change the toolchain description to use current_os instead of
host_os so that the template can be used for cross builds, and add
a current_os to the win toolchain to match the unix toolchain.

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

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

5 years ago[AArch64] Improve Exynos predicates
Evandro Menezes [Fri, 11 Jan 2019 22:39:47 +0000 (22:39 +0000)]
[AArch64] Improve Exynos predicates

Expand the predicate using shifted arithmetic and logic instructions to also
consider the respective not shifted instructions.

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

5 years agogn build: Merge r350958.
Peter Collingbourne [Fri, 11 Jan 2019 22:15:53 +0000 (22:15 +0000)]
gn build: Merge r350958.

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

5 years ago[ConstantFolding] Fold undef for integer intrinsics
Nikita Popov [Fri, 11 Jan 2019 21:18:00 +0000 (21:18 +0000)]
[ConstantFolding] Fold undef for integer intrinsics

This fixes https://bugs.llvm.org/show_bug.cgi?id=40110.

This implements handling of undef operands for integer intrinsics in
ConstantFolding, in particular for the bitcounting intrinsics (ctpop,
cttz, ctlz), the with.overflow intrinsics, the saturating math
intrinsics and the funnel shift intrinsics.

The undef behavior follows what InstSimplify does for the general cas
e of non-constant operands. For the bitcount intrinsics (where
InstSimplify doesn't do undef handling -- there cannot be a combination
of an undef + non-constant operand) I'm using a 0 result if the intrinsic
is defined for zero and undef otherwise.

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

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

5 years ago[SLP]Moved NVPTX test under NVPTX directory, NFC.
Alexey Bataev [Fri, 11 Jan 2019 20:42:48 +0000 (20:42 +0000)]
[SLP]Moved NVPTX test under NVPTX directory, NFC.

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

5 years ago[SLP]Update test checks for the SPL vectorizer, NFC.
Alexey Bataev [Fri, 11 Jan 2019 20:21:14 +0000 (20:21 +0000)]
[SLP]Update test checks for the SPL vectorizer, NFC.

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

5 years ago[X86] Fix incomplete handling of register-assigned variables in parsing.
Nirav Dave [Fri, 11 Jan 2019 20:17:36 +0000 (20:17 +0000)]
[X86] Fix incomplete handling of register-assigned variables in parsing.

Teach x86 assembly operand parsing to distinguish between assembler
variable assigned to named registers and those assigned to immediate
values.

Reviewers: rnk, nickdesaulniers, void

Subscribers: hiraditya, jyknight, llvm-commits

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

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

5 years agogn build: Create a variable for the host toolchain and start using it in the tblgen...
Peter Collingbourne [Fri, 11 Jan 2019 19:53:06 +0000 (19:53 +0000)]
gn build: Create a variable for the host toolchain and start using it in the tblgen template.

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

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

5 years agogn build: s/root_out_dir/root_build_dir/g in llvm/utils/gn/build/write_cmake_config...
Peter Collingbourne [Fri, 11 Jan 2019 19:51:49 +0000 (19:51 +0000)]
gn build: s/root_out_dir/root_build_dir/g in llvm/utils/gn/build/write_cmake_config.gni.

This makes the generated files go to the right place when using a non-default toolchain.

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

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

5 years ago[RISCV][NFC] Add CHECK lines for atomic operations on RV64I
Alex Bradbury [Fri, 11 Jan 2019 19:46:48 +0000 (19:46 +0000)]
[RISCV][NFC] Add CHECK lines for atomic operations on RV64I

As or RV32I, we include these for completeness. Committing now to make it
easier to review the RV64A patch.

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

5 years ago[llvm-mca] Update tests for Exynos (NFC)
Evandro Menezes [Fri, 11 Jan 2019 19:36:27 +0000 (19:36 +0000)]
[llvm-mca] Update tests for Exynos (NFC)

Update test cases for Exynos M4.

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

5 years ago[AArch64] Add pipeline model for Exynos M4
Evandro Menezes [Fri, 11 Jan 2019 19:36:25 +0000 (19:36 +0000)]
[AArch64] Add pipeline model for Exynos M4

Add the scheduling and cost model for Exynos M4.

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

5 years ago[CMake] Export utility targets to the build/install tree depending on LLVM_BUILD...
Stefan Granitz [Fri, 11 Jan 2019 19:34:34 +0000 (19:34 +0000)]
[CMake] Export utility targets to the build/install tree depending on LLVM_BUILD/INSTALL_UTILS

Summary:
Allow external projects to import test-related targets like FileCheck, count, not etc. and query binary paths, properties, etc.
This would be useful for LLDB, because it reduces the difference between in-tree vs. standalone builds and simplifies CMake logic.

Reviewers: chapuni, gottesmm, beanz

Reviewed By: beanz

Subscribers: mgorny, lldb-commits, llvm-commits, #lldb

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

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

5 years ago[AArch64] Create feature set for Exynos M4
Evandro Menezes [Fri, 11 Jan 2019 18:54:25 +0000 (18:54 +0000)]
[AArch64] Create feature set for Exynos M4

Complete the feature set for Exynos M4 and update test cases.

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

5 years ago[Legalizer] Use correct ValueType of SELECT_CC node during Float promotion
Pirama Arumuga Nainar [Fri, 11 Jan 2019 18:46:02 +0000 (18:46 +0000)]
[Legalizer] Use correct ValueType of SELECT_CC node during Float promotion

Summary:
When legalizing the result of a SELECT_CC node by promoting the
floating-point type, use the promoted-to type rather than the original
type.

Fix PR40273.

Reviewers: efriedma, majnemer

Subscribers: llvm-commits

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

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

5 years ago[LTO] Record whether LTOUnit splitting is enabled in index
Teresa Johnson [Fri, 11 Jan 2019 18:31:57 +0000 (18:31 +0000)]
[LTO] Record whether LTOUnit splitting is enabled in index

Summary:
Records in the module summary index whether the bitcode was compiled
with the option necessary to enable splitting the LTO unit
(e.g. -fsanitize=cfi, -fwhole-program-vtables, or -fsplit-lto-unit).

The information is passed down to the ModuleSummaryIndex builder via a
new module flag "EnableSplitLTOUnit", which is propagated onto a flag
on the summary index.

This is then used during the LTO link to check whether all linked
summaries were built with the same value of this flag. If not, an error
is issued when we detect a situation requiring whole program visibility
of the class hierarchy. This is the case when both of the following
conditions are met:
1) We are performing LowerTypeTests or Whole Program Devirtualization.
2) There are type tests or type checked loads in the code.

Note I have also changed the ThinLTOBitcodeWriter to also gate the
module splitting on the value of this flag.

Reviewers: pcc

Subscribers: ormris, mehdi_amini, Prazek, inglorion, eraman, steven_wu, dexonsmith, arphaman, dang, llvm-commits

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

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

5 years ago[llvm-objcopy][NFC] Consistenly use two dashes for flags in tests.
Jordan Rupprecht [Fri, 11 Jan 2019 18:06:31 +0000 (18:06 +0000)]
[llvm-objcopy][NFC] Consistenly use two dashes for flags in tests.

Summary:
As pointed out in D53667, our use of hyphens in flags can be inconsistent, mixing `-` with `--`. This change makes all long style flags use `--`.

Automatically changed via:

```
find test/tools/llvm-objcopy/ELF -type f | xargs sed -i 's/ -\([a-zA-Z]\{3\}\)/ --\1/g'
```

Two false positives were manually fixed/reverted.

Reviewers: jhenderson, espindola, alexshap

Reviewed By: jhenderson

Subscribers: emaste, javed.absar, arichardson, fedor.sergeev, jakehehrlich, llvm-commits

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

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

5 years ago[MergeFunc] Erase unused duplicate functions if they are discardable
Vedant Kumar [Fri, 11 Jan 2019 17:56:35 +0000 (17:56 +0000)]
[MergeFunc] Erase unused duplicate functions if they are discardable

MergeFunc only deletes unused duplicate functions if they have local
linkage, but it should be safe to relax this to any "discardable if
unused" linkage type.

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

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

5 years ago[MergeFunc] Use Instruction::getFunction as a cleanup, NFC
Vedant Kumar [Fri, 11 Jan 2019 17:56:21 +0000 (17:56 +0000)]
[MergeFunc] Use Instruction::getFunction as a cleanup, NFC

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

5 years ago[Jump Threading] Unfold a select insn that feeds a switch via a phi node
Ehsan Amiri [Fri, 11 Jan 2019 15:52:57 +0000 (15:52 +0000)]
[Jump Threading] Unfold a select insn that feeds a switch via a phi node

Currently when a select has a constant value in one branch and the select feeds
a conditional branch (via a compare/ phi and compare) we unfold the select
statement. This results in threading the conditional branch later on. Similar
opportunity exists when a select (with a constant in one branch) feeds a
switch (via a phi node). The patch unfolds select under this condition.
A testcase is provided.

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

5 years ago[x86] allow insert/extract when matching horizontal ops
Sanjay Patel [Fri, 11 Jan 2019 14:27:59 +0000 (14:27 +0000)]
[x86] allow insert/extract when matching horizontal ops

Previously, we limited this transform to cases where the
extraction into the build vector happens from vectors of
the same type as the build vector, but that's not required.

There's a slight potential regression seen in the AVX512
result for phadd -- we're using the 256-bit flavor of the
instruction now even though the 128-bit subset is sufficient.
The same problem could already be seen in the AVX2 result.
Follow-up patches will attempt to narrow that back down.

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

5 years ago[llvm-objcopy] [COFF] Implmement --strip-unneeded and -x/--discard-all for symbols
Martin Storsjo [Fri, 11 Jan 2019 14:13:04 +0000 (14:13 +0000)]
[llvm-objcopy] [COFF] Implmement --strip-unneeded and -x/--discard-all for symbols

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

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

5 years ago[llvm-objcopy] [COFF] Fix writing object files without symbols/string table
Martin Storsjo [Fri, 11 Jan 2019 13:47:37 +0000 (13:47 +0000)]
[llvm-objcopy] [COFF] Fix writing object files without symbols/string table

Previously, this was broken - by setting PointerToSymbolTable to zero
but still actually writing the string table length, the object file
header was corrupted.

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

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

5 years ago[llvm-symbolizer] Add -exe, -e as aliases to -obj
Dmitry Venikov [Fri, 11 Jan 2019 11:51:52 +0000 (11:51 +0000)]
[llvm-symbolizer] Add -exe, -e as aliases to -obj

Summary: Provides -exe, -e as aliases to -obj. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40071

Reviewers: ruiu, rnk, fjricci, jhenderson

Reviewed By: jhenderson

Subscribers: llvm-commits

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

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

5 years agoRevert "[SelectionDAGBuilder] Refactor GetRegistersForValue. NFCI."
Martin Storsjo [Fri, 11 Jan 2019 07:31:17 +0000 (07:31 +0000)]
Revert "[SelectionDAGBuilder] Refactor GetRegistersForValue. NFCI."

This reverts commit r350841, as it actually had functional changes
and broke compilation. See PR40290.

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

5 years ago[X86] Change vXi1 extract_vector_elt lowering to be legal if the index is 0. Add...
Craig Topper [Fri, 11 Jan 2019 05:44:56 +0000 (05:44 +0000)]
[X86] Change vXi1 extract_vector_elt lowering to be legal if the index is 0. Add DAG combine to turn scalar_to_vector+extract_vector_elt into extract_subvector.

We were lowering the last step extract_vector_elt to a bitcast+truncate. Change it to use an extract_vector_elt of index 0 instead. Add isel patterns to do the equivalent of what the bitcast would have done. Plus an isel pattern for an any_extend+extract to prevent some regressions.

Finally add a DAG combine to turn v1i1 scalar_to_vector+extract_vector_elt of 0 into an extract_subvector.

This fixes some of the regressions from D350800.

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

5 years ago[llvm-objdump][MachO] Disable some invalid input tests
Francis Visoiu Mistrih [Thu, 10 Jan 2019 23:46:31 +0000 (23:46 +0000)]
[llvm-objdump][MachO] Disable some invalid input tests

It causes some (but not all) bots to fail. I'll look into it tomorrow
morning. Remove the tests for now to make the bots green.

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

5 years ago[WebAssembly] Fix stack pointer store check in RegStackify
Heejin Ahn [Thu, 10 Jan 2019 23:12:07 +0000 (23:12 +0000)]
[WebAssembly] Fix stack pointer store check in RegStackify

Summary:
We now use __stack_pointer global and global.get/global.set instruction.
This fixes the checking routine for stack_pointer writes accordingly.

This also fixes the existing __stack_pointer test in reg-stackify.ll:
That test used to pass not because of __stack_pointer clashes but
because the function `stackpointer_callee` was not marked as `readnone`,
so it was assumed to possibly write to memory arbitraily, and
`global.set` instruction was marked as `mayStore` in the .td definition,
so they were identified as intervening writes. After we added `readnone`
to its attribute, this test fails without this patch.

Reviewers: dschuff, sunfish

Subscribers: jgravelle-google, sbc100, llvm-commits

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

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

5 years agogn build: Add a template for calling write_cmake_config.py
Nico Weber [Thu, 10 Jan 2019 23:10:04 +0000 (23:10 +0000)]
gn build: Add a template for calling write_cmake_config.py

No behavior change.

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

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

5 years agogn build: Merge r350852
Nico Weber [Thu, 10 Jan 2019 23:05:39 +0000 (23:05 +0000)]
gn build: Merge r350852

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

5 years ago[MSP430] Minor fixes/improvements for assembler/disassembler
Anton Korobeynikov [Thu, 10 Jan 2019 22:59:50 +0000 (22:59 +0000)]
[MSP430] Minor fixes/improvements for assembler/disassembler

* Teach AsmParser to recognize @rn in distination operand as 0(rn).
* Do not allow Disassembler decoding instructions that have size more
  than a number of input bytes.
* Fix UB in MSP430MCCodeEmitter.

Patch by Kristina Bessonova!

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

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

5 years ago[MSP430] Add missing instruction forms
Anton Korobeynikov [Thu, 10 Jan 2019 22:54:53 +0000 (22:54 +0000)]
[MSP430] Add missing instruction forms

* Add missing mm, [r|m]n, [r|m]p instruction forms.
* Fix bit16mc instruction.

Patch by Kristina Bessonova!

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

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

5 years ago[WebAssembly] Add unimplemented-simd128 subtarget feature
Thomas Lively [Thu, 10 Jan 2019 22:32:11 +0000 (22:32 +0000)]
[WebAssembly] Add unimplemented-simd128 subtarget feature

Summary:
This is a third attempt, but this time we have vetted it on Windows
first. The previous errors were due to an uninitialized class member.

Reviewers: aheejin

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

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

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

5 years ago[llvm-objcopy] [COFF] Fix a test matching pathnames for Windows. NFC.
Martin Storsjo [Thu, 10 Jan 2019 22:05:21 +0000 (22:05 +0000)]
[llvm-objcopy] [COFF] Fix a test matching pathnames for Windows. NFC.

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

5 years ago[llvm-objcopy] [COFF] Fix warnings abuilt missing field initialization. NFC.
Martin Storsjo [Thu, 10 Jan 2019 21:59:41 +0000 (21:59 +0000)]
[llvm-objcopy] [COFF] Fix warnings abuilt missing field initialization. NFC.

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

5 years agogn build: Use "git rev-parse --git-dir" to discover the path to the .git directory.
Peter Collingbourne [Thu, 10 Jan 2019 21:57:07 +0000 (21:57 +0000)]
gn build: Use "git rev-parse --git-dir" to discover the path to the .git directory.

This makes it compatible with worktrees.

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

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

5 years ago[MachineCombiner][NFC] Prevent dereferencing past-the-end object in an MRI container
Gerolf Hoflehner [Thu, 10 Jan 2019 21:53:13 +0000 (21:53 +0000)]
[MachineCombiner][NFC] Prevent dereferencing past-the-end object in an MRI container

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

5 years ago[MemorySSA] Disable checkClobberSanity for SkipSelfWalker.
Alina Sbirlea [Thu, 10 Jan 2019 21:47:15 +0000 (21:47 +0000)]
[MemorySSA] Disable checkClobberSanity for SkipSelfWalker.

Sanity will fail for this, since we're exploring getting a clobber
further than the sanity check expects.
Ideally we need to teach the sanity check to differentiate between the
two walkers based on the SkipSelf bool in the query.

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

5 years agogn build: Merge r350893
Nico Weber [Thu, 10 Jan 2019 21:47:10 +0000 (21:47 +0000)]
gn build: Merge r350893

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

5 years ago[llvm-objcopy] [COFF] Add support for removing symbols
Martin Storsjo [Thu, 10 Jan 2019 21:28:24 +0000 (21:28 +0000)]
[llvm-objcopy] [COFF] Add support for removing symbols

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

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

5 years agoAvoid use-after-free in ~LegacyRTDyldObjectLinkingLayer
Sanjoy Das [Thu, 10 Jan 2019 20:12:09 +0000 (20:12 +0000)]
Avoid use-after-free in ~LegacyRTDyldObjectLinkingLayer

Reviewers: lhames

Subscribers: mcrosier, jlebar, bixia, llvm-commits

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

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

5 years ago[GVN] Update BlockRPONumber prior to use.
Matt Davis [Thu, 10 Jan 2019 19:56:03 +0000 (19:56 +0000)]
[GVN] Update BlockRPONumber prior to use.

Summary:
The original patch addressed the use of BlockRPONumber by forcing a sequence point when accessing that map in a conditional.  In short we found cases where that map was being accessed with blocks that had not yet been added to that structure.  For context, I've kept the wall of text below,  to what we are trying to fix, by always ensuring a updated BlockRPONumber.

== Backstory ==

I was investigating an ICE (segfault accessing a DenseMap item).  This failure happened non-deterministically, with no apparent reason and only on a Windows build of LLVM (from October 2018).

After looking into the crashes (multiple core files) and running DynamoRio, the cores and DynamoRio (DR) log pointed to the same code in `GVN::performScalarPRE()`. The values in the map are unsigned integers, the keys are `llvm::BasicBlock*`.  Our test case that triggered this warning and periodic crash is rather involved.  But the problematic line looks to be:

GVN.cpp: Line 2197

```
     if (BlockRPONumber[P] >= BlockRPONumber[CurrentBlock] &&
```

To test things out, I cooked up a patch that accessed the items in the map outside of the condition, by forcing a sequence point between accesses. DynamoRio stopped warning of the issue, and the test didn't seem to crash after 1000+ runs.

My investigation was on an older version of LLVM, (source from October this year). What it looks like was occurring is the following, and the assembly from the latest pull of llvm in December seems to confirm this might still be an issue; however, I have not witnessed the crash on more recent builds. Of course the asm in question is generated from the host compiler on that Windows box (not clang), but it hints that we might want to consider how we access the BlockRPONumber map in this conditional (line 2197, listed above).  In any case, I don't think the host compiler is wrong, rather I think it is pointing out a possibly latent bug in llvm.

1) There is no sequence point for the `>=` operation.

2) A call to a `DenseMapBase::operator[]` can have the side effect of the map reallocating a larger store (more Buckets, via a call to `DenseMap::grow`).

3) It seems perfectly legal for a host compiler to generate assembly that stores the result of a call to `operator[]` on the stack (that's what my host compile of GVN.cpp is doing) .  A second call to `operator[]` //might// encourage the map to 'grow' thus making any pointers to the map's store invalid.  The `>=` compares the first and second values. If the first happens to be a pointer produced from operator[], it could be invalid when dereferenced at the time of comparison.

The assembly generated from the Window's host compiler does show the result of the first access to the map via `operator[]` produces a pointer to an unsigned int.  And that pointer is being stored on  the stack.  If a second call to the map (which does occur) causes the map to grow, that address (on the stack) is now invalid.

Reviewers: t.p.northover, efriedma

Reviewed By: efriedma

Subscribers: efriedma, llvm-commits

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

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

5 years agoUse MemorySSA in LICM to do sinking and hoisting.
Alina Sbirlea [Thu, 10 Jan 2019 19:29:04 +0000 (19:29 +0000)]
Use MemorySSA in LICM to do sinking and hoisting.

Summary:
Step 2 in using MemorySSA in LICM:
Use MemorySSA in LICM to do sinking and hoisting, all under "EnableMSSALoopDependency" flag.
Promotion is disabled.

Enable flag in LICM sink/hoist tests to test correctness of this change. Moved one test which
relied on promotion, in order to test all sinking tests.

Reviewers: sanjoy, davide, gberry, george.burgess.iv

Subscribers: llvm-commits, Prazek

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

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

5 years ago[X86] Call SimplifyDemandedBits on conditions of X86ISD::SHRUNKBLEND
Craig Topper [Thu, 10 Jan 2019 19:05:34 +0000 (19:05 +0000)]
[X86] Call SimplifyDemandedBits on conditions of X86ISD::SHRUNKBLEND

This extends to combineVSelectToShrunkBlend to be able to resimplify SHRUNKBLENDS that have already been created.

This should help some of the regressions from D56387

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

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

5 years ago[X86] Simplify the BRCOND handling for FCMP_UNE.
Craig Topper [Thu, 10 Jan 2019 19:02:14 +0000 (19:02 +0000)]
[X86] Simplify the BRCOND handling for FCMP_UNE.

Despite what the comment says, FCMP_UNE would be an OR not an AND. In the lowering code the first branch created still goes to the original destination. The second branch was exchanged to go to where the subsequent unconditional branch went. This is different than what we do for FCMP_OEQ where both branches that we create go to the original unconditional branch.

As far as I can tell, I think this means we don't need to exchange the branch target with the unconditional branch for FCMP_UNE at all.

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

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

5 years ago[llvm-objdump][MachO] Fix test to work on Windows
Francis Visoiu Mistrih [Thu, 10 Jan 2019 18:32:30 +0000 (18:32 +0000)]
[llvm-objdump][MachO] Fix test to work on Windows

This fails in http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/3208/steps/stage%201%20check/logs/stdio.

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

5 years ago[lit] Make it possible for the lit test suite to pass with
Dan Liew [Thu, 10 Jan 2019 17:47:44 +0000 (17:47 +0000)]
[lit] Make it possible for the lit test suite to pass with
`FILECHECK_OPTS=-v` set in the environment.

Follow up to r350850 as requested by Joel E. Denny in
https://reviews.llvm.org/D56541 .

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

5 years ago[llvm-objdump][MachO] Fix error reporting after r350848 and r350849
Francis Visoiu Mistrih [Thu, 10 Jan 2019 17:36:54 +0000 (17:36 +0000)]
[llvm-objdump][MachO] Fix error reporting after r350848 and r350849

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

5 years ago[FileCheck] Don't propagate `FILECHECK_DUMP_INPUT_ON_FAILURE` and
Dan Liew [Thu, 10 Jan 2019 17:24:06 +0000 (17:24 +0000)]
[FileCheck] Don't propagate `FILECHECK_DUMP_INPUT_ON_FAILURE` and
`FILECHECK_OPTS` into environment for FileCheck tests.

Summary:

This fixes the following FileCheck tests:

* FileCheck/dump-input-enable.txt
* FileCheck/match-full-lines.txt

when `FILECHECK_DUMP_INPUT_ON_FAILURE` is set in the environment.

By default llvm-lit propagates `FILECHECK_DUMP_INPUT_ON_FAILURE` and
`FILECHECK_OPTS` from llvm-lit's environment into the test environment.
Unfortunately this can break FileCheck's tests because they expect that
these environment variables not to be set.

rdar://problem/47176262

Reviewers: jdenny, probinson, george.karpenkov

Subscribers: llvm-commits

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

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

5 years ago[llvm-objdump][MachO] Use the -dsym file name when reporting errors
Francis Visoiu Mistrih [Thu, 10 Jan 2019 17:16:42 +0000 (17:16 +0000)]
[llvm-objdump][MachO] Use the -dsym file name when reporting errors

Instead of using the binary filename.

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

5 years ago[llvm-objdump][MachO] Correctly handle the llvm::Error when -dsym has errors
Francis Visoiu Mistrih [Thu, 10 Jan 2019 17:16:37 +0000 (17:16 +0000)]
[llvm-objdump][MachO] Correctly handle the llvm::Error when -dsym has errors

In an assert build, the Error gets destroyed and we get "Program aborted
due to an unhandled Error:".

In release, we get an empty message.

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

5 years ago[Docs] fix typo, adjust text order
Sanjay Patel [Thu, 10 Jan 2019 17:02:55 +0000 (17:02 +0000)]
[Docs] fix typo, adjust text order

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

5 years ago[Docs] add note to avoid 'errno' for better vectorization (PR40265)
Sanjay Patel [Thu, 10 Jan 2019 16:57:28 +0000 (16:57 +0000)]
[Docs] add note to avoid 'errno' for better vectorization (PR40265)

This is a partial fix for the documentation improvements requested in:
https://bugs.llvm.org/show_bug.cgi?id=40265

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

5 years ago[DAGCombiner] simplify code; NFC
Sanjay Patel [Thu, 10 Jan 2019 16:47:42 +0000 (16:47 +0000)]
[DAGCombiner] simplify code; NFC

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

5 years agoRepair compilation of llvm-stress after r350835.
James Y Knight [Thu, 10 Jan 2019 16:43:26 +0000 (16:43 +0000)]
Repair compilation of llvm-stress after r350835.

Apparently it doesn't get built by 'ninja check'. :(

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

5 years ago[SelectionDAGBuilder] Refactor GetRegistersForValue. NFCI.
Nirav Dave [Thu, 10 Jan 2019 16:25:47 +0000 (16:25 +0000)]
[SelectionDAGBuilder] Refactor GetRegistersForValue. NFCI.

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

5 years ago[llvm-objdump] - Do not include reserved undefined symbol in -t output.
George Rimar [Thu, 10 Jan 2019 16:24:10 +0000 (16:24 +0000)]
[llvm-objdump] - Do not include reserved undefined symbol in -t output.

This is https://bugs.llvm.org/show_bug.cgi?id=26892,

GNU objdump hides the special symbol entry:

SYMBOL TABLE:
000000000000a7e0 l     F .text 00000000000003f9 bi_copymodules
while llvm-objdump does not:

SYMBOL TABLE:
0000000000000000         *UND*  00000000
000000000000a7e0 l     F .text  000003f9 bi_copymodules

Patch makes the behavior of the llvm-objdump to be consistent with the GNU objdump.

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

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

5 years ago[SelectionDAGBuilder] Fix formatting. NFC.
Nirav Dave [Thu, 10 Jan 2019 16:22:19 +0000 (16:22 +0000)]
[SelectionDAGBuilder] Fix formatting. NFC.

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

5 years ago[AMDGPU] Fix dwordx3/southern-islands failures.
Neil Henning [Thu, 10 Jan 2019 16:21:08 +0000 (16:21 +0000)]
[AMDGPU] Fix dwordx3/southern-islands failures.

This commit fixes the dwordx3/southern-islands failures that were found
in bugzilla https://bugs.llvm.org/show_bug.cgi?id=40129, by not
generating the dwordx3 variants of load/store instructions that were
added to the ISA after southern islands.

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

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

5 years ago[SelectionDAGBuilder] Refactor visitInlineAsm. NFC.
Nirav Dave [Thu, 10 Jan 2019 16:18:18 +0000 (16:18 +0000)]
[SelectionDAGBuilder] Refactor visitInlineAsm. NFC.

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

5 years ago[opaque pointer types] Remove some calls to generic Type subtype accessors.
James Y Knight [Thu, 10 Jan 2019 16:07:20 +0000 (16:07 +0000)]
[opaque pointer types] Remove some calls to generic Type subtype accessors.

That is, remove many of the calls to Type::getNumContainedTypes(),
Type::subtypes(), and Type::getContainedType(N).

I'm not intending to remove these accessors -- they are
useful/necessary in some cases. However, removing the pointee type
from pointers would potentially break some uses, and reducing the
number of calls makes it easier to audit.

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

5 years ago[llvm-symbolizer] Add -p as alias to -pretty-print
Dmitry Venikov [Thu, 10 Jan 2019 15:33:35 +0000 (15:33 +0000)]
[llvm-symbolizer] Add -p as alias to -pretty-print

Summary: Provides -p as a short alias for -pretty-print. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40076

Reviewers: samsonov, khemant, ruiu, rnk, fjricci, jhenderson

Reviewed By: jhenderson

Subscribers: llvm-commits

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

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

5 years ago[RISCV][MC] Add support for evaluating constant symbols as immediates
Alex Bradbury [Thu, 10 Jan 2019 15:33:17 +0000 (15:33 +0000)]
[RISCV][MC] Add support for evaluating constant symbols as immediates

This further improves compatibility with GNU as, allowing input such as the
following to be assembled:

.equ CONST, 0x123456
li a0, CONST
addi a0, a0, %lo(CONST)

.equ CONST, 1
slli a0, a0, CONST

Note that we don't have perfect compatibility with gas, as it will avoid
emitting a relocation in this case:

addi a0, a0, %lo(CONST2)
.equ CONST2, 0x123456

Thanks to Shiva Chen for suggesting a better way to approach this during review.

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

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

5 years ago[x86] fix remaining miscompile bug in horizontal binop matching (PR40243)
Sanjay Patel [Thu, 10 Jan 2019 15:27:23 +0000 (15:27 +0000)]
[x86] fix remaining miscompile bug in horizontal binop matching (PR40243)

When we use the partial-matching function on a 128-bit chunk, we must
account for the possibility that we've matched undef halves of the
original source vectors, so the outputs may need to be reset.

This should allow closing PR40243:
https://bugs.llvm.org/show_bug.cgi?id=40243

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

5 years agogn build: Merge r350819
Nico Weber [Thu, 10 Jan 2019 15:16:32 +0000 (15:16 +0000)]
gn build: Merge r350819

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

5 years ago[x86] fix horizontal binop matching for 256-bit vectors (PR40243)
Sanjay Patel [Thu, 10 Jan 2019 15:04:52 +0000 (15:04 +0000)]
[x86] fix horizontal binop matching for 256-bit vectors (PR40243)

This is a partial fix for:
https://bugs.llvm.org/show_bug.cgi?id=40243
...as seen in the integer test, we still need to correct the result when using the
existing (old) horizontal op matching function because it does not model the way
x86 256-bit horizontal ops return results (each 128-bit half is its own horizontal-op).
A potential follow-up change for that is discussed in the bug report - see also D56490.

This generally duplicates a lot of the existing matching code, but we can't just remove
that without introducing regressions, so the existing code is renamed and used less often.
Follow-ups may try to reduce that overlap.

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

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

5 years ago[AArch64] Fix operation actions for FP16 vector intrinsics
Bryan Chan [Thu, 10 Jan 2019 15:02:37 +0000 (15:02 +0000)]
[AArch64] Fix operation actions for FP16 vector intrinsics

Summary:
This patch changes the legalization action for some half-precision floating-
point vector intrinsics (FSIN, FLOG, etc.) from Promote to Expand. These ops
are not supported in hardware for half-precision vectors, but promotion is
not always possible (for v8f16 operands). Changing the action to Expand fixes
an assertion failure in the legalizer when the frontend produces such ops.
In addition, a quick microbenchmark shows that, in the v4f16 case,
expanding introduces fewer spills and is therefore slightly faster than
promoting.

Reviewers: t.p.northover, SjoerdMeijer

Reviewed By: SjoerdMeijer

Subscribers: javed.absar, kristof.beyls, llvm-commits

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

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

5 years ago[llvm-objdump] - Implement -z/--disassemble-zeroes.
George Rimar [Thu, 10 Jan 2019 14:55:26 +0000 (14:55 +0000)]
[llvm-objdump] - Implement -z/--disassemble-zeroes.

This is https://bugs.llvm.org/show_bug.cgi?id=37151,

GNU objdump spec says that "Normally the disassembly output will skip blocks of zeroes.",
but currently, llvm-objdump prints them.

The patch implements the -z/--disassemble-zeroes option and switches the default to always
skip blocks of zeroes.

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

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

5 years ago[X86] Add SSE41 vector abs tests
Simon Pilgrim [Thu, 10 Jan 2019 14:26:15 +0000 (14:26 +0000)]
[X86] Add SSE41 vector abs tests

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

5 years ago[llvm-symbolizer] Add support for specifying addresses on command-line
James Henderson [Thu, 10 Jan 2019 14:10:02 +0000 (14:10 +0000)]
[llvm-symbolizer] Add support for specifying addresses on command-line

See https://bugs.llvm.org/show_bug.cgi?id=40070.

GNU addr2line accepts input addresses both on the command-line and via
stdin. llvm-symbolizer previously only supported the latter. This
change adds support for the former. As with addr2line, the new
behaviour is to only look for addresses on stdin if no positional
arguments were provided to llvm-symbolizer.

Reviewed by: ruiu

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

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

5 years ago[MCA] Fix wrong definition of ResourceUnitMask in DefaultResourceStrategy.
Andrea Di Biagio [Thu, 10 Jan 2019 13:59:13 +0000 (13:59 +0000)]
[MCA] Fix wrong definition of ResourceUnitMask in DefaultResourceStrategy.

Field ResourceUnitMask was incorrectly defined as a 'const unsigned' mask. It
should have been a 64 bit quantity instead. That means, ResourceUnitMask was
always implicitly truncated to a 32 bit quantity.
This issue has been found by inspection. Surprisingly, that bug was latent, and
it never negatively affected any existing upstream targets.

This patch fixes  the wrong definition of ResourceUnitMask, and adds a bunch of
extra debug prints to help debugging potential issues related to invalid
processor resource masks.

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

5 years ago[ARM] Fix for verifier buildbot
Sam Parker [Thu, 10 Jan 2019 10:47:23 +0000 (10:47 +0000)]
[ARM] Fix for verifier buildbot

Copy the MachineOperand first and then change the flags instead of
making a copy.

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

5 years ago[LoopUnroll] add parsing for unroll parameters in -passes pipeline
Fedor Sergeev [Thu, 10 Jan 2019 10:01:53 +0000 (10:01 +0000)]
[LoopUnroll] add parsing for unroll parameters in -passes pipeline

Allow to specify loop-unrolling with optional parameters explicitly
spelled out in -passes pipeline specification.
Introducing somewhat generic way of specifying parameters parsing via
FUNCTION_PASS_PARAMETRIZED pass registration.

Syntax of parametrized unroll pass name is as follows:
   'unroll<' parameter-list '>'

Where parameter-list is ';'-separate list of parameter names and optlevel
   optlevel: 'O[0-3]'
   parameter: { 'partial' | 'peeling' | 'runtime' | 'upperbound' }
   negated:  'no-' parameter

Example:
   -passes=loop(unroll<O3;runtime;no-upperbound>)

    this invokes LoopUnrollPass configured with OptLevel=3,
    Runtime, no UpperBound, everything else by default.

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

5 years agoFix RUN line in test/Transforms/LoopDeletion/crashbc.ll
Bjorn Pettersson [Thu, 10 Jan 2019 09:58:23 +0000 (09:58 +0000)]
Fix RUN line in test/Transforms/LoopDeletion/crashbc.ll

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

5 years ago[ARM] Size reduce teq to eors
Sam Parker [Thu, 10 Jan 2019 08:36:33 +0000 (08:36 +0000)]
[ARM] Size reduce teq to eors

Add t2TEQrr to the map of instructions with can be reduced down into
a T1 instruction. This is a special case because TEQ just sets the
CPSR and doesn't write to a GPR, which is not the case for EOR. So,
we need to ensure that the EOR can write to the first operand.

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

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

5 years ago[X86] Disable DomainReassignment pass when AVX512BW is disabled to avoid injecting...
Craig Topper [Thu, 10 Jan 2019 07:43:54 +0000 (07:43 +0000)]
[X86] Disable DomainReassignment pass when AVX512BW is disabled to avoid injecting VK32/VK64 references into the MachineIR

Summary:
This pass replaces GR8/GR16/GR32/GR64 with their equivalent sized mask register classes. But VK32/VK64 aren't legal without AVX512BW. Apparently this mostly appears to work if the register coalescer is able to remove the VK32/VK64 register class reference. Or if we don't ever spill it. But there's no guarantee of that.

Another Intel employee managed to trigger a crash due to this with ISPC. Unfortunately, I've lost the test case he sent me at the time. I'm trying to get him to reproduce it for me. I'd like to get this in before 8.0 branches since its a little scary.

The regressions here are unfortunate, but I think we can make some improvements to DAG combine, load folding, etc. to fix them. Just not sure if we can get that done for 8.0.

Fixes PR39741

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

5 years agoRecommit "[PowerPC] Fix assert from machine verify pass that unmatched register class...
Zi Xuan Wu [Thu, 10 Jan 2019 06:20:14 +0000 (06:20 +0000)]
Recommit "[PowerPC] Fix assert from machine verify pass that unmatched register class about fcmp selection in fast-isel"

This re-commit r350685.

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

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

5 years ago[AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc
Mandeep Singh Grang [Thu, 10 Jan 2019 04:59:44 +0000 (04:59 +0000)]
[AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc

Summary:
D55896 and D56029 add support to emit fixups for :abs_g0: , :abs_g1_s: , etc.
This patch adds the necessary enums and MCExpr needed for lowering these.

Reviewers: rnk, mstorsjo, efriedma

Reviewed By: efriedma

Subscribers: javed.absar, kristof.beyls, llvm-commits

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

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

5 years agoRevert "[WebAssembly] Add simd128-unimplemented subtarget feature"
Thomas Lively [Thu, 10 Jan 2019 04:09:25 +0000 (04:09 +0000)]
Revert "[WebAssembly] Add simd128-unimplemented subtarget feature"

This reverts rL350791.

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

5 years ago[AMDGPU] Separate feature dot-insts
Stanislav Mekhanoshin [Thu, 10 Jan 2019 03:25:20 +0000 (03:25 +0000)]
[AMDGPU] Separate feature dot-insts

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

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

5 years ago[WebAssembly] Add simd128-unimplemented subtarget feature
Thomas Lively [Thu, 10 Jan 2019 02:55:52 +0000 (02:55 +0000)]
[WebAssembly] Add simd128-unimplemented subtarget feature

This is a second attempt at r350778, which was reverted in
r350789. The only change is that the unimplemented-simd128 feature has
been renamed simd128-unimplemented, since naming it
unimplemented-simd128 somehow made the simd128 feature flag enable the
unimplemented-simd128 feature on Windows.

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

5 years agoRevert "Fix go bindings for r350647: missed a function rename"
Jorge Gorbe Moya [Thu, 10 Jan 2019 01:51:54 +0000 (01:51 +0000)]
Revert "Fix go bindings for r350647: missed a function rename"

This reverts commit a74266858a8164cfb23d4e138cd4c7c37be0b5d1. SVN revision r350657.

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

5 years agoRevert "[WebAssembly] Add unimplemented-simd128 subtarget feature"
Thomas Lively [Thu, 10 Jan 2019 01:37:44 +0000 (01:37 +0000)]
Revert "[WebAssembly] Add unimplemented-simd128 subtarget feature"

This reverts L350778.

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

5 years ago[MemorySSA] Remove optimized value when reseting optimized.
Alina Sbirlea [Thu, 10 Jan 2019 00:16:54 +0000 (00:16 +0000)]
[MemorySSA] Remove optimized value when reseting optimized.

Summary:
If we don't reset the optimized value O for access A, even though A is no longer optimized to O, A will still show up in that O's users list.
This fails verification when hoisting a Def outside a loop, even though the updates are correct.
The reason is that the phi in the loop header still find as user the hoisted def, because the Def has a pointer to the Phi in its optimized operand.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

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

5 years ago[X86] After turning VSELECT into SHRUNKBLEND, make we push the VSELECT into the workl...
Craig Topper [Thu, 10 Jan 2019 00:14:27 +0000 (00:14 +0000)]
[X86] After turning VSELECT into SHRUNKBLEND, make we push the VSELECT into the worklist so it can be deleted.

Found while trying to figure out why my second version of D56421 worked better than the first version. We weren't deleting the vselect in a timely fashion and that caused SimplfyDemandedBit to see an additional user.

The new version doesn't have this problem so this fix isn't needed there, but seemed like the right thing to do.

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

5 years ago[WebAssembly] Add unimplemented-simd128 subtarget feature
Thomas Lively [Wed, 9 Jan 2019 23:59:37 +0000 (23:59 +0000)]
[WebAssembly] Add unimplemented-simd128 subtarget feature

Summary:
This replaces the old ad-hoc -wasm-enable-unimplemented-simd
flag. Also makes the new unimplemented-simd128 feature imply the
simd128 feature.

Reviewers: aheejin, dschuff

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

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

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

5 years ago[llvm-mca] Display masks in hex
Evandro Menezes [Wed, 9 Jan 2019 23:57:15 +0000 (23:57 +0000)]
[llvm-mca] Display masks in hex

Display the resources masks as hexadecimal.  Otherwise, NFC.

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

5 years ago[SimplifyLibCalls] Fix memchr expansion for constant strings.
Eli Friedman [Wed, 9 Jan 2019 23:39:26 +0000 (23:39 +0000)]
[SimplifyLibCalls] Fix memchr expansion for constant strings.

The C standard says "The memchr function locates the first
occurrence of c (converted to an unsigned char)[...]".  The expansion
was missing the conversion to unsigned char.

Fixes https://bugs.llvm.org/show_bug.cgi?id=39041 .

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

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

5 years agoDon't require a null terminator when loading objects
David Major [Wed, 9 Jan 2019 23:36:32 +0000 (23:36 +0000)]
Don't require a null terminator when loading objects

When a null terminator is required and the file size is a multiple of the system page size, MemoryBuffer will prefer pread() over mmap(), which can result in excessive memory usage.

Patch by Mike Hommey!

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

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

5 years ago[WebAssembly] Print a debug message at the start of each pass
Heejin Ahn [Wed, 9 Jan 2019 23:05:21 +0000 (23:05 +0000)]
[WebAssembly] Print a debug message at the start of each pass

Summary:
Looks like many passes print its pass description as a debug message at
the start of each pass, so added that to (mostly newly added) other
passes as well.

Reviewers: dschuff

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

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

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

5 years ago[AArch64] Add test for constant shrinking with multiple users (NFC).
Florian Hahn [Wed, 9 Jan 2019 21:04:36 +0000 (21:04 +0000)]
[AArch64] Add test for constant shrinking with multiple users (NFC).

Test to avoid regression fixed by rL350684.

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

5 years agoRefactor synthetic profile count computation. NFC.
Easwaran Raman [Wed, 9 Jan 2019 20:10:27 +0000 (20:10 +0000)]
Refactor synthetic profile count computation. NFC.

Summary:
Instead of using two separate callbacks to return the entry count and the
relative block frequency, use a single callback to return callsite
count. This would allow better supporting hybrid mode in the future as
the count of callsite need not always be derived from entry count (as in
sample PGO).

Reviewers: davidxl

Subscribers: mehdi_amini, steven_wu, dexonsmith, dang, llvm-commits

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

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

5 years ago[CodeGen] Ignore return sext/zext attributes of unused results for tail calls
Francis Visoiu Mistrih [Wed, 9 Jan 2019 19:46:15 +0000 (19:46 +0000)]
[CodeGen] Ignore return sext/zext attributes of unused results for tail calls

If the caller's return type does not have a zeroext attribute but the
callee does a tail call zeroext, we won't consider the tail call during
CodeGenPrepare because the attributes don't match.

However, if the result of the tail call has no uses, it makes sense to
drop the sext/zext attributes.

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

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

5 years ago[Inliner] Assert that the computed inline threshold is non-negative.
Easwaran Raman [Wed, 9 Jan 2019 19:26:17 +0000 (19:26 +0000)]
[Inliner] Assert that the computed inline threshold is non-negative.

Reviewers: chandlerc

Subscribers: haicheng, llvm-commits

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

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

5 years agorefactor BlockFrequencyInfo::view to take a title parameter
David Callahan [Wed, 9 Jan 2019 19:12:38 +0000 (19:12 +0000)]
refactor  BlockFrequencyInfo::view to take a title parameter

Summary: All a non-default title for the debugging this debugging aide

Reviewers: twoh, Kader, modocache

Reviewed By: twoh

Subscribers: llvm-commits

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

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

5 years agoFix visualization of intrusive reference counted objects in MSVC.
Aaron Ballman [Wed, 9 Jan 2019 18:59:56 +0000 (18:59 +0000)]
Fix visualization of intrusive reference counted objects in MSVC.

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

5 years ago[WebAssembly] Standardize order of SIMD bitselect arguments
Thomas Lively [Wed, 9 Jan 2019 18:13:11 +0000 (18:13 +0000)]
[WebAssembly] Standardize order of SIMD bitselect arguments

Summary:
For some reason the backend assumed that the condition mask would be
the first argument to the LLVM intrinsic, but everywhere else the
condition mask is the third argument.

Reviewers: aheejin

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

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

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

5 years ago[x86] use 'nounwind' to remove test noise; NFC
Sanjay Patel [Wed, 9 Jan 2019 17:29:18 +0000 (17:29 +0000)]
[x86] use 'nounwind' to remove test noise; NFC

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

5 years ago[unittests][Support] AIX: Skip sticky bit file tests
Hubert Tong [Wed, 9 Jan 2019 16:00:39 +0000 (16:00 +0000)]
[unittests][Support] AIX: Skip sticky bit file tests

On AIX, attempting (without root) to set the sticky bit on a file with
the `chmod` utility will give:
```
chmod: not all requested changes were made to <file>
```

The same occurs when modifying other permission bits on a file with the
sticky bit already set.

It seems that the `chmod` function will report success despite failing
to set the sticky bit.

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

5 years ago[mips][micrompis] Emit 16bit NOPs by default
Aleksandar Beserminji [Wed, 9 Jan 2019 15:58:02 +0000 (15:58 +0000)]
[mips][micrompis] Emit 16bit NOPs by default

Emit 16bit NOPs by default.
Use 32bit NOPs in delay slots where necessary.

Differential https://reviews.llvm.org/D55323

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