OSDN Git Service

android-x86/external-llvm.git
6 years ago[llvm-exegesis] Print the whole snippet in analysis.
Clement Courbet [Fri, 15 Jun 2018 07:30:45 +0000 (07:30 +0000)]
[llvm-exegesis] Print the whole snippet in analysis.

Summary:
On hover, the whole asm snippet is displayed, including operands.

This requires the actual assembly output instead of just the MCInsts:
This is because some pseudo-instructions get lowered to actual target
instructions during codegen (e.g. ABS_Fp32 -> SSE or X87).

Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

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

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

6 years agoRevert r334802 "[X86] Prevent folding stack reloads with instructions that have an...
Craig Topper [Fri, 15 Jun 2018 06:15:26 +0000 (06:15 +0000)]
Revert r334802 "[X86] Prevent folding stack reloads with instructions that have an undefined register update."

There's a typo causing the build to fail.

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

6 years ago[X86] Prevent folding stack reloads with instructions that have an undefined register...
Craig Topper [Fri, 15 Jun 2018 06:11:36 +0000 (06:11 +0000)]
[X86] Prevent folding stack reloads with instructions that have an undefined register update.

We want to keep the load unfolded so we can use the same register for both sources to avoid a false dependency.

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

6 years ago[X86] Add more instructions to the memory folding tables using the autogenerated...
Craig Topper [Fri, 15 Jun 2018 05:49:19 +0000 (05:49 +0000)]
[X86] Add more instructions to the memory folding tables using the autogenerated table as a guide.

I think this covers most of the unmasked vector instructions. We're still missing a lot of the masked instructions.

There are some test changes here because of the new folding support. I don't think these particular cases should be folded because it creates an undef register dependency. I think the changes introduced in r334175 are not handling stack folding. They're only blocking the peephole pass.

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

6 years ago[NFC] fix trivial typos in documents
Hiroshi Inoue [Fri, 15 Jun 2018 05:10:09 +0000 (05:10 +0000)]
[NFC] fix trivial typos in documents

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

6 years ago[X86] Fix some checks to use X86 instead of X32.
Craig Topper [Fri, 15 Jun 2018 04:42:55 +0000 (04:42 +0000)]
[X86] Fix some checks to use X86 instead of X32.

These tests were recently updated so it looks like gone wrong.

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

6 years ago[X86] Add 'Z' to the internal names of various EVEX instructions for overall consistency.
Craig Topper [Fri, 15 Jun 2018 04:42:54 +0000 (04:42 +0000)]
[X86] Add 'Z' to the internal names of various EVEX instructions for overall consistency.

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

6 years agoAdd debug info for OProfile profiling support
Andrew Kaylor [Fri, 15 Jun 2018 00:07:28 +0000 (00:07 +0000)]
Add debug info for OProfile profiling support

Patch by Gaetano Priori

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

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

6 years ago[cmake] Change ON/OFF to YES/NO. NFC
Shoaib Meenai [Thu, 14 Jun 2018 23:40:04 +0000 (23:40 +0000)]
[cmake] Change ON/OFF to YES/NO. NFC

compnerd pointed out that the latter reads better over here.

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

6 years ago[cmake] Add linker detection for Apple platforms
Shoaib Meenai [Thu, 14 Jun 2018 23:26:33 +0000 (23:26 +0000)]
[cmake] Add linker detection for Apple platforms

LLVM currently assumes that Apple platforms will always use ld64. In the
future, LLD Mach-O might also be supported, so add the beginnings of
linker detection support. ld64 is currently the only detected linker,
since `ld64.lld -v` doesn't yield any useful version output, but we can
add that detection later, and in the meantime it's still useful to have
the ld64 identification.

Switch clang's order file check to use this new detection rather than
just checking for the presence of an ld64 executable.

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

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

6 years agoMake uitofp and sitofp defined on overflow.
Eli Friedman [Thu, 14 Jun 2018 22:58:48 +0000 (22:58 +0000)]
Make uitofp and sitofp defined on overflow.

IEEE 754 defines the expected result on overflow. As far as I know,
hardware implementations (of f16), and compiler-rt (__floatuntisf)
correctly return +-Inf on overflow. And I can't think of any useful
transform that would take advantage of overflow being undefined here.

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

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

6 years ago[ORC] Strip weak flags from a symbol once it is selected for materialization.
Lang Hames [Thu, 14 Jun 2018 21:16:29 +0000 (21:16 +0000)]
[ORC] Strip weak flags from a symbol once it is selected for materialization.

Once a symbol has been selected for materialization it can no longer be
overridden. Stripping the weak flag guarantees this (override attempts will
then be treated as duplicate definitions and result in a DuplicateDefinition
error).

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

6 years ago[llvm-mca] Clean up the header comment. NFC.
Matt Davis [Thu, 14 Jun 2018 20:58:54 +0000 (20:58 +0000)]
[llvm-mca] Clean up the header comment. NFC.

This change removes a few dashes to make room for the header syntax string.

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

6 years agoeasing the constraint for isNegatibleForFree and GetNegatedExpression
Michael Berg [Thu, 14 Jun 2018 20:54:13 +0000 (20:54 +0000)]
easing the constraint for isNegatibleForFree and GetNegatedExpression

Summary:
Here we relax the old constraint which utilized unsafe with the TargetOption flag HonorSignDependentRoundingFPMathOption, with the assertion that unsafe is no longer needed or never was required for correctness on FDIV/FMUL.

Reviewers: spatel, hfinkel, wristow, arsenm, javed.absar

Reviewed By: spatel

Subscribers: efriedma, wdng, tpr

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

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

6 years agoRevert r334764, as it breaks some bots
Florian Hahn [Thu, 14 Jun 2018 20:32:58 +0000 (20:32 +0000)]
Revert r334764, as it breaks some bots

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

6 years ago[TableGen] Make TreePatternNode::getChild return a reference (NFC)
Florian Hahn [Thu, 14 Jun 2018 20:23:48 +0000 (20:23 +0000)]
[TableGen] Make TreePatternNode::getChild return a reference (NFC)

The return value of TreePatternNode::getChild is never null. This patch also
updates various places that use return values of getChild to also use
references. Those changes were suggested post-commit for D47463.

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

6 years ago[MSSA] Print more optimization information
George Burgess IV [Thu, 14 Jun 2018 19:55:53 +0000 (19:55 +0000)]
[MSSA] Print more optimization information

In particular, when asked to print a MemoryAccess, we'll now print where
defs are optimized to, and we'll print optimized access types.

This patch also introduces an operator<< to make printing AliasResults
easier.

Patch by Juneyoung Lee!

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

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

6 years ago[x86] be more selective about converting 'and' to shuffle (PR37749)
Sanjay Patel [Thu, 14 Jun 2018 19:55:02 +0000 (19:55 +0000)]
[x86] be more selective about converting 'and' to shuffle (PR37749)

isVectorClearMaskLegal() is the TLI hook used by the generic
DAGCombiner::XformToShuffleWithZero().

We've grown to accomodate/expect this transform to shuffle
(disabling it more generally results in many regressions).
So I'm narrowly excluding the 256-bit types that clearly
are not worthwhile for AVX1.

I think in most cases we are able to recover by converting
the shuffle back into 'and' ops, but the cases in:
https://bugs.llvm.org/show_bug.cgi?id=37749
...show that there are cracks.

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

6 years ago[X86] Fix stale comment in folding tables.
Craig Topper [Thu, 14 Jun 2018 19:28:31 +0000 (19:28 +0000)]
[X86] Fix stale comment in folding tables.

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

6 years agoAMDGPU/GlobalISel: Implement select() for @llvm.amdgcn.cvt.pkrtz
Tom Stellard [Thu, 14 Jun 2018 19:26:37 +0000 (19:26 +0000)]
AMDGPU/GlobalISel: Implement select() for @llvm.amdgcn.cvt.pkrtz

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years agoRe-apply "[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles"
Justin Bogner [Thu, 14 Jun 2018 19:24:03 +0000 (19:24 +0000)]
Re-apply "[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles"

This is r334750 (which was reverted in r334754) with a fix for an
uninitialized variable that was caught by msan.

Original commit message:
> If a copy bundle happens to involve overlapping registers, we can end
> up with emitting the copies in an order that ends up clobbering some
> of the subregisters. Since instructions in the copy bundle
> semantically happen at the same time, this is incorrect and we need to
> make sure we order the copies such that this doesn't happen.

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

6 years agoRevert "[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles"
Justin Bogner [Thu, 14 Jun 2018 19:10:57 +0000 (19:10 +0000)]
Revert "[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles"

There's an msan failure:

  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/19549

This reverts r334750.

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

6 years agoupdating isNegatibleForFree and GetNegatedExpression with fmf for fadd
Michael Berg [Thu, 14 Jun 2018 18:48:31 +0000 (18:48 +0000)]
updating isNegatibleForFree and GetNegatedExpression with fmf for fadd

Summary:  A FMF constraint is added to FADD with unsafe still available as the fallback

Reviewers: spatel, wristow, arsenm, hfinkel

Reviewed By: spatel

Subscribers: wdng

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

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

6 years ago[WebAssembly] Ignore explicit section names for functions
Sam Clegg [Thu, 14 Jun 2018 18:48:19 +0000 (18:48 +0000)]
[WebAssembly] Ignore explicit section names for functions

WebAssembly doesn't support more than one function per section
and we rely on function sections being unique. This change ignores
the section provided by the function to avoid two functions being
in the same section.

Without this change the object writer produces the following
error for this test:
 LLVM ERROR: section already has a defining function: baz

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

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

6 years ago[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles
Justin Bogner [Thu, 14 Jun 2018 18:32:55 +0000 (18:32 +0000)]
[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles

If a copy bundle happens to involve overlapping registers, we can end
up with emitting the copies in an order that ends up clobbering some
of the subregisters. Since instructions in the copy bundle
semantically happen at the same time, this is incorrect and we need to
make sure we order the copies such that this doesn't happen.

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

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

6 years ago[CMAKE] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2
Bruno Cardoso Lopes [Thu, 14 Jun 2018 18:19:54 +0000 (18:19 +0000)]
[CMAKE] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2

On MacOS, if CMAKE_OSX_SYSROOT is used and the user has command line tools
installed, we currently get the include path for libxml2 as
/usr/include/libxml2, instead of ${CMAKE_OSX_SYSROOT}/usr/include/libxml2.

Make it consistent on MacOS by prefixing ${CMAKE_OSX_SYSROOT} when
possible.

rdar://problem/41103601

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

6 years ago[x86] add tests for AVX1 FP logic op abuse (PR37749); NFC
Sanjay Patel [Thu, 14 Jun 2018 18:08:06 +0000 (18:08 +0000)]
[x86] add tests for AVX1 FP logic op abuse (PR37749); NFC

Also, add a RUN for AVX2 to make sure that's good.

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

6 years ago[llvm-mca] Add tests for instructions that implicitly clear the upper portion of...
Andrea Di Biagio [Thu, 14 Jun 2018 17:48:42 +0000 (17:48 +0000)]
[llvm-mca] Add tests for instructions that implicitly clear the upper portion of a super-register.

On x86-64, a write to register EAX implicitly clears the upper half or RAX.
128-bit AVX instructions clear the upper 128-bit of the YMM register that
aliases the XMM definition register.

llvm-mca doesn't know about register writes that implicitly clear the upper
portion of an aliasing super-register. This issue will be fixed in a future patch.

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

6 years ago[X86] Lowering Mask Scalar intrinsics to native IR (LLVM part)
Tomasz Krupa [Thu, 14 Jun 2018 17:32:58 +0000 (17:32 +0000)]
[X86] Lowering Mask Scalar intrinsics to native IR (LLVM part)

Summary: Complementary patch to lowering add, sub, mul and div mask scalar
intrinsics in Clang.

Reviewers: craig.topper, sroland, spatel, RKSimon

Reviewed by: craig.topper

Subscribers: llvm-commits

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

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

6 years ago[SCEV] Fix a variable name, NFC.
Justin Lebar [Thu, 14 Jun 2018 17:14:01 +0000 (17:14 +0000)]
[SCEV] Fix a variable name, NFC.

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

6 years ago[SCEV] Simplify zext/trunc idiom that appears when handling bitmasks.
Justin Lebar [Thu, 14 Jun 2018 17:13:48 +0000 (17:13 +0000)]
[SCEV] Simplify zext/trunc idiom that appears when handling bitmasks.

Summary:
Specifically, we transform

  zext(2^K * (trunc X to iN)) to iM ->
  2^K * (zext(trunc X to i{N-K}) to iM)<nuw>

This is helpful because pulling the 2^K out of the zext allows further
optimizations.

Reviewers: sanjoy

Subscribers: hiraditya, llvm-commits, timshen

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

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

6 years ago[SCEV] Simplify trunc-of-add/mul to add/mul-of-trunc under more circumstances.
Justin Lebar [Thu, 14 Jun 2018 17:13:35 +0000 (17:13 +0000)]
[SCEV] Simplify trunc-of-add/mul to add/mul-of-trunc under more circumstances.

Summary:
Previously we would do this simplification only if it did not introduce
any new truncs (excepting new truncs which replace other cast ops).

This change weakens this condition: If the number of truncs stays the
same, but we're able to transform trunc(X + Y) to X + trunc(Y), that's
still simpler, and it may open up additional transformations.

While we're here, also clean up some duplicated code.

Reviewers: sanjoy

Subscribers: hiraditya, llvm-commits

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

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

6 years ago[SCEV] Fix indentation and combine two if statements in getMulExpr, NFC.
Justin Lebar [Thu, 14 Jun 2018 17:13:22 +0000 (17:13 +0000)]
[SCEV] Fix indentation and combine two if statements in getMulExpr, NFC.

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

6 years agoRevert "[MC] Factor MCObjectStreamer::addFragmentAtoms out of MachO streamer."
Sam Clegg [Thu, 14 Jun 2018 17:11:19 +0000 (17:11 +0000)]
Revert "[MC] Factor MCObjectStreamer::addFragmentAtoms out of MachO streamer."

This reverts rL331412.  We didn't up using fragment atoms
in the wasm object writer after all.

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

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

6 years ago[AMDGPU] Document the AMDGPU LLVM attributes
Tony Tye [Thu, 14 Jun 2018 16:40:10 +0000 (16:40 +0000)]
[AMDGPU] Document the AMDGPU LLVM attributes

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

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

6 years agoRevert rL334704: "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue"
Bjorn Pettersson [Thu, 14 Jun 2018 16:08:22 +0000 (16:08 +0000)]
Revert rL334704: "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue"

This reverts commit r334704.

Buildbots detected an assertion in "test tsan in debug compiler-rt build".

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

6 years agoAvoid unused variable in non-assert builds.
Nirav Dave [Thu, 14 Jun 2018 15:55:15 +0000 (15:55 +0000)]
Avoid unused variable in non-assert builds.

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

6 years ago[llvm-mca] Add another test for partial register stalls.
Andrea Di Biagio [Thu, 14 Jun 2018 15:54:34 +0000 (15:54 +0000)]
[llvm-mca] Add another test for partial register stalls.

This test checks that a physical register is correctly allocated for the partial
write to register BX.
The ADD instruction has to wait for the write to RBX (and BX) before being
executed.

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

6 years ago[DAG] Avoid needing to walk out legalization tables. NFCI.
Nirav Dave [Thu, 14 Jun 2018 15:46:23 +0000 (15:46 +0000)]
[DAG] Avoid needing to walk out legalization tables. NFCI.

To avoid redundant work, during DAG legalization we keep tables
mapping pre-legalized SDValues to post-legalized SDValues and a
SDValue-to-SDValue map to enable fast node replacements. However, as
the keys are nodes which may be reused it is possible that an entry in
a table refers to a now deleted node N (that should have been renamed
by the value replacement map) while a new node N' exists. If N' is
then replaced that entry would be wrong. Previously we avoided this by
when potentially violating this property, walking every table and
updating all node pointers. This is very expensive but hopefully rare
occurance.

This patch assigns each instance of a SDValue used in legalization a
unique id and uses these ids in the legalization tables. This avoids
any such aliasing issue, avoiding the full table search and allowing
more aggressive incremental table pruning.

In some cases this is a 1000x speedup to compilation.

Reviewers: jyknight, echristo, bogner, tra

Reviewed By: bogner

Subscribers: dberris, grandinj, hiraditya, llvm-commits

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

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

6 years ago[X86] Add more vector instructions to the memory folding table using the autogenerate...
Craig Topper [Thu, 14 Jun 2018 15:40:31 +0000 (15:40 +0000)]
[X86] Add more vector instructions to the memory folding table using the autogenerated table as a guide.

The test cahnge is because we now fold stack reload into RNDSCALE and RNDSCALE can be turned into ROUND by EVEX->VEX.

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

6 years ago[X86] Remove '128' from the internal name of some scalar FP instructions to be consis...
Craig Topper [Thu, 14 Jun 2018 15:40:30 +0000 (15:40 +0000)]
[X86] Remove '128' from the internal name of some scalar FP instructions to be consistent with other scalar instructions.

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

6 years ago[X86] Disable load unfolding for a bunch of instruction where unfolding would increas...
Craig Topper [Thu, 14 Jun 2018 15:40:29 +0000 (15:40 +0000)]
[X86] Disable load unfolding for a bunch of instruction where unfolding would increase the size of the load.

Found by an audit of the manual table vs the autogenerated table.

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

6 years ago[X86] Remove NotMemoryFoldable from some AVX/AVX512 scalar instructions.
Craig Topper [Thu, 14 Jun 2018 15:40:27 +0000 (15:40 +0000)]
[X86] Remove NotMemoryFoldable from some AVX/AVX512 scalar instructions.

Some of these instructions are already in the manual folding table so we should have them in the auto table too.

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

6 years ago[ORC] Filter out self-dependencies in VSO::addDependencies.
Lang Hames [Thu, 14 Jun 2018 15:32:59 +0000 (15:32 +0000)]
[ORC] Filter out self-dependencies in VSO::addDependencies.

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

6 years ago[ORC] Assert that the query argument to VSO::lookup must be non-null.
Lang Hames [Thu, 14 Jun 2018 15:32:59 +0000 (15:32 +0000)]
[ORC] Assert that the query argument to VSO::lookup must be non-null.

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

6 years ago[ORC] Add a WaitUntilReady argument to blockingLookup.
Lang Hames [Thu, 14 Jun 2018 15:32:58 +0000 (15:32 +0000)]
[ORC] Add a WaitUntilReady argument to blockingLookup.

If WaitUntilReady is set to true then blockingLookup will return once all
requested symbols are ready. If WaitUntilReady is set to false then
blockingLookup will return as soon as all requested symbols have been
resolved. In the latter case, if any error occurs in finalizing the symbols it
will be reported to the ExecutionSession, rather than returned by
blockingLookup.

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

6 years ago[ORC] Strip the Materializing flag off finalized symbols in VSOs.
Lang Hames [Thu, 14 Jun 2018 15:32:56 +0000 (15:32 +0000)]
[ORC] Strip the Materializing flag off finalized symbols in VSOs.

Finalized symbols are no longer in the materializing state.

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

6 years ago[docs] Update CompilerWriterInfo.rst for MIPS
Simon Dardis [Thu, 14 Jun 2018 15:16:37 +0000 (15:16 +0000)]
[docs] Update CompilerWriterInfo.rst for MIPS

Update the URL of where the documentation can be found.

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

6 years ago[EarlyCSE] Fix MSVC build. NFCI.
Simon Pilgrim [Thu, 14 Jun 2018 14:22:03 +0000 (14:22 +0000)]
[EarlyCSE] Fix MSVC build. NFCI.

MSVC doesn't let you assign different lambdas through a ternary operator.

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

6 years ago[CostModel][AArch64] Add cost tests for ALTERNATE/SELECT style shuffle masks
Simon Pilgrim [Thu, 14 Jun 2018 14:20:20 +0000 (14:20 +0000)]
[CostModel][AArch64] Add cost tests for ALTERNATE/SELECT style shuffle masks

Precursor to fixing a regression with SLP vectorizer for supporting SELECT shuffles (vs the current ALTERNATE)

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

6 years ago[MC] Move MCAssembler::dump into the correct cpp file. NFC
Sam Clegg [Thu, 14 Jun 2018 14:04:23 +0000 (14:04 +0000)]
[MC] Move MCAssembler::dump into the correct cpp file. NFC

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

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

6 years ago[DWARFv5] Tolerate files not all having an MD5 checksum.
Paul Robinson [Thu, 14 Jun 2018 13:38:20 +0000 (13:38 +0000)]
[DWARFv5] Tolerate files not all having an MD5 checksum.

In some cases, for example when compiling a preprocessed file, the
front-end is not able to provide an MD5 checksum for all files. When
that happens, omit the MD5 checksums from the final DWARF, because
DWARF doesn't have a way to indicate that some but not all files have
a checksum.

When assembling a .s file, and some but not all .file directives
provide an MD5 checksum, issue a warning and don't emit MD5 into the
DWARF.

Fixes PR37623.

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

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

6 years ago[mips] Correct predicates for MSA pseudo instructions
Simon Dardis [Thu, 14 Jun 2018 13:03:53 +0000 (13:03 +0000)]
[mips] Correct predicates for MSA pseudo instructions

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

6 years ago[EarlyCSE] Propagate conditions of AND and OR instructions
Max Kazantsev [Thu, 14 Jun 2018 13:02:13 +0000 (13:02 +0000)]
[EarlyCSE] Propagate conditions of AND and OR instructions

This patches teaches EarlyCSE to figure out that if `and i1 %x, %y` is true then both
`%x` and `%y` are true in the taken branch, and if `or i1 %x, %y` is false then both
`%x` and `%y` are false in non-taken branch. Fix for PR37635.

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

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

6 years ago[TableGen] Move some shared_ptrs to avoid unnecessary copies (NFC).
Florian Hahn [Thu, 14 Jun 2018 11:56:19 +0000 (11:56 +0000)]
[TableGen] Move some shared_ptrs to avoid unnecessary copies (NFC).

Those changes were suggested post-commit for D47463.

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

6 years ago[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue
Bjorn Pettersson [Thu, 14 Jun 2018 11:23:42 +0000 (11:23 +0000)]
[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue

Summary:
Do not convert a DbgDeclare to DbgValue if the store
instruction only refer to a fragment of the variable
described by the DbgDeclare.

Problem was seen when for example having an alloca for an
array or struct, and there were stores to individual elements.
In the past we inserted a DbgValue intrinsics for each store,
just as if the store wrote the whole variable.

When handling store instructions we insert a DbgValue that
indicates that the variable is "undefined", as we do not know
which part of the variable that is updated by the store.

When ConvertDebugDeclareToDebugValue is used with a load/phi
instruction we assert that the referenced value is large enough
to cover the whole variable. Afaict this should be true for all
scenarios where those methods are used on trunk. If the assert
blows in the future I guess we could simply skip to insert a
dbg.value instruction.

In the future I think we should examine which part of the variable
that is accessed, and add a DbgValue instrinsic with an appropriate
DW_OP_LLVM_fragment expression.

Reviewers: dblaikie, aprantl, rnk

Reviewed By: aprantl

Subscribers: JDevlieghere, llvm-commits

Tags: #debug-info

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

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

6 years ago[SLPVectorizer] Remove RawInstructionsData/getMainOpcode and merge into getSameOpcode
Simon Pilgrim [Thu, 14 Jun 2018 10:25:19 +0000 (10:25 +0000)]
[SLPVectorizer] Remove RawInstructionsData/getMainOpcode and merge into getSameOpcode

This is part of the work to cleanup use of 'alternate' ops so we can use the more general SK_Select shuffle type.

Only getSameOpcode calls getMainOpcode and much of the logic is repeated in both functions. This will require some reworking of D28907 but that patch has hit trouble and is unlikely to be completed anytime soon.

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

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

6 years ago[CostModel] Cleanup isSingleSourceVectorMask to match other shuffle matchers. NFCI.
Simon Pilgrim [Thu, 14 Jun 2018 09:48:19 +0000 (09:48 +0000)]
[CostModel] Cleanup isSingleSourceVectorMask to match other shuffle matchers. NFCI.

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

6 years ago[CostModel] Recognise REVERSE shuffle mask if the elements come from the second src
Simon Pilgrim [Thu, 14 Jun 2018 09:35:00 +0000 (09:35 +0000)]
[CostModel] Recognise REVERSE shuffle mask if the elements come from the second src

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

6 years ago[llvm-exegesis] Use BenchmarkResult::Instructions instead of OpcodeName
Clement Courbet [Thu, 14 Jun 2018 06:57:52 +0000 (06:57 +0000)]
[llvm-exegesis] Use BenchmarkResult::Instructions instead of OpcodeName

Summary:
Get rid of OpcodeName.

To remove the opcode name from an old file:
```
cat old_file | sed '/opcode_name.*/d'
```

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

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

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Thu, 14 Jun 2018 05:41:49 +0000 (05:41 +0000)]
[NFC] fix trivial typos in comments

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

6 years ago[x86] fix mappings of cvttp2si/cvttp2ui x86 intrinsics to x86-specific nodes and...
Craig Topper [Thu, 14 Jun 2018 03:16:58 +0000 (03:16 +0000)]
[x86] fix mappings of cvttp2si/cvttp2ui x86 intrinsics to x86-specific nodes and isel patterns (PR37551)

Summary:
The tests in:
https://bugs.llvm.org/show_bug.cgi?id=37751
...show miscompiles because we wrongly mapped and folded x86-specific intrinsics into generic DAG nodes.

This patch corrects the mappings in X86IntrinsicsInfo.h and adds isel matching corresponding to the new patterns. The complete tests for the failure cases should be in avx-cvttp2si.ll and sse-cvttp2si.ll and avx512-cvttp2i.ll

Reviewers: RKSimon, gbedwell, spatel

Reviewed By: spatel

Subscribers: mcrosier, llvm-commits

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

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

6 years ago[llvm-mca] Introduce the ExecuteStage (was originally the Scheduler class).
Matt Davis [Thu, 14 Jun 2018 01:20:18 +0000 (01:20 +0000)]
[llvm-mca] Introduce the ExecuteStage (was originally the Scheduler class).

Summary: This patch transforms the Scheduler class into the ExecuteStage.  Most of the logic remains.

Reviewers: andreadb, RKSimon, courbet

Reviewed By: andreadb

Subscribers: mgorny, javed.absar, tschuett, gbedwell, llvm-commits

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

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

6 years agoAMDGPU/GlobalISel: Implement select() for 32-bit G_FADD and G_FMUL
Tom Stellard [Wed, 13 Jun 2018 22:30:47 +0000 (22:30 +0000)]
AMDGPU/GlobalISel: Implement select() for 32-bit G_FADD and G_FMUL

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years agoRevert "Enable ThreadPool to queue tasks that return values."
Zachary Turner [Wed, 13 Jun 2018 21:24:19 +0000 (21:24 +0000)]
Revert "Enable ThreadPool to queue tasks that return values."

This is failing to compile when LLVM_ENABLE_THREADS is false,
and the fix is not immediately obvious, so reverting while I look
into it.

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

6 years agoReland: [Timers] Use the pass argument name for JSON keys in time-passes
Francis Visoiu Mistrih [Wed, 13 Jun 2018 21:03:56 +0000 (21:03 +0000)]
Reland: [Timers] Use the pass argument name for JSON keys in time-passes

When using clang --save-stats -mllvm -time-passes, both timers and stats
end up in the same json file.

We could end up with things like:

{
  "asm-printer.EmittedInsts": 1,
  "time.pass.Virtual Register Map.wall": 2.9015541076660156e-04,
  "time.pass.Virtual Register Map.user": 2.0500000000000379e-04,
  "time.pass.Virtual Register Map.sys": 8.5000000000001741e-05,
}

This patch makes use of the pass argument name (if available) in the
JSON key to end up with things like:

{
  "asm-printer.EmittedInsts": 1,
  "time.pass.virtregmap.wall": 2.9015541076660156e-04,
  "time.pass.virtregmap.user": 2.0500000000000379e-04,
  "time.pass.virtregmap.sys": 8.5000000000001741e-05,
}

This also helps avoiding to write another JSON printer to handle all the
cases that we could have in our pass names.

Fixed test instead of adding a new one originally from r334649.

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

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

6 years ago[TableGen] Make getOnlyTree return a const ref (NFC)
Florian Hahn [Wed, 13 Jun 2018 20:59:53 +0000 (20:59 +0000)]
[TableGen] Make getOnlyTree return a const ref (NFC)

This avoids some unnecessary copies of shared_ptrs.
Those changes were suggested post-commit for D47463.

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

6 years agoUpdate comments of CheckedArithmetic API based on Philip Reames feedback.
George Karpenkov [Wed, 13 Jun 2018 20:48:53 +0000 (20:48 +0000)]
Update comments of CheckedArithmetic API based on Philip Reames feedback.

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

6 years ago[WinASan] Don't instrument globals in sections containing '$'
Reid Kleckner [Wed, 13 Jun 2018 20:47:21 +0000 (20:47 +0000)]
[WinASan] Don't instrument globals in sections containing '$'

Such globals are very likely to be part of a sorted section array, such
the .CRT sections used for dynamic initialization. The uses its own
sorted sections called ATL$__a, ATL$__m, and ATL$__z. Instead of special
casing them, just look for the dollar sign, which is what invokes linker
section sorting for COFF.

Avoids issues with ASan and the ATL uncovered after we started
instrumenting comdat globals on COFF.

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

6 years agoRevert r334649 "[Timers] Use the pass argument name for JSON keys in time-passes"
Francis Visoiu Mistrih [Wed, 13 Jun 2018 20:44:02 +0000 (20:44 +0000)]
Revert r334649 "[Timers] Use the pass argument name for JSON keys in time-passes"

This reverts commit r334649.

This breaks a test.

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

6 years ago[Timers] Use the pass argument name for JSON keys in time-passes
Francis Visoiu Mistrih [Wed, 13 Jun 2018 20:09:59 +0000 (20:09 +0000)]
[Timers] Use the pass argument name for JSON keys in time-passes

When using clang --save-stats -mllvm -time-passes, both timers and stats
end up in the same json file.

We could end up with things like:

{
  "asm-printer.EmittedInsts": 1,
  "time.pass.Virtual Register Map.wall": 2.9015541076660156e-04,
  "time.pass.Virtual Register Map.user": 2.0500000000000379e-04,
  "time.pass.Virtual Register Map.sys": 8.5000000000001741e-05,
}

This patch makes use of the pass argument name (if available) in the
JSON key to end up with things like:

{
  "asm-printer.EmittedInsts": 1,
  "time.pass.virtregmap.wall": 2.9015541076660156e-04,
  "time.pass.virtregmap.user": 2.0500000000000379e-04,
  "time.pass.virtregmap.sys": 8.5000000000001741e-05,
}

This also helps avoiding to write another JSON printer to handle all the
cases that we could have in our pass names.

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

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

6 years ago[X86] Move RCPSSr_Int, RSQRTSSr_Int, SQRTSDr_Int, SQRTSSr_Int to the correct load...
Craig Topper [Wed, 13 Jun 2018 20:03:42 +0000 (20:03 +0000)]
[X86] Move RCPSSr_Int, RSQRTSSr_Int, SQRTSDr_Int, SQRTSSr_Int to the correct load folding table.

They were in the operand 1 folding table, but their foldable operand is operand 2.

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

6 years agoAdd missing #include.
Zachary Turner [Wed, 13 Jun 2018 19:37:41 +0000 (19:37 +0000)]
Add missing #include.

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

6 years agoEnable ThreadPool to support tasks that return values.
Zachary Turner [Wed, 13 Jun 2018 19:29:16 +0000 (19:29 +0000)]
Enable ThreadPool to support tasks that return values.

Previously ThreadPool could only queue async "jobs", i.e. work
that was done for its side effects and not for its result.  It's
useful occasionally to queue async work that returns a value.
From an API perspective, this is very intuitive.  The previous
API just returned a shared_future<void>, so all we need to do is
make it return a shared_future<T>, where T is the type of value
that the operation returns.

Making this work required a little magic, but ultimately it's not
too bad.  Instead of keeping a shared queue<packaged_task<void()>>
we just keep a shared queue<unique_ptr<TaskBase>>, where TaskBase
is a class with a pure virtual execute() method, then have a
templated derived class that stores a packaged_task<T()>.  Everything
else works out pretty cleanly.

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

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

6 years ago[AMDGPU] Corrected computeKnownBits for V_PERM_B32
Stanislav Mekhanoshin [Wed, 13 Jun 2018 18:52:54 +0000 (18:52 +0000)]
[AMDGPU] Corrected computeKnownBits for V_PERM_B32

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

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

6 years agoAdd checkMulAdd helper function to CheckedArithmetic
George Karpenkov [Wed, 13 Jun 2018 18:32:02 +0000 (18:32 +0000)]
Add checkMulAdd helper function to CheckedArithmetic

Multiplication followed by addition
(https://en.wikipedia.org/wiki/Multiply–accumulate_operation) is a
sufficiently common use-case to warrant a separate helper.

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

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

6 years agoChange checked arithmetic functions API to return Optional
George Karpenkov [Wed, 13 Jun 2018 18:31:43 +0000 (18:31 +0000)]
Change checked arithmetic functions API to return Optional

Returning optional is much safer.
The previous API had potential to cause use of undefined variables, if
the value passed by pointer was accidentally read afterwards.

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

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

6 years ago[llvm-mca] Fixed a bug in the logic that checks if a memory operation is ready to...
Andrea Di Biagio [Wed, 13 Jun 2018 18:30:14 +0000 (18:30 +0000)]
[llvm-mca] Fixed a bug in the logic that checks if a memory operation is ready to execute.

Fixes PR37790.

In some (very rare) cases, the LSUnit (Load/Store unit) was wrongly marking a
load (or store) as "ready to execute" effectively bypassing older memory barrier
instructions.

To reproduce this bug, the memory barrier must be the first instruction in the
input assembly sequence, and it doesn't have to perform any register writes.

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

6 years ago[CMake] Handle 'libtool' being at a path with spaces in it.
Jordan Rose [Wed, 13 Jun 2018 18:21:47 +0000 (18:21 +0000)]
[CMake] Handle 'libtool' being at a path with spaces in it.

This can happen on macOS if the user's Xcode is at a path with spaces in it.

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

6 years agoLTO: Keep file handles open for memory mapped files.
Peter Collingbourne [Wed, 13 Jun 2018 18:03:14 +0000 (18:03 +0000)]
LTO: Keep file handles open for memory mapped files.

On Windows we've observed that if you open a file, write to it, map it into
memory and close the file handle, the contents of the memory mapping can
sometimes be incorrect. That was what we did when adding an entry to the
ThinLTO cache using the TempFile and MemoryBuffer classes, and it was causing
intermittent build failures on Chromium's ThinLTO bots on Windows. More
details are in the associated Chromium bug (crbug.com/786127).

We can prevent this from happening by keeping a handle to the file open while
the mapping is active. So this patch changes the mapped_file_region class to
duplicate the file handle when mapping the file and close it upon unmapping it.

One gotcha is that the file handle that we keep open must not have been
created with FILE_FLAG_DELETE_ON_CLOSE, as otherwise the operating system
will prevent other processes from opening the file. We can achieve this
by avoiding the use of FILE_FLAG_DELETE_ON_CLOSE altogether.  Instead,
we use SetFileInformationByHandle with FileDispositionInfo to manage the
delete-on-close bit. This lets us remove the hack that we used to use to
clear the delete-on-close bit on a file opened with FILE_FLAG_DELETE_ON_CLOSE.

A downside of using SetFileInformationByHandle/FileDispositionInfo as
opposed to FILE_FLAG_DELETE_ON_CLOSE is that it prevents us from using
CreateFile to open the file while the flag is set, even within the same
process. This doesn't seem to matter for almost every client of TempFile,
except for LockFileManager, which calls sys::fs::create_link to create a
hard link from the lock file, and in the process of doing so tries to open
the file. To prevent this change from breaking LockFileManager I changed it
to stop using TempFile by effectively reverting r318550.

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

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

6 years ago[X86] Add one more intrinsic and test cases to avx512-cvttp2i.ll.
Craig Topper [Wed, 13 Jun 2018 17:55:13 +0000 (17:55 +0000)]
[X86] Add one more intrinsic and test cases to avx512-cvttp2i.ll.

spatel noticed it was missing in D47993.

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

6 years agoIR: fix documentation markup
Saleem Abdulrasool [Wed, 13 Jun 2018 17:51:27 +0000 (17:51 +0000)]
IR: fix documentation markup

Use `\brief` instead of `\Brief`.  NFC.

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

6 years ago[AMDGPU] Change enqueue kernel handle type
Yaxun Liu [Wed, 13 Jun 2018 17:31:51 +0000 (17:31 +0000)]
[AMDGPU] Change enqueue kernel handle type

Currently the handle type is a global pointer which holds 8 bytes.
We need a larger type which hold 16 bytes, therefore change it
to [i64 x 2].

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

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

6 years ago[CostModel][X86] Test showing failure to recognise REVERSE shuffle mask if the elemen...
Simon Pilgrim [Wed, 13 Jun 2018 17:12:11 +0000 (17:12 +0000)]
[CostModel][X86] Test showing failure to recognise REVERSE shuffle mask if the elements come from the second src

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

6 years ago[AMDGPU][MC] Enabled parsing of relocations on VALU instructions
Dmitry Preobrazhensky [Wed, 13 Jun 2018 17:02:03 +0000 (17:02 +0000)]
[AMDGPU][MC] Enabled parsing of relocations on VALU instructions

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

Reviewers: artem.tamazov, arsenm, nhaehnle

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

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

6 years ago[CostModel] Recognise BROADCAST shuffle mask if the elements come from the second src
Simon Pilgrim [Wed, 13 Jun 2018 16:52:02 +0000 (16:52 +0000)]
[CostModel] Recognise BROADCAST shuffle mask if the elements come from the second src

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

6 years agoRevert: [llvm-mca] Flush the output stream before we start the analysis of a new...
Andrea Di Biagio [Wed, 13 Jun 2018 16:33:52 +0000 (16:33 +0000)]
Revert: [llvm-mca] Flush the output stream before we start the analysis of a new code region. NFC

Not sure why, but it breaks buildbot clang-cmake-armv8-full.
It causes a failure in TEST 'Xray-armhf-linux :: TestCases/Posix/profiling-single-threaded.cc'.

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

6 years ago[CostModel][X86] Test showing failure to recognise BROADCAST shuffle mask if the...
Simon Pilgrim [Wed, 13 Jun 2018 16:33:42 +0000 (16:33 +0000)]
[CostModel][X86] Test showing failure to recognise BROADCAST shuffle mask if the elements come from the second src

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

6 years ago[llvm-mca] Flush the output stream before we start the analysis of a new code region...
Andrea Di Biagio [Wed, 13 Jun 2018 15:43:56 +0000 (15:43 +0000)]
[llvm-mca] Flush the output stream before we start the analysis of a new code region. NFC

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

6 years ago[AMDGPU][MC][GFX8][GFX9] Allow LDS direct reads for BUFFER_LOAD_DWORDX2/X3/X4
Dmitry Preobrazhensky [Wed, 13 Jun 2018 15:32:46 +0000 (15:32 +0000)]
[AMDGPU][MC][GFX8][GFX9] Allow LDS direct reads for BUFFER_LOAD_DWORDX2/X3/X4

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

Reviewers: artem.tamazov, arsenm

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

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

6 years ago[DAGCombiner] remove hasOneUse() check from fadd constants transform
Sanjay Patel [Wed, 13 Jun 2018 15:22:48 +0000 (15:22 +0000)]
[DAGCombiner] remove hasOneUse() check from fadd constants transform

We're constant folding here, so we shouldn't check uses. This matches
the IR optimizer behavior.

The x86 test shows the expected win. The AArch64 test shows something
else. This only seems to happen if the "generic" AArch64 CPU model is
used by MachineCombiner, so I'll file a bug report to follow-up.

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

6 years agoAMDGPU: Move isSDNodeSourceOfDivergence() implementation to SITargetLowering
Tom Stellard [Wed, 13 Jun 2018 15:06:37 +0000 (15:06 +0000)]
AMDGPU: Move isSDNodeSourceOfDivergence() implementation to SITargetLowering

Summary:
The code that handles ISD:Register and ISD::CopyFromReg assumes
the target is amdgcn, so this is broken on r600.  We don't
need this analysis on r600 anyway so we can safely move
it to SITargetLowering.

Reviewers: alex-t, arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: msearles, kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years ago[x86] add test for fadd with more than one use; NFC
Sanjay Patel [Wed, 13 Jun 2018 15:01:07 +0000 (15:01 +0000)]
[x86] add test for fadd with more than one use; NFC

The equivalent AArch64 test added at rL334556 isn't showing
the expected output from the DAGCombiner code change that
would fix this example. That's a machine combiner bug from
what I see.

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

6 years ago[FPEnv] Expand constrained FP operations
Cameron McInally [Wed, 13 Jun 2018 14:32:12 +0000 (14:32 +0000)]
[FPEnv] Expand constrained FP operations

Add a helper function to expand constrained FP operations as needed.
Note that the Strict POWI operation is not handled in this patch since
the format is slightly different from the others.

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

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

6 years agoDo not enforce absolute path argv0 in windows
Hans Wennborg [Wed, 13 Jun 2018 14:29:26 +0000 (14:29 +0000)]
Do not enforce absolute path argv0 in windows

Even if we support no-canonical-prefix on
clang-cl(https://reviews.llvm.org/D47480), argv0 becomes absolute path
in clang-cl and that embeds absolute path in /showIncludes.

This patch removes such full path normalization from InitLLVM on
windows, and that removes absolute path from clang-cl output
(obj/stdout/stderr) when debug flag is disabled.

Patch by Takuto Ikuta!

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

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

6 years ago[llvm-exegesis] Fix buildbot - power was using native target for X86.
Guillaume Chatelet [Wed, 13 Jun 2018 14:07:36 +0000 (14:07 +0000)]
[llvm-exegesis] Fix buildbot - power was using native target for X86.

Reviewers: courbet

Reviewed By: courbet

Subscribers: tschuett, llvm-commits

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

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

6 years ago[llvm-exegesis] Fix failing assert when creating Snippet for LAHF.
Guillaume Chatelet [Wed, 13 Jun 2018 13:53:56 +0000 (13:53 +0000)]
[llvm-exegesis] Fix failing assert when creating Snippet for LAHF.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

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

6 years agoRevert "Improve handling of COPY instructions with identical value numbers"
Krzysztof Parzyszek [Wed, 13 Jun 2018 13:49:06 +0000 (13:49 +0000)]
Revert "Improve handling of COPY instructions with identical value numbers"

This reverts r334594, it breaks buildbots and fails with expensive checks.

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

6 years ago[llvm-exegesis] Cleaner design without mutable data.
Guillaume Chatelet [Wed, 13 Jun 2018 13:24:41 +0000 (13:24 +0000)]
[llvm-exegesis] Cleaner design without mutable data.

Summary: Previous design was relying on the 'mutate' keyword and was quite confusing. This version separate mutable from immutable data and makes it clearer what changes and what doesn't.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

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

6 years ago[mips][microMIPS] Extending size reduction pass with LWP and SWP
Zoran Jovanovic [Wed, 13 Jun 2018 12:51:37 +0000 (12:51 +0000)]
[mips][microMIPS] Extending size reduction pass with LWP and SWP
Author: milena.vujosevic.janicic
Reviewers: sdardis
The patch extends size reduction pass for MicroMIPS.
It introduces reduction of two instructions into one instruction:
Two SW instructions are transformed into one SWP instrucition.
Two LW instructions are transformed into one LWP instrucition.
Differential Revision: https://reviews.llvm.org/D39115

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