]> granicus.if.org Git - llvm/log
llvm
6 years ago[AArch64][Outliner] Don't outline BTI instructions
Oliver Stannard [Tue, 5 Feb 2019 17:21:57 +0000 (17:21 +0000)]
[AArch64][Outliner] Don't outline BTI instructions

We can't outline BTI instructions, because they need to be the very first
instruction executed after an indirect call or branch. If we outline them, then
an indirect call might go to the branch to the outlined function, which will
fault.

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

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

6 years ago[X86][AVX] Attempt to combine shuffles to subvector broadcast load
Simon Pilgrim [Tue, 5 Feb 2019 17:02:49 +0000 (17:02 +0000)]
[X86][AVX] Attempt to combine shuffles to subvector broadcast load

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

6 years agoAArch64/GlobalISel: Don't clamp from 2 to 2
Matt Arsenault [Tue, 5 Feb 2019 16:57:18 +0000 (16:57 +0000)]
AArch64/GlobalISel: Don't clamp from 2 to 2

This is equivalent to clampMaxNumElements, but saves a check.

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

6 years ago[WebAssembly] Object: Remove redundant method. NFC.
Sam Clegg [Tue, 5 Feb 2019 16:30:21 +0000 (16:30 +0000)]
[WebAssembly] Object: Remove redundant method. NFC.

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

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

6 years ago[X86][AVX] Add PR34041 subvector broadcast test cases
Simon Pilgrim [Tue, 5 Feb 2019 16:18:30 +0000 (16:18 +0000)]
[X86][AVX] Add PR34041 subvector broadcast test cases

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

6 years ago[CGP] add test for unsigned subtract of 1 with overflow; NFC
Sanjay Patel [Tue, 5 Feb 2019 15:27:40 +0000 (15:27 +0000)]
[CGP] add test for unsigned subtract of 1 with overflow; NFC

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

6 years ago[AArch64][x86] add tests for unsigned subtract with overflow; NFC
Sanjay Patel [Tue, 5 Feb 2019 15:26:42 +0000 (15:26 +0000)]
[AArch64][x86] add tests for unsigned subtract with overflow; NFC

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

6 years agogn build: BUILD.gn files for clang-tidy and clang-apply-replacements
Nico Weber [Tue, 5 Feb 2019 15:14:38 +0000 (15:14 +0000)]
gn build: BUILD.gn files for clang-tidy and clang-apply-replacements

Patch from Mirko Bonadei <mbonadei@webrtc.org>!

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

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

6 years agoFix typo in comment, NFCI
Krasimir Georgiev [Tue, 5 Feb 2019 15:00:56 +0000 (15:00 +0000)]
Fix typo in comment, NFCI

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

6 years agogn build: Merge r353072
Nico Weber [Tue, 5 Feb 2019 14:47:36 +0000 (14:47 +0000)]
gn build: Merge r353072

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

6 years agoRecommit: Detect incorrect FileCheck variable CLI definition
Thomas Preud'homme [Tue, 5 Feb 2019 14:17:28 +0000 (14:17 +0000)]
Recommit: Detect incorrect FileCheck variable CLI definition

Summary:
While the backend code of FileCheck relies on definition of variable
from the command-line to have an equal sign '=' and a variable name
before that, the frontend does not actually enforce it. This leads to
FileCheck crashing when invoked with invalid syntax for the -D option.

This patch adds the missing validation in the frontend. It also makes
the -D option an AlwaysPrefix option to be able to detect -D=FOO as
being a define without variable and -D as missing its value.

Copyright:
- Linaro (changes in version 2 of revision D55940)
- GraphCore (changes in later versions)

Reviewers: jdenny

Subscribers: JonChesterfield, hiraditya, kristina, probinson,
llvm-commits

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

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

6 years agoRecommit: Add support for prefix-only CLI options
Thomas Preud'homme [Tue, 5 Feb 2019 14:17:16 +0000 (14:17 +0000)]
Recommit: Add support for prefix-only CLI options

Summary:
Add support for options that always prefix their value, giving an error
if the value is in the next argument or if the option is given a value
assignment (ie. opt=val). This is the desired behavior for the -D option
of FileCheck for instance.

Copyright:
- Linaro (changes in version 2 of revision D55940)
- GraphCore (changes in later versions and introduced when creating
  D56549)

Reviewers: jdenny

Subscribers: llvm-commits, probinson, kristina, hiraditya,
JonChesterfield

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

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

6 years ago[X86][SSE] Rename SimplifyDemandedVectorElts BLENDV tests
Simon Pilgrim [Tue, 5 Feb 2019 14:11:50 +0000 (14:11 +0000)]
[X86][SSE] Rename SimplifyDemandedVectorElts BLENDV tests

I'm going to be adding SimplifyDemandedBits tests shortly.

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

6 years ago[MCA] Moved the logic that updates register dependencies from DispatchStage to Regist...
Andrea Di Biagio [Tue, 5 Feb 2019 14:11:41 +0000 (14:11 +0000)]
[MCA] Moved the logic that updates register dependencies from DispatchStage to RegisterFile. NFC

DispatchStage should always delegate to an object of class RegisterFile the task
of updating data dependencies.  ReadState and WriteState objects should not be
modified directly by DispatchStage.
This patch also renames stage IS_AVAILABLE to IS_DISPATCHED.

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

6 years agogn build: Fix Python 3 write_vcsrevision script compatibility
Serge Guelton [Tue, 5 Feb 2019 13:01:12 +0000 (13:01 +0000)]
gn build: Fix Python 3 write_vcsrevision script compatibility

Trivial fix: decode was not called for all subprocess.check_output calls.

Commited on behalf of Andrew Boyarshin

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

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

6 years ago[X86][SSE] Add SimplifyDemandedVectorElts support for X86ISD::BLENDV
Simon Pilgrim [Tue, 5 Feb 2019 12:27:29 +0000 (12:27 +0000)]
[X86][SSE] Add SimplifyDemandedVectorElts support for X86ISD::BLENDV

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

6 years ago[X86][SSE] Add tests showing missing SimplifyDemandedVectorElts support for X86ISD...
Simon Pilgrim [Tue, 5 Feb 2019 12:18:34 +0000 (12:18 +0000)]
[X86][SSE] Add tests showing missing SimplifyDemandedVectorElts support for X86ISD::BLENDV

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

6 years ago[MCA] Simplify the logic in method WriteState::addUser. NFCI
Andrea Di Biagio [Tue, 5 Feb 2019 11:36:55 +0000 (11:36 +0000)]
[MCA] Simplify the logic in method WriteState::addUser. NFCI

In some cases, it is faster to just grow the set of 'Users' rather than
performing a llvm::find_if every time a new user is added to
the set. No functional change intended.

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

6 years ago[DebugInfo][NFCI] Split salvageDebugInfo into helper functions
Jeremy Morse [Tue, 5 Feb 2019 11:11:28 +0000 (11:11 +0000)]
[DebugInfo][NFCI] Split salvageDebugInfo into helper functions

Some use cases are appearing where salvaging is needed that does not
correspond to an instruction being deleted -- for example an instruction
being sunk, or a Value not being available in a block being isel'd.

Enable more fine grained control over how salavging occurs by splitting
the logic into helper functions, separating things that are specific to
working on DbgVariableIntrinsics from those specific to interpreting IR
and building DIExpressions.

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

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

6 years agoFix format string in bindings/go/llvm/ir_test.go (PR40561)
Hans Wennborg [Tue, 5 Feb 2019 11:01:54 +0000 (11:01 +0000)]
Fix format string in bindings/go/llvm/ir_test.go (PR40561)

The test started failing for me recently. I don't see any changes around
this code, so maybe it's my local go version that changed or something.

The error seems real to me: we're trying to print an Attribute with %d.
The test talks about "attribute masks" I'm not sure what that refers to,
but I suppose we could print the raw pointer value, since that's
what the test seems to be comparing.

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

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

6 years ago[X86][AVX] Attempt to share broadcasts of different widths (PR39454)
Simon Pilgrim [Tue, 5 Feb 2019 10:58:43 +0000 (10:58 +0000)]
[X86][AVX] Attempt to share broadcasts of different widths (PR39454)

If we have broadcasts of different vector widths, keep the longest vector width and extract subvectors for the shorter vectors (which should be free).

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

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

6 years ago[CostModel][X86] Add UMUL fixed point cost tests
Simon Pilgrim [Tue, 5 Feb 2019 10:55:38 +0000 (10:55 +0000)]
[CostModel][X86] Add UMUL fixed point cost tests

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

6 years ago[CGP] Add support for sinking operands to their users, if they are free.
Florian Hahn [Tue, 5 Feb 2019 10:27:40 +0000 (10:27 +0000)]
[CGP] Add support for sinking operands to their users, if they are free.

This patch improves code generation for some AArch64 ACLE intrinsics. It adds
support to CGP to duplicate and sink operands to their user, if they can be
folded into a target instruction, like zexts and sub into usubl. It adds a
TargetLowering hook shouldSinkOperands, which looks at the operands of
instructions to see if sinking is profitable.

I decided to add a new target hook, as for the sinking to be profitable,
at least on AArch64, we have to look at multiple operands of an
instruction, instead of looking at the users of a zext for example.

The sinking is done in CGP, because it works around an instruction
selection limitation. If instruction selection is not limited to a
single basic block, this patch should not be needed any longer.

Alternatively this could be done in the LoopSink pass, which tries to
undo LICM for instructions in blocks that are not executed frequently.

Note that we do not force the operands to sink to have a single user,
because we duplicate them before sinking. Therefore this is only
desirable if they really can be done for free. Additionally we could
consider the impact on live ranges later on.

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

As for performance, we have internal code that uses intrinsics and can
be speed up by 10% by this change.

Reviewers: SjoerdMeijer, t.p.northover, samparker, efriedma, RKSimon, spatel

Reviewed By: samparker

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

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

6 years ago[ARM GlobalISel] Support G_GEP for Thumb2
Diana Picus [Tue, 5 Feb 2019 10:21:37 +0000 (10:21 +0000)]
[ARM GlobalISel] Support G_GEP for Thumb2

Same as ARM, but use a different opcode in the instruction selection.

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

6 years agoPreviously if the user configured their build but then changed
Dan Liew [Tue, 5 Feb 2019 08:47:28 +0000 (08:47 +0000)]
Previously if the user configured their build but then changed
LLVM_ENABLED_PROJECT and reconfigured it had no effect on what
projects were actually built. This was very confusing behaviour. The
reason for this is that the value of the `LLVM_TOOL_<PROJECT>_BUILD`
variables are already set.

The problem here is that we have two sources of truth:

* The projects listed in LLVM_ENABLE_PROJECTS.
* The projects enabled/disabled with LLVM_TOOL_<PROJECT>_BUILD.

At configure time we have no real way of knowing which source of truth
the user wants so we apply the following heuristic:

If the user ever sets `LLVM_ENABLE_PROJECTS` in the CMakeCache then that
is used as the single source of truth and we force the
`LLVM_TOOL_<PROJECT>_BUILD` CMake cache variables to have the
appropriate values that match the contents of the
`LLVM_ENABLE_PROJECTS`. If the user never sets `LLVM_ENABLE_PROJECTS`
then they can continue to use and set the `LLVM_TOOL_<PROJECT>_BUILD`
variables as the "source of truth".

The problem with this approach is that if the user ever tries to use
both `LLVM_ENABLE_PROJECTS` and `LLVM_TOOL_<PROJECT>_BUILD` for the same
build directory then any user set value for `LLVM_TOOL_<PROJECT>_BUILD`
variables will get overwriten, likely without the user noticing.

Hopefully the above shouldn't matter in practice because the
LLVM_TOOL_<PROJECT>_BUILD variables are not documented, but
LLVM_ENABLE_PROJECTS is.

We should probably deprecate the `LLVM_TOOL_<PROJECT>_BUILD`
variables at some point by turning them into to regular CMake
variables that don't live in the CMake cache.

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

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

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Tue, 5 Feb 2019 08:30:48 +0000 (08:30 +0000)]
[NFC] fix trivial typos in comments

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

6 years ago[DAG][NFC] Add unit tests.
Clement Courbet [Tue, 5 Feb 2019 08:00:17 +0000 (08:00 +0000)]
[DAG][NFC] Add unit tests.

In preparation for D57541.

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

6 years ago[DAG] BaseIndexOffset: FrameIndexSDNodes with the same FrameIndex compare equal.
Clement Courbet [Tue, 5 Feb 2019 07:36:20 +0000 (07:36 +0000)]
[DAG] BaseIndexOffset: FrameIndexSDNodes with the same FrameIndex compare equal.

Reviewers: niravd

Subscribers: arphaman, llvm-commits

Tags: #llvm

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

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

6 years ago[X86] Connect the default fpsr and dirflag clobbers in inline assembly to the registe...
Craig Topper [Tue, 5 Feb 2019 06:13:06 +0000 (06:13 +0000)]
[X86] Connect the default fpsr and dirflag clobbers in inline assembly to the registers we have defined for them.

Summary:
We don't currently map these constraints to physical register numbers so they don't make it to the MachineIR representation of inline assembly.

This could have problems for proper dependency tracking in the machine schedulers though I don't have a test case that shows that.

Reviewers: rnk

Reviewed By: rnk

Subscribers: eraman, llvm-commits

Tags: #llvm

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

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

6 years agogn build: Upgrade to NDK r19.
Peter Collingbourne [Tue, 5 Feb 2019 05:10:19 +0000 (05:10 +0000)]
gn build: Upgrade to NDK r19.

NDK r19 includes a sysroot that can be used directly by the compiler
without creating a standalone toolchain, so we just need a handful
of flags to point Clang there.

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

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

6 years ago[X86] Add test case from PR40529. NFC
Craig Topper [Tue, 5 Feb 2019 04:48:23 +0000 (04:48 +0000)]
[X86] Add test case from PR40529. NFC

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

6 years ago[LSR] Check SCEV on isZero() after extend. PR40514
Max Kazantsev [Tue, 5 Feb 2019 04:30:37 +0000 (04:30 +0000)]
[LSR] Check SCEV on isZero() after extend. PR40514

When LSR first adds SCEVs to BaseRegs, it only does it if `isZero()` has
returned false. In the end, in invocation of `InsertFormula`, it asserts that
all values there are still not zero constants. However between these two
points, it makes some transformations, in particular extends them to wider
type.

SCEV does not give us guarantee that if `S` is not a constant zero, then
`sext(S)` is also not a constant zero. It might have missed some optimizing
transforms when it was calculating `S` and then made them when it took `sext`.
For example, it may happen if previously optimizing transforms were limited
by depth or somehow else.

This patch adds a bailout when we may end up with a zero SCEV after extension.

Differential Revision: https://reviews.llvm.org/D57565
Reviewed By: samparker

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

6 years ago[SamplePGO] More pipeline changes when flattened profile used in ThinLTO postlink
Teresa Johnson [Tue, 5 Feb 2019 04:09:19 +0000 (04:09 +0000)]
[SamplePGO] More pipeline changes when flattened profile used in ThinLTO postlink

Summary:
Follow on to D54819/r351476.

We also don't need to perform extra InstCombine pass when we aren't
loading the sample profile in the ThinLTO backend because we have a
flattened sample profile.

Additionally, for consistency and clarity, when we aren't reloading the
sample profile, perform ICP in the same location as non-sample PGO
backends. To this end I have moved the ICP invocation for non-SamplePGO
ThinLTO down into buildModuleSimplificationPipeline (partly addresses
the FIXME where we were previously setting this up).

Reviewers: wmi

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

Tags: #llvm

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

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

6 years agoFix narrowing issue from r353129
Richard Trieu [Tue, 5 Feb 2019 02:26:03 +0000 (02:26 +0000)]
Fix narrowing issue from r353129

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

6 years ago[WebAssembly] Fix indentation after adding IsCanonical property (NFC)
Heejin Ahn [Tue, 5 Feb 2019 01:59:49 +0000 (01:59 +0000)]
[WebAssembly] Fix indentation after adding IsCanonical property (NFC)

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

6 years ago[WebAssembly] Make disassembler always emit most canonical name.
Wouter van Oortmerssen [Tue, 5 Feb 2019 01:19:45 +0000 (01:19 +0000)]
[WebAssembly] Make disassembler always emit most canonical name.

Summary:
There are a few instructions that all map to the same opcode, so
when disassembling, we have to pick one. That was just the first one
before (the except_ref variant in the case of "call"), now it is the
one marked as IsCanonical in tablegen, or failing that, the shortest
name (which is typically the "canonical" one).

Also introduced a canonical "end" instruction for this purpose.

Reviewers: dschuff, tlively

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

Tags: #llvm

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

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

6 years ago[SamplePGO][NFC] Minor improvement to replace a temporary vector with a
Wei Mi [Tue, 5 Feb 2019 00:57:50 +0000 (00:57 +0000)]
[SamplePGO][NFC] Minor improvement to replace a temporary vector with a
brace-enclosed init list.

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

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

6 years agoGlobalISel: Fix verifier crashing on non-register operands
Matt Arsenault [Tue, 5 Feb 2019 00:53:22 +0000 (00:53 +0000)]
GlobalISel: Fix verifier crashing on non-register operands

Also correct the wording of error on subregisters.

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

6 years ago[WebAssembly] memory.copy
Thomas Lively [Tue, 5 Feb 2019 00:49:55 +0000 (00:49 +0000)]
[WebAssembly] memory.copy

Summary: Depends on D57495.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish

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

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

6 years agoGlobalISel: Consolidate load/store legalization
Matt Arsenault [Tue, 5 Feb 2019 00:26:12 +0000 (00:26 +0000)]
GlobalISel: Consolidate load/store legalization

The fewerElementsVectors implementation for load/stores
handles the scalar reduction case just as well, so drop
the redundant code in narrowScalar. This also introduces
support for narrowing irregular size breakdowns for
scalars.

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

6 years ago[DAGCombiner] Discard pointer info when combining extract_vector_elt of a vector...
Craig Topper [Tue, 5 Feb 2019 00:22:23 +0000 (00:22 +0000)]
[DAGCombiner] Discard pointer info when combining extract_vector_elt of a vector load when the index isn't constant

Summary:
If the index isn't constant, this transform inserts a multiply and an add on the index to calculating the base pointer for a scalar load. But we still create a memory operand with an offset of 0 and the size of the scalar access. But the access is really to an unknown offset within the original access size.

This can cause the machine scheduler to incorrectly calculate dependencies between this load and other accesses. In the case we saw, there was a 32 byte vector store that was split into two 16 byte stores, one with offset 0 and one with offset 16. The size of the memory operand for both was 16. The scheduler correctly detected the alias with the offset 0 store, but not the offset 16 store.

This patch discards the pointer info so we don't incorrectly detect aliasing. I wasn't sure if we could keep using the original offset and size without risking some other transform on the load changing the size.

I tried to reduce a test case, but there's still a lot of memory operations needed to get the scheduler to do the bad reordering. So it looked pretty fragile to maintain.

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: arphaman, llvm-commits

Tags: #llvm

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

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

6 years ago[SamplePGO] Minor efficiency improvement in samplePGO ICP
Teresa Johnson [Tue, 5 Feb 2019 00:18:38 +0000 (00:18 +0000)]
[SamplePGO] Minor efficiency improvement in samplePGO ICP

Summary:
When attaching prof metadata to promoted direct calls in SamplePGO
mode, no need to construct and use a SmallVector to pass a single count
to the ArrayRef parameter, we can simply use a brace-enclosed init list.

This made a small but consistent improvement for a ThinLTO backend
compile I was measuring.

Reviewers: wmi

Subscribers: mehdi_amini, dexonsmith, llvm-commits

Tags: #llvm

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

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

6 years agoGlobalISel: Implement narrowScalar for select
Matt Arsenault [Tue, 5 Feb 2019 00:13:44 +0000 (00:13 +0000)]
GlobalISel: Implement narrowScalar for select

Don't handle vector conditions.

I think this can be merged in the future with
fewerElementsVectorSelect, although this becomes slightly tricky with
a vector condition.

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

6 years agoGlobalISel: Combine g_extract with g_merge_values
Matt Arsenault [Mon, 4 Feb 2019 23:41:59 +0000 (23:41 +0000)]
GlobalISel: Combine g_extract with g_merge_values

Try to use the underlying source registers.

This enables legalization in more cases where some irregular
operations are widened and others narrowed.

This seems to make the test_combines_2 AArch64 test worse, since the
MERGE_VALUES has multiple uses. Since this should be required for
legalization, a hasOneUse check is probably inappropriate (or maybe
should only be used if the merge is legal?).

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

6 years ago[Sanitizers] UBSan unreachable incompatible with Kernel ASan
Julian Lettner [Mon, 4 Feb 2019 23:37:50 +0000 (23:37 +0000)]
[Sanitizers] UBSan unreachable incompatible with Kernel ASan

Summary:
This is a follow up for https://reviews.llvm.org/D57278. The previous
revision should have also included Kernel ASan.

rdar://problem/40723397

Subscribers: cfe-commits

Tags: #clang

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

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

6 years ago[llvm-readobj] Fix readobj test expectation broken in rL353109. NFC.
Sam Clegg [Mon, 4 Feb 2019 23:36:38 +0000 (23:36 +0000)]
[llvm-readobj] Fix readobj test expectation broken in rL353109. NFC.

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

6 years agoRevert "[PATCH] [TargetLibraryInfo] Update run time support for Windows"
Evandro Menezes [Mon, 4 Feb 2019 23:34:50 +0000 (23:34 +0000)]
Revert "[PATCH] [TargetLibraryInfo] Update run time support for Windows"

This reverts accidental commit ff5527718d5d3b9966f6e8948866c0dc15ffcf3c.

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

6 years ago[ADT] Refactor the Windows query functions (NFC)
Evandro Menezes [Mon, 4 Feb 2019 23:34:38 +0000 (23:34 +0000)]
[ADT] Refactor the Windows query functions (NFC)

Increase reuse in the query functions for Windows.

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

6 years ago[PATCH] [TargetLibraryInfo] Update run time support for Windows
Evandro Menezes [Mon, 4 Feb 2019 23:29:41 +0000 (23:29 +0000)]
[PATCH] [TargetLibraryInfo] Update run time support for Windows

It seems that the run time for Windows has changed and supports more math
functions than before.  Since LLVM requires at least VS2015, I assume that
this is the run time that would be redistributed with programs built with
Clang.  Thus, I based this update on the header file `math.h` that
accompanies it.

This patch addresses the PR40541.  Unfortunately, I have no access to a
Windows development environment to validate it.

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

6 years agoGlobalISel: Enforce operand types for constants
Matt Arsenault [Mon, 4 Feb 2019 23:29:31 +0000 (23:29 +0000)]
GlobalISel: Enforce operand types for constants

A number of of tests were using imm operands, not cimm. Since CSE
relies on the exact ConstantInt* pointer used, and implicit
conversions are generally evil, also enforce the bitsize of the types.

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

6 years agoGlobalISel: Verify g_select
Matt Arsenault [Mon, 4 Feb 2019 23:29:16 +0000 (23:29 +0000)]
GlobalISel: Verify g_select

Factor the common vector element consistency check many instructions
need out, although this makes the error messages worse.

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

6 years agoMachineVerifier: Move verification of G_* instructions to function
Matt Arsenault [Mon, 4 Feb 2019 23:29:11 +0000 (23:29 +0000)]
MachineVerifier: Move verification of G_* instructions to function

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

6 years ago[WebAssembly] MC: Mark more function aliases as functions
Sam Clegg [Mon, 4 Feb 2019 23:07:34 +0000 (23:07 +0000)]
[WebAssembly] MC: Mark more function aliases as functions

Aliases of functions are now marked as function symbols even if
they are bitcast to some other other non-function type.
This is important for WebAssembly where object and function
symbols can't alias each other.

Fixes PR38866

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

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

6 years agoMIR: Validate LLT types when parsing
Matt Arsenault [Mon, 4 Feb 2019 22:59:56 +0000 (22:59 +0000)]
MIR: Validate LLT types when parsing

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

6 years ago[CGP] fix bogus test names/comments; NFC
Sanjay Patel [Mon, 4 Feb 2019 22:37:05 +0000 (22:37 +0000)]
[CGP] fix bogus test names/comments; NFC

Inverted operand 0 and operand 1.

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

6 years ago[llvm-readobj] Report more WebAssembly symbol info
Sam Clegg [Mon, 4 Feb 2019 22:27:46 +0000 (22:27 +0000)]
[llvm-readobj] Report more WebAssembly symbol info

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

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

6 years ago[CGP] add tests for usubo; NFC
Sanjay Patel [Mon, 4 Feb 2019 22:27:08 +0000 (22:27 +0000)]
[CGP] add tests for usubo; NFC

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

6 years agoGlobalISel: Fix not calling observer when legalizing bitcount ops
Matt Arsenault [Mon, 4 Feb 2019 22:26:33 +0000 (22:26 +0000)]
GlobalISel: Fix not calling observer when legalizing bitcount ops

This was hiding bugs from never legalizing the source type.

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

6 years agoAMDGPU: Don't rematerialize mov with implicit operands
Matt Arsenault [Mon, 4 Feb 2019 22:26:21 +0000 (22:26 +0000)]
AMDGPU: Don't rematerialize mov with implicit operands

This was pulling the mov used for register indexing on gfx9 out of the
loop.

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

6 years ago[SanitizerCoverage] Clang crashes if user declares `__sancov_lowest_stack` variable
Julian Lettner [Mon, 4 Feb 2019 22:06:30 +0000 (22:06 +0000)]
[SanitizerCoverage] Clang crashes if user declares `__sancov_lowest_stack` variable

Summary:
If the user declares or defines `__sancov_lowest_stack` with an
unexpected type, then `getOrInsertGlobal` inserts a bitcast and the
following cast fails:
```
Constant *SanCovLowestStackConstant =
       M.getOrInsertGlobal(SanCovLowestStackName, IntptrTy);
SanCovLowestStack = cast<GlobalVariable>(SanCovLowestStackConstant);
```

This variable is a SanitizerCoverage implementation detail and the user
should generally never have a need to access it, so we emit an error
now.

rdar://problem/44143130

Reviewers: morehouse

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

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

6 years agogn build: Windows: use a more standard format for PDB filenames
David Major [Mon, 4 Feb 2019 21:27:38 +0000 (21:27 +0000)]
gn build: Windows: use a more standard format for PDB filenames

The current build was producing names like llvm-undname.exe.pdb, which looks unusual to me at least. This switches them to the more common llvm-undname.pdb style.

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

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

6 years agogn build: Revert r353094 (bad merge)
David Major [Mon, 4 Feb 2019 21:25:13 +0000 (21:25 +0000)]
gn build: Revert r353094 (bad merge)

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

6 years ago[InstCombine] Cleanup the TFE/LWE check in AMDGPU SimplifyDemanded
Nicolai Haehnle [Mon, 4 Feb 2019 21:24:19 +0000 (21:24 +0000)]
[InstCombine] Cleanup the TFE/LWE check in AMDGPU SimplifyDemanded

Summary:
The fix added in r352904 is not quite correct, or rather misleading:

1. When the texfailctrl (TFC) argument was non-constant, the fix assumed
   non-TFE/LWE, which is incorrect.

2. Regardless, this code path cannot even be hit for correct
   TFE/LWE-enabled calls, because those return a struct. Added
   a test case for those for completeness.

Change-Id: I92d314dbc67a2670f6d7adaab765ef45f56a49cf

Reviewers: hliao, dstuttard, arsenm

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

Tags: #llvm

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

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

6 years ago[X86] Add test case for report_fatal_error added in r352699.
Craig Topper [Mon, 4 Feb 2019 21:24:15 +0000 (21:24 +0000)]
[X86] Add test case for report_fatal_error added in r352699.

r352699 replaced an llvm_unreachable with a report_fatal_error. This patch adds a test case for it.

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

6 years ago[CodeGen][ARC][SystemZ][WebAssembly] Use MachineInstr::isInlineAsm in more places...
Craig Topper [Mon, 4 Feb 2019 21:24:13 +0000 (21:24 +0000)]
[CodeGen][ARC][SystemZ][WebAssembly] Use MachineInstr::isInlineAsm in more places instead of just comparing opcode. NFCI

I'm looking at adding a second INLINEASM opcode for better modeling asm-goto
as a terminator. Using the existing predicate will reduce teh number of
places that will need to use the new opcode.

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

6 years agogn build: Windows: use a more standard format for PDB filenames
David Major [Mon, 4 Feb 2019 21:20:25 +0000 (21:20 +0000)]
gn build: Windows: use a more standard format for PDB filenames

The current build was producing names like llvm-undname.exe.pdb, which looks unusual to me at least. This switches them to the more common llvm-undname.pdb style.

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

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

6 years agogn build: Windows: write PDBs when is_debug
David Major [Mon, 4 Feb 2019 21:13:43 +0000 (21:13 +0000)]
gn build: Windows: write PDBs when is_debug

Without /DEBUG, the /Zi doesn't on its own create PDB files.

And since ninja runs multiple compilations in parallel, we need /FS to prevent contention on PDBs.

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

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

6 years ago[Tablegen][DAG]: Fix build breakage when LLVM_ENABLE_DAGISEL_COV=1
Aditya Nandakumar [Mon, 4 Feb 2019 21:06:24 +0000 (21:06 +0000)]
[Tablegen][DAG]: Fix build breakage when LLVM_ENABLE_DAGISEL_COV=1

LLVM_ENABLE_DAGISEL_COV can be used to instrument DAGISel tablegen
selection code to show which patterns along with Complex patterns were
used when selecting instructions. Unfortunately this is turned off by
default and was broken but never tested.
This required a simple fix (missing new line) to get it to build again.

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

6 years ago[NewPM][MSan] Add Options Handling
Philip Pfaffe [Mon, 4 Feb 2019 21:02:49 +0000 (21:02 +0000)]
[NewPM][MSan] Add Options Handling

Summary: This patch enables passing options to msan via the passes pipeline, e.e., -passes=msan<recover;kernel;track-origins=4>.

Reviewers: chandlerc, fedor.sergeev, leonardchan

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

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

6 years ago[DEBUGINFO] Reposting r352642: Handle restore instructions in LiveDebugValues
Wolfgang Pieb [Mon, 4 Feb 2019 20:42:45 +0000 (20:42 +0000)]
[DEBUGINFO] Reposting r352642: Handle restore instructions in LiveDebugValues

The LiveDebugValues pass recognizes spills but not restores, which can
cause large gaps in location information for some variables, depending
on control flow. This patch make LiveDebugValues recognize restores and
generate appropriate DBG_VALUE instructions.

This patch was posted previously with r352642 and reverted in r352666 due
to buildbot errors. A missing return statement was the cause for the
failures.

Reviewers: aprantl, NicolaPrica

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

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

6 years ago[AMDGPU] Support emitting GOT relocations for function calls
Scott Linder [Mon, 4 Feb 2019 20:00:07 +0000 (20:00 +0000)]
[AMDGPU] Support emitting GOT relocations for function calls

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

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

6 years ago[WarnMissedTransforms] Do not warn about already vectorized loops.
Michael Kruse [Mon, 4 Feb 2019 19:55:59 +0000 (19:55 +0000)]
[WarnMissedTransforms] Do not warn about already vectorized loops.

LoopVectorize adds llvm.loop.isvectorized, but leaves
llvm.loop.vectorize.enable. Do not consider such a loop for user-forced
vectorization since vectorization already happened -- by prioritizing
llvm.loop.isvectorized except for TM_SuppressedByUser.

Fixes http://llvm.org/PR40546

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

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

6 years agoGlobalISel: Fix CheckMachineFunction passing if ReadCheckFile files
Matt Arsenault [Mon, 4 Feb 2019 19:53:22 +0000 (19:53 +0000)]
GlobalISel: Fix CheckMachineFunction passing if ReadCheckFile files

This could be tested, but the FileCheck library spams the error
message to the console.

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

6 years agoGlobalISel: Allow constructing SrcOp/DstOp from MachineOperand
Matt Arsenault [Mon, 4 Feb 2019 19:53:19 +0000 (19:53 +0000)]
GlobalISel: Allow constructing SrcOp/DstOp from MachineOperand

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

6 years agoGlobalISel: Fix parameter name in documentation
Matt Arsenault [Mon, 4 Feb 2019 19:16:58 +0000 (19:16 +0000)]
GlobalISel: Fix parameter name in documentation

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

6 years agoGlobalISel: Fix CSE handling of buildConstant
Matt Arsenault [Mon, 4 Feb 2019 19:15:50 +0000 (19:15 +0000)]
GlobalISel: Fix CSE handling of buildConstant

This fixes two problems with CSE done in buildConstant. First, this
would hit an assert when used with a vector result type. Solve this by
allowing CSE on the vector elements, but not on the result vector for
now.

Second, this was also performing the CSE based on the input
ConstantInt pointer. The underlying buildConstant could potentially
convert the constant depending on the result type, giving in a
different ConstantInt*. Stop allowing the APInt and ConstantInt forms
from automatically casting to the result type to avoid any similar
problems in the future.

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

6 years ago[WebAssembly] clang-tidy (NFC)
Heejin Ahn [Mon, 4 Feb 2019 19:13:39 +0000 (19:13 +0000)]
[WebAssembly] clang-tidy (NFC)

Summary:
This patch fixes clang-tidy warnings on wasm-only files.
The list of checks used is:
`-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,readability-identifier-naming,modernize-*`
(LLVM's default .clang-tidy list is the same except it does not have
`modernize-*`. But I've seen in multiple CLs in LLVM the modernize style
was recommended and code was fixed based on the style, so I added it as
well.)

The common fixes are:
- Variable names start with an uppercase letter
- Function names start with a lowercase letter
- Use `auto` when you use casts so the type is evident
- Use inline initialization for class member variables
- Use `= default` for empty constructors / destructors
- Use `using` in place of `typedef`

Reviewers: sbc100, tlively, aardappel

Subscribers: dschuff, sunfish, jgravelle-google, yurydelendik, kripken, MatzeB, mgorny, rupprecht, llvm-commits

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

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

6 years ago[llvm-objcopy][NFC] simplify an error return
Jordan Rupprecht [Mon, 4 Feb 2019 19:09:20 +0000 (19:09 +0000)]
[llvm-objcopy][NFC] simplify an error return

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

6 years ago[X86] X86DAGToDAGISel::matchBitExtract(): prepare 'control' in 32 bits
Roman Lebedev [Mon, 4 Feb 2019 19:04:26 +0000 (19:04 +0000)]
[X86] X86DAGToDAGISel::matchBitExtract(): prepare 'control' in 32 bits

Summary:
Noticed while looking at D56052.
```
  // The 'control' of BEXTR has the pattern of:
  // [15...8 bit][ 7...0 bit] location
  // [ bit count][     shift] name
  // I.e. 0b000000011'00000001 means  (x >> 0b1) & 0b11
```
I.e. we do not care about any of the bits aside from the low 16 bits.
So there is no point in doing the `slh`,`or` in 64 bits,
let's just do everything in 32 bits, and anyext if needed.

We could do that in 16 even, but we intentionally don't
zext to i16 (longer encoding IIRC),
so i'm guessing the same applies here.

Reviewers: craig.topper, andreadb, RKSimon

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

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

6 years agoGlobalISel: Improve gtest usage
Matt Arsenault [Mon, 4 Feb 2019 18:58:27 +0000 (18:58 +0000)]
GlobalISel: Improve gtest usage

Don't unnecessarily use ASSERT_*, and print the MachineFunction
on failure.

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

6 years agoAdjust cardinality of internal inliner thresholds
David Callahan [Mon, 4 Feb 2019 18:46:25 +0000 (18:46 +0000)]
Adjust cardinality of internal inliner thresholds

Summary:
While compiling openJDK11 (also other workloads), some make files would pass both  CFLAGS  and LDFLAGS at link step ; resulting in duplicate options on the command line when one is using LTO and trying to influence the inliner. Most of the internal flags are ZeroOrMore, this diff changes the remaining ones.

Reviewers: david2050, twoh, modocache

Reviewed By: twoh

Subscribers: mehdi_amini, dexonsmith, eraman, haicheng, llvm-commits

Tags: #llvm

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

Patch by: Abdoul-Kader Keita

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

6 years ago[X86] Add ST0 as an implicit def/use of x87 load/store instructions during FP stackif...
Craig Topper [Mon, 4 Feb 2019 18:43:55 +0000 (18:43 +0000)]
[X86] Add ST0 as an implicit def/use of x87 load/store instructions during FP stackifying.

These instructions implicitly operate on ST0, but we don't currently add that information to the MachineInstr. We also don't add it the tablegen definitions either.

For the most part this doesn't cause any problems because the stackifying occurs after register allocation. All the instructions are marked as having side effects so the postRA scheduler won't reorder them amongst themselves.

But nothing stops inline assembly using X87 instructions from being reordered around other x87 instructions if that inline assembly wasn't marked volatile.

The two test cases I've identified so far in PR40539 involve loads and stores used to set up the inline assembly or capture the results of the inline assembly ending up in the wrong order.

This patch adds implicit ST0 uses/defs to the load/store instructions to prevent this from happening.

I plan to fix all of the FP instructions, but the binops are bit trickier to get right. So I've chosen fixing the known test cases as a good first step.

I think we also need to update the tablegen descriptions so MS inline assembly infers the right clobbers, but I haven't checked that yet.

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

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

6 years agoGlobalISel: Fix moreElementsToNextPow2
Matt Arsenault [Mon, 4 Feb 2019 18:42:24 +0000 (18:42 +0000)]
GlobalISel: Fix moreElementsToNextPow2

This was completely broken. The condition was inverted, and changed
the element type for vectors of pointers.

Fixes bug 40592.

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

6 years ago[llvm-objcopy][NFC] Use StringSaver for --keep-global-symbols
Jordan Rupprecht [Mon, 4 Feb 2019 18:38:00 +0000 (18:38 +0000)]
[llvm-objcopy][NFC] Use StringSaver for --keep-global-symbols

Summary: Use StringSaver/BumpPtrAlloc when parsing lines from --keep-global-symbols files. This allows us to consistently use StringRef for driver options, which avoids copying the full strings for each object copied, as well as simplifies part of D57517.

Reviewers: jhenderson, evgeny777, alexshap

Subscribers: jakehehrlich

Tags: #llvm

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

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

6 years ago[WebAssembly] Make segment/size/type directives optional in asm
Wouter van Oortmerssen [Mon, 4 Feb 2019 18:03:11 +0000 (18:03 +0000)]
[WebAssembly] Make segment/size/type directives optional in asm

Summary:
These were "boilerplate" that repeated information already present
in .functype and end_function, that needed to be repeated to Please
the particular way our object writing works, and missing them would
generate errors.

Instead, we generate the information for these automatically so the
user can concern itself with writing more canonical wasm functions
that always work as expected.

Reviewers: dschuff, sbc100

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

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

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

6 years agoRevert "[GlobalISel] Introduce a generic floating point floor opcode, G_FFLOOR"
Jessica Paquette [Mon, 4 Feb 2019 17:32:47 +0000 (17:32 +0000)]
Revert "[GlobalISel] Introduce a generic floating point floor opcode, G_FFLOOR"

This reverts commit b05ecba6d687fcb3078509220c67458bf1d77a2e.

Apparently adding floor breaks AMDGPU somehow, so I have to back this out
while I look into it.

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

6 years agoRevert "[GlobalISel] Add IRTranslator support for G_FFLOOR"
Jessica Paquette [Mon, 4 Feb 2019 17:32:43 +0000 (17:32 +0000)]
Revert "[GlobalISel] Add IRTranslator support for G_FFLOOR"

This reverts commit 8bbd570fd5205a04d88d2e5513a6e4adbd028039.

Apparently adding ffloor breaks AMDGPU somehow, so I need to back this out
while I look into it.

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

6 years agogn build: Merge r352944
Nico Weber [Mon, 4 Feb 2019 17:32:36 +0000 (17:32 +0000)]
gn build: Merge r352944

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

6 years ago[WebAssembly] Rename relocations from R_WEBASSEMBLY_ to R_WASM_
Sam Clegg [Mon, 4 Feb 2019 17:28:46 +0000 (17:28 +0000)]
[WebAssembly] Rename relocations from R_WEBASSEMBLY_ to R_WASM_

See https://github.com/WebAssembly/tool-conventions/pull/95.

This is less typing and IMHO more readable, and it also fits with
our naming around the binary format which tends to use the short name.
e.g.

include/llvm/BinaryFormat/Wasm.h
tools/llvm-objdump/WasmDump.cpp
etc..

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

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

6 years ago[X86] Print all register forms of x87 fadd/fsub/fdiv/fmul as having two arguments...
Craig Topper [Mon, 4 Feb 2019 17:28:18 +0000 (17:28 +0000)]
[X86] Print all register forms of x87 fadd/fsub/fdiv/fmul as having two arguments where on is %st.

All of these instructions consume one encoded register and the other register is %st. They either write the result to %st or the encoded register. Previously we printed both arguments when the encoded register was written. And we printed one argument when the result was written to %st. For the stack popping forms the encoded register is always the destination and we didn't print both operands. This was inconsistent with gcc and objdump and just makes the output assembly code harder to read.

This patch changes things to always print both operands making us consistent with gcc and objdump. The parser should still be able to handle the single register forms just as it did before. This also matches the GNU assembler behavior.

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

6 years ago[WebAssembly] Remove redundant namespaces qualifiers. NFC.
Sam Clegg [Mon, 4 Feb 2019 17:26:22 +0000 (17:26 +0000)]
[WebAssembly] Remove redundant namespaces qualifiers. NFC.

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

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

6 years ago[Intrinsic] Unsigned Fixed Point Multiplication Intrinsic
Leonard Chan [Mon, 4 Feb 2019 17:18:11 +0000 (17:18 +0000)]
[Intrinsic] Unsigned Fixed Point Multiplication Intrinsic

Add an intrinsic that takes 2 unsigned integers with the scale of them
provided as the third argument and performs fixed point multiplication on
them.

This is a part of implementing fixed point arithmetic in clang where some of
the more complex operations will be implemented as intrinsics.

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

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

6 years ago[GlobalISel] Add IRTranslator support for G_FFLOOR
Jessica Paquette [Mon, 4 Feb 2019 17:15:34 +0000 (17:15 +0000)]
[GlobalISel] Add IRTranslator support for G_FFLOOR

Follow-up to https://reviews.llvm.org/D57484

Adds G_FFLOOR to translateKnownIntrinsic and update arm64-irtranslator.ll.

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

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

6 years ago[GlobalISel] Introduce a generic floating point floor opcode, G_FFLOOR
Jessica Paquette [Mon, 4 Feb 2019 17:10:55 +0000 (17:10 +0000)]
[GlobalISel] Introduce a generic floating point floor opcode, G_FFLOOR

This introduces a generic opcode for floating point floor, working towards
selecting @llvm.floor.

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

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

6 years ago[CGP] use IRBuilder to simplify code
Sanjay Patel [Mon, 4 Feb 2019 16:30:46 +0000 (16:30 +0000)]
[CGP] use IRBuilder to simplify code

This is no-functional-change-intended although there could
be intermediate variations caused by a difference in the
debug info produced by setting that from the builder's
insertion point.

I'm updating the IR test file associated with this code just
to show that the naming differences from using the builder
are visible.

The motivation for adding a helper function is that we are
likely to extend this code to deal with other overflow ops.

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

6 years ago[CommandLine] Don't print empty sentinel values from EnumValN lists in help text
James Henderson [Mon, 4 Feb 2019 16:17:57 +0000 (16:17 +0000)]
[CommandLine] Don't print empty sentinel values from EnumValN lists in help text

In order to make an option value truly optional, both the ValueOptional
attribute and an empty-named value are required. Prior to this change,
this empty-named value appears in the command-line help text:

-some-option - some help text
  =v1        - description 1
  =v2        - description 2
  =          -

This change improves the help text for these sort of options in a number
of ways:

1) ValueOptional options with an empty-named value now print their help
   text twice: both without and then with '=<value>' after the name. The
   latter version then lists the allowed values after it.
2) Empty-named values with no help text in ValueOptional options are not
   listed in the permitted values.

-some-option         - some help text
-some-option=<value> - some help text
  =v1                - description 1
  =v2                - description 2

3) Otherwise empty-named options are printed as =<empty> rather than
   simply '='.
4) Option values without help text do not have the '-' separator
   printed.

-some-option=<value> - some help text
  =v1                - description 1
  =v2
  =<empty>           - description

It also tweaks the llvm-symbolizer -functions help text to not print a
trailing ':' as that looks bad combined with 1) above.

This is mostly a reland of r353048 which in turn was a reland of
r352750.

Reviewed by: ruiu, thopre, mstorsjo

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

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

6 years ago[X86][SSE] SimplifyDemandedBitsForTargetNode - PCMPGT(0,X) sign mask
Simon Pilgrim [Mon, 4 Feb 2019 15:43:36 +0000 (15:43 +0000)]
[X86][SSE] SimplifyDemandedBitsForTargetNode - PCMPGT(0,X) sign mask

For PCMPGT(0, X) patterns where we only demand the sign bit (e.g. BLENDV or MOVMSK) then we can use X directly.

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

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

6 years agoRevert r353048.
James Henderson [Mon, 4 Feb 2019 15:09:58 +0000 (15:09 +0000)]
Revert r353048.

It was causing unexpected unit test failures on build bots.

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

6 years ago[CommandLine] Don't print empty sentinel values from EnumValN lists in help text
James Henderson [Mon, 4 Feb 2019 14:48:33 +0000 (14:48 +0000)]
[CommandLine] Don't print empty sentinel values from EnumValN lists in help text

In order to make an option value truly optional, both the ValueOptional
attribute and an empty-named value are required. Prior to this change,
this empty-named value appears in the command-line help text:

-some-option - some help text
  =v1        - description 1
  =v2        - description 2
  =          -

This change improves the help text for these sort of options in a number
of ways:

1) ValueOptional options with an empty-named value now print their help
   text twice: both without and then with '=<value>' after the name. The
   latter version then lists the allowed values after it.
2) Empty-named values with no help text in ValueOptional options are not
   listed in the permitted values.

-some-option         - some help text
-some-option=<value> - some help text
  =v1                - description 1
  =v2                - description 2

3) Otherwise empty-named options are printed as =<empty> rather than
   simply '='.
4) Option values without help text do not have the '-' separator
   printed.

-some-option=<value> - some help text
  =v1                - description 1
  =v2
  =<empty>           - description

It also tweaks the llvm-symbolizer -functions help text to not print a
trailing ':' as that looks bad combined with 1) above.

This is mostly a reland of r352750.

Reviewed by: ruiu, thopre, mstorsjo

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

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

6 years agoGlobalISel: Fix formatting of debug output
Matt Arsenault [Mon, 4 Feb 2019 14:05:33 +0000 (14:05 +0000)]
GlobalISel: Fix formatting of debug output

There was a missing space before the instruction name, and the newline
is redundant since MI::print by default adds one.

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