OSDN Git Service

android-x86/external-llvm.git
6 years ago[llvm-mca] Use a WriteRef to describe register writes in class RegisterFile.
Andrea Di Biagio [Thu, 28 Jun 2018 15:50:26 +0000 (15:50 +0000)]
[llvm-mca] Use a WriteRef to describe register writes in class RegisterFile.

This patch introduces a new class named WriteRef. A WriteRef is used by the
RegisterFile to keep track of register definitions. Internally it wraps a
WriteState, as well as the source index of the defining instruction.

This patch allows the tool to propagate additional information to support future
analysis on data dependencies.

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

6 years ago[AMDGPU] Overload llvm.amdgcn.fmad.ftz to support f16
Stanislav Mekhanoshin [Thu, 28 Jun 2018 15:24:46 +0000 (15:24 +0000)]
[AMDGPU] Overload llvm.amdgcn.fmad.ftz to support f16

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

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

6 years ago[PhiValues] Adjust unit test to invalidate instructions before deleting them
John Brawn [Thu, 28 Jun 2018 15:17:07 +0000 (15:17 +0000)]
[PhiValues] Adjust unit test to invalidate instructions before deleting them

This should fix a sanitizer buildbot failure.

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

6 years ago[DEBUG_INFO, NVPTX] Add test for .debug_loc section, NFC.
Alexey Bataev [Thu, 28 Jun 2018 15:14:58 +0000 (15:14 +0000)]
[DEBUG_INFO, NVPTX] Add test for .debug_loc section, NFC.

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

6 years ago[dsymutil] Use UnitListTy consistently (NFC)
Jonas Devlieghere [Thu, 28 Jun 2018 15:01:42 +0000 (15:01 +0000)]
[dsymutil] Use UnitListTy consistently (NFC)

Use the UnitListTy typedef consistently throughout the Dwarf linker and
pass it by const reference where possible.

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

6 years agoAdd a PhiValuesAnalysis pass to calculate the underlying values of phis
John Brawn [Thu, 28 Jun 2018 14:13:06 +0000 (14:13 +0000)]
Add a PhiValuesAnalysis pass to calculate the underlying values of phis

This pass is being added in order to make the information available to BasicAA,
which can't do caching of this information itself, but possibly this information
may be useful for other passes.

Incorporates code based on Daniel Berlin's implementation of Tarjan's algorithm.

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

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

6 years agoRevert "Add support for generating a call graph profile from Branch Frequency Info."
Benjamin Kramer [Thu, 28 Jun 2018 13:15:03 +0000 (13:15 +0000)]
Revert "Add support for generating a call graph profile from Branch Frequency Info."

This reverts commits r335794 and r335797. Breaks ThinLTO+FDO selfhost.

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

6 years ago[ARM] Parallel DSP Pass
Sjoerd Meijer [Thu, 28 Jun 2018 12:55:29 +0000 (12:55 +0000)]
[ARM] Parallel DSP Pass

Armv6 introduced instructions to perform 32-bit SIMD operations. The purpose of
this pass is to do some straightforward IR pattern matching to create ACLE DSP
intrinsics, which map on these 32-bit SIMD operations.

Currently, only the SMLAD instruction gets recognised. This instruction
performs two multiplications with 16-bit operands, and stores the result in an
accumulator. We will follow this up with patches to recognise SMLAD in more
cases, and also to generate other DSP instructions (like e.g. SADD16).

Patch by: Sam Parker and Sjoerd Meijer

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

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

6 years agoRevert "ADT: Move ArrayRef comparison operators into the class"
Pavel Labath [Thu, 28 Jun 2018 12:10:21 +0000 (12:10 +0000)]
Revert "ADT: Move ArrayRef comparison operators into the class"

This reverts commit r335839, because it breaks the MSVC build.

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

6 years agoADT: Move ArrayRef comparison operators into the class
Pavel Labath [Thu, 28 Jun 2018 11:45:28 +0000 (11:45 +0000)]
ADT: Move ArrayRef comparison operators into the class

Summary:
This allows the implicit ArrayRef conversions to kick in when e.g.
comparing ArrayRef to a SmallVector.

Reviewers: zturner, dblaikie

Subscribers: llvm-commits

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

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

6 years ago[llvm-mca] Refactor method RegisterFile::collectWrites(). NFCI
Andrea Di Biagio [Thu, 28 Jun 2018 11:20:14 +0000 (11:20 +0000)]
[llvm-mca] Refactor method RegisterFile::collectWrites(). NFCI

Rather than calling std::find in a loop, just sort the vector and remove
duplicate entries at the end of the function.

Also, move the debug print at the end of the function, and query the
MCRegisterInfo to print register names rather than physreg IDs.

No functional change intended.

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

6 years agoComment change to verify commit rights. NFC.
Jesper Antonsson [Thu, 28 Jun 2018 10:55:04 +0000 (10:55 +0000)]
Comment change to verify commit rights. NFC.

Summary: Just a silly one-character correction.

Subscribers: llvm-commits

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

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

6 years agos/TablesChecked/TableChecked/ after r335823
Hans Wennborg [Thu, 28 Jun 2018 10:24:38 +0000 (10:24 +0000)]
s/TablesChecked/TableChecked/ after r335823

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

6 years agoAMDGPU: Remove MFI::ABIArgOffset
Matt Arsenault [Thu, 28 Jun 2018 10:18:55 +0000 (10:18 +0000)]
AMDGPU: Remove MFI::ABIArgOffset

We have too many mechanisms for tracking the various offsets
used for kernel arguments, so remove one. There's still a lot of
confusion with these because there are two different "implicit"
argument areas located at the beginning and end of the kernarg
segment.

Additionally, the offset was determined based on the memory
size of the split element types. This would break in a future
commit where v3i32 is decomposed into separate i32 pieces.

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

6 years agoAMDGPU: Error on calls from graphics shaders
Matt Arsenault [Thu, 28 Jun 2018 10:18:36 +0000 (10:18 +0000)]
AMDGPU: Error on calls from graphics shaders

In principle nothing should stop these from working, but
work is necessary to create an ABI for dealing with the stack
related registers.

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

6 years agoAMDGPU: Fix AMDGPUCodeGenPrepare using uninitialized AMDGPUAS struct
Matt Arsenault [Thu, 28 Jun 2018 10:18:23 +0000 (10:18 +0000)]
AMDGPU: Fix AMDGPUCodeGenPrepare using uninitialized AMDGPUAS struct

Not sure how this wasn't noticed before.

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

6 years agoAMDGPU: Fix assert on aggregate type kernel arguments
Matt Arsenault [Thu, 28 Jun 2018 10:18:11 +0000 (10:18 +0000)]
AMDGPU: Fix assert on aggregate type kernel arguments

Just fix the crash for now by not doing the optimization since
figuring out how to properly convert the bits for an arbitrary
struct is a pain.

Also fix a crash when there is only an empty struct argument.

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

6 years agoUnify sorted asserts to use the existing atomic pattern
Benjamin Kramer [Thu, 28 Jun 2018 10:03:45 +0000 (10:03 +0000)]
Unify sorted asserts to use the existing atomic pattern

These are all benign races and only visible in !NDEBUG. tsan complains
about it, but a simple atomic bool is sufficient to make it happy.

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

6 years ago[DAGCombiner] Ensure we use the correct CC result type in visitSDIV
Simon Pilgrim [Thu, 28 Jun 2018 09:54:28 +0000 (09:54 +0000)]
[DAGCombiner] Ensure we use the correct CC result type in visitSDIV

We could get away with it for constant folded cases, but not for rL335719.

Thanks to Krzysztof Parzyszek for noticing.

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

6 years ago[SCCP] Mark CFG as preserved.
Florian Hahn [Thu, 28 Jun 2018 09:53:38 +0000 (09:53 +0000)]
[SCCP] Mark CFG as preserved.

SCCP does not change the CFG, so we can mark it as preserved.

Reviewers: dberlin, efriedma, davide

Reviewed By: davide

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

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

6 years ago[DAGCombiner] Remove unused variable. NFCI.
Simon Pilgrim [Thu, 28 Jun 2018 09:29:08 +0000 (09:29 +0000)]
[DAGCombiner] Remove unused variable. NFCI.

Noticed in D45806 review.

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

6 years ago[IndVarSimplify] Ignore unreachable users of truncs
Max Kazantsev [Thu, 28 Jun 2018 08:20:03 +0000 (08:20 +0000)]
[IndVarSimplify] Ignore unreachable users of truncs

If a trunc has a user in a block which is not reachable from entry,
we can safely perform trunc elimination as if this user didn't exist.

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

6 years ago[llvm-exegesis] Add partial X87 support.
Clement Courbet [Thu, 28 Jun 2018 07:41:16 +0000 (07:41 +0000)]
[llvm-exegesis] Add partial X87 support.

Summary:
This enables the X86-specific X86FloatingPointStackifierPass, and allow
llvm-exegesis to generate and measure X87 latency/uops for some FP ops.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

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

6 years ago[DwarfDebug] Remove unused argument (NFC)
Petar Jovanovic [Thu, 28 Jun 2018 04:50:40 +0000 (04:50 +0000)]
[DwarfDebug] Remove unused argument (NFC)

Remove unused ByteStreamer argument from function emitDebugLocValue.

Patch by Nikola Prica.

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

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

6 years agoSupport for multiarch runtimes layout
Petr Hosek [Thu, 28 Jun 2018 03:11:52 +0000 (03:11 +0000)]
Support for multiarch runtimes layout

This change adds a support for multiarch style runtimes layout, so in
addition to the existing layout where runtimes get installed to:

lib/clang/$version/lib/$os

Clang now allows runtimes to be installed to:

lib/clang/$version/$target/lib

This also includes libc++, libc++abi and libunwind; today those are
assumed to be in Clang library directory built for host, with the
new layout it is possible to install libc++, libc++abi and libunwind
into the runtime directory built for different targets.

The use of new layout is enabled by setting the
LLVM_ENABLE_RUNTIME_TARGET_DIR CMake variable and is supported by both
projects and runtimes layouts. The runtimes CMake build has been further
modified to use the new layout when building runtimes for multiple
targets.

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

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

6 years ago[X86] Use PatFrag with hardcoded numbers for FROUND_NO_EXC/FROUND_CURRENT instead...
Craig Topper [Thu, 28 Jun 2018 01:45:44 +0000 (01:45 +0000)]
[X86] Use PatFrag with hardcoded numbers for FROUND_NO_EXC/FROUND_CURRENT instead of ImmLeafs with predicates where one of the two numbers was hardcoded.

This more efficient for the isel table generator since we can use CheckChildInteger instead of MoveChild, CheckPredicate, MoveParent. This reduced the table size by 1-2K.

I wish there was a way to share the values with X86BaseInfo.h and still use a PatFrag like this. These numbers are fixed by the X86 intrinsic spec going back many years and we should never need to change them. So we shouldn't waste table bytes to support sharing.

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

6 years ago[X86] Change how we prefer shift by immediate over folding a load into a shift.
Craig Topper [Thu, 28 Jun 2018 00:47:41 +0000 (00:47 +0000)]
[X86] Change how we prefer shift by immediate over folding a load into a shift.

BMI2 added new shift by register instructions that have the ability to fold a load.

Normally without doing anything special isel would prefer folding a load over folding an immediate because the load folding pattern has higher "complexity". This would require an instruction to move the immediate into a register. We would rather fold the immediate instead and have a separate instruction for the load.

We used to enforce this priority by artificially lowering the complexity of the load pattern.

This patch changes this to instead reject the load fold in isProfitableToFoldLoad if there is an immediate. This is more consistent with other binops and feels less hacky.

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

6 years ago[cmake][xcode-toolchain] add support for major Xcode version >= 10
Alex Lorenz [Thu, 28 Jun 2018 00:39:09 +0000 (00:39 +0000)]
[cmake][xcode-toolchain] add support for major Xcode version >= 10

The regex that extracts the Xcode version should support major versions with two
digits.

rdar://41465184

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

6 years ago[CGProfile] Fix unused variable warning.
Michael J. Spencer [Thu, 28 Jun 2018 00:12:04 +0000 (00:12 +0000)]
[CGProfile] Fix unused variable warning.

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

6 years agoAdd support for generating a call graph profile from Branch Frequency Info.
Michael J. Spencer [Wed, 27 Jun 2018 23:58:08 +0000 (23:58 +0000)]
Add support for generating a call graph profile from Branch Frequency Info.

=== Generating the CG Profile ===

The CGProfile module pass simply gets the block profile count for each BB and scans for call instructions.  For each call instruction it adds an edge from the current function to the called function with the current BB block profile count as the weight.

After scanning all the functions, it generates an appending module flag containing the data. The format looks like:
```
!llvm.module.flags = !{!0}

!0 = !{i32 5, !"CG Profile", !1}
!1 = !{!2, !3, !4} ; List of edges
!2 = !{void ()* @a, void ()* @b, i64 32} ; Edge from a to b with a weight of 32
!3 = !{void (i1)* @freq, void ()* @a, i64 11}
!4 = !{void (i1)* @freq, void ()* @b, i64 20}
```

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

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

6 years agoMove some code from PDBFileBuilder to MSFBuilder.
Zachary Turner [Wed, 27 Jun 2018 21:18:15 +0000 (21:18 +0000)]
Move some code from PDBFileBuilder to MSFBuilder.

The code to emit the pieces of the MSF file were actually in
PDBFileBuilder.  Move this to MSFBuilder so that we can
theoretically emit an MSF without having a PDB file.

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

6 years ago[X86] Make folding table checking threadsafe
Benjamin Kramer [Wed, 27 Jun 2018 21:01:53 +0000 (21:01 +0000)]
[X86] Make folding table checking threadsafe

This is a benign race, but tsan likes to complain about it. Just make it
happy.

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

6 years ago[X86] In X86DAGToDAGISel::PreprocessISelDAG, make sure we don't access N after we...
Craig Topper [Wed, 27 Jun 2018 20:58:46 +0000 (20:58 +0000)]
[X86] In X86DAGToDAGISel::PreprocessISelDAG, make sure we don't access N after we delete it.

If we turn X86ISD::AND into ISD::AND, we delete N. But we were continuing onto the next block of code even though N no longer existed.

Just happened to notice it. I assume asan didn't notice it because we explicitly unpoison deleted nodes and give them a DELETE_NODE opcode.

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

6 years ago[RISCV] Add machine function pass to merge base + offset
Sameer AbuAsal [Wed, 27 Jun 2018 20:51:42 +0000 (20:51 +0000)]
[RISCV] Add machine function pass to merge base + offset

Summary:
   In r333455 we added a peephole to fix the corner cases that result
   from separating base + offset lowering of global address.The
   peephole didn't handle some of the cases because it only has a basic
   block view instead of a function level view.

   This patch replaces that logic with a machine function pass. In
   addition to handling the original cases it handles uses of the global
   address across blocks in function and folding an offset from LW\SW
   instruction. This pass won't run for OptNone compilation, so there
   will be a negative impact overall vs the old approach at O0.

Reviewers: asb, apazos, mgrang

Reviewed By: asb

Subscribers: MartinMosbeck, brucehoult, the_o, rogfer01, mgorny, rbar, johnrusso, simoncook, niosHD, kito-cheng, shiva0217, zzheng, llvm-commits, edward-jones

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

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

6 years ago[llvm-objdump] Add -x --all-headers options
Fangrui Song [Wed, 27 Jun 2018 20:45:11 +0000 (20:45 +0000)]
[llvm-objdump] Add -x --all-headers options

Reviewers: paulsemel, echristo

Subscribers: llvm-commits

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

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

6 years ago[InstCombine] add tests for vector-select-of-binops with 2 variables; NFC
Sanjay Patel [Wed, 27 Jun 2018 20:23:47 +0000 (20:23 +0000)]
[InstCombine] add tests for vector-select-of-binops with 2 variables; NFC

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

6 years agoDocument the git config for Windows to do line-endings correctly.
Paul Robinson [Wed, 27 Jun 2018 19:58:28 +0000 (19:58 +0000)]
Document the git config for Windows to do line-endings correctly.

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

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

6 years ago[DAGCombine] Disable TokenFactor simplifications when optnone.
Nirav Dave [Wed, 27 Jun 2018 19:41:25 +0000 (19:41 +0000)]
[DAGCombine] Disable TokenFactor simplifications when optnone.

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

6 years ago[ADT] drop_begin: use adl_begin/adl_end. NFC.
Michael Kruse [Wed, 27 Jun 2018 19:39:03 +0000 (19:39 +0000)]
[ADT] drop_begin: use adl_begin/adl_end. NFC.

Summary:
The instantiation of the drop_begin function template usually fails because the functions begin() and end() do not exist. Only when using on a container from the std namespace (or `llvm::iterator_range`s of something derived from `std::iterator`), they are matched to std::begin() and std::end() due to Koenig-lookup.

Explicitly use llvm::adl_begin and llvm::adl_end to make drop_begin applicable to anything iterable (including C-style arrays).

A solution for general `llvm::iterator_range`s was already tried in r244620, but got reverted in r244621 due to MSVC not liking it.

Reviewers: dblaikie, grosbach, aaron.ballman, ruiu

Reviewed By: dblaikie, aaron.ballman

Subscribers: aaron.ballman, llvm-commits

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

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

6 years ago[WebAssembly] Try fixing test/CodeGen/WebAssembly/vector_sdiv.ll
Fangrui Song [Wed, 27 Jun 2018 19:35:50 +0000 (19:35 +0000)]
[WebAssembly] Try fixing test/CodeGen/WebAssembly/vector_sdiv.ll

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

6 years ago[X86] Fix unmatched parenthesis in r335768
Fangrui Song [Wed, 27 Jun 2018 19:12:07 +0000 (19:12 +0000)]
[X86] Fix unmatched parenthesis in r335768

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

6 years ago[X86] Teach the disassembler to use %eiz/%riz instead of NoRegister when the SIB...
Craig Topper [Wed, 27 Jun 2018 19:03:36 +0000 (19:03 +0000)]
[X86] Teach the disassembler to use %eiz/%riz instead of NoRegister when the SIB byte is present, but doesn't encode an index register and there was another shorter encoding that would achieve the same result.

The %eiz/%riz are dummy registers that force the encoder to emit a SIB byte when it normally wouldn't. By emitting them in the disassembly output we ensure that assembling the disassembler output would also produce a SIB byte.

This should match the behavior of objdump from binutils.

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

6 years ago[globalisel][legalizer] Add AtomicOrdering to LegalityQuery and use it in AArch64
Daniel Sanders [Wed, 27 Jun 2018 19:03:21 +0000 (19:03 +0000)]
[globalisel][legalizer] Add AtomicOrdering to LegalityQuery and use it in AArch64

Now that we have the ability to legalize based on MMO's. Add support for
legalizing based on AtomicOrdering and use it to correct the legalization
of the atomic instructions.

Also extend all() to be a variadic template as this ruleset now requires
3 and 4 argument versions.

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

6 years ago[ThinLTO] Fix test
Teresa Johnson [Wed, 27 Jun 2018 19:00:35 +0000 (19:00 +0000)]
[ThinLTO] Fix test

Fix test changes added in r335760. Even though we are invoking llvm-lto2
in single threaded mode, the order of processing the modules in the
backend is apparently not deterministic. Handle the expected debug
messages in any order. (The determinism would be good to fix, but not
related to this change.)

This also undoes the change I made in r335764 to help debug this.

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

6 years ago[ThinLTO] Modify test to help diagnose bot failures
Teresa Johnson [Wed, 27 Jun 2018 18:36:53 +0000 (18:36 +0000)]
[ThinLTO] Modify test to help diagnose bot failures

I am getting bot failures from r335760 that are difficult to diagnose
since the stderr is getting redirected to FileCheck. Save and dump the
debug output to stderr to help debug the issue.

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

6 years ago[DAGCombiner] restrict (float)((int) f) --> ftrunc with no-signed-zeros
Sanjay Patel [Wed, 27 Jun 2018 18:16:40 +0000 (18:16 +0000)]
[DAGCombiner] restrict (float)((int) f) --> ftrunc with no-signed-zeros

As noted in the D44909 review, the transform from (fptosi+sitofp) to ftrunc
can produce -0.0 where the original code does not:

#include <stdio.h>

int main(int argc) {
  float x;
  x = -0.8 * argc;
  printf("%f\n", (float)((int)x));
  return 0;
}

$ clang -O0 -mavx fp.c ; ./a.out
0.000000
$ clang -O1 -mavx fp.c ; ./a.out
-0.000000

Ideally, we'd use IR/node flags to predicate the transform, but the IR parser
doesn't currently allow fast-math-flags on the cast instructions. So for now,
just use the function attribute that corresponds to clang's "-fno-signed-zeros"
option.

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

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

6 years ago[ThinLTO] Print names in function import debug messages when available
Teresa Johnson [Wed, 27 Jun 2018 18:03:39 +0000 (18:03 +0000)]
[ThinLTO] Print names in function import debug messages when available

Summary:
Rather than just print the GUID, when it is available in the index,
print the global name as well in the function import thin link debug
messages. Names will be available when the combined index is being
built by the same process, e.g. a linker or "llvm-lto2 run".

Reviewers: davidxl

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, llvm-commits

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

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

6 years ago[Object] Allow iterating over an IRObjectFile's modules
Justin Bogner [Wed, 27 Jun 2018 17:58:32 +0000 (17:58 +0000)]
[Object] Allow iterating over an IRObjectFile's modules

If you've already loaded an IRObjectFile and need access to the
Modules themselves you shouldn't have to reparse a byte stream to do
it. Adds an accessor for the modules in IRObjectFile.

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

6 years ago[MachineOutliner] Don't outline sequences where x16/x17/nzcv are live across
Jessica Paquette [Wed, 27 Jun 2018 17:43:27 +0000 (17:43 +0000)]
[MachineOutliner] Don't outline sequences where x16/x17/nzcv are live across

It isn't safe to outline sequences of instructions where x16/x17/nzcv live
across the sequence.

This teaches the outliner to check whether or not a specific canidate has
x16/x17/nzcv live across it and discard the candidate in the case that that is
true.

https://bugs.llvm.org/show_bug.cgi?id=37573
https://reviews.llvm.org/D47655

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

6 years ago[InstCombine] add more tests for shuffle with different binops; NFC
Sanjay Patel [Wed, 27 Jun 2018 17:21:57 +0000 (17:21 +0000)]
[InstCombine] add more tests for shuffle with different binops; NFC

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

6 years ago[X86] Use bts/btr/btc for single bit set/clear/complement of a variable bit position
Craig Topper [Wed, 27 Jun 2018 16:47:39 +0000 (16:47 +0000)]
[X86] Use bts/btr/btc for single bit set/clear/complement of a variable bit position

If we are just modifying a single bit at a variable bit position we can use the BT* instructions to make the change instead of shifting a 1(or rotating a -1) and doing a binop. These instruction also ignore the upper bits of their index input so we can also remove an and if one is present on the index.

Fixes PR37938.

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

6 years ago[X86] Add test cases for D48606.
Craig Topper [Wed, 27 Jun 2018 16:47:36 +0000 (16:47 +0000)]
[X86] Add test cases for D48606.

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

6 years ago[AliasSet] Fix UnknownInstructions printing
Jakub Kuderski [Wed, 27 Jun 2018 16:34:30 +0000 (16:34 +0000)]
[AliasSet] Fix UnknownInstructions printing

Summary:
AliasSet::print uses `I->printAsOperand` to print UnknownInstructions. The problem is that not all UnknownInstructions have names (e.g. call instructions). When such instructions are printed, they appear as `<badref>` in AliasSets, which is very confusing, as the values are perfectly valid.

This patch fixes that by printing UnknownInstructions without a name using `print` instead of `printAsOperand`.

Reviewers: asbirlea, chandlerc, sanjoy, grosser

Reviewed By: asbirlea

Subscribers: llvm-commits

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

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

6 years ago[dsymutil] Move abstractions into separate files (NFC)
Jonas Devlieghere [Wed, 27 Jun 2018 16:13:40 +0000 (16:13 +0000)]
[dsymutil] Move abstractions into separate files (NFC)

This patch splits off some abstractions used by dsymutil's dwarf linker
and moves them into separate header and implementation files. This
almost halves the number of LOC in DwarfLinker.cpp and makes it a lot
easier to understand what functionality lives where.

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

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

6 years ago[llvm-mca] Register listeners with stages; remove Pipeline dependency from Stage.
Matt Davis [Wed, 27 Jun 2018 16:09:33 +0000 (16:09 +0000)]
[llvm-mca] Register listeners with  stages; remove Pipeline dependency from Stage.

Summary:
This patch removes a few callbacks from Pipeline.  It comes at the cost of
registering Listeners with all Stages.  Not all stages need listeners or issue
callbacks, this registration is a bit redundant.  However, as we build-out the
API, this redundancy can disappear.

The main purpose here is to move callback code from the Pipeline and into the
stages that actually issue those callbacks. This removes the back-pointer to
the Pipeline that was put into a few Stage subclasses.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb, courbet

Subscribers: tschuett, gbedwell, llvm-commits

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

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

6 years ago[X86][SSE] Add missing AVX512 rotation tests
Simon Pilgrim [Wed, 27 Jun 2018 16:00:53 +0000 (16:00 +0000)]
[X86][SSE] Add missing AVX512 rotation tests

Increase coverage to make sure we're not doing anything stupid without AVX512BW

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

6 years ago[X86] Rename the autoupgraded of packed fp compare and fpclass intrinsics that don...
Craig Topper [Wed, 27 Jun 2018 15:57:53 +0000 (15:57 +0000)]
[X86] Rename the autoupgraded of packed fp compare and fpclass intrinsics that don't take a mask as input to exclude '.mask.' from their name.

I think the intrinsics named 'avx512.mask.' should refer to the previous behavior of taking a mask argument in the intrinsic instead of using a 'select' or 'and' instruction in IR to accomplish the masking. This is more consistent with the goal that eventually we will have no intrinsics that have masking builtin. When we reach that goal, we should have no intrinsics named "avx512.mask".

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

6 years ago[AMDGPU] Convert rcp to rcp_iflag
Stanislav Mekhanoshin [Wed, 27 Jun 2018 15:33:33 +0000 (15:33 +0000)]
[AMDGPU] Convert rcp to rcp_iflag

If a source of rcp instruction is a result of any conversion from
an integer convert it into rcp_iflag instruction. No FP exception
can ever happen except division by zero if a single precision rcp
argument is a representation of an integral number.

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

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

6 years ago[AArch64] Reverting FP16 vcvth_n_s64_f16 to fix
Luke Geeson [Wed, 27 Jun 2018 14:34:40 +0000 (14:34 +0000)]
[AArch64] Reverting FP16 vcvth_n_s64_f16 to fix

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

6 years ago[AArch64] Add custom lowering for v4i8 trunc store
Adhemerval Zanella [Wed, 27 Jun 2018 13:58:46 +0000 (13:58 +0000)]
[AArch64] Add custom lowering for v4i8 trunc store

This patch adds a custom trunc store lowering for v4i8 vector types.
Since there is not v.4b register, the v4i8 is promoted to v4i16 (v.4h)
and default action for v4i8 is to extract each element and issue 4
byte stores.

A better strategy would be to extended the promoted v4i16 to v8i16
(with undef elements) and extract and store the word lane which
represents the v4i8 subvectores. The construction:

  define void @foo(<4 x i16> %x, i8* nocapture %p) {
    %0 = trunc <4 x i16> %x to <4 x i8>
    %1 = bitcast i8* %p to <4 x i8>*
    store <4 x i8> %0, <4 x i8>* %1, align 4, !tbaa !2
    ret void
  }

Can be optimized from:

  umov    w8, v0.h[3]
  umov    w9, v0.h[2]
  umov    w10, v0.h[1]
  umov    w11, v0.h[0]
  strb    w8, [x0, #3]
  strb    w9, [x0, #2]
  strb    w10, [x0, #1]
  strb    w11, [x0]
  ret

To:

  xtn     v0.8b, v0.8h
  str     s0, [x0]
  ret

The patch also adjust the memory cost for autovectorization, so the C
code:

  void foo (const int *src, int width, unsigned char *dst)
  {
    for (int i = 0; i < width; i++)
       *dst++ = *src++;
  }

can be vectorized to:

  .LBB0_4:                                // %vector.body
                                          // =>This Inner Loop Header: Depth=1
        ldr     q0, [x0], #16
        subs    x12, x12, #4            // =4
        xtn     v0.4h, v0.4s
        xtn     v0.8b, v0.8h
        st1     { v0.s }[0], [x2], #4
        b.ne    .LBB0_4

Instead of byte operations.

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

6 years ago[NEON] Support vldNq intrinsics in AArch32 (LLVM part)
Ivan A. Kosarev [Wed, 27 Jun 2018 13:57:52 +0000 (13:57 +0000)]
[NEON] Support vldNq intrinsics in AArch32 (LLVM part)

This patch adds support for the q versions of the dup
(load-to-all-lanes) NEON intrinsics, such as vld2q_dup_f16() for
example.

Currently, non-q versions of the dup intrinsics are implemented
in clang by generating IR that first loads the elements of the
structure into the first lane with the lane (to-single-lane)
intrinsics, and then propagating it other lanes. There are at
least two problems with this approach. First, there are no
double-spaced to-single-lane byte-element instructions. For
example, there is no such instruction as 'vld2.8 { d0[0], d2[0]
}, [r0]'. That means we cannot rely on the to-single-lane
intrinsics and instructions to implement the q versions of the
dup intrinsics. Note that to-all-lanes instructions do support
all sizes of data items, including bytes.

The second problem with the current approach is that we need a
separate vdup instruction to propagate the structure to each
lane. So for vld4q_dup_f16() we would need four vdup instructions
in addition to the initial vld instruction.

This patch introduces dup LLVM intrinsics and reworks handling of
the currently supported (non-q) NEON dup intrinsics to expand
them into those LLVM intrinsics, thus eliminating the need for
using to-single-lane intrinsics and instructions.

Additionally, this patch adds support for u64 and s64 dup NEON
intrinsics. These are marked as Arch64-only in the ARM NEON
Reference, but it seems there are no reasons to not support them
in AArch32 mode. Please correct, if that is wrong.

That's what we generate with this patch applied:

vld2q_dup_f16:
  vld2.16 {d0[], d2[]}, [r0]
  vld2.16 {d1[], d3[]}, [r0]

vld3q_dup_f16:
  vld3.16 {d0[], d2[], d4[]}, [r0]
  vld3.16 {d1[], d3[], d5[]}, [r0]

vld4q_dup_f16:
  vld4.16 {d0[], d2[], d4[], d6[]}, [r0]
  vld4.16 {d1[], d3[], d5[], d7[]}, [r0]

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

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

6 years ago[ValueLattice] Return false if value range did not change in mergeIn.
Florian Hahn [Wed, 27 Jun 2018 12:57:51 +0000 (12:57 +0000)]
[ValueLattice] Return false if value range did not change in mergeIn.

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

6 years ago[DAGCombiner] visitSDIV - add special case handling for (sdiv X, 1) -> X in pow2...
Simon Pilgrim [Wed, 27 Jun 2018 12:45:31 +0000 (12:45 +0000)]
[DAGCombiner] visitSDIV - add special case handling for (sdiv X, 1) -> X in pow2 expansion

For divisor = 1, perform a select of X - reduces scalarisation of simple SDIVs

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

6 years agoBuild TaskQueueTest in threads=on builds, fixes regression from r335608.
Nico Weber [Wed, 27 Jun 2018 11:52:30 +0000 (11:52 +0000)]
Build TaskQueueTest in threads=on builds, fixes regression from r335608.

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

6 years ago[llvm-mca] Avoid calling method update() on instructions that are already in the...
Andrea Di Biagio [Wed, 27 Jun 2018 11:17:07 +0000 (11:17 +0000)]
[llvm-mca] Avoid calling method update() on instructions that are already in the IS_READY state. NFCI

When promoting instructions from the wait queue to the ready queue, we should
check if an instruction has already reached the IS_READY state before
calling method update().

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

6 years ago[X86][SSE] Include MIN_SIGNED element in non-uniform SDIV pow2 tests
Simon Pilgrim [Wed, 27 Jun 2018 10:59:36 +0000 (10:59 +0000)]
[X86][SSE] Include MIN_SIGNED element in non-uniform SDIV pow2 tests

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

6 years ago[DAGCombiner] visitSDIV - simplify pow2 handling. NFCI.
Simon Pilgrim [Wed, 27 Jun 2018 10:51:55 +0000 (10:51 +0000)]
[DAGCombiner] visitSDIV - simplify pow2 handling. NFCI.

Use the builtin constant folding of getNode() etc. instead of doing it manually.

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

6 years ago[DAGCombiner] Fold SDIV(%X, MIN_SIGNED) -> SELECT(%X == MIN_SIGNED, 1, 0)
Simon Pilgrim [Wed, 27 Jun 2018 10:21:06 +0000 (10:21 +0000)]
[DAGCombiner] Fold SDIV(%X, MIN_SIGNED) -> SELECT(%X == MIN_SIGNED, 1, 0)

Fixes PR37569.

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

6 years ago[DAGCombiner] Don't accept signbit sdiv divisors in sdiv-by-pow2 vector expansion...
Simon Pilgrim [Wed, 27 Jun 2018 09:41:22 +0000 (09:41 +0000)]
[DAGCombiner] Don't accept signbit sdiv divisors in sdiv-by-pow2 vector expansion (PR37569)

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

6 years agoRemoving empty CodeGen dir in root
Luke Geeson [Wed, 27 Jun 2018 09:23:38 +0000 (09:23 +0000)]
Removing empty CodeGen dir in root

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

6 years ago[AArch64] Remove Duplicate FP16 Patterns with same encoding, match on existing patterns
Luke Geeson [Wed, 27 Jun 2018 09:20:13 +0000 (09:20 +0000)]
[AArch64] Remove Duplicate FP16 Patterns with same encoding, match on existing patterns

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

6 years agoAMDGPU/NFC: Fix typo in comment
Konstantin Zhuravlyov [Wed, 27 Jun 2018 05:36:03 +0000 (05:36 +0000)]
AMDGPU/NFC: Fix typo in comment

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

6 years agoAMDHSA: Rename RESERVED -> RESERVED0, mark gfx9-specific field
Konstantin Zhuravlyov [Wed, 27 Jun 2018 05:18:50 +0000 (05:18 +0000)]
AMDHSA: Rename RESERVED -> RESERVED0, mark gfx9-specific field

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

6 years agoAMDHSA/NFC: Address missed review feedback from
Konstantin Zhuravlyov [Wed, 27 Jun 2018 04:56:00 +0000 (04:56 +0000)]
AMDHSA/NFC: Address missed review feedback from
https://reviews.llvm.org/D47566

Change wording from "Must be backwards compatible" to
"Must match hardware definition" for enums that are
defined by hardware.

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

6 years ago[CMake] Provide direct support for building sanitized runtimes
Petr Hosek [Wed, 27 Jun 2018 03:35:53 +0000 (03:35 +0000)]
[CMake] Provide direct support for building sanitized runtimes

This avoids having to rely on magic separators and special parsing.

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

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

6 years ago[CMake] Use variables rather than ":" delimiters
Petr Hosek [Wed, 27 Jun 2018 03:14:41 +0000 (03:14 +0000)]
[CMake] Use variables rather than ":" delimiters

This is a more idiomatic CMake.

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

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

6 years ago[ADT] Pass DerivedT from pointe{e,r}_iterator to iterator_adaptor_base
Justin Bogner [Wed, 27 Jun 2018 00:54:36 +0000 (00:54 +0000)]
[ADT] Pass DerivedT from pointe{e,r}_iterator to iterator_adaptor_base

These were passing the wrong type into iterator_adaptor_base if T was
anything but the default.

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

6 years ago[llvm-mca] Add a comment to Stage::execute and fix a spelling error. NFC.
Matt Davis [Wed, 27 Jun 2018 00:54:11 +0000 (00:54 +0000)]
[llvm-mca] Add a comment to Stage::execute and fix a spelling error. NFC.

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

6 years ago[InstCombine] Avoid creating mis-sized dbg.values in commonCastTransforms()
Vedant Kumar [Wed, 27 Jun 2018 00:47:53 +0000 (00:47 +0000)]
[InstCombine] Avoid creating mis-sized dbg.values in commonCastTransforms()

This prevents InstCombine from creating mis-sized dbg.values when
replacing a sequence of casts with a simpler cast. For example, in:

  (fptrunc (floor (fpext X))) -> (floorf X)

We no longer emit dbg.value(X) (with a 32-bit float operand) to describe
(fpext X) (which is a 64-bit float).

This was diagnosed by the debugify check added in r335682.

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

6 years ago[Debugify] Handle failure to get fragment size when checking dbg.values
Vedant Kumar [Wed, 27 Jun 2018 00:47:52 +0000 (00:47 +0000)]
[Debugify] Handle failure to get fragment size when checking dbg.values

It's not possible to get the fragment size of some dbg.values. Teach the
mis-sized dbg.value diagnostic to detect this scenario and bail out.

Tested with:
$ find test/Transforms -print -exec opt -debugify-each -instcombine {} \;

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

6 years ago[X86] Don't store register and memory FMA3 opcodes in the same X86InstrFMA3Group.
Craig Topper [Wed, 27 Jun 2018 00:42:24 +0000 (00:42 +0000)]
[X86] Don't store register and memory FMA3 opcodes in the same X86InstrFMA3Group.

Nothing was using this relationship. By splitting them we no longer need to worry about register or memory entries being empty in a group.

The memory folding tables in X86InstrInfo.cpp can be used to access this relationship if needed.

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

6 years ago[Debugify] Diagnose mis-sized dbg.values
Vedant Kumar [Tue, 26 Jun 2018 22:46:41 +0000 (22:46 +0000)]
[Debugify] Diagnose mis-sized dbg.values

Report an error in -check-debugify when the size of a dbg.value operand
doesn't match up with the size of the variable it describes.

Eventually this check should be moved into the IR verifier. For the
moment, it's useful to include the check in -check-debugify as a means
of catching regressions and finding existing bugs.

Here are some instances of bugs the new check finds in the -O2 pipeline
(all in InstCombine):

1) A float is used where a double is expected:

ERROR: dbg.value operand has size 32, but its variable has size 64:
call void @llvm.dbg.value(metadata float %expf, metadata !12, metadata
!DIExpression()), !dbg !15

2) An i8 is used where an i32 is expected:

ERROR: dbg.value operand has size 8, but its variable has size 32:
call void @llvm.dbg.value(metadata i8 %t4, metadata !14, metadata
!DIExpression()), !dbg !24

3) A <4 x i32> is used where something twice as large is expected
(perhaps a <4 x i64>, I haven't double-checked):

ERROR: dbg.value operand has size 128, but its variable has size 256:
call void @llvm.dbg.value(metadata <4 x i32> %4, metadata !40, metadata
!DIExpression()), !dbg !95

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

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

6 years agoRevert "[asan] Instrument comdat globals on COFF targets"
Evgeniy Stepanov [Tue, 26 Jun 2018 22:43:48 +0000 (22:43 +0000)]
Revert "[asan] Instrument comdat globals on COFF targets"

Causes false positive ODR violation reports on __llvm_profile_raw_version.

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

6 years ago[ORC] Don't call isa<> on a null value.
Lang Hames [Tue, 26 Jun 2018 22:43:01 +0000 (22:43 +0000)]
[ORC] Don't call isa<> on a null value.

This should fix the recent builder failures in the test-global-ctors.ll testcase.

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

6 years ago[ORC] Fix a missing return value.
Lang Hames [Tue, 26 Jun 2018 22:30:42 +0000 (22:30 +0000)]
[ORC] Fix a missing return value.

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

6 years ago[JumpThreading] Don't try to rewrite a use if it's already valid.
Michael Zolotukhin [Tue, 26 Jun 2018 22:19:48 +0000 (22:19 +0000)]
[JumpThreading] Don't try to rewrite a use if it's already valid.

Summary:
When recording uses we need to rewrite after cloning a loop we need to
check if the use is not dominated by the original def. The initial
assumption was that the cloned basic block will introduce a new path and
thus the original def will only dominate the use if they are in the same
BB, but as the reproducer from PR37745 shows it's not always the case.

This fixes PR37745.

Reviewers: haicheng, Ka-Ka

Subscribers: hiraditya, llvm-commits

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

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

6 years ago[ORC] Add a dependence on MC to LLVMBuild.txt
Lang Hames [Tue, 26 Jun 2018 22:12:02 +0000 (22:12 +0000)]
[ORC] Add a dependence on MC to LLVMBuild.txt

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

6 years ago[X86] Add test for SDIV by sign bit (minsigned) value
Simon Pilgrim [Tue, 26 Jun 2018 22:03:00 +0000 (22:03 +0000)]
[X86] Add test for SDIV by sign bit (minsigned) value

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

6 years ago[ORC] Add LLJIT and LLLazyJIT, and replace OrcLazyJIT in LLI with LLLazyJIT.
Lang Hames [Tue, 26 Jun 2018 21:35:48 +0000 (21:35 +0000)]
[ORC] Add LLJIT and LLLazyJIT, and replace OrcLazyJIT in LLI with LLLazyJIT.

LLJIT is a prefabricated ORC based JIT class that is meant to be the go-to
replacement for MCJIT. Unlike OrcMCJITReplacement (which will continue to be
supported) it is not API or bug-for-bug compatible, but targets the same
use cases: Simple, non-lazy compilation and execution of LLVM IR.

LLLazyJIT extends LLJIT with support for function-at-a-time lazy compilation,
similar to what was provided by LLVM's original (now long deprecated) JIT APIs.

This commit also contains some simple utility classes (CtorDtorRunner2,
LocalCXXRuntimeOverrides2, JITTargetMachineBuilder) to support LLJIT and
LLLazyJIT.

Both of these classes are works in progress. Feedback from JIT clients is very
welcome!

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

6 years agoAMDGPU: Silence unused warnings in waitcnt insertion pass in release build
Konstantin Zhuravlyov [Tue, 26 Jun 2018 21:33:38 +0000 (21:33 +0000)]
AMDGPU: Silence unused warnings in waitcnt insertion pass in release build

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

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

6 years ago[X86][AsmParser] Recommit r335658
Jessica Paquette [Tue, 26 Jun 2018 21:30:34 +0000 (21:30 +0000)]
[X86][AsmParser] Recommit r335658

Recommit of r335658 so that it does not change the behaviour of any
existing error output.

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

6 years agoRename skipDebugInfo -> skipDebugIntrinsics, NFC
Vedant Kumar [Tue, 26 Jun 2018 21:16:59 +0000 (21:16 +0000)]
Rename skipDebugInfo -> skipDebugIntrinsics, NFC

This addresses post-commit feedback about the name 'skipDebugInfo' being
misleading. This name could be interpreted as meaning 'a function that
skips instructions with debug locations'.

The new name, 'skipDebugIntrinsics', makes it clear that this function
only skips debug info intrinsics.

Thanks to Adrian Prantl for pointing this out!

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

6 years ago[ORC] Allow IRTransformLayer2's transform to be modified after initialization.
Lang Hames [Tue, 26 Jun 2018 20:59:51 +0000 (20:59 +0000)]
[ORC] Allow IRTransformLayer2's transform to be modified after initialization.

Also give the constructor's transform parameter a default no-op transform value.

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

6 years ago[ORC] Reset AsynchronousSymbolQuery's NotifySymbolsResolved callback on error.
Lang Hames [Tue, 26 Jun 2018 20:59:50 +0000 (20:59 +0000)]
[ORC] Reset AsynchronousSymbolQuery's NotifySymbolsResolved callback on error.

AsynchronousSymbolQuery::canStillFail checks the value of the callback to
prevent sending it redundant error notifications, so we need to reset it after
running it.

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

6 years ago[ORC] Move the VSOList typedef out of VSO.
Lang Hames [Tue, 26 Jun 2018 20:59:49 +0000 (20:59 +0000)]
[ORC] Move the VSOList typedef out of VSO.

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

6 years ago[ORC] Add a FIXME.
Lang Hames [Tue, 26 Jun 2018 20:59:49 +0000 (20:59 +0000)]
[ORC] Add a FIXME.

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

6 years ago[ORC] Fix a FIXME by moving MangleAndInterner to Core.h.
Lang Hames [Tue, 26 Jun 2018 20:59:46 +0000 (20:59 +0000)]
[ORC] Fix a FIXME by moving MangleAndInterner to Core.h.

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

6 years agoRevert "[X86][AsmParser] Emit an error when RIP-relative instructions are used in...
Jessica Paquette [Tue, 26 Jun 2018 20:57:19 +0000 (20:57 +0000)]
Revert "[X86][AsmParser] Emit an error when RIP-relative instructions are used in 32-bit mode"

This reverts commit 4850a9aae8b38c7deadc103d634ec7397e6c323b.

It caused MC/X86/x86_errors.s to fail. Will fix and recommit shortly.

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

6 years ago[X86][AsmParser] Emit an error when RIP-relative instructions are used in 32-bit...
Jessica Paquette [Tue, 26 Jun 2018 20:33:46 +0000 (20:33 +0000)]
[X86][AsmParser] Emit an error when RIP-relative instructions are used in 32-bit mode

Right now, when we use RIP-relative instructions in 32-bit mode, we'll just
assert and crash.

This adds an error message which tells the user that they can't do that in
32-bit mode, so that we don't crash (and also can see the issue outside of
assert builds).

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

6 years ago[AMDGPU] Add llvm.amdgcn.fmad.ftz intrinsic
Stanislav Mekhanoshin [Tue, 26 Jun 2018 20:04:19 +0000 (20:04 +0000)]
[AMDGPU] Add llvm.amdgcn.fmad.ftz intrinsic

This intrinsic selects v_mad_f32 regardless of fp32 denorm support.

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

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