OSDN Git Service

android-x86/external-llvm.git
5 years ago[NFC] Tweak SplitBlockAndInsertIfThen to use existing ThenBlock
Max Kazantsev [Fri, 15 Feb 2019 08:18:00 +0000 (08:18 +0000)]
[NFC] Tweak SplitBlockAndInsertIfThen to use existing ThenBlock

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

5 years ago[TEST] Update test comments, refactor checks with update_test_checks.py
Max Kazantsev [Fri, 15 Feb 2019 07:06:52 +0000 (07:06 +0000)]
[TEST] Update test comments, refactor checks with update_test_checks.py

This patch changes messages in guards-related tests to adequately reflect
reality.

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

5 years agoX86: Replace isSafeToClobberEFLAGS implementation
Matt Arsenault [Fri, 15 Feb 2019 04:01:39 +0000 (04:01 +0000)]
X86: Replace isSafeToClobberEFLAGS implementation

Also use modifiesRegister instead of looping over operands.

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

5 years agoRevert "[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support."
Francis Visoiu Mistrih [Fri, 15 Feb 2019 03:01:09 +0000 (03:01 +0000)]
Revert "[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support."

This reverts commit aa0b77d3395dc6ab91647138139c1a15a3aa088d.

This fails to pass the machine verifier:
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/13579/

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

5 years ago[lit][NFC] Cleanup copy&paste naming mistake
Julian Lettner [Fri, 15 Feb 2019 02:44:52 +0000 (02:44 +0000)]
[lit][NFC] Cleanup copy&paste naming mistake

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

5 years ago[llvm-cxxfilt] Fix a comment typo. NFC.
Matt Davis [Fri, 15 Feb 2019 02:43:14 +0000 (02:43 +0000)]
[llvm-cxxfilt] Fix a comment typo. NFC.

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

5 years ago[GISel][NFC]: Add methods to speed up insertion into GISelWorklist
Aditya Nandakumar [Fri, 15 Feb 2019 01:37:54 +0000 (01:37 +0000)]
[GISel][NFC]: Add methods to speed up insertion into GISelWorklist

https://reviews.llvm.org/D58073

Speed up insertion during the initial populating phase into the
GISelWorkList by deferring repeatedly resizing the DenseMap.
This results in ~10% improvement in the combiner passes, and
~3% speedup in the Legalizer.

reviewed by: aemerson.

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

5 years agoAMDGPU: Set ABI version to 1 for code object v3
Konstantin Zhuravlyov [Thu, 14 Feb 2019 23:56:04 +0000 (23:56 +0000)]
AMDGPU: Set ABI version to 1 for code object v3

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

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

5 years ago[symbolizer] Avoid collecting symbols belonging to invalid sections.
Matt Davis [Thu, 14 Feb 2019 23:50:35 +0000 (23:50 +0000)]
[symbolizer] Avoid collecting symbols belonging to invalid sections.

Summary:
llvm-symbolizer would originally report symbols that belonged to an invalid object file section.
Specifically the case where: `*Symbol.getSection() == ObjFile.section_end()`
This patch prevents the Symbolizer from collecting symbols that belong to invalid sections.

The test  (from PR40591) introduces a case where two symbols have address 0,
one symbol is defined, 'foo', and the other is not defined, 'bar'.  This patch will cause
the Symbolizer to keep 'foo' and ignore 'bar'.

As a side note, the logic for adding symbols to the Symbolizer's store
(`SymbolizableObjectFile::addSymbol`) replaces symbols with the
same <address, size> pair.  At some point that logic should be revisited as in the
aforementioned case, 'bar' was overwriting 'foo' in the Symbolizer's store,
and 'foo' was forgotten.

This fixes PR40591

Reviewers: jhenderson, rupprecht

Reviewed By: rupprecht

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoRevert "[INLINER] allow inlining of address taken blocks"
Nick Desaulniers [Thu, 14 Feb 2019 23:42:21 +0000 (23:42 +0000)]
Revert "[INLINER] allow inlining of address taken blocks"

This reverts commit 19e95fe61182945b7b68ad15348f144fb996633f.

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

5 years ago[INLINER] allow inlining of address taken blocks
Nick Desaulniers [Thu, 14 Feb 2019 23:35:53 +0000 (23:35 +0000)]
[INLINER] allow inlining of address taken blocks

as long as their uses does not contain calls to functions that capture
the argument (potentially allowing the blockaddress to "escape" the
lifetime of the caller).

TODO:
- add more tests
- fix crash in llvm::updateCGAndAnalysisManagerForFunctionPass when
  invoking Transforms/Inline/blockaddress.ll

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

5 years ago[x86] add tests for extractelement of FP; NFC
Sanjay Patel [Thu, 14 Feb 2019 23:17:22 +0000 (23:17 +0000)]
[x86] add tests for extractelement of FP; NFC

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

5 years ago[lit] Remove --single-process option (use -j1 instead)
Julian Lettner [Thu, 14 Feb 2019 22:46:56 +0000 (22:46 +0000)]
[lit] Remove --single-process option (use -j1 instead)

Remove `--single-process` command line option. Use `-j1` instead.

Also see commit: 96adb78b120b6aa9739eb714534dc8e819f7bc52

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

5 years agoMC/ELF: Allow targets to set ABI version
Konstantin Zhuravlyov [Thu, 14 Feb 2019 22:42:09 +0000 (22:42 +0000)]
MC/ELF: Allow targets to set ABI version

Tests are in the follow up change

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

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

5 years agoGlobalISel: Add alignment to LegalityQuery MMOs
Matt Arsenault [Thu, 14 Feb 2019 22:41:09 +0000 (22:41 +0000)]
GlobalISel: Add alignment to LegalityQuery MMOs

This allows targets to specify the minimum alignment required for the
load/store.

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

5 years agoReplace gcroot verifier tests
Matt Arsenault [Thu, 14 Feb 2019 22:41:01 +0000 (22:41 +0000)]
Replace gcroot verifier tests

These haven't been checking anything useful and have been testing the
wrong failure reason for many years. Replace them with something which
stresses what is actually implemented in the verifier now.

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

5 years ago[lit] Set --single-process for single tests and --threads=1
Julian Lettner [Thu, 14 Feb 2019 22:30:07 +0000 (22:30 +0000)]
[lit] Set --single-process for single tests and --threads=1

Summary:
Automatically upgrade debugging experience (single process, no thread
pool) when:
  1) we only run a single test
  2) user specifies `-j1`

Details:
Fix `--max-failures` in single process mode. Option did not have an
effect in single process mode.

Add display feedback for single process mode. Adapted test.

Improve argument checking (require positive integers).

`--single-process` is now essentially an alias for `-j1`. Should we
remove it?

Reviewers: rnk

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

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

5 years agoAMDGPU/GlobalISel: Fix RegBankSelect for GEP.
Matt Arsenault [Thu, 14 Feb 2019 22:24:28 +0000 (22:24 +0000)]
AMDGPU/GlobalISel: Fix RegBankSelect for GEP.

This is basically a pointer typed add, so shouldn't be any different.
This was assuming everything was an SGPR, which is not true.

Also cleanup legality for GEP. I don't seem to be seeing the problem
the hack marking s64 as a legal pointer type the comment mentions.

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

5 years ago[AMDGPU] Ressociate 'add (add x, y), z' to use SALU
Stanislav Mekhanoshin [Thu, 14 Feb 2019 22:11:25 +0000 (22:11 +0000)]
[AMDGPU] Ressociate 'add (add x, y), z' to use SALU

Reassociate adds to collect scalar operands in a single
instruction when possible. That will result in a scalar
add followed by vector instead of two vector adds, thus
better utilizing SALU.

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

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

5 years agoAMDGPU/GlobalISel: Handle split for 64-bit VALU select
Matt Arsenault [Thu, 14 Feb 2019 21:58:12 +0000 (21:58 +0000)]
AMDGPU/GlobalISel: Handle split for 64-bit VALU select

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

5 years ago[ThinLTO] Detect partially split modules during the thin link
Teresa Johnson [Thu, 14 Feb 2019 21:22:50 +0000 (21:22 +0000)]
[ThinLTO] Detect partially split modules during the thin link

Summary:
The changes to disable LTO unit splitting by default (r350949) and
detect inconsistently split LTO units (r350948) are causing some crashes
when the inconsistency is detected in multiple threads simultaneously.
Fix that by having the code always look for the inconsistently split
LTO units during the thin link, by checking for the presence of type
tests recorded in the summaries.

Modify test added in r350948 to remove single threading required to fix
a bot failure due to this issue (and some debugging options added in the
process of diagnosing it).

Reviewers: pcc

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

Tags: #llvm

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

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

5 years ago[CMake] Fix ability to use LLVM_ENABLE_PROJECTS with LLVM_EXTERNAL_PROJECTS
Chris Bieneman [Thu, 14 Feb 2019 20:57:17 +0000 (20:57 +0000)]
[CMake] Fix ability to use LLVM_ENABLE_PROJECTS with LLVM_EXTERNAL_PROJECTS

LLVM r353148, changed the circumstances in which the project source directory variables are created to only create them for LLVM projects. This patch initializes the directory variables for projects specified in `LLVM_EXTERNAL_PROJECTS` as well.

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

5 years ago[InstCombine] Add todos for possible atomicrmw transforms
Philip Reames [Thu, 14 Feb 2019 20:48:36 +0000 (20:48 +0000)]
[InstCombine] Add todos for possible atomicrmw transforms

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

5 years agoCanonicalize all integer "idempotent" atomicrmw ops
Philip Reames [Thu, 14 Feb 2019 20:41:17 +0000 (20:41 +0000)]
Canonicalize all integer "idempotent" atomicrmw ops

For "idempotent" atomicrmw instructions which we can't simply turn into load, canonicalize the operation and constant. This reduces the matching needed elsewhere in the optimizer, but doesn't directly impact codegen.

For any architecture where OR/Zero is not a good default choice, you can extend the AtomicExpand lowerIdempotentRMWIntoFencedLoad mechanism. I reviewed X86 to make sure this works well, haven't audited other backends.

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

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

5 years agoStop enabling clang-tools-extra automatically when clang is in LLVM_ENABLE_PROJECTS
Nico Weber [Thu, 14 Feb 2019 20:26:35 +0000 (20:26 +0000)]
Stop enabling clang-tools-extra automatically when clang is in LLVM_ENABLE_PROJECTS

If you want to build clang-tools-extra with monorepo, just add it to
LLVM_ENABLE_PROJECTS like with other projects.

See also "Separating clang-tools-extra from clang in LLVM_ENABLE_PROJECTS"
on cfe-dev.

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

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

5 years agoOptional specialization for trivially copyable types, part2
Serge Guelton [Thu, 14 Feb 2019 19:41:44 +0000 (19:41 +0000)]
Optional specialization for trivially copyable types, part2

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

5 years agoRecommit Optional specialization for trivially copyable types
Serge Guelton [Thu, 14 Feb 2019 19:17:00 +0000 (19:17 +0000)]
Recommit Optional specialization for trivially copyable types

Unfortunately the original code gets misscompiled by GCC (at least 8.1),
this is a tentative workaround using std::memcpy instead of inplace new
for trivially copyable types. I'll revert if it breaks.

Original revision: https://reviews.llvm.org/D57097

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

5 years agoTeach instcombine about remaining "idempotent" atomicrmw types
Philip Reames [Thu, 14 Feb 2019 18:39:14 +0000 (18:39 +0000)]
Teach instcombine about remaining "idempotent" atomicrmw types

Expand on Quentin's r353471 patch which converts some atomicrmws into loads. Handle remaining operation types, and fix a slight bug. Atomic loads are required to have alignment. Since this was within the InstCombine fixed point, somewhere else in InstCombine was adding alignment before the verifier saw it, but still, we should fix.

Terminology wise, I'm using the "idempotent" naming that is used for the same operations in AtomicExpand and X86ISelLoweringInfo. Once this lands, I'll add similar tests for AtomicExpand, and move the pattern match function to a common location. In the review, there was seemingly consensus that "idempotent" was slightly incorrect for this context.  Once we setle on a better name, I'll update all uses at once.

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

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

5 years agoSupport: use internal `call_once` on PPC64le
Saleem Abdulrasool [Thu, 14 Feb 2019 18:36:52 +0000 (18:36 +0000)]
Support: use internal `call_once` on PPC64le

Always use the internal `call_once` for PPC64le.  This is needed to
support the Swift toolchain on PPC64le.

Patch by Sarvesh Tamba!

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

5 years ago[llvm-ar] Implement the P modifier.
Jordan Rupprecht [Thu, 14 Feb 2019 18:35:13 +0000 (18:35 +0000)]
[llvm-ar] Implement the P modifier.

Summary:
GNU ar has a `P` modifier that changes filename comparisons to use full paths instead of the basename. As noted in the GNU docs, regular archives are not created with full path names, so P is used to deal with archives created by other archive programs (e.g. see the updated `absolute-paths.test` test case).

Since thin archives use full path names -- paths are relative to the archive -- it seems very error prone to not imply P when dealing with thin archives, so P is implied in those cases. (I think this is a deviation from GNU ar that makes sense).

This fixes PR37436 via https://github.com/ClangBuiltLinux/linux/issues/33.

Reviewers: mstorsjo, pcc, ruiu, davide, david2050, rnk

Subscribers: tpimh, llvm-commits, nickdesaulniers

Tags: #llvm

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

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

5 years ago[X86] cleanup inline asm register generation. NFCI.
Nirav Dave [Thu, 14 Feb 2019 18:06:21 +0000 (18:06 +0000)]
[X86] cleanup inline asm register generation. NFCI.

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

5 years ago[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support.
Jonas Paulsson [Thu, 14 Feb 2019 17:58:48 +0000 (17:58 +0000)]
[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support.

Review: Ulrich Weigand
https://reviews.llvm.org/D58240

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

5 years ago[Tests] Add tests for all idemptotent atomicrmws
Philip Reames [Thu, 14 Feb 2019 17:01:15 +0000 (17:01 +0000)]
[Tests] Add tests for all idemptotent atomicrmws

Base for a followup patch to strengthen the InstCombine transform, and then integrate the ExpandAtomics logic.

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

5 years ago[X86][AVX] Add PR40730 test case
Simon Pilgrim [Thu, 14 Feb 2019 14:45:32 +0000 (14:45 +0000)]
[X86][AVX] Add PR40730 test case

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

5 years agoRefine ArgPromotion metadata handling
Teresa Johnson [Thu, 14 Feb 2019 14:14:24 +0000 (14:14 +0000)]
Refine ArgPromotion metadata handling

Summary:
In r353537 we now copy all metadata to the new function, with the old
being removed when the old function is eliminated. In some cases the old
function is dropped to a declaration (seems to only occur with the old
PM). Go ahead and clear all metadata from the old function to handle that
case, since verification will complain otherwise. This is consistent
with what was being done for debug metadata before r353537.

Reviewers: davidxl, uabelho

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years ago[LoopUnrollPeel] Add case where we should forget the peeled loop from SCEV.
Florian Hahn [Thu, 14 Feb 2019 13:59:39 +0000 (13:59 +0000)]
[LoopUnrollPeel] Add case where we should forget the peeled loop from SCEV.

The test case requires the peeled loop to be forgotten after peeling,
even though it does not have a parent. When called via the unroller,
SE->forgetTopmostLoop is also called, so the test case would also pass
without any SCEV invalidation, but peelLoop is exposed as utility
function. Also, in the test case, simplifyLoop will make changes,
removing the loop from SCEV, but it is better to not rely on this
behavior.

Reviewers: sanjoy, mkazantsev

Reviewed By: mkazantsev

Tags: #llvm

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

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

5 years ago[RISCV][NFC] Add RV64I CHECK lines to inline-asm.ll test
Alex Bradbury [Thu, 14 Feb 2019 13:09:54 +0000 (13:09 +0000)]
[RISCV][NFC] Add RV64I CHECK lines to inline-asm.ll test

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

5 years agoReapply [VFS] Allow multiple RealFileSystem instances with independent CWDs.
Sam McCall [Thu, 14 Feb 2019 12:57:01 +0000 (12:57 +0000)]
Reapply [VFS] Allow multiple RealFileSystem instances with independent CWDs.

This reverts commit r351091.
The original mac breakages are addressed by ensuring the root directory
we're working from is fully symlink-resolved before starting.

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

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

5 years ago[MIPS GlobalISel] Select phi instruction for integers
Petar Avramovic [Thu, 14 Feb 2019 12:36:19 +0000 (12:36 +0000)]
[MIPS GlobalISel] Select phi instruction for integers

Select G_PHI for integers for MIPS32.

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

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

5 years ago[Instrumentation][NFC] Fix warning.
Clement Courbet [Thu, 14 Feb 2019 12:10:49 +0000 (12:10 +0000)]
[Instrumentation][NFC] Fix warning.

lib/Transforms/Instrumentation/AddressSanitizer.cpp:1173:29: warning: extra â€˜;’ [-Wpedantic]

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

5 years ago[MIPS GlobalISel] Select branch instructions
Petar Avramovic [Thu, 14 Feb 2019 11:39:53 +0000 (11:39 +0000)]
[MIPS GlobalISel] Select branch instructions

Select G_BR and G_BRCOND for MIPS32.
Unconditional branch G_BR does not have register operand,
for that reason we only add tests.
Since conditional branch G_BRCOND compares register to zero on MIPS32,
explicit extension must be performed on i1 condition in order to set
high bits to appropriate value.

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

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

5 years agoMake widenable condition transparent for MemoryWriteTracking
Max Kazantsev [Thu, 14 Feb 2019 11:10:29 +0000 (11:10 +0000)]
Make widenable condition transparent for MemoryWriteTracking

Side effects of widenable condition intrinsic are modelled via
InaccessibleMemOnly, and there is no way to say that it isn't
really writing any memory. This patch teaches MemoryWriteTracking
ignore this intrinsic.

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

5 years agoTeach isGuaranteedToTransferExecutionToSuccessor about widenable conditions
Max Kazantsev [Thu, 14 Feb 2019 11:10:21 +0000 (11:10 +0000)]
Teach isGuaranteedToTransferExecutionToSuccessor about widenable conditions

Widenable condition intrinsic is guaranteed to return value, notify
the isGuaranteedToTransferExecutionToSuccessor function about it.

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

5 years agoFix an accidentally flipped pair of arguments, NFCI
Jeremy Morse [Thu, 14 Feb 2019 11:09:24 +0000 (11:09 +0000)]
Fix an accidentally flipped pair of arguments, NFCI

While rebasing a refactor in r353950 I accidentally swapped two function
arguments; one is SelectionDAGBuilders "current" DebugLoc, the other is the one
from the "current" debug intrinsic. They're probably always identical, but I
haven't proved that yet.

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

5 years ago[ARM] Ensure we update the correct flags in the peephole optimiser
David Green [Thu, 14 Feb 2019 11:09:24 +0000 (11:09 +0000)]
[ARM] Ensure we update the correct flags in the peephole optimiser

The Arm peephole optimiser code keeps track of both an MI and a SubAdd that can
be used to optimise away a CMP. In the rare case that both are found and not
ruled-out as valid, we could end up setting the flags on the wrong one.

Instead make sure we are using SubAdd if it exists, as it will be closer to the
CMP.

The testcase here is a little theoretical, with a dead def of cpsr. It should
hopefully show the point.

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

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

5 years ago[Support] Fix TempFile::discard to not leave behind temporary files
Andrew Ng [Thu, 14 Feb 2019 11:08:49 +0000 (11:08 +0000)]
[Support] Fix TempFile::discard to not leave behind temporary files

Moved the remove of the temporary file to after the close to avoid
remove failures caused by ETXTBSY errors.

This issue was seen when FileOutputBuffer falls back to an in memory
buffer due to the inability to mmap the on disk file. This occurred when
running LLD on an Ubuntu VM in VirtualBox on a Windows host attempting
to write the output to a VirtualBox shared folder.

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

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

5 years ago[NFC] Refactor LICM code for better readability
Max Kazantsev [Thu, 14 Feb 2019 09:04:12 +0000 (09:04 +0000)]
[NFC] Refactor LICM code for better readability

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

5 years ago[llvm-readobj][test] Add all GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} bits
Fangrui Song [Thu, 14 Feb 2019 07:52:51 +0000 (07:52 +0000)]
[llvm-readobj][test] Add all GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} bits

And delete trailing whitespace

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

5 years agoRelax test to check for a valid number instead of a specific number
Douglas Yung [Thu, 14 Feb 2019 04:11:09 +0000 (04:11 +0000)]
Relax test to check for a valid number instead of a specific number
to be like every other check in this test.

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

5 years ago[X86] Make (f80 (sint_to_fp (i16))) use fistps/fisttps instead of fistpl/fisttpl...
Craig Topper [Thu, 14 Feb 2019 01:41:43 +0000 (01:41 +0000)]
[X86] Make (f80 (sint_to_fp (i16))) use fistps/fisttps instead of fistpl/fisttpl when SSE is enabled.

When SSE is enabled sint_to_fp with i16 is blindly promoted to i32, but that changes the behavior of f80 conversion.

Move the promotion to i16 to LowerFP_TO_INT so we can limit it based on the floating point type.

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

5 years agoRevert "[llvm-objdump] Allow short options without arguments to be grouped"
Matthew Voss [Thu, 14 Feb 2019 01:39:43 +0000 (01:39 +0000)]
Revert "[llvm-objdump] Allow short options without arguments to be grouped"

Reverted due to failures on the llvm-hexagon-elf.

This reverts commit 77e1f27476c89f65eeb496d131065177e6417f23.

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

5 years ago[llvm-objdump] Allow short options without arguments to be grouped
Matthew Voss [Thu, 14 Feb 2019 00:39:40 +0000 (00:39 +0000)]
[llvm-objdump] Allow short options without arguments to be grouped

Summary:

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

Reviewers: kristina, jhenderson, grimar, jakehehrlich, rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[globalisel][combine] Split existing rules into a match and apply step
Daniel Sanders [Thu, 14 Feb 2019 00:15:28 +0000 (00:15 +0000)]
[globalisel][combine] Split existing rules into a match and apply step

Summary:
The declarative tablegen definitions split rules into match and apply steps.
Prepare for that by doing the same in the C++ implementations. This aids
some of the migration effort while the tablegen version is incomplete.

Reviewers: bogner, volkan, aditya_nandakumar, paquette, aemerson

Reviewed By: aditya_nandakumar

Subscribers: rovka, kristof.beyls, Petar.Avramovic, jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-ar][libObject] Fix relative paths when nesting thin archives.
Jordan Rupprecht [Wed, 13 Feb 2019 23:39:41 +0000 (23:39 +0000)]
[llvm-ar][libObject] Fix relative paths when nesting thin archives.

Summary:
When adding one thin archive to another, we currently chop off the relative path to the flattened members. For instance, when adding `foo/child.a` (which contains `x.txt`) to `parent.a`, when flattening it we should add it as `foo/x.txt` (which exists) instead of `x.txt` (which does not exist).

As a note, this also undoes the `IsNew` parameter of handling relative paths in r288280. The unit test there still passes.

This was reported as part of testing the kernel build with llvm-ar: https://patchwork.kernel.org/patch/10767545/ (see the second point).

Reviewers: mstorsjo, pcc, ruiu, davide, david2050, inglorion

Reviewed By: ruiu

Subscribers: void, jdoerfert, tpimh, mgorny, hans, nickdesaulniers, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[PowerPC][NFC] Added tests for prologue and epilogue code gen.
Stefan Pintilie [Wed, 13 Feb 2019 23:37:23 +0000 (23:37 +0000)]
[PowerPC][NFC] Added tests for prologue and epilogue code gen.

Added four test files to check the existing behaviour of prologue
and epilogue code generation. This patch was done as a setup for
the upcoming patch listed on Phabricator that will change how the
prologue and epilogue work.
The upcoming patch is: https://reviews.llvm.org/D42590

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

5 years ago[ConstProp] add IR tests to show miscompiles; NFC
Sanjay Patel [Wed, 13 Feb 2019 23:27:31 +0000 (23:27 +0000)]
[ConstProp] add IR tests to show miscompiles; NFC

A fix for these is proposed in D51216.

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

5 years ago[llvm-readobj] Dump GNU_PROPERTY_X86_ISA_1_{NEEDED,USED} notes in .note.gnu.property
Fangrui Song [Wed, 13 Feb 2019 23:18:05 +0000 (23:18 +0000)]
[llvm-readobj] Dump GNU_PROPERTY_X86_ISA_1_{NEEDED,USED} notes in .note.gnu.property

Reviewers: grimar, rupprecht

Reviewed By: rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[SelectionDAG] Inline a single use helper function, and remove last non-MMO interface...
Philip Reames [Wed, 13 Feb 2019 23:01:11 +0000 (23:01 +0000)]
[SelectionDAG] Inline a single use helper function, and remove last non-MMO interface [NFC]

For D57601, we need to know whether the instruction is volatile.  We'd either have to pass yet another parameter, or just standardize on the MMO interface.  I chose the second.

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

5 years ago[RegAllocGreedy] Take last chance recoloring into account in evicting.
Mark Lacey [Wed, 13 Feb 2019 22:56:43 +0000 (22:56 +0000)]
[RegAllocGreedy] Take last chance recoloring into account in evicting.

Last chance recoloring inserts into FixedRegisters those virtual
registers it is attempting to assign a physical register to.

We must consider these when we consider candidates for eviction so that
we do not end up evicting something while we are attempting to recolor
to assign it.

This is hitting in an out-of-tree target and no longer reproduces on
trunk. That does not appear to be a result of it having been fixed, but
rather, it appears that optimization changes and/or other changes to
register allocation mask the problem.

I haven't found a way to come up with a reasonable test case for this
(i.e. one that I can actually commit to open source, is reasonable
in size, and actually reproduces the issue).

rdar://problem/45708741

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

5 years ago[AVR] Fix a typo - 's/analisys/analysis'
Dylan McKay [Wed, 13 Feb 2019 22:31:37 +0000 (22:31 +0000)]
[AVR] Fix a typo - 's/analisys/analysis'

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

5 years ago[WebAssembly] memory.fill
Thomas Lively [Wed, 13 Feb 2019 22:25:18 +0000 (22:25 +0000)]
[WebAssembly] memory.fill

Summary:
memset lowering, fix argument types in memcpy lowering, and
test encodings. Depends on D57736.

Reviewers: aheejin

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

Tags: #llvm

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

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

5 years ago[NewPM] Second attempt at porting ASan
Leonard Chan [Wed, 13 Feb 2019 22:22:48 +0000 (22:22 +0000)]
[NewPM] Second attempt at porting ASan

This is the second attempt to port ASan to new PM after D52739. This takes the
initialization requried by ASan from the Module by moving it into a separate
class with it's own analysis that the new PM ASan can use.

Changes:
- Split AddressSanitizer into 2 passes: 1 for the instrumentation on the
  function, and 1 for the pass itself which creates an instance of the first
  during it's run. The same is done for AddressSanitizerModule.
- Add new PM AddressSanitizer and AddressSanitizerModule.
- Add legacy and new PM analyses for reading data needed to initialize ASan with.
- Removed DominatorTree dependency from ASan since it was unused.
- Move GlobalsMetadata and ShadowMapping out of anonymous namespace since the
  new PM analysis holds these 2 classes and will need to expose them.

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

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

5 years ago[WebAssembly] Bulk memory intrinsics and builtins
Thomas Lively [Wed, 13 Feb 2019 22:11:16 +0000 (22:11 +0000)]
[WebAssembly] Bulk memory intrinsics and builtins

Summary:
implements llvm intrinsics and clang intrinsics for
memory.init and data.drop.

Reviewers: aheejin

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

Tags: #clang

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

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

5 years agoRevert r353962
Serge Guelton [Wed, 13 Feb 2019 22:11:09 +0000 (22:11 +0000)]
Revert r353962

Specialization of Optional for trivially copyable types yields failure on the buildbots I fail to reproduce locally.
Better safe than sorry, reverting.

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

5 years agogn build: Merge r353957.
Peter Collingbourne [Wed, 13 Feb 2019 21:03:23 +0000 (21:03 +0000)]
gn build: Merge r353957.

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

5 years ago[SelectionDAG] Kill last uses of getAtomic w/o a MMO operand [NFC]
Philip Reames [Wed, 13 Feb 2019 20:42:59 +0000 (20:42 +0000)]
[SelectionDAG] Kill last uses of getAtomic w/o a MMO operand [NFC]

The helper function was used by only two callers, and largely ended up providing distinct functionality based on optional arguments and opcode.  Inline and simply to make the functionality much more clear.

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

5 years ago[X86] Add 'mpx' to getHostCPUFeatures.
Craig Topper [Wed, 13 Feb 2019 20:12:41 +0000 (20:12 +0000)]
[X86] Add 'mpx' to getHostCPUFeatures.

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

5 years ago[CodeExtractor] Only lift lifetime markers present in the extraction region
Vedant Kumar [Wed, 13 Feb 2019 19:53:38 +0000 (19:53 +0000)]
[CodeExtractor] Only lift lifetime markers present in the extraction region

When CodeExtractor finds liftime markers referencing inputs to the
extraction region, it lifts these markers out of the region and inserts
them around the call to the extracted function (see r350420, PR39671).

However, it should *only* lift lifetime markers that are actually
present in the extraction region. I.e., if a start marker is present in
the extraction region but a corresponding end marker isn't (or vice
versa), only the start marker (or end marker, resp.) should be lifted.

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

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

5 years ago[Tests] More unordered atomic lowering tests
Philip Reames [Wed, 13 Feb 2019 19:49:17 +0000 (19:49 +0000)]
[Tests] More unordered atomic lowering tests

This time, focused around narrowing and widening transformations.  Also, include a few simple memory optimization tests to highlight missed oppurtunities.  This is part of building up the test base for D57601.

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

5 years ago[Tests] RMW folding tests w/unordered atomic operations
Philip Reames [Wed, 13 Feb 2019 18:41:54 +0000 (18:41 +0000)]
[Tests] RMW folding tests w/unordered atomic operations

We get a suprising number of these today actually, but some are missed. The main point of this is strengthen the test set for D57601.

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

5 years ago[Tests] Add a bunch of tests for load folding w/unordered atomics
Philip Reames [Wed, 13 Feb 2019 18:26:01 +0000 (18:26 +0000)]
[Tests] Add a bunch of tests for load folding w/unordered atomics

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

5 years ago[X86] Add 'fxsr' to the getHostCPUFeatures detection code.
Craig Topper [Wed, 13 Feb 2019 18:21:36 +0000 (18:21 +0000)]
[X86] Add 'fxsr' to the getHostCPUFeatures detection code.

We implicitly mark this feature as enabled when the target is 64-bits, but our detection code for -march=native didn't support it so you can't detect it on 32-bit targets.

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

5 years agoRe-commit rL353927, patch included
Serge Guelton [Wed, 13 Feb 2019 18:12:04 +0000 (18:12 +0000)]
Re-commit rL353927, patch included

Make llvm::Optional<T> trivially copyable when T is trivially copyable

This is an ever-recurring issue (see https://bugs.llvm.org/show_bug.cgi?id=39427 and https://bugs.llvm.org/show_bug.cgi?id=35978)
but I believe that thanks to https://reviews.llvm.org/D54472 we can now ship a decent implementation of this.

Basically the fact that llvm::is_trivially_copyable has a consistent behavior across compilers should prevent any ABI issue,
and using in-place new instead of memcpy should keep compiler bugs away.

This patch is slightly different from the original revision https://reviews.llvm.org/rL353927 but achieves the same goal. It just avoids
going through std::conditional which may the code more explicit.

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

5 years ago[Tests] First batch of cornercase tests for unordered atomics
Philip Reames [Wed, 13 Feb 2019 18:00:58 +0000 (18:00 +0000)]
[Tests] First batch of cornercase tests for unordered atomics

Mixture of things we legally can't do, and things we're missing.  Once D57601 is in, the later will serve as a punch list.

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

5 years ago[Tests] Auto update a test
Philip Reames [Wed, 13 Feb 2019 17:30:03 +0000 (17:30 +0000)]
[Tests] Auto update a test

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

5 years ago[AArch64] Support reserving arbitrary general purpose registers
Petr Hosek [Wed, 13 Feb 2019 17:28:47 +0000 (17:28 +0000)]
[AArch64] Support reserving arbitrary general purpose registers

This is a follow up to D48580 and D48581 which allows reserving
arbitrary general purpose registers with the exception of registers
with special purpose (X8, X16-X18, X29, X30) and registers used by LLVM
(X0, X19). This change also generalizes some of the existing logic to
rely entirely on values generated from tablegen.

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

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

5 years ago[Tests] Rename some test files for consistency
Philip Reames [Wed, 13 Feb 2019 17:23:11 +0000 (17:23 +0000)]
[Tests] Rename some test files for consistency

Most are named "atomic-something" so rename the few which were "atomic_something".  I keep typing the wrong name due to the inconsistency.  :)

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

5 years ago[DebugInfo][DAG] Either salvage dangling debug info or emit Undef DBG_VALUEs
Jeremy Morse [Wed, 13 Feb 2019 16:33:05 +0000 (16:33 +0000)]
[DebugInfo][DAG] Either salvage dangling debug info or emit Undef DBG_VALUEs

In this patch SelectionDAG tries to salvage any dbg.values that are going to be
dropped, in case they can be recovered from Values in the current BB. It also
strengthens SelectionDAGs handling of dangling debug data, so that dbg.values
are *always* emitted (as Undef or otherwise) instead of dangling forever.

The motivation behind this patch exists in the new test case: a memory address
(here a bitcast and GEP) exist in one basic block, and a dbg.value referring to
the address is left in the 'next' block. The base pointer is live across all
basic blocks. In current llvm trunk the dbg.value cannot be encoded, and it
isn't even emitted as an Undef DBG_VALUE.

The change is simply: if we're definitely going to drop a dbg.value, repeatedly
apply salvageDebugInfo to its operand until either we find something that can
be encoded, or we can't salvage any further in which case we produce an Undef
DBG_VALUE. To know when we're "definitely going to drop a dbg.value",
SelectionDAG signals SelectionDAGBuilder when all IR instructions have been
encoded to force salvaging. This ensures that any dbg.value that's dangling
after DAG creation will have a corresponding DBG_VALUE encoded.

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

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

5 years ago[X86][AVX] Add shuffle_v8i32_0dcd3f14 shuffle test case
Simon Pilgrim [Wed, 13 Feb 2019 16:12:36 +0000 (16:12 +0000)]
[X86][AVX] Add shuffle_v8i32_0dcd3f14 shuffle test case

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

5 years ago[llvm-readobj] Rename pr_data to PrData
Fangrui Song [Wed, 13 Feb 2019 15:58:23 +0000 (15:58 +0000)]
[llvm-readobj] Rename pr_data to PrData

As requested by grimar in D58112.

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

5 years ago[DebugInfo][DAG] Refactor dbg.value lowering into its own method
Jeremy Morse [Wed, 13 Feb 2019 15:53:10 +0000 (15:53 +0000)]
[DebugInfo][DAG] Refactor dbg.value lowering into its own method

This is a pure copy-and-paste job, moving the logic for lowering dbg.value
intrinsics to SDDbgValues into its own function. This is ahead of adding some
more users of this logic.

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

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

5 years ago[MCA] Store a bitmask of used groups in the instruction descriptor.
Andrea Di Biagio [Wed, 13 Feb 2019 14:56:06 +0000 (14:56 +0000)]
[MCA] Store a bitmask of used groups in the instruction descriptor.

This is to speedup 'checkAvailability' queries in class ResourceManager.
No functional change intended.

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

5 years ago[DebugInfo][DAG] Limit special-casing of dbg.values for Arguments
Jeremy Morse [Wed, 13 Feb 2019 13:37:33 +0000 (13:37 +0000)]
[DebugInfo][DAG] Limit special-casing of dbg.values for Arguments

SelectionDAGBuilder has special handling for dbg.value intrinsics that are
understood to define the location of function parameters on entry to the
function. To enable this, we avoid recording a dbg.value as a virtual register
reference if it might be such a parameter, so that it later hits
EmitFuncArgumentDbgValue.

This patch reduces the set of circumstances where we avoid recording a
dbg.value as a virtual register reference, to allow more "normal" variables
to be recorded that way. We now only bypass for potential parameters if:
 * The dbg.value operand is an Argument,
 * The Variable is a parameter, and
 * The Variable is not inlined.
meaning it's very likely that the dbg.value is a function-entry parameter
location.

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

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

5 years ago[NFC] Add const qualifiers where possible
Max Kazantsev [Wed, 13 Feb 2019 11:54:45 +0000 (11:54 +0000)]
[NFC] Add const qualifiers where possible

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

5 years agoRevert r353927
Serge Guelton [Wed, 13 Feb 2019 11:35:45 +0000 (11:35 +0000)]
Revert r353927

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

5 years ago[ARM GlobalISel] Support G_SELECT for Thumb2
Diana Picus [Wed, 13 Feb 2019 11:25:32 +0000 (11:25 +0000)]
[ARM GlobalISel] Support G_SELECT for Thumb2

Same as arm mode, but slightly different opcodes.

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

5 years ago[MCA][Scheduler] Use latency information to further classify busy instructions.
Andrea Di Biagio [Wed, 13 Feb 2019 11:02:42 +0000 (11:02 +0000)]
[MCA][Scheduler] Use latency information to further classify busy instructions.

This patch introduces a new instruction stage named 'IS_PENDING'.
An instruction transitions from the IS_DISPATCHED to the IS_PENDING stage if
input registers are not available, but their latency is known.

This patch also adds a new set of instructions named 'PendingSet' to class
Scheduler. The idea is that the PendingSet will only contain instructions that
have reached the IS_PENDING stage.
By construction, an instruction in the PendingSet is only dependent on
instructions that have already reached the execution stage. The plan is to use
this knowledge to identify bottlenecks caused by data dependencies (see
PR37494).

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

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

5 years ago[DebugInfo][InstCombine] Prefer to salvage debuginfo over sinking it
Jeremy Morse [Wed, 13 Feb 2019 10:54:53 +0000 (10:54 +0000)]
[DebugInfo][InstCombine] Prefer to salvage debuginfo over sinking it

When instcombine sinks an instruction between two basic blocks, it sinks any
dbg.value users in the source block with it, to prevent debug use-before-free.
However we can do better by attempting to salvage the debug users, which would
avoid moving where the variable location changes. If we successfully salvage,
still sink a (cloned) dbg.value with the sunk instruction, as the sunk
instruction is more likely to be "live" later in the compilation process.

If we can't salvage dbg.value users of a sunk instruction, mark the dbg.values
in the original block as being undef. This terminates any earlier variable
location range, and represents the fact that we've optimized out the variable
location for a portion of the program.

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

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

5 years agoMissing header
Serge Guelton [Wed, 13 Feb 2019 10:19:06 +0000 (10:19 +0000)]
Missing header

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

5 years ago[GuardWidening] Support widening of explicitly expressed guards
Max Kazantsev [Wed, 13 Feb 2019 09:56:30 +0000 (09:56 +0000)]
[GuardWidening] Support widening of explicitly expressed guards

This patch adds support of guards expressed in explicit form via
`widenable_condition` in Guard Widening pass.

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

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

5 years ago[DebugInfo] Stop changing labels for register-described parameter DBG_VALUEs
David Stenberg [Wed, 13 Feb 2019 09:34:07 +0000 (09:34 +0000)]
[DebugInfo] Stop changing labels for register-described parameter DBG_VALUEs

Summary:
This is a follow-up to D57510. This patch stops DebugHandlerBase from
changing the starting label for the first non-overlapping,
register-described parameter DBG_VALUEs to the beginning of the
function. That code did not consider what defined the registers, which
could result in the ranges for the debug values starting before their
defining instructions. We currently do not emit debug values for
constant values directly at the start of the function, so this code is
still useful for such values, but my intention is to remove the code
from DebugHandlerBase completely when we get there. One reason for
removing it is that the code violates the history map's ranges, which I
think can make it quite confusing when troubleshooting.

In D57510, PrologEpilogInserter was amended so that parameter DBG_VALUEs
now are kept at the start of the entry block, even after emission of
prologue code. That was done to reduce the degradation of debug
completeness from this patch. PR40638 is another example, where the
lexical-scope trimming that LDV does, in combination with scheduling,
results in instructions after the prologue being left without locations.
There might be other cases where the DBG_VALUEs are pushed further down,
for which the DebugHandlerBase code may be helpful, but as it now quite
often result in incorrect locations, even after the prologue, it seems
better to remove that code, and try to work our way up with accurate
locations.

In the long run we should maybe not aim to provide accurate locations
inside the prologue. Some single location descriptions, at least those
referring to stack values, generate inaccurate values inside the
epilogue, so we maybe should not aim to achieve accuracy for location
lists. However, it seems that we now emit line number programs that can
result in GDB and LLDB stopping inside the prologue when doing line
number stepping into functions. See PR40188 for more information.

A summary of some of the changed test cases is available in PR40188#c2.

Reviewers: aprantl, dblaikie, rnk, jmorse

Reviewed By: aprantl

Subscribers: jdoerfert, jholewinski, jvesely, javed.absar, llvm-commits

Tags: #debug-info, #llvm

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

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

5 years agoMake llvm::Optional<T> trivially copyable when T is trivially copyable
Serge Guelton [Wed, 13 Feb 2019 09:31:22 +0000 (09:31 +0000)]
Make llvm::Optional<T> trivially copyable when T is trivially copyable

This is an ever-recurring issue (see https://bugs.llvm.org/show_bug.cgi?id=39427 and https://bugs.llvm.org/show_bug.cgi?id=35978)
but I believe that thanks to https://reviews.llvm.org/D54472 we can now ship a decent implementation of this.

Basically the fact that llvm::is_trivially_copyable has a consistent behavior across compilers should prevent any ABI issue,
and using in-place new instead of memcpy should keep compiler bugs away.

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

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

5 years ago[llvm] [cmake] Provide split include paths in LLVMConfig
Michal Gorny [Wed, 13 Feb 2019 08:34:40 +0000 (08:34 +0000)]
[llvm] [cmake] Provide split include paths in LLVMConfig

Modify LLVMConfig to provide split variables for in-source and generated
include paths.  Currently, it uses a single value for both
LLVM_INCLUDE_DIRS and LLVM_INCLUDE_DIR which works for install tree but
fails hard at build tree (where LLVM_INCLUDE_DIR incorrectly contains
multiple values).

Instead, put the generated directory in LLVM_INCLUDE_DIR, and the source
tree in LLVM_MAIN_INCLUDE_DIR which is consistent with in-LLVM builds.
For install tree, both variables will have the same value.

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

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

5 years ago[X86][SLP] Enable SLP vectorization for 128-bit horizontal X86 instructions (add...
Anton Afanasyev [Wed, 13 Feb 2019 08:26:43 +0000 (08:26 +0000)]
[X86][SLP] Enable SLP vectorization for 128-bit horizontal X86 instructions (add, sub)

Try to use 64-bit SLP vectorization. In addition to horizontal instrs
this change triggers optimizations for partial vector operations (for instance,
using low halfs of 128-bit registers xmm0 and xmm1 to multiply <2 x float> by
<2 x float>).

Fixes llvm.org/PR32433

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

5 years ago[X86] Use default expansion for (i64 fp_to_uint f80) when avx512 is enabled on 64...
Craig Topper [Wed, 13 Feb 2019 07:42:34 +0000 (07:42 +0000)]
[X86] Use default expansion for (i64 fp_to_uint f80) when avx512 is enabled on 64-bit targets to match what happens without avx512.

In 64-bit mode prior to avx512 we use Expand, but with avx512 we need to make f32/f64 conversions Legal so we use Custom and then do our own expansion for f80. But this seems to produce codegen differences relative to avx2. This patch corrects this.

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

5 years ago[X86] Refactor the FP_TO_INTHelper interface. NFCI
Craig Topper [Wed, 13 Feb 2019 07:42:31 +0000 (07:42 +0000)]
[X86] Refactor the FP_TO_INTHelper interface. NFCI

-Pull the final stack load creation from the two callers into the helper.
-Return a single SDValue instead of a std::pair.
-Remove the Replace flag which isn't really needed.

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

5 years ago[llvm-objcopy] Add --strip-unneeded-symbol(s)
Eugene Leviant [Wed, 13 Feb 2019 07:34:54 +0000 (07:34 +0000)]
[llvm-objcopy] Add --strip-unneeded-symbol(s)

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

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

5 years ago[LoopSimplifyCFG] Re-enable const branch folding by default
Max Kazantsev [Wed, 13 Feb 2019 06:12:48 +0000 (06:12 +0000)]
[LoopSimplifyCFG] Re-enable const branch folding by default

Known underlying bugs have been fixed, intensive fuzz testing did not
find any new problems. Re-enabling by default. Feel free to revert if
it causes any functional failures.

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

5 years ago[llvm-readobj] Dump GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} notes in .note.gnu.property
Fangrui Song [Wed, 13 Feb 2019 01:51:45 +0000 (01:51 +0000)]
[llvm-readobj] Dump GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} notes in .note.gnu.property

Summary: And change the output ("X86 features" -> "x86 feature") a bit.

Reviewers: grimar, xiangzhangllvm, hjl.tools, rupprecht

Reviewed By: rupprecht

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

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

5 years ago[MC] Make symbol version errors non-fatal
Reid Kleckner [Wed, 13 Feb 2019 01:39:32 +0000 (01:39 +0000)]
[MC] Make symbol version errors non-fatal

We stil don't have a source location, which is pretty lame, but at least
we won't tell the user to file a clang bug report anymore.

Fixes PR40712

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