OSDN Git Service

android-x86/external-llvm.git
6 years ago[X86] Use the same predicate for the load for PMOVSXBQ and PMOVZXBQ.
Craig Topper [Wed, 4 Apr 2018 07:00:24 +0000 (07:00 +0000)]
[X86] Use the same predicate for the load for PMOVSXBQ and PMOVZXBQ.

These both use a 16-bit load, but one used loadi16_anyext and the other used extloadi32i16. The only difference between them is that loadi16_anyext checked that the load was at least 2 byte aligned and non-volatile. But the alignment doesn't matter here. Just use extloadi32i16 for both.

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

6 years ago[X86] Use loadi16/loadi32 predicates in multiply patterns
Craig Topper [Wed, 4 Apr 2018 07:00:19 +0000 (07:00 +0000)]
[X86] Use loadi16/loadi32 predicates in multiply patterns

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

6 years ago[X86] Remove more dead code left over from the handling of i8/i16 UMUL_LOHI/SMUL_LOHI...
Craig Topper [Wed, 4 Apr 2018 07:00:16 +0000 (07:00 +0000)]
[X86] Remove more dead code left over from the handling of i8/i16 UMUL_LOHI/SMUL_LOHI that is no longer needed. NFC

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

6 years ago[SCEV] Prove implications for SCEVUnknown Phis
Max Kazantsev [Wed, 4 Apr 2018 05:46:47 +0000 (05:46 +0000)]
[SCEV] Prove implications for SCEVUnknown Phis

This patch teaches SCEV how to prove implications for SCEVUnknown nodes that are Phis.
If we need to prove `Pred` for `LHS, RHS`, and `LHS` is a Phi with possible incoming values
`L1, L2, ..., LN`, then if we prove `Pred` for `(L1, RHS), (L2, RHS), ..., (LN, RHS)` then we can also
prove it for `(LHS, RHS)`. If both `LHS` and `RHS` are Phis from the same block, it is sufficient
to prove the predicate for values that come from the same predecessor block.

The typical case that it handles is that we sometimes need to prove that `Phi(Len, Len - 1) >= 0`
given that `Len > 0`. The new logic was added to `isImpliedViaOperations` and only uses it and
non-recursive reasoning to prove the facts we need, so it should not hurt compile time a lot.

Differential Revision: https://reviews.llvm.org/D44001
Reviewed By: anna

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

6 years ago[X86] Remove dead code for handling i8/i16 UMUL_LOHI/SMUL_LOHI from X86ISelDAGToDAG...
Craig Topper [Wed, 4 Apr 2018 04:38:55 +0000 (04:38 +0000)]
[X86] Remove dead code for handling i8/i16 UMUL_LOHI/SMUL_LOHI from X86ISelDAGToDAG.cpp. NFC

These are promoted to i16/i32 multiplies by a DAG combine.

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

6 years ago[X86] Remove some code that was only needed when i1 was a legal type. NFC
Craig Topper [Wed, 4 Apr 2018 04:38:54 +0000 (04:38 +0000)]
[X86] Remove some code that was only needed when i1 was a legal type. NFC

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

6 years ago[SimplifyCFG] Teach merge conditional stores to handle cases where the PostBB has...
Craig Topper [Wed, 4 Apr 2018 03:47:17 +0000 (03:47 +0000)]
[SimplifyCFG] Teach merge conditional stores to handle cases where the PostBB has more than 2 predecessors by inserting a new block for the store.

Summary:
Currently merge conditional stores can't handle cases where PostBB (the block we need to move the store to) has more than 2 predecessors.

This patch removes that restriction by creating a new block with only the 2 predecessors we care about and an unconditional branch to the original block. This provides a place to put the store.

Reviewers: efriedma, jmolloy, ABataev

Reviewed By: efriedma

Subscribers: llvm-commits

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

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

6 years agoFix bad #include path in r329139
Vlad Tsyrklevich [Wed, 4 Apr 2018 01:34:42 +0000 (01:34 +0000)]
Fix bad #include path in r329139

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

6 years agoAdd the ShadowCallStack pass
Vlad Tsyrklevich [Wed, 4 Apr 2018 01:21:16 +0000 (01:21 +0000)]
Add the ShadowCallStack pass

Summary:
The ShadowCallStack pass instruments functions marked with the
shadowcallstack attribute. The instrumented prolog saves the return
address to [gs:offset] where offset is stored and updated in [gs:0].
The instrumented epilog loads/updates the return address from [gs:0]
and checks that it matches the return address on the stack before
returning.

Reviewers: pcc, vitalybuka

Reviewed By: pcc

Subscribers: cryptoad, eugenis, craig.topper, mgorny, llvm-commits, kcc

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

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

6 years agoMinor no-op cmake file style fix.
Nico Weber [Wed, 4 Apr 2018 00:50:22 +0000 (00:50 +0000)]
Minor no-op cmake file style fix.

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

6 years agoReapply r329133 with fix.
Lang Hames [Wed, 4 Apr 2018 00:34:54 +0000 (00:34 +0000)]
Reapply r329133 with fix.

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

6 years agoRevert r329133 "[RuntimeDyld][AArch64] Add some error pluming / generation..."
Lang Hames [Wed, 4 Apr 2018 00:12:12 +0000 (00:12 +0000)]
Revert r329133 "[RuntimeDyld][AArch64] Add some error pluming / generation..."

This broke a number of buildbots. Looking in to it now...

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

6 years ago[MachineOutliner] Test for X86FI->getUsesRedZone() as well as Attribute::NoRedZone
Jessica Paquette [Tue, 3 Apr 2018 23:32:41 +0000 (23:32 +0000)]
[MachineOutliner] Test for X86FI->getUsesRedZone() as well as Attribute::NoRedZone

This commit is similar to r329120, but uses the existing getUsesRedZone() function
in X86MachineFunctionInfo. This teaches the outliner to look at whether or not a
function *truly* uses a redzone instead of just the noredzone attribute on a
function.

Thus, after this commit, it's possible to outline from x86 without using
-mno-red-zone and still get outlining results.

This also adds a new test for the new redzone behaviour.

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

6 years ago[RuntimeDyld][AArch64] Add some error pluming / generation to catch unhandled
Lang Hames [Tue, 3 Apr 2018 23:19:20 +0000 (23:19 +0000)]
[RuntimeDyld][AArch64] Add some error pluming / generation to catch unhandled
relocation types on AArch64.

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

6 years ago[AMDGPU] performMinMaxCombine should not optimize patterns of vectors to min3/max3.
Farhana Aleen [Tue, 3 Apr 2018 23:00:30 +0000 (23:00 +0000)]
[AMDGPU] performMinMaxCombine should not optimize patterns of vectors to min3/max3.

Summary: There are no packed instructions for min3 or max3. So, performMinMaxCombine should not optimize vectors of f16 to min3/max3.

Author: FarhanaAleen

Reviewed By: arsenm

Subscribers: llvm-commits, AMDGPU

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

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

6 years ago[AArch64] Adjust the cost model for Exynos M3
Evandro Menezes [Tue, 3 Apr 2018 22:57:17 +0000 (22:57 +0000)]
[AArch64] Adjust the cost model for Exynos M3

Fix typo and simplify matching expression.

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

6 years ago[Hexagon] peel loops with runtime small trip counts
Ikhlas Ajbar [Tue, 3 Apr 2018 22:55:09 +0000 (22:55 +0000)]
[Hexagon] peel loops with runtime small trip counts

Move the check canPeel() to Hexagon Target before setting PeelCount.

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

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

6 years ago'cat' command for internal shell - Support Python 3
Reid Kleckner [Tue, 3 Apr 2018 22:38:25 +0000 (22:38 +0000)]
'cat' command for internal shell - Support Python 3

LLVM Bug Id : 36449

Revision 328563 caused tests to fail under python 3.

This patch modified cat.py file to support both python 2 and 3.
This patch also fixes CRLF issues on Windows.

Patch by Chamal de Silva

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

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

6 years ago[InstCombine] allow more fmul folds with 'reassoc'
Sanjay Patel [Tue, 3 Apr 2018 22:19:19 +0000 (22:19 +0000)]
[InstCombine] allow more fmul folds with 'reassoc'

The tests marked with 'FIXME' require loosening the check
in SimplifyAssociativeOrCommutative() to optimize completely;
that's still checking isFast() in Instruction::isAssociative().

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

6 years ago[MachineOutliner] Keep track of fns that use a redzone in AArch64FunctionInfo
Jessica Paquette [Tue, 3 Apr 2018 21:56:10 +0000 (21:56 +0000)]
[MachineOutliner] Keep track of fns that use a redzone in AArch64FunctionInfo

This patch adds a hasRedZone() function to AArch64MachineFunctionInfo. It
returns true if the function is known to use a redzone, false if it is known
to not use a redzone, and no value otherwise.

This removes the requirement to pass -mno-red-zone when outlining for AArch64.

https://reviews.llvm.org/D45189

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

6 years agoRevert "MSG"
Farhana Aleen [Tue, 3 Apr 2018 21:51:45 +0000 (21:51 +0000)]
Revert "MSG"

This reverts commit 9a0ce889d1c39c74d69ecad5ce9c875155ae55de.

This was committed by mistake.

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

6 years agoFix bad copy-and-paste in r329108
Vlad Tsyrklevich [Tue, 3 Apr 2018 21:40:27 +0000 (21:40 +0000)]
Fix bad copy-and-paste in r329108

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

6 years ago[MachineOutliner][NFC] Make outlined functions have internal linkage
Jessica Paquette [Tue, 3 Apr 2018 21:36:00 +0000 (21:36 +0000)]
[MachineOutliner][NFC] Make outlined functions have internal linkage

The linkage type on outlined functions was private before. This meant that if
you set a breakpoint in an outlined function, the debugger wouldn't be able to
give a sane name to the outlined function.

This commit changes the linkage type to internal and updates any tests that
relied on the prefixes on the names of outlined functions.

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

6 years agoMSG
Farhana Aleen [Tue, 3 Apr 2018 21:20:39 +0000 (21:20 +0000)]
MSG

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

6 years ago[coroutines] Respect alloca alignment requirements when building coroutine frame
Gor Nishanov [Tue, 3 Apr 2018 20:54:20 +0000 (20:54 +0000)]
[coroutines] Respect alloca alignment requirements when building coroutine frame

Summary:
If an alloca need to be stored in the coroutine frame and it has an alignment specified and the alignment does not match the natural alignment of the alloca type. Insert appropriate padding into the coroutine frame to make sure that it gets requested alignment.

For example for a packet type (which natural alignment is 1), but alloca alignment is 8, we may need to insert a padding field with required number of bytes to make sure it is properly aligned.

```
%PackedStruct = type <{ i64 }>
...
  %data = alloca %PackedStruct, align 8
```

If the previous field in the coroutine frame had alignment 2, we would have [6 x i8] inserted before %PackedStruct in the coroutine frame:

```
%f.Frame = type { ..., i16, [6 x i8], %PackedStruct }
```

Reviewers: rnk, lewissbaker, modocache

Reviewed By: modocache

Subscribers: EricWF, llvm-commits

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

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

6 years ago[LoopInterchange] Add remark for calls preventing interchanging.
Florian Hahn [Tue, 3 Apr 2018 20:54:04 +0000 (20:54 +0000)]
[LoopInterchange] Add remark for calls preventing interchanging.

It also updates test/Transforms/LoopInterchange/call-instructions.ll
to use accesses where we can prove dependence after D35430.

Reviewers: sebpop, karthikthecool, blitz.opensource

Reviewed By: sebpop

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

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

6 years agoAdd the ShadowCallStack attribute
Vlad Tsyrklevich [Tue, 3 Apr 2018 20:10:40 +0000 (20:10 +0000)]
Add the ShadowCallStack attribute

Summary:
Introduce the ShadowCallStack function attribute. It's added to
functions compiled with -fsanitize=shadow-call-stack in order to mark
functions to be instrumented by a ShadowCallStack pass to be submitted
in a separate change.

Reviewers: pcc, kcc, kubamracek

Reviewed By: pcc, kcc

Subscribers: cryptoad, mehdi_amini, javed.absar, llvm-commits, kcc

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

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

6 years ago[DebugInfoPDB] Add methods used to read function flags
Aaron Smith [Tue, 3 Apr 2018 19:43:40 +0000 (19:43 +0000)]
[DebugInfoPDB] Add methods used to read function flags

The specific function flags are listed in CodeView::FunctionOption.

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

6 years ago[DebugInfoPDB] Add a few missing definitions to PDBTypes.h
Aaron Smith [Tue, 3 Apr 2018 19:41:27 +0000 (19:41 +0000)]
[DebugInfoPDB] Add a few missing definitions to PDBTypes.h

The missing definitions are from cvconst.h shipped with DIA SDK.

Correct the url to MSDN for MemoryTypeEnum and set the underlying
type of PDB_StackFrameType and PDB_MemoryType to uint16_t.

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

6 years ago[x86] add tests for convert-FP-to-integer with constants; NFC
Sanjay Patel [Tue, 3 Apr 2018 18:34:56 +0000 (18:34 +0000)]
[x86] add tests for convert-FP-to-integer with constants; NFC

We don't constant fold any of these, but we could...but if we
do, we must produce the right answer.

Unlike the IR fptosi instruction or its DAG node counterpart
ISD::FP_TO_SINT, these are not undef for an out-of-range input.

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

6 years agoDisable a test using environment variables that requires a real shell
David Blaikie [Tue, 3 Apr 2018 18:19:52 +0000 (18:19 +0000)]
Disable a test using environment variables that requires a real shell

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

6 years ago[CodeGen]Add NoVRegs property on PostRASink and ShrinkWrap
Jun Bum Lim [Tue, 3 Apr 2018 18:17:34 +0000 (18:17 +0000)]
[CodeGen]Add NoVRegs property on PostRASink and ShrinkWrap

Summary:
This change declare that PostRAMachineSinking and ShrinkWrap require NoVRegs
property, so now the MachineFunctionPass can enforce this check.
These passes are disabled in NVPTX & WebAssembly.

Reviewers: dschuff, jlebar, tra, jgravelle-google, MatzeB, sebpop, thegameg, mcrosier

Reviewed By: dschuff, thegameg

Subscribers: jholewinski, jfb, sbc100, aheejin, sunfish, llvm-commits

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

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

6 years ago[dsymutil] Apply recursion workaround for threading
Jonas Devlieghere [Tue, 3 Apr 2018 18:01:18 +0000 (18:01 +0000)]
[dsymutil] Apply recursion workaround for threading

The DwarfLinker can have some very deep recursion that can max out the
(significantly smaller) stack when using threads. We don't want this
limitation when we only have a single thread. We already have this
workaround for the architecture-related threading. This patch applies
the same workaround to the parallel analysis and cloning.

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

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

6 years ago[SLP] Fixed formatting, NFC.
Alexey Bataev [Tue, 3 Apr 2018 17:48:14 +0000 (17:48 +0000)]
[SLP] Fixed formatting, NFC.

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

6 years ago[DEBUGINFO] Add option that allows to disable emission of flags in .loc directives.
Alexey Bataev [Tue, 3 Apr 2018 17:28:55 +0000 (17:28 +0000)]
[DEBUGINFO] Add option that allows to disable emission of flags in .loc directives.

Summary:
Some targets do not support extended format of .loc directive and
support only simple format: .loc <FileID> <Line> <Column>. Patch adds
MCAsmInfo flag and option that allows emit .loc directive without
additional flags.

Reviewers: echristo

Subscribers: llvm-commits

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

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

6 years ago[InstCombine] Fold compare of int constant against a splatted vector of ints
Daniel Neilson [Tue, 3 Apr 2018 17:26:20 +0000 (17:26 +0000)]
[InstCombine] Fold compare of int constant against a splatted vector of ints

Summary:
Folding patterns like:
  %vec = shufflevector <4 x i8> %insvec, <4 x i8> undef, <4 x i32> zeroinitializer
  %cast = bitcast <4 x i8> %vec to i32
  %cond = icmp eq i32 %cast, 0
into:
  %ext = extractelement <4 x i8> %insvec, i32 0
  %cond = icmp eq i32 %ext, 0

Combined with existing rules, this allows us to fold patterns like:
  %insvec = insertelement <4 x i8> undef, i8 %val, i32 0
  %vec = shufflevector <4 x i8> %insvec, <4 x i8> undef, <4 x i32> zeroinitializer
  %cast = bitcast <4 x i8> %vec to i32
  %cond = icmp eq i32 %cast, 0
into:
  %cond = icmp eq i8 %val, 0

When we construct a splat vector via a shuffle, and bitcast the vector into an integer type for comparison against an integer constant. Then we can simplify the the comparison to compare the splatted value against the integer constant.

Reviewers: spatel, anna, mkazantsev

Reviewed By: spatel

Subscribers: efriedma, rengolin, llvm-commits

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

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

6 years ago[SLP] Fix PR36481: vectorize reassociated instructions.
Alexey Bataev [Tue, 3 Apr 2018 17:14:47 +0000 (17:14 +0000)]
[SLP] Fix PR36481: vectorize reassociated instructions.

Summary:
If the load/extractelement/extractvalue instructions are not originally
consecutive, the SLP vectorizer is unable to vectorize them. Patch
allows reordering of such instructions.

Patch does not support reordering of the repeated instruction, this must
be handled in the separate patch.

Reviewers: RKSimon, spatel, hfinkel, mkuper, Ayal, ashahid

Subscribers: llvm-commits

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

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

6 years agoRemove a stale comment cut and pasted from another file.
Eric Christopher [Tue, 3 Apr 2018 17:07:05 +0000 (17:07 +0000)]
Remove a stale comment cut and pasted from another file.

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

6 years ago[llvm-mca] Move the logic that prints register file statistics to its own view. NFCI
Andrea Di Biagio [Tue, 3 Apr 2018 16:46:23 +0000 (16:46 +0000)]
[llvm-mca] Move the logic that prints register file statistics to its own view. NFCI

Before this patch, the "BackendStatistics" view was responsible for printing the
register file usage (as well as many other statistics).

Now users can enable register file usage statistics using the command line flag
`-register-file-stats`. By default, the tool doesn't print register file
statistics.

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

6 years agoRecommit "[SLP] Fix issues with debug output in the SLP vectorizer."
Alexey Bataev [Tue, 3 Apr 2018 16:40:33 +0000 (16:40 +0000)]
Recommit "[SLP] Fix issues with debug output in the SLP vectorizer."

The primary issue here is that using NDEBUG alone isn't enough to guard
debug printing -- instead the DEBUG() macro needs to be used so that the
specific pass debug logging check is employed. Without this, every
asserts-enabled build was printing out information when it hit this.

I also fixed another place where we had multiple statements in a DEBUG
macro to use {}s to be a bit cleaner. And I fixed a place that used
errs() rather than dbgs().

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

6 years ago[LoopInterchange] Update tests so DA can handle access after D35430.
Florian Hahn [Tue, 3 Apr 2018 16:37:58 +0000 (16:37 +0000)]
[LoopInterchange] Update tests so DA can handle access after D35430.

I have taken the opportunity to simplify some tests slightly and move
parts around.

It also brings back a few IR checks for interchangable loops.

Reviewers: karthikthecool, sebpop, grosser

Reviewed By: sebpop

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

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

6 years ago[SLP] Added tests for checks of reordering of the repeated instructions,
Alexey Bataev [Tue, 3 Apr 2018 16:31:26 +0000 (16:31 +0000)]
[SLP] Added tests for checks of reordering of the repeated instructions,
NFC.

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

6 years ago[Hexagon] Remove -mhvx-double and the corresponding subtarget feature
Krzysztof Parzyszek [Tue, 3 Apr 2018 16:06:36 +0000 (16:06 +0000)]
[Hexagon] Remove -mhvx-double and the corresponding subtarget feature

Specifying the HVX vector length should be done via the -mhvx-length
option.

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

6 years ago[Hexagon] Remove unneeded attributes from lit test
Krzysztof Parzyszek [Tue, 3 Apr 2018 16:05:20 +0000 (16:05 +0000)]
[Hexagon] Remove unneeded attributes from lit test

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

6 years agoAdding optional Name parameter to createVirtualRegister and createGenericVirtualRegister.
Puyan Lotfi [Tue, 3 Apr 2018 15:53:49 +0000 (15:53 +0000)]
Adding optional Name parameter to createVirtualRegister and createGenericVirtualRegister.

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

6 years ago[llvm-mca] Remove redundant include from BackendStatistics.h. NFC
Andrea Di Biagio [Tue, 3 Apr 2018 15:36:15 +0000 (15:36 +0000)]
[llvm-mca] Remove redundant include from BackendStatistics.h. NFC

Also use llvm::DenseMap for Histograms (instead of std::map).

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

6 years agoRevert "[SLP] Fix PR36481: vectorize reassociated instructions."
Benjamin Kramer [Tue, 3 Apr 2018 14:40:33 +0000 (14:40 +0000)]
Revert "[SLP] Fix PR36481: vectorize reassociated instructions."

This reverts commit r328980 and r329046. Makes the vectorizer crash.

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

6 years ago[MC] Fix -Wmissing-field-initializer warning after r329067.
Andrea Di Biagio [Tue, 3 Apr 2018 13:52:26 +0000 (13:52 +0000)]
[MC] Fix -Wmissing-field-initializer warning after r329067.

This should fix the problem reported by the lld buildbots:
 - Builder lld-x86_64-darwin13, Build #19782
 - Builder lld-perf-testsuite, Build #1419

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

6 years ago[MC][Tablegen] Allow the definition of processor register files in the scheduling...
Andrea Di Biagio [Tue, 3 Apr 2018 13:36:24 +0000 (13:36 +0000)]
[MC][Tablegen] Allow the definition of processor register files in the scheduling model for llvm-mca

This patch allows the description of register files in processor scheduling
models. This addresses PR36662.

A new tablegen class named 'RegisterFile' has been added to TargetSchedule.td.
Targets can optionally describe register files for their processors using that
class. In particular, class RegisterFile allows to specify:
 - The total number of physical registers.
 - Which target registers are accessible through the register file.
 - The cost of allocating a register at register renaming stage.

Example (from this patch - see file X86/X86ScheduleBtVer2.td)

  def FpuPRF : RegisterFile<72, [VR64, VR128, VR256], [1, 1, 2]>

Here, FpuPRF describes a register file for MMX/XMM/YMM registers. On Jaguar
(btver2), a YMM register definition consumes 2 physical registers, while MMX/XMM
register definitions only cost 1 physical register.

The syntax allows to specify an empty set of register classes.  An empty set of
register classes means: this register file models all the registers specified by
the Target.  For each register class, users can specify an optional register
cost. By default, register costs default to 1.  A value of 0 for the number of
physical registers means: "this register file has an unbounded number of
physical registers".

This patch is structured in two parts.

* Part 1 - MC/Tablegen *

A first part adds the tablegen definition of RegisterFile, and teaches the
SubtargetEmitter how to emit information related to register files.

Information about register files is accessible through an instance of
MCExtraProcessorInfo.
The idea behind this design is to logically partition the processor description
which is only used by external tools (like llvm-mca) from the processor
information used by the llvm machine schedulers.
I think that this design would make easier for targets to get rid of the extra
processor information if they don't want it.

* Part 2 - llvm-mca related *

The second part of this patch is related to changes to llvm-mca.

The main differences are:
 1) class RegisterFile now needs to take into account the "cost of a register"
when allocating physical registers at register renaming stage.
 2) Point 1. triggered a minor refactoring which lef to the removal of the
"maximum 32 register files" restriction.
 3) The BackendStatistics view has been updated so that we can print out extra
details related to each register file implemented by the processor.

The effect of point 3. is also visible in tests register-files-[1..5].s.

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

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

6 years ago[LangRef] fix description and examples of fptrunc
Sanjay Patel [Tue, 3 Apr 2018 13:05:20 +0000 (13:05 +0000)]
[LangRef] fix description and examples of fptrunc

As noted in PR36966:
https://bugs.llvm.org/show_bug.cgi?id=36966

The old description doesn't match what we do in code,
so this just fixes the documentation to avoid confusion.

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

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

6 years ago[PowerPC] reorder entries in P9InstrResources.td in alphabetical order; NFC
Hiroshi Inoue [Tue, 3 Apr 2018 12:49:42 +0000 (12:49 +0000)]
[PowerPC] reorder entries in P9InstrResources.td in alphabetical order; NFC

Reorder entries added in my previous commit (rL328969) to keep alphabetical order.

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

6 years ago[x86] Fix a pretty obvious think-o with my asm scrubbing. You have to in
Chandler Carruth [Tue, 3 Apr 2018 10:28:56 +0000 (10:28 +0000)]
[x86] Fix a pretty obvious think-o with my asm scrubbing. You have to in
fact use regular expression syntax to use regular expressions.

Should restore the bots. Sorry for the noise on this test.

Thanks to Philip for spotting the bug!

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

6 years ago[x86] Clean up and enhance a test around eflags copying.
Chandler Carruth [Tue, 3 Apr 2018 10:04:37 +0000 (10:04 +0000)]
[x86] Clean up and enhance a test around eflags copying.

This adds the basic test cases from all the EFLAGS bugs in more direct
forms. It also switches to generated check lines, and includes both
32-bit and 64-bit variations.

No functionality changing here, just setting things up to have a nice
clean asm diff in my EFLAGS patch.

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

6 years ago[x86] Extend my goofy SP offset scrubbing for llc test cases to actually
Chandler Carruth [Tue, 3 Apr 2018 09:57:05 +0000 (09:57 +0000)]
[x86] Extend my goofy SP offset scrubbing for llc test cases to actually
do explicit scrubbing of the offsets of stack spills and reloads.

You can always turn this off in order to test specific stack slot usage.
We were already hiding most of this, but the new logic hides it more
generically. Notably, we should effectively hide stack slot churn in
functions that have a frame pointer now, and should also hide it when
changing a function from stack pointer to frame pointer. That transition
already changes enough to be clearly noticed in the test case diff,
showing *every* spill and reload is really noisy without benefit. See
the test case I ran this on as a classic example.

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

6 years agoMSan: introduce the conservative assembly handling mode.
Alexander Potapenko [Tue, 3 Apr 2018 09:50:06 +0000 (09:50 +0000)]
MSan: introduce the conservative assembly handling mode.

The default assembly handling mode may introduce false positives in the
cases when MSan doesn't understand that the assembly call initializes
the memory pointed to by one of its arguments.

We introduce the conservative mode, which initializes the first
|sizeof(type)| bytes for every |type*| pointer passed into the
assembly statement.

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

6 years ago[SCEV] Fix PR36974.
Serguei Katkov [Tue, 3 Apr 2018 07:29:00 +0000 (07:29 +0000)]
[SCEV] Fix PR36974.

The patch changes the usage of dominate to properlyDominate
to satisfy the condition !(a < a) while using std::max.

It is actually NFC due to set data structure is used to keep
the Loops and no two identical loops can be in collection.
So in reality there is no difference between usage of
dominate and properlyDominate in this particular case.
However it might be changed so it is better to fix it.

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

6 years agoAdd a wrapper around llvm-objdump to look for indirect calls/jmps in x86 assembly.
Eric Christopher [Tue, 3 Apr 2018 07:01:33 +0000 (07:01 +0000)]
Add a wrapper around llvm-objdump to look for indirect calls/jmps in x86 assembly.

Useful when looking for indirect calls/jmps the need mitigation
via retpoline or other mitigations for Spectre v2.

Feedback, extension, additional patches welcome.

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

6 years ago[X86] Reduce number of OpPrefix bits in TSFlags to 2. NFCI
Craig Topper [Tue, 3 Apr 2018 06:37:04 +0000 (06:37 +0000)]
[X86] Reduce number of OpPrefix bits in TSFlags to 2. NFCI

TSFlag doesn't need to disambiguate NoPrfx from PS. So shift the encodings so PS is NoPrfx|0x4.

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

6 years ago[X86][TableGen] Add a missing error check to make sure EVEX instructions use one...
Craig Topper [Tue, 3 Apr 2018 06:37:01 +0000 (06:37 +0000)]
[X86][TableGen] Add a missing error check to make sure EVEX instructions use one PS/PD/XS/XD prefixes.

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

6 years ago[SCEV] Make computeExitLimit more simple and more powerful
Max Kazantsev [Tue, 3 Apr 2018 05:57:19 +0000 (05:57 +0000)]
[SCEV] Make computeExitLimit more simple and more powerful

Current implementation of `computeExitLimit` has a big piece of code
the only purpose of which is to prove that after the execution of this
block the latch will be executed. What it currently checks is actually a
subset of situations where the exiting block dominates latch.

This patch replaces all these checks for simple particular cases with
domination check over loop's latch which is the only necessary condition
of taking the exiting block into consideration. This change allows to
calculate exact loop taken count for simple loops like

  for (int i = 0; i < 100; i++) {
    if (cond) {...} else {...}
    if (i > 50) break;
    . . .
  }

Differential Revision: https://reviews.llvm.org/D44677
Reviewed By: efriedma

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

6 years ago[SLP] Fix issues with debug output in the SLP vectorizer.
Chandler Carruth [Tue, 3 Apr 2018 05:27:28 +0000 (05:27 +0000)]
[SLP] Fix issues with debug output in the SLP vectorizer.

The primary issue here is that using NDEBUG alone isn't enough to guard
debug printing -- instead the DEBUG() macro needs to be used so that the
specific pass debug logging check is employed. Without this, every
asserts-enabled build was printing out information when it hit this.

I also fixed another place where we had multiple statements in a DEBUG
macro to use {}s to be a bit cleaner. And I fixed a place that used
`errs()` rather than `dbgs()`.

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

6 years ago[TableGen] Use llvm::cast instead of static_cast so that the cast will be checked...
Craig Topper [Tue, 3 Apr 2018 05:10:12 +0000 (05:10 +0000)]
[TableGen] Use llvm::cast instead of static_cast so that the cast will be checked. NFC

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

6 years agobpf: fix incorrect SELECT_CC lowering
Yonghong Song [Tue, 3 Apr 2018 03:56:37 +0000 (03:56 +0000)]
bpf: fix incorrect SELECT_CC lowering

Commit 37962a331c77 ("bpf: Improve expanding logic in LowerSELECT_CC")
intended to improve code quality for certain jmp conditions. The
commit, however, has a couple of issues:
  (1). In code, just swap is not enough, ConditionalCode CC
       should also be swapped, otherwise incorrect code will
       be generated.
  (2). The ConditionalCode swap should be subject to
       getHasJmpExt(). If getHasJmpExt() is False, certain
       conditional codes will not be supported and swap
       may generate incorrect code.

The original goal for this patch is to optimize jmp operations
which does not have JmpExt turned on. If JmpExt is on,
better code could be generated. For example, the test
select_ri.ll is introduced to demonstrate the optimization.
The same result can be achieved with -mcpu=v2 flag.

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329043 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agopeel loops with runtime small trip counts
Ikhlas Ajbar [Tue, 3 Apr 2018 03:39:43 +0000 (03:39 +0000)]
peel loops with runtime small trip counts

For Hexagon, peeling loops with small runtime trip count is beneficial for our
benchmarks. We set PeelCount in HexagonTargetInfo.cpp and we use PeelCount set
by the target for computing the desired peel count.

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

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

6 years agoRemove utils/makellvm; it doesn't look like it works with cmake builds.
Nico Weber [Tue, 3 Apr 2018 02:37:49 +0000 (02:37 +0000)]
Remove utils/makellvm; it doesn't look like it works with cmake builds.

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

6 years ago[x86] Tidy up test case, generate check lines with script. NFC.
Chandler Carruth [Tue, 3 Apr 2018 02:19:05 +0000 (02:19 +0000)]
[x86] Tidy up test case, generate check lines with script. NFC.

Just adds basic block labels and tidies up where comments go in the test
case and then generates fresh CHECK lines with the script. This way, the
check lines are much easier to maintain. They were already close to this
but not quite there.

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

6 years ago[lit] Prefer opening files with open (Python 2) rather than io.open which requires io.
Aaron Smith [Tue, 3 Apr 2018 00:22:12 +0000 (00:22 +0000)]
[lit] Prefer opening files with open (Python 2) rather than io.open which requires io.

Only rely on Python 3 (io.open) when necessary. This puts TestRunnyer.py closer to how it behaved
before the changes introduced in D43165 and silences a few Windows build bot failures.

Thanks to Stella Stamenova for the patch!

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

6 years ago[SLP] Distinguish "demanded and shrinkable" from "demanded and not shrinkable" values...
Haicheng Wu [Tue, 3 Apr 2018 00:05:10 +0000 (00:05 +0000)]
[SLP] Distinguish "demanded and shrinkable" from "demanded and not shrinkable" values when determining the minimum bitwidth

We use two approaches for determining the minimum bitwidth.

   * Demanded bits
   * Value tracking

If demanded bits doesn't result in a narrower type, we then try value tracking.
We need this if we want to root SLP trees with the indices of getelementptr
instructions since all the bits of the indices are demanded.

But there is a missing piece though. We need to be able to distinguish "demanded
and shrinkable" from "demanded and not shrinkable". For example, the bits of %i
in

%i = sext i32 %e1 to i64
%gep = getelementptr inbounds i64, i64* %p, i64 %i

are demanded, but we can shrink %i's type to i32 because it won't change the
result of the getelementptr. On the other hand, in

%tmp15 = sext i32 %tmp14 to i64
%tmp16 = insertvalue { i64, i64 } undef, i64 %tmp15, 0

it doesn't make sense to shrink %tmp15 and we can skip the value tracking.

Ideas are from Matthew Simpson!

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

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

6 years ago[Coroutines] Avoid assert splitting hidden coros
Brian Gesiak [Mon, 2 Apr 2018 23:39:40 +0000 (23:39 +0000)]
[Coroutines] Avoid assert splitting hidden coros

Summary:
When attempting to split a coroutine with 'hidden' visibility (for
example, a C++ coroutine that is inlined when compiled with the option
'-fvisibility-inlines-hidden'), LLVM would hit an assertion in
include/llvm/IR/GlobalValue.h:240: "local linkage requires default
visibility". The issue is that the visibility is copied from the source
of the function split in the `CloneFunctionInto` function, but the linkage
is not. To fix, create the new function first with external linkage,
then copy the linkage from the original function *after* `CloneFunctionInto`
is called.

Since `GlobalValue::setLinkage` in turn calls `maybeSetDsoLocal`, the
explicit call to `setDSOLocal` can be removed in CoroSplit.cpp.

Test Plan: check-llvm

Reviewers: GorNishanov, lewissbaker, EricWF, majnemer, rnk

Reviewed By: rnk

Subscribers: llvm-commits, eric_niebler

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

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

6 years agoAlign stubs for external and common global variables to pointer size.
Rafael Espindola [Mon, 2 Apr 2018 23:20:30 +0000 (23:20 +0000)]
Align stubs for external and common global variables to pointer size.

This patch fixes PR36885: clang++ generates unaligned stub symbol
holding a pointer.

Patch by Rahul Chaudhry!

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

6 years agoRemove llvm-mcmarkup.
Eric Christopher [Mon, 2 Apr 2018 23:17:55 +0000 (23:17 +0000)]
Remove llvm-mcmarkup.

It was never used and I've checked with the original authors.

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

6 years ago[InstCombine] Don't strip function type casts from musttail calls
Reid Kleckner [Mon, 2 Apr 2018 22:49:44 +0000 (22:49 +0000)]
[InstCombine] Don't strip function type casts from musttail calls

Summary:
The cast simplifications that instcombine does here do not make any
attempt to obey the verifier rules for musttail calls. Therefore we have
to disable them.

Reviewers: efriedma, majnemer, pcc

Subscribers: hiraditya, llvm-commits

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

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

6 years ago[lit] One more try at fixing TestRunner.py for D43165
Aaron Smith [Mon, 2 Apr 2018 22:34:35 +0000 (22:34 +0000)]
[lit] One more try at fixing TestRunner.py for D43165

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

6 years ago[lit] Attempt to fix builtin diff code for Python 2
Reid Kleckner [Mon, 2 Apr 2018 22:19:42 +0000 (22:19 +0000)]
[lit] Attempt to fix builtin diff code for Python 2

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

6 years ago[lit] Fix problem in how Python versions open files with different encodings
Aaron Smith [Mon, 2 Apr 2018 22:08:56 +0000 (22:08 +0000)]
[lit] Fix problem in how Python versions open files with different encodings

Reapply D43165 which was reverted because of different versions of python failing.
The one line fix for the different python versions was commited at the same time
that D43165 was reverted. If this change is giving you issues then get in touch
with your python version and we will fix it.

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

6 years agoFix Go IR test for changes in DIBuilder API
Harlan Haskins [Mon, 2 Apr 2018 21:45:35 +0000 (21:45 +0000)]
Fix Go IR test for changes in DIBuilder API

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

6 years ago[lit] Use io.open to compare two files since it supports different encodings while...
Aaron Smith [Mon, 2 Apr 2018 21:44:51 +0000 (21:44 +0000)]
[lit] Use io.open to compare two files since it supports different encodings while older versions of open do not

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

6 years ago[ORC] Add a debugging check to catch dangling references to SymbolStringPools.
Lang Hames [Mon, 2 Apr 2018 21:39:39 +0000 (21:39 +0000)]
[ORC] Add a debugging check to catch dangling references to SymbolStringPools.

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

6 years ago[ORC] Fix a think-o: ExecutionSession should create a SymbolStringPool if none
Lang Hames [Mon, 2 Apr 2018 21:34:48 +0000 (21:34 +0000)]
[ORC] Fix a think-o: ExecutionSession should create a SymbolStringPool if none
is passed in.

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

6 years agoRevert r329012 "[lit] Fix problem in how Python versions open files with different...
Reid Kleckner [Mon, 2 Apr 2018 21:33:46 +0000 (21:33 +0000)]
Revert r329012 "[lit] Fix problem in how Python versions open files with different encodings"

This doesn't work with Python 2. See this build-in-progress:
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/11105

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

6 years agoTreat inlining a notail call as a regular, non-tail call
Reid Kleckner [Mon, 2 Apr 2018 21:23:16 +0000 (21:23 +0000)]
Treat inlining a notail call as a regular, non-tail call

Otherwise, we end up inlining a musttail call into a non-tail position,
which breaks verifier invariants.

Fixes PR31014

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

6 years ago[ORC] Create a new SymbolStringPool by default in ExecutionSession constructor.
Lang Hames [Mon, 2 Apr 2018 20:57:56 +0000 (20:57 +0000)]
[ORC] Create a new SymbolStringPool by default in ExecutionSession constructor.

This makes the common case of constructing an ExecutionSession tidier.

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

6 years ago[lit] Fix problem in how Python versions open files with different encodings
Aaron Smith [Mon, 2 Apr 2018 20:57:06 +0000 (20:57 +0000)]
[lit] Fix problem in how Python versions open files with different encodings

Summary:
This issue was found when running the clang unit test on Windows. Python 3.x cannot open some of the files that the tests are using with a simple open because of their encoding. Python 2.7+ and Python 3.x both support io.open which allows for an encoding to be specified.

This change will determine whether two files being compared should be opened (and then compared) as text or binary and whether to use utf-8 or the default encoding before proceeding with a line-by-line comparison.

Patch by Stella Stamenova!

Reviewers: zturner, llvm-commits, rnk, MaggieYi

Reviewed By: zturner

Subscribers: asmith, MatzeB, stella.stamenova, delcypher, llvm-commits

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

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

6 years ago[InstCombine] add folds for icmp + sub (PR36969)
Sanjay Patel [Mon, 2 Apr 2018 20:37:40 +0000 (20:37 +0000)]
[InstCombine] add folds for icmp + sub (PR36969)

(A - B) >u A --> A <u B
C <u (C - D) --> C <u D

https://rise4fun.com/Alive/e7j

Name: ugt
  %sub = sub i8 %x, %y
  %cmp = icmp ugt i8 %sub, %x
=>
  %cmp = icmp ult i8 %x, %y

Name: ult
  %sub = sub i8 %x, %y
  %cmp = icmp ult i8 %x, %sub
=>
  %cmp = icmp ult i8 %x, %y

This should fix:
https://bugs.llvm.org/show_bug.cgi?id=36969

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

6 years ago[InstCombine] add tests for icmp (sub x, y), x (PR36969); NFC
Sanjay Patel [Mon, 2 Apr 2018 20:23:54 +0000 (20:23 +0000)]
[InstCombine] add tests for icmp (sub x, y), x (PR36969); NFC

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

6 years agoAnother attempt to fix papertrail-warnings.test on Windows bots by making expected...
Douglas Yung [Mon, 2 Apr 2018 20:05:05 +0000 (20:05 +0000)]
Another attempt to fix papertrail-warnings.test on Windows bots by making expected message less case sensitive.

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

6 years agoFix header mismatch in DIBuilder Type APIs
Harlan Haskins [Mon, 2 Apr 2018 19:11:44 +0000 (19:11 +0000)]
Fix header mismatch in DIBuilder Type APIs

Some of the headers changed slightly, and the accompanying
implementation didn't change. This caused a silent failure.

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

6 years ago[llvm-pdbutil] Add an export subcommand.
Zachary Turner [Mon, 2 Apr 2018 18:35:21 +0000 (18:35 +0000)]
[llvm-pdbutil] Add an export subcommand.

This command can dump the binary contents of a stream to a file.
This is useful when you want to do side-by-side comparisons of
a specific stream from two PDBs to examine the differences between
them.  You can export both of them to a file, then open them up
side by side in a hex editor (for example), so as to eliminate any
differences that might arise from the contents being on different
blocks in the PDB.

In subsequent patches I plan to improve the "explain" subcommand
so that you can explain the contents of a binary file that isn't
necessarily a full PDB, but one of these dumped streams, by telling
the subcommand how to interpret the contents.

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

6 years agoRemove unused PACKAGE_TARNAME; looks like a remnant of the old autoconf build.
Nico Weber [Mon, 2 Apr 2018 18:13:05 +0000 (18:13 +0000)]
Remove unused PACKAGE_TARNAME; looks like a remnant of the old autoconf build.

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

6 years agoRemove some unused cmake standard library includes.
Nico Weber [Mon, 2 Apr 2018 17:52:19 +0000 (17:52 +0000)]
Remove some unused cmake standard library includes.

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

6 years agoRemove more feature test macros that became unused after r328989.
Nico Weber [Mon, 2 Apr 2018 17:45:47 +0000 (17:45 +0000)]
Remove more feature test macros that became unused after r328989.

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

6 years agoRemove HAVE_LIBPSAPI, HAVE_SHELL32.
Nico Weber [Mon, 2 Apr 2018 17:32:48 +0000 (17:32 +0000)]
Remove HAVE_LIBPSAPI, HAVE_SHELL32.

These used to be set in the old autoconf build, but the cmake build has had a
"TODO: actually check for these" comment since it was checked in, and they
were set to 1 on mingw unconditionally.  It seems safe to say that they always
exist under mingw, so just remove them and assume they're set exactly when on
mingw (with msvc, we use `pragma comment` instead of linking these via flags).

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

6 years ago[DeadArgumentElim] Clone function level metadatas
Rong Xu [Mon, 2 Apr 2018 17:27:38 +0000 (17:27 +0000)]
[DeadArgumentElim] Clone function level metadatas

Some Function level metadatas, such as function entry count, are not cloned in
DeadArgumentElim. This happens a lot in lto/thinlto because of DeadArgumentElim
after internalization.

This patch clones the metadatas in the original function to the new function.

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

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

6 years agoRemove HAVE_DIRENT_H.
Nico Weber [Mon, 2 Apr 2018 17:17:29 +0000 (17:17 +0000)]
Remove HAVE_DIRENT_H.

The autoconf manual: "This macro is obsolescent, as all current systems with
directory libraries have <dirent.h>. New programs need not use this macro."

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

6 years ago[AMDGPU][MC][GFX9] Added instructions v_cvt_norm_*16_f16, v_sat_pk_u8_i16
Dmitry Preobrazhensky [Mon, 2 Apr 2018 17:09:20 +0000 (17:09 +0000)]
[AMDGPU][MC][GFX9] Added instructions v_cvt_norm_*16_f16, v_sat_pk_u8_i16

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

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

Reviewers: artem.tamazov, arsenm, timcorringham

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

6 years ago[coroutines] Add support for llvm.coro.noop intrinsics
Gor Nishanov [Mon, 2 Apr 2018 16:55:12 +0000 (16:55 +0000)]
[coroutines] Add support for llvm.coro.noop intrinsics

Summary:
A recent addition to Coroutines TS (https://wg21.link/p0913) adds a pre-defined coroutine noop_coroutine that does nothing.
To implement this feature, we implemented an llvm.coro.noop intrinsic that returns a coroutine handle to a coroutine that does nothing when resumed or destroyed.

Reviewers: EricWF, modocache, rnk, lewissbaker

Reviewed By: modocache

Subscribers: llvm-commits

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

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

6 years ago[AMDGPU][MC][GFX9] Added s_atomic_* and s_buffer_atomic_* instructions
Dmitry Preobrazhensky [Mon, 2 Apr 2018 16:10:25 +0000 (16:10 +0000)]
[AMDGPU][MC][GFX9] Added s_atomic_* and s_buffer_atomic_* instructions

Fixed a bug which caused Tablegen crash.

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

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

Reviewers: artem.tamazov, arsenm, timcorringham

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

6 years ago[Hexagon] Clean up some code in HexagonAsmPrinter, NFC
Krzysztof Parzyszek [Mon, 2 Apr 2018 15:06:55 +0000 (15:06 +0000)]
[Hexagon] Clean up some code in HexagonAsmPrinter, NFC

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

6 years ago[SLP] Fix PR36481: vectorize reassociated instructions.
Alexey Bataev [Mon, 2 Apr 2018 14:51:37 +0000 (14:51 +0000)]
[SLP] Fix PR36481: vectorize reassociated instructions.

Summary:
If the load/extractelement/extractvalue instructions are not originally
consecutive, the SLP vectorizer is unable to vectorize them. Patch
allows reordering of such instructions.

Reviewers: RKSimon, spatel, hfinkel, mkuper, Ayal, ashahid

Subscribers: llvm-commits

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

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

6 years agoRemove stro(u?)ll() config checks. Those were needed pre-MSVC2013, but we require...
Nico Weber [Mon, 2 Apr 2018 14:36:34 +0000 (14:36 +0000)]
Remove stro(u?)ll() config checks. Those were needed pre-MSVC2013, but we require 2015 nowadays.

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