]> granicus.if.org Git - llvm/log
llvm
5 years ago[TargetLowering] Simplify expansion of S{ADD,SUB}O
Roger Ferrer Ibanez [Mon, 30 Sep 2019 07:58:50 +0000 (07:58 +0000)]
[TargetLowering] Simplify expansion of S{ADD,SUB}O

ISD::SADDO uses the suggested sequence described in the section ยง2.4 of
the RISCV Spec v2.2. ISD::SSUBO uses the dual approach but checking for
(non-zero) positive.

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

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

5 years ago[ARM][CGP] Allow signext arguments
Sam Parker [Mon, 30 Sep 2019 07:52:10 +0000 (07:52 +0000)]
[ARM][CGP] Allow signext arguments

As we perform a zext on any arguments used in the promoted tree, it
doesn't matter if they're marked as signext. The only permitted
user(s) in the tree which would interpret the sign bits are signed
icmps. For these instructions, their promoted operands are truncated
before the icmp uses them.

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

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

5 years agoRevert "[SCEV] add no wrap flag for SCEVAddExpr."
Tim Northover [Mon, 30 Sep 2019 07:46:52 +0000 (07:46 +0000)]
Revert "[SCEV] add no wrap flag for SCEVAddExpr."

This reverts r366419 because the analysis performed is within the context of
the loop and it's only valid to add wrapping flags to "global" expressions if
they're always correct.

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

5 years agoReland "[utils] Implement the llvm-locstats tool"
Djordje Todorovic [Mon, 30 Sep 2019 07:35:17 +0000 (07:35 +0000)]
Reland "[utils] Implement the llvm-locstats tool"

The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

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

5 years ago[SystemZ] Add SystemZPostRewrite in addPostRegAlloc() instead at -O0.
Jonas Paulsson [Mon, 30 Sep 2019 07:29:54 +0000 (07:29 +0000)]
[SystemZ]  Add SystemZPostRewrite in addPostRegAlloc() instead at -O0.

SystemZPostRewrite needs to be run before (it may emit COPYs) the Post-RA
pseudo pass also at -O0, so it should be added in addPostRegAlloc().

Review: Ulrich Weigand

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

5 years ago[X86] Remove some redundant isel patterns. NFCI
Craig Topper [Mon, 30 Sep 2019 06:47:03 +0000 (06:47 +0000)]
[X86] Remove some redundant isel patterns. NFCI

These are all also implemented in avx512_logical_lowering_types
with support for masking.

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

5 years agoAMDGPU/GlobalISel: Fix select for v2s16 and/or/xor
Matt Arsenault [Mon, 30 Sep 2019 06:31:30 +0000 (06:31 +0000)]
AMDGPU/GlobalISel: Fix select for v2s16 and/or/xor

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

5 years ago[test] Change llvm-readobj --arm-attributes to --arch-specific after r373125
Fangrui Song [Mon, 30 Sep 2019 04:45:14 +0000 (04:45 +0000)]
[test] Change llvm-readobj --arm-attributes to --arch-specific after r373125

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

5 years ago[X86] Split v16i32/v8i64 bitreverse on avx512f targets without avx512bw to enable...
Craig Topper [Mon, 30 Sep 2019 03:14:38 +0000 (03:14 +0000)]
[X86] Split v16i32/v8i64 bitreverse on avx512f targets without avx512bw to enable the use of vpshufb on the 256-bit halves.

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

5 years agoUndef the macros after their use
Aditya Kumar [Mon, 30 Sep 2019 02:46:56 +0000 (02:46 +0000)]
Undef the macros after their use

Summary:

Reviewers:
t.p.northover

Subscribers:

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

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

5 years ago[X86] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after r373174
Fangrui Song [Mon, 30 Sep 2019 02:06:23 +0000 (02:06 +0000)]
[X86] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after r373174

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

5 years ago[X86] Remove -x86-experimental-vector-widening-legalization command line flag
Craig Topper [Sun, 29 Sep 2019 23:32:37 +0000 (23:32 +0000)]
[X86] Remove -x86-experimental-vector-widening-legalization command line flag

This was added back to allow some performance regressions to be
investigated. The main perf issue was fixed shortly after adding
this back and no other major issues have been reported. So I
think its safe to remove this again.

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

5 years ago[X86] Add custom isel logic to match VPTERNLOG from 2 logic ops.
Craig Topper [Sun, 29 Sep 2019 18:43:08 +0000 (18:43 +0000)]
[X86] Add custom isel logic to match VPTERNLOG from 2 logic ops.

There's room from improvement here, but this is a decent
starting point.

There are a few minor regressions in the vector-rotate tests,
where we are now forming a vpternlog from an and before we get
a chance to form it for a bitselect that we were matching
previously. This results in an AND and an ANDN feeding the
vpternlog where previously we just had an AND after the
vpternlog. I think we can probably DAG combine the AND with
the bitselect to get back to similar codegen.

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

5 years agoAdd test case peeking through vector concat when combining insert into shuffles. NFC
Amaury Sechet [Sun, 29 Sep 2019 17:54:03 +0000 (17:54 +0000)]
Add test case peeking through vector concat when combining insert into shuffles. NFC

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

5 years ago[LLVM-C][Ocaml] Add MergeFunctions and DCE pass
Aditya Kumar [Sun, 29 Sep 2019 16:06:22 +0000 (16:06 +0000)]
[LLVM-C][Ocaml] Add MergeFunctions and DCE pass

MergeFunctions and DCE pass are missing from OCaml/C-api. This patch
adds them.

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

Reviewers: whitequark, hiraditya, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

Tags: #llvm

Authored by: kren1

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

5 years ago[Docs] Moves article links to new pages
DeForest Richards [Sun, 29 Sep 2019 15:31:52 +0000 (15:31 +0000)]
[Docs] Moves article links to new pages

Moves existing article links on the Programming, Subsystem, and Reference documentation pages to new locations. Also moves Github Repository and Publications links to the sidebar.

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

5 years ago[MC] Emit unused undefined symbol even if its binding is not set
Fangrui Song [Sun, 29 Sep 2019 15:26:12 +0000 (15:26 +0000)]
[MC] Emit unused undefined symbol even if its binding is not set

For the following two cases, we currently suppress the symbols. This
patch emits them (compatible with GNU as).

* `test2_a = undef`: if `undef` is otherwise unused.
* `.hidden hidden`: if `hidden` is unused. This is the main point of the
  patch, because omitting the symbol would cause a linker semantic
  difference.

It causes a behavior change that is not compatible with GNU as:

.weakref foo1, bar1

When neither foo1 nor bar1 is used, we now emit bar1, which is arguably
more consistent.

Another change is that we will emit .TOC. for .TOC.@tocbase .  For this
directive, suppressing .TOC. can be seen as a size optimization, but we
choose to drop it for simplicity and consistency.

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

5 years ago[DivRemPairs] Don't assert that we won't ever get expanded-form rem pairs in differen...
Roman Lebedev [Sun, 29 Sep 2019 15:25:24 +0000 (15:25 +0000)]
[DivRemPairs] Don't assert that we won't ever get expanded-form rem pairs in different BB's (PR43500)

If we happen to have the same div in two basic blocks,
and in one of those we also happen to have the rem part,
we'd match the div-rem pair, but the wrong ones.
So let's drop overly-ambiguous assert.

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

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

5 years ago[SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAdd...
Alexey Bataev [Sun, 29 Sep 2019 14:18:06 +0000 (14:18 +0000)]
[SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!")

Initially SLP vectorizer replaced all going-to-be-vectorized
instructions with Undef values. It may break ScalarEvaluation and may
cause a crash.
Reworked SLP vectorizer so that it does not replace vectorized
instructions by UndefValue anymore. Instead vectorized instructions are
marked for deletion inside if BoUpSLP class and deleted upon class
destruction.

Reviewers: mzolotukhin, mkuper, hfinkel, RKSimon, davide, spatel

Subscribers: RKSimon, Gerolf, anemet, hans, majnemer, llvm-commits, sanjoy

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

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

5 years ago[PowerPC] Fix conditions of assert in PPCAsmPrinter
Jinsong Ji [Sun, 29 Sep 2019 12:43:46 +0000 (12:43 +0000)]
[PowerPC] Fix conditions of assert in PPCAsmPrinter

Summary:
g++ build emits warning:

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:667:77: error: suggest parentheses around ?&&? within ?||? [-Werror=parentheses]
     assert(MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isBlockAddress() &&
                                                         ~~~~~~~~~~~~~~~~~~~~^~
            "Unexpected operand type for LWZtoc pseudo.");

I believe the intension is to assert all different types,
so we should add a parentheses to include all '||'.

Reviewers: #powerpc, sfertile, hubert.reinterpretcast, Xiangling_L

Reviewed By: Xiangling_L

Subscribers: wuzish, nemanjai, hiraditya, kbarton, MaskRay, shchenz, steven.zhang, llvm-commits

Tags: #llvm

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

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

5 years ago[ARM] Cortex-M4 schedule additions
David Green [Sun, 29 Sep 2019 08:38:48 +0000 (08:38 +0000)]
[ARM] Cortex-M4 schedule additions

This is an attempt to fill in some of the missing instructions from the
Cortex-M4 schedule, and make it easier to do the same for other ARM cpus.

- Some instructions are marked as hasNoSchedulingInfo as they are pseudos or
  otherwise do not require scheduling info
- A lot of features have been marked not supported
- Some WriteRes's have been added for cvt instructions.
- Some extra instruction latencies have been added, notably by relaxing the
  regex for dsp instruction to catch more cases, and some fp instructions.

This goes a long way to get the CompleteModel working for this CPU. It does not
go far enough as to get all scheduling info for all output operands correct.

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

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

5 years ago[Docs] Adds sections for Command Line and LibFuzzer articles
DeForest Richards [Sun, 29 Sep 2019 02:16:38 +0000 (02:16 +0000)]
[Docs] Adds sections for Command Line and LibFuzzer articles

Adds sections for Command Line and Libfuzzer articles on Programming Documentation page.

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

5 years ago[X86] Enable isel to fold broadcast loads that have been bitcasted from FP into a...
Craig Topper [Sun, 29 Sep 2019 01:24:33 +0000 (01:24 +0000)]
[X86] Enable isel to fold broadcast loads that have been bitcasted from FP into a vpternlog.

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

5 years ago[X86] Move bitselect matching to vpternlog into X86ISelDAGToDAG.cpp
Craig Topper [Sun, 29 Sep 2019 01:24:29 +0000 (01:24 +0000)]
[X86] Move bitselect matching to vpternlog into X86ISelDAGToDAG.cpp

This allows us to reduce the use count on the condition node before
the match. This enables load folding for that operand without
relying on the peephole pass. This will be improved on for
broadcast load folding in a subsequent commit.

This still requires a bunch of isel patterns for vXi16/vXi8 types
though.

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

5 years ago[X86] Enable canonicalizeBitSelect for AVX512 since we can use VPTERNLOG now.
Craig Topper [Sun, 29 Sep 2019 01:24:22 +0000 (01:24 +0000)]
[X86] Enable canonicalizeBitSelect for AVX512 since we can use VPTERNLOG now.

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

5 years ago[X86] Match (or (and A, B), (andn (A, C))) to VPTERNLOG with AVX512.
Craig Topper [Sun, 29 Sep 2019 01:24:16 +0000 (01:24 +0000)]
[X86] Match (or (and A, B), (andn (A, C))) to VPTERNLOG with AVX512.

This uses a similar isel pattern as we used for vpcmov with XOP.

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

5 years ago[NFC] Move hot cold splitting class to header file
Aditya Kumar [Sat, 28 Sep 2019 18:13:33 +0000 (18:13 +0000)]
[NFC] Move hot cold splitting class to header file

Summary:  This is to facilitate unittests

Reviewers: compnerd, vsk, tejohnson, sebpop, brzycki, SirishP

Reviewed By: tejohnson

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[PowerPC] make tests immune to improved undef handling
Sanjay Patel [Sat, 28 Sep 2019 13:34:53 +0000 (13:34 +0000)]
[PowerPC] make tests immune to improved undef handling

The fma mutate test will not exercise what it was intended to test
once we simplify those ops immediately, but the test will still
pass with the existing CHECKs, so I'm leaving it in case that
still has minimal value.

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

5 years ago[GlobalISel Enable memcpy inlining with optsize.
Amara Emerson [Sat, 28 Sep 2019 07:55:42 +0000 (07:55 +0000)]
[GlobalISel Enable memcpy inlining with optsize.

We should be disabling inline for minsize, not optsize.

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

5 years ago[TimeProfiler] Fix "OptModule" section and add new "Backend" sections
Anton Afanasyev [Sat, 28 Sep 2019 07:14:12 +0000 (07:14 +0000)]
[TimeProfiler] Fix "OptModule" section and add new "Backend" sections

Remove unnecessary "OptModule" section. Add "PerFunctionPasses",
"PerModulePasses" and "CodeGenPasses" sections under "Backend" section.

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

5 years agoAdd an operand to memory intrinsics to denote the "tail" marker.
Amara Emerson [Sat, 28 Sep 2019 05:33:21 +0000 (05:33 +0000)]
Add an operand to memory intrinsics to denote the "tail" marker.

We need to propagate this information from the IR in order to be able to safely
do tail call optimizations on the intrinsics during legalization. Assuming
it's safe to do tail call opt without checking for the marker isn't safe because
the mem libcall may use allocas from the caller.

This adds an extra immediate operand to the end of the intrinsics and fixes the
legalizer to handle it.

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

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

5 years agoAMDGPU/GlobalISel: Avoid getting MRI in every function
Matt Arsenault [Sat, 28 Sep 2019 03:41:13 +0000 (03:41 +0000)]
AMDGPU/GlobalISel: Avoid getting MRI in every function

Store it in AMDGPUInstructionSelector to avoid boilerplate in nearly
every select function.

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

5 years ago[X86] Add broadcast load unfolding support for VPTESTMD/Q and VPTESTNMD/Q.
Craig Topper [Sat, 28 Sep 2019 01:56:36 +0000 (01:56 +0000)]
[X86] Add broadcast load unfolding support for VPTESTMD/Q and VPTESTNMD/Q.

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

5 years ago[X86] Stop using UpdateNodeOperands in combineGatherScatter. Create new nodes like...
Craig Topper [Sat, 28 Sep 2019 01:08:46 +0000 (01:08 +0000)]
[X86] Stop using UpdateNodeOperands in combineGatherScatter. Create new nodes like most other DAG combines.

Creating new nodes is what we usually do. Have to explicitly
check that we don't update to an existing node and having
to manually manage the worklist is unusual.

We can probably add a helper function to reduce the duplication
of having to check if we should create a gather or scatter, but
I wanted to just get the simple thing done.

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

5 years ago[X86] Split combineGatherScatter into a version for generic ISD nodes and another...
Craig Topper [Sat, 28 Sep 2019 01:06:58 +0000 (01:06 +0000)]
[X86] Split combineGatherScatter into a version for generic ISD nodes and another version for X86 specific nodes.

The majority of the code doesn't run on the X86 nodes today since
its gated by isBeforeLegalizeOps and we don't formm X86 nodes
until after that. Except for a couple special case in type
legalization. But I think we would probably break those if
some of the transforms fire on them.

I want to remove the hardcoded operand numbers and the unusual
use of UpdateNodeOperands. Being able to know which ISD opcodes
are present should help with that.

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

5 years ago[SampleFDO] Create a separate flag profile-accurate-for-symsinlist to handle
Wei Mi [Fri, 27 Sep 2019 22:33:59 +0000 (22:33 +0000)]
[SampleFDO] Create a separate flag profile-accurate-for-symsinlist to handle
profile symbol list.

Currently many existing users using profile-sample-accurate want to reduce
code size as much as possible. Their use cases are different from the scenario
profile symbol list tries to handle -- the major motivation of adding profile
symbol list is to get the major memory/code size saving without introduce
performance regression. So to keep the behavior of profile-sample-accurate
unchanged, we think decoupling these two things and using a new flag to
control the handling of profile symbol list may be better.

When profile-sample-accurate and the new flag profile-accurate-for-symsinlist
are both present, since profile-sample-accurate is a user assertion we let it
have a higher precedence.

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

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

5 years ago[llvm-lipo] Add support for -arch
Alexander Shaposhnikov [Fri, 27 Sep 2019 22:33:18 +0000 (22:33 +0000)]
[llvm-lipo] Add support for -arch

Add support for -arch.

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

Test plan: make check-all

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

5 years ago[X86] Add test case to show missed opportunity to turn (add (zext (vXi1 X)), Y) ...
Craig Topper [Fri, 27 Sep 2019 22:30:24 +0000 (22:30 +0000)]
[X86] Add test case to show missed opportunity to turn (add (zext (vXi1 X)), Y) -> (sub Y, (sext (vXi1 X))) with avx512.

With avx512, the vXi1 type is legal. And we can more easily sign
extend them to vector registers. zext requires a sign extend and
a shift.

If we can easily turn the zext into a sext we should.

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

5 years ago[PatternMatch] Add m_SExtOrSelf(), m_ZExtOrSExtOrSelf() matchers + unittests
Roman Lebedev [Fri, 27 Sep 2019 21:53:04 +0000 (21:53 +0000)]
[PatternMatch] Add m_SExtOrSelf(), m_ZExtOrSExtOrSelf() matchers + unittests

m_SExtOrSelf() is for consistency.

m_ZExtOrSExtOrSelf() is motivated by the D68103/r373106 :
sometimes it is useful to look past any extensions of the shift amount,
and m_ZExtOrSExtOrSelf() may be exactly the tool to do that.

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

5 years ago[llvm-readobj] Rename --arm-attributes to --arch-specific
Yi Kong [Fri, 27 Sep 2019 20:38:18 +0000 (20:38 +0000)]
[llvm-readobj] Rename --arm-attributes to --arch-specific

This is for compatibility with GNU readobj. --arm-attributes option is
left as a hidden alias due to large number of tests using it.

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

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

5 years ago[InstSimplify] generalize FP folds with undef/NaN; NFC
Sanjay Patel [Fri, 27 Sep 2019 20:09:09 +0000 (20:09 +0000)]
[InstSimplify] generalize FP folds with undef/NaN; NFC

We can reuse this logic for things like fma.

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

5 years agoRevert [Dominators][CodeGen] Clean up MachineDominators
Jakub Kuderski [Fri, 27 Sep 2019 19:33:39 +0000 (19:33 +0000)]
Revert [Dominators][CodeGen] Clean up MachineDominators

This reverts r373101 (git commit 72c57ec3e6b320c31274dadb888dc16772b8e7b6)

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

5 years agoRevert XFAIL a codegen test AArch64/tailmerging_in_mbp.ll
Jakub Kuderski [Fri, 27 Sep 2019 19:33:35 +0000 (19:33 +0000)]
Revert XFAIL a codegen test AArch64/tailmerging_in_mbp.ll

This reverts r373103 (git commit a524e630a793e18e7d5fabc2262781f310eb0279)

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

5 years ago[NFC][PhaseOrdering] Add end-to-end tests for the 'two shifts by sext' problem
Roman Lebedev [Fri, 27 Sep 2019 19:32:43 +0000 (19:32 +0000)]
[NFC][PhaseOrdering] Add end-to-end tests for the 'two shifts by sext' problem

We start with two separate sext's, but EarlyCSE runs before InstCombine,
so when we get them, they are a single sext, and we just ignore that.
Likewise, if we had a single sext, we don't do anything there.

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

5 years ago[Docs] Adds new section to User Guides page
DeForest Richards [Fri, 27 Sep 2019 19:12:00 +0000 (19:12 +0000)]
[Docs] Adds new section to User Guides page

Adds a section to the User Guides page for articles related to building, packaging, and distributing LLVM. Includes sub-sections for CMake, Clang, and Docker.

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

5 years ago[InstSimplify] add tests for fma/fmuladd with undef operand; NFC
Sanjay Patel [Fri, 27 Sep 2019 18:38:51 +0000 (18:38 +0000)]
[InstSimplify] add tests for fma/fmuladd with undef operand; NFC

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

5 years ago[X86] Call SimplifyDemandedBits in combineGatherScatter any time the mask element...
Craig Topper [Fri, 27 Sep 2019 18:23:55 +0000 (18:23 +0000)]
[X86] Call SimplifyDemandedBits in combineGatherScatter any time the mask element is wider than i1, not just when AVX512 is disabled.

The AVX2 intrinsics can still be used when AVX512 is enabled and
those go through this path. So we should simplify them.

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

5 years ago[X86] Add test case to show failure to perform SimplifyDemandedBits on mask of avx2...
Craig Topper [Fri, 27 Sep 2019 18:23:46 +0000 (18:23 +0000)]
[X86] Add test case to show failure to perform SimplifyDemandedBits on mask of avx2 gather intrinsics when avx512 is enabled.

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

5 years ago[InstCombine] Simplify shift-by-sext to shift-by-zext
Roman Lebedev [Fri, 27 Sep 2019 18:12:15 +0000 (18:12 +0000)]
[InstCombine] Simplify shift-by-sext to shift-by-zext

Summary:
This is valid for any `sext` bitwidth pair:
```
Processing /tmp/opt.ll..

----------------------------------------
  %signed = sext %y
  %r = shl %x, %signed
  ret %r
=>
  %unsigned = zext %y
  %r = shl %x, %unsigned
  ret %r
  %signed = sext %y

Done: 2016
Optimization is correct!
```

(This isn't so for funnel shifts, there it's illegal for e.g. i6->i7.)

Main motivation is the C++ semantics:
```
int shl(int a, char b) {
    return a << b;
}
```
ends as
```
  %3 = sext i8 %1 to i32
  %4 = shl i32 %0, %3
```
https://godbolt.org/z/0jgqUq
which is, as this shows, too pessimistic.

There is another problem here - we can only do the fold
if sext is one-use. But we can trivially have cases
where several shifts have the same sext shift amount.
This should be resolved, later.

Reviewers: spatel, nikic, RKSimon

Reviewed By: spatel

Subscribers: efriedma, hiraditya, nlopes, llvm-commits

Tags: #llvm

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

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

5 years agoXFAIL a codegen test AArch64/tailmerging_in_mbp.ll
Jakub Kuderski [Fri, 27 Sep 2019 17:41:17 +0000 (17:41 +0000)]
XFAIL a codegen test AArch64/tailmerging_in_mbp.ll

This test fails when machine dominator tree verifier is run.
Needs more investigation, as this is not a new failure.

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

5 years ago[Dominators][CodeGen] Clean up MachineDominators
Jakub Kuderski [Fri, 27 Sep 2019 17:25:39 +0000 (17:25 +0000)]
[Dominators][CodeGen] Clean up MachineDominators

Summary: This is a cleanup patch for MachineDominatorTree. It would be an NFC, except for replacing custom DomTree verification with the generic one.

Reviewers: tstellar, tpr, nhaehnle, arsenm, NutshellySima, grosser, hliao

Reviewed By: arsenm

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Fri, 27 Sep 2019 16:56:07 +0000 (16:56 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

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

5 years agoModuleUtils - silence static analyzer dyn_cast<> null dereference warning. NFCI.
Simon Pilgrim [Fri, 27 Sep 2019 16:55:49 +0000 (16:55 +0000)]
ModuleUtils - silence static analyzer dyn_cast<> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us.

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

5 years agoChange -march=systemz to triple and fix test
Kai Nacke [Fri, 27 Sep 2019 16:19:15 +0000 (16:19 +0000)]
Change -march=systemz to triple and fix test

These two test cases use -march=systemz instead of a triple. In
particular, the used file format is then based on the default host
triple. This leads to different behaviour on different platforms.

The SystemZ implementation uses the integrated assembler for a
long time now. The mature-mc-support test can be fully enabled.

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

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

5 years agoFunctionImportGlobalProcessing::processGlobalForThinLTO - silence static analyzer...
Simon Pilgrim [Fri, 27 Sep 2019 15:49:19 +0000 (15:49 +0000)]
FunctionImportGlobalProcessing::processGlobalForThinLTO - silence static analyzer dyn_cast<FunctionSummary> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<FunctionSummary> directly and if not assert will fire for us.

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

5 years ago[RISCV] Rename FPRs and use Register arithmetic
Luis Marques [Fri, 27 Sep 2019 15:49:10 +0000 (15:49 +0000)]
[RISCV] Rename FPRs and use Register arithmetic

The new names for FPRs ensure that the Register values within the same class are
enumerated consecutively (the order is determined by the `LessRecordRegister`
function object). Where there were tables mapping between 32- and 64-bit FPRs
(and vice versa) this patch replaces them with Register arithmetic. The
enumeration order between different register classes is expected to continue to
be arbitrary, although it does impact the conversion from the (overloaded) asm
FPR names to Register values, and therefore might require updates to the target
if the sorting algorithm is changed. Static asserts were added to ensure that
changes to the ordering that would impact the current implementation are
detected.

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

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

5 years agoSCCP - silence static analyzer dyn_cast<StructType> null dereference warning. NFCI.
Simon Pilgrim [Fri, 27 Sep 2019 15:49:10 +0000 (15:49 +0000)]
SCCP - silence static analyzer dyn_cast<StructType> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<StructType> directly and if not assert will fire for us.

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

5 years ago[AMDGPU][MC] Corrected parsing of registers
Dmitry Preobrazhensky [Fri, 27 Sep 2019 15:41:31 +0000 (15:41 +0000)]
[AMDGPU][MC] Corrected parsing of registers

Summary of changes:

refactored code for better readability and future improvements;
fixed bug 41281: https://bugs.llvm.org/show_bug.cgi?id=41281

Reviewers: artem.tamazov, arsenm

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

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

5 years ago[DebugInfo] Exclude memory location values as parameter entry values
Djordje Todorovic [Fri, 27 Sep 2019 13:52:43 +0000 (13:52 +0000)]
[DebugInfo] Exclude memory location values as parameter entry values

Abandon describing of loaded values due to safety concerns. Loaded
values are described as derefed memory location at caller point.
At callee we can unintentionally change that memory location which
would lead to different entry being printed value before and after
the memory location clobbering. This problem is described in
llvm.org/PR43343.

Patch by Nikola Prica

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

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

5 years ago[llvm-exegesis] Fix r373083: Module -> Mod.
Clement Courbet [Fri, 27 Sep 2019 13:21:37 +0000 (13:21 +0000)]
[llvm-exegesis] Fix r373083: Module -> Mod.

SnippetRepetitorTest.cpp:66:27: error: declaration of โ€˜std::unique_ptr<llvm::Module> llvm::exegesis::{anonymous}::X86SnippetRepetitorTest::Moduleโ€™ [-fpermissive]
   std::unique_ptr<Module> Module;

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

5 years agogn build: (manually) merge r373082
Nico Weber [Fri, 27 Sep 2019 13:14:34 +0000 (13:14 +0000)]
gn build: (manually) merge r373082

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

5 years agogn build: Merge r373083
GN Sync Bot [Fri, 27 Sep 2019 13:04:46 +0000 (13:04 +0000)]
gn build: Merge r373083

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

5 years ago[CodeGenPrepare] Mend "avoid crashing from replacing a phi twice" fix.
Jesper Antonsson [Fri, 27 Sep 2019 13:01:37 +0000 (13:01 +0000)]
[CodeGenPrepare] Mend "avoid crashing from replacing a phi twice" fix.

Summary:
An erroneously negated if-statement by an earlier (March 2019) bugfix left phi replacement/simplification under optimizeMemoryInst()  in CodeGenPrepare largely inactivated. The error was found when csmith found that the same assert as in the original bug report could still be triggered in a different way. This patch fixes the bugfix. The original bug was:
 https://bugs.llvm.org/show_bug.cgi?id=41052
... and the previous fix was D59358.

Reviewers: aprantl, skatkov

Reviewed By: skatkov

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-exegesis] Add loop mode for repeating the snippet.
Clement Courbet [Fri, 27 Sep 2019 12:56:24 +0000 (12:56 +0000)]
[llvm-exegesis] Add loop mode for repeating the snippet.

Summary:
Before this change the Executable function was made by duplicating the
snippet. This change adds a --repetion-mode={loop|duplicate} flag that
allows choosing between this behaviour and wrapping the snippet instructions
in a loop.

The new mode can help measurements when the snippet fits in the DSB by
short-cirtcuiting decoding. The loop adds a dec + jmp to the measurements, but
since these are not part of the critical path, they execute in parallel
with the measured code and do not impact measurements in practice.

Overview of the change:
 - New SnippetRepetitor abstraction that handles repeating the snippet.
   The assembler delegates repeating the instructions to this class.
 - ExegesisTarget learns how to decrement loop counter and jump.
 - Some refactoring of the assembler into FunctionFiller/BasicBlockFiller.

Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

Tags: #llvm

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

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

5 years ago[Alignment][NFC] Remove unneeded llvm:: scoping on Align types
Guillaume Chatelet [Fri, 27 Sep 2019 12:54:21 +0000 (12:54 +0000)]
[Alignment][NFC] Remove unneeded llvm:: scoping on Align types

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

5 years agoReland "gn build: (manually) merge r373028"
Nico Weber [Fri, 27 Sep 2019 11:37:59 +0000 (11:37 +0000)]
Reland "gn build: (manually) merge r373028"

This relands r373029, reverted in 373033, because r373028 relanded in r373066.

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

5 years ago[NFC][ARM] Add some tail-predication tests
Sam Parker [Fri, 27 Sep 2019 10:33:53 +0000 (10:33 +0000)]
[NFC][ARM] Add some tail-predication tests

Use different data types for some simple loops.

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

5 years ago[SLPVectorizer][X86] Regenerate arith-fp tests
Simon Pilgrim [Fri, 27 Sep 2019 10:04:25 +0000 (10:04 +0000)]
[SLPVectorizer][X86] Regenerate arith-fp tests

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

5 years ago[UpdateTestChecks] Fix wildcard support on DOS prompts
Simon Pilgrim [Fri, 27 Sep 2019 10:04:16 +0000 (10:04 +0000)]
[UpdateTestChecks] Fix wildcard support on DOS prompts

D64572 / rL365818 changed the way that the file paths were collected, which meant we lost the file pattern expansion necessary when working with DOS command prompt

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

5 years agoRevert r372893 "[CodeGen] Replace -max-jump-table-size with -max-jump-table-targets"
Hans Wennborg [Fri, 27 Sep 2019 09:54:26 +0000 (09:54 +0000)]
Revert r372893 "[CodeGen] Replace -max-jump-table-size with -max-jump-table-targets"

This caused severe compile-time regressions, see PR43455.

> Modern processors predict the targets of an indirect branch regardless of
> the size of any jump table used to glean its target address.  Moreover,
> branch predictors typically use resources limited by the number of actual
> targets that occur at run time.
>
> This patch changes the semantics of the option `-max-jump-table-size` to limit
> the number of different targets instead of the number of entries in a jump
> table.  Thus, it is now renamed to `-max-jump-table-targets`.
>
> Before, when `-max-jump-table-size` was specified, it could happen that
> cluster jump tables could have targets used repeatedly, but each one was
> counted and typically resulted in tables with the same number of entries.
> With this patch, when specifying `-max-jump-table-targets`, tables may have
> different lengths, since the number of unique targets is counted towards the
> limit, but the number of unique targets in tables is the same, but for the
> last one containing the balance of targets.
>
> Differential revision: https://reviews.llvm.org/D60295

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

5 years ago[sancov][NFC] Make filename Regexes "const"
Thomas Preud'homme [Fri, 27 Sep 2019 09:39:13 +0000 (09:39 +0000)]
[sancov][NFC] Make filename Regexes "const"

Summary:
The const-correctness of match() was fixed in rL372764, which allows
such static Regex objects to be marked const.

Reviewers: thopre

Reviewed By: thopre

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][InstCombine] Revisit shift-by-signext tests
Roman Lebedev [Fri, 27 Sep 2019 09:09:15 +0000 (09:09 +0000)]
[NFC][InstCombine] Revisit shift-by-signext tests

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

5 years ago[Alignment][NFC] MaybeAlign in GVNExpression
Guillaume Chatelet [Fri, 27 Sep 2019 08:56:43 +0000 (08:56 +0000)]
[Alignment][NFC] MaybeAlign in GVNExpression

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[MC][ARM] vscclrm disassembles as vldmia
Alexandros Lamprineas [Fri, 27 Sep 2019 08:22:24 +0000 (08:22 +0000)]
[MC][ARM] vscclrm disassembles as vldmia

Happens only when the mve.fp subtarget feature is enabled:

$ llvm-mc -triple thumbv8.1m.main -mattr=+mve.fp,+8msecext -disassemble <<< "0x9f,0xec,0x08,0x0b"
  .text
  vldmia  pc, {d0, d1, d2, d3}
$ llvm-mc -triple thumbv8.1m.main -mattr=+8msecext -disassemble <<< "0x9f,0xec,0x08,0x0b"
  .text
  vscclrm {d0, d1, d2, d3, vpr}

Assembling returns the correct encoding with or without mve.fp:

$ llvm-mc -triple thumbv8.1m.main -mattr=+mve.fp,+8msecext -show-encoding <<< "vscclrm {d0-d3, vpr}"
  .text
  vscclrm {d0, d1, d2, d3, vpr}   @ encoding: [0x9f,0xec,0x08,0x0b]
$ llvm-mc -triple thumbv8.1m.main -mattr=+8msecext -show-encoding <<< "vscclrm {d0-d3, vpr}"
  .text
  vscclrm {d0, d1, d2, d3, vpr}   @ encoding: [0x9f,0xec,0x08,0x0b]

The problem seems to be in the TableGen description of VSCCLRMD.
The least significant bit should be set to zero.

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

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

5 years ago[llvm-exegesis] Refactor how forbidden registers are computed.
Clement Courbet [Fri, 27 Sep 2019 08:04:10 +0000 (08:04 +0000)]
[llvm-exegesis] Refactor how forbidden registers are computed.

Summary:
Right now latency generation can incorrectly select the scratch register
as a dependency-carrying register.
 - Move the logic for preventing register selection from Uops
   implementation to common SnippetGenerator class.
 - Aliasing detection now takes a set of forbidden registers just like
   random register assignment does.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

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

5 years ago[LoopInfo] Remove duplicates in ExitBlocks to reduce the compile time of
Wei Mi [Fri, 27 Sep 2019 05:43:31 +0000 (05:43 +0000)]
[LoopInfo] Remove duplicates in ExitBlocks to reduce the compile time of
hasDedicatedExits.

For the compile time problem described in https://reviews.llvm.org/D67359,
turns out the root cause is there are many duplicates in ExitBlocks so
the algorithm complexity of hasDedicatedExits gets very high. If we remove
the duplicates, the compile time issue is gone.

Thanks to Philip Reames for raising a good question and it leads me to
find the root cause.

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

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

5 years agoRevert "[LoopInfo] Limit the iterations to check whether a loop has dedicated
Wei Mi [Fri, 27 Sep 2019 05:43:30 +0000 (05:43 +0000)]
Revert "[LoopInfo] Limit the iterations to check whether a loop has dedicated
exits"

Get a better approach in https://reviews.llvm.org/D68107 to solve the problem.
Revert the initial patch and will commit the new one soon.

This reverts commit rL372990.

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

5 years ago[WebAssembly] v128.andnot
Thomas Lively [Fri, 27 Sep 2019 02:11:40 +0000 (02:11 +0000)]
[WebAssembly] v128.andnot

Summary:
As specified at
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#bitwise-and-not

Reviewers: aheejin

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

Tags: #llvm

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

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

5 years ago[WebAssembly] SIMD Load and extend operations
Thomas Lively [Fri, 27 Sep 2019 02:06:50 +0000 (02:06 +0000)]
[WebAssembly] SIMD Load and extend operations

Summary:
As specified at
https://github.com/webassembly/simd/blob/master/proposals/simd/SIMD.md#load-and-extend.
These instructions are behind the unimplemented-simd128 target feature
for now because they have not been implemented in V8 yet.

Reviewers: aheejin

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

Tags: #llvm

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

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

5 years agoRevert r373034
Nicholas Allegra [Fri, 27 Sep 2019 01:58:31 +0000 (01:58 +0000)]
Revert r373034

It breaks the build on MSVC.

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

5 years agoSpeculative fix for gcc build.
Peter Collingbourne [Fri, 27 Sep 2019 01:35:04 +0000 (01:35 +0000)]
Speculative fix for gcc build.

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

5 years agohwasan: Compatibility fixes for short granules.
Peter Collingbourne [Fri, 27 Sep 2019 01:02:10 +0000 (01:02 +0000)]
hwasan: Compatibility fixes for short granules.

We can't use short granules with stack instrumentation when targeting older
API levels because the rest of the system won't understand the short granule
tags stored in shadow memory.

Moreover, we need to be able to let old binaries (which won't understand
short granule tags) run on a new system that supports short granule
tags. Such binaries will call the __hwasan_tag_mismatch function when their
outlined checks fail. We can compensate for the binary's lack of support
for short granules by implementing the short granule part of the check in
the __hwasan_tag_mismatch function. Unfortunately we can't do anything about
inline checks, but I don't believe that we can generate these by default on
aarch64, nor did we do so when the ABI was fixed.

A new function, __hwasan_tag_mismatch_v2, is introduced that lets code
targeting the new runtime avoid redoing the short granule check. Because tag
mismatches are rare this isn't important from a performance perspective; the
main benefit is that it introduces a symbol dependency that prevents binaries
targeting the new runtime from running on older (i.e. incompatible) runtimes.

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

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

5 years ago[Consumed][NFC] Refactor handleCall to take function argument list.
Nicholas Allegra [Thu, 26 Sep 2019 23:47:18 +0000 (23:47 +0000)]
[Consumed][NFC] Refactor handleCall to take function argument list.

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

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

5 years agoRevert "gn build: (manually) merge r373028"
Dmitri Gribenko [Thu, 26 Sep 2019 23:30:47 +0000 (23:30 +0000)]
Revert "gn build: (manually) merge r373028"

This reverts commit r373029, which depends on r373028, which I reverted.

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

5 years ago[X86] Remove CodeGenOnly instructions added in r373021, but keep the isel patterns...
Craig Topper [Thu, 26 Sep 2019 23:22:15 +0000 (23:22 +0000)]
[X86] Remove CodeGenOnly instructions added in r373021, but keep the isel patterns and add COPY_TO_REGCLASS to them.

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

5 years agogn build: (manually) merge r373028
Nico Weber [Thu, 26 Sep 2019 23:17:25 +0000 (23:17 +0000)]
gn build: (manually) merge r373028

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

5 years ago[X86] Remove unused arguments from a tablegen multiclass. NFC
Craig Topper [Thu, 26 Sep 2019 22:56:19 +0000 (22:56 +0000)]
[X86] Remove unused arguments from a tablegen multiclass. NFC

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

5 years ago[X86] Add VMOVSSZrrk/VMOVSDZrrk/VMOVSSZrrkz/VMOVSDZrrkz to getUndefRegClearance.
Craig Topper [Thu, 26 Sep 2019 22:56:06 +0000 (22:56 +0000)]
[X86] Add VMOVSSZrrk/VMOVSDZrrk/VMOVSSZrrkz/VMOVSDZrrkz to getUndefRegClearance.

We have isel patterns that can put an IMPLICIT_DEF on one of
the sources for these instructions. So we should make sure
we break any dependencies there. This should be done by
just using one of the other sources.

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

5 years agoRemove the AliasAnalysis argument in function areMemAccessesTriviallyDisjoint
Changpeng Fang [Thu, 26 Sep 2019 22:53:44 +0000 (22:53 +0000)]
Remove the AliasAnalysis argument in function areMemAccessesTriviallyDisjoint

Reviewers:
  arsenm

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

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

5 years ago[X86] Add CodeGenOnly instructions for (f32 (X86selects $mask, (loadf32 addr), fp32im...
Craig Topper [Thu, 26 Sep 2019 22:23:09 +0000 (22:23 +0000)]
[X86] Add CodeGenOnly instructions for (f32 (X86selects $mask, (loadf32 addr), fp32imm0) to use masked MOVSS from memory.

Similar for f64 and having a non-zero passthru value.

We were previously not trying to fold the load at all. Using
a CodeGenOnly instruction allows us to use FR32X/FR64X as the
register class to avoid a bunch of COPY_TO_REGCLASS.

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

5 years agoRevert [SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L)...
Jordan Rupprecht [Thu, 26 Sep 2019 22:09:17 +0000 (22:09 +0000)]
Revert [SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!")

This reverts r372626 (git commit 6a278d9073bdc158d31d4f4b15bbe34238f22c18)

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

5 years ago[LoopFusion] Add ability to fuse guarded loops
Kit Barton [Thu, 26 Sep 2019 21:42:45 +0000 (21:42 +0000)]
[LoopFusion] Add ability to fuse guarded loops

Summary:
This patch extends the current capabilities in loop fusion to fuse guarded loops
(as defined in https://reviews.llvm.org/D63885). The patch adds the necessary
safety checks to ensure that it safe to fuse the guarded loops (control flow
equivalent, no intervening code, and same guard conditions). It also provides an
alternative method to perform the actual fusion of guarded loops. The mechanics
to fuse guarded loops are slightly different then fusing non-guarded loops, so I
opted to keep them separate methods. I will be cleaning this up in later
patches, and hope to converge on a single method to fuse both guarded and
non-guarded loops, but for now I think the review will be easier to keep them
separate.

Reviewers: jdoerfert, Meinersbur, dmgreen, etiotto, Whitney

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[Unroll] Do NOT unroll a loop with small runtime upperbound
Zhaoshi Zheng [Thu, 26 Sep 2019 21:40:27 +0000 (21:40 +0000)]
[Unroll] Do NOT unroll a loop with small runtime upperbound

For a runtime loop if we can compute its trip count upperbound:

Don't unroll if:
1. loop is not guaranteed to run either zero or upperbound iterations; and
2. trip count upperbound is less than UnrollMaxUpperBound
Unless user or TTI asked to do so.

If unrolling, limit unroll factor to loop's trip count upperbound.

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

Change-Id: I6083c46a9d98b2e22cd855e60523fdc5a4929c73

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

5 years ago[AMDGPU] copy OtherPredicates from pseudo to VOP3_Real
Stanislav Mekhanoshin [Thu, 26 Sep 2019 21:06:17 +0000 (21:06 +0000)]
[AMDGPU] copy OtherPredicates from pseudo to VOP3_Real

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

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

5 years ago[DAGCombine][X86][AArch64][NFC] Add tests for shift-by-signext
Roman Lebedev [Thu, 26 Sep 2019 20:49:49 +0000 (20:49 +0000)]
[DAGCombine][X86][AArch64][NFC] Add tests for shift-by-signext

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

5 years ago[InstCombine][NFC] Add tests for shift-by-signext
Roman Lebedev [Thu, 26 Sep 2019 20:49:30 +0000 (20:49 +0000)]
[InstCombine][NFC] Add tests for shift-by-signext

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

5 years ago[InstCombine][NFC] Regenerate load-cmp.ll test
Roman Lebedev [Thu, 26 Sep 2019 20:49:21 +0000 (20:49 +0000)]
[InstCombine][NFC] Regenerate load-cmp.ll test

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

5 years ago[LOOPGUARD] Disable loop with multiple loop exiting blocks.
Whitney Tsang [Thu, 26 Sep 2019 20:20:42 +0000 (20:20 +0000)]
[LOOPGUARD] Disable loop with multiple loop exiting blocks.
Summary: As discussed in the loop group meeting. With the current
definition of loop guard, we should not allow multiple loop exiting
blocks. For loops that has multiple loop exiting blocks, we can simply
unable to find the loop guard.
When getUniqueExitBlock() obtains a vector size not equals to one, that
means there is either no exit blocks or there exists more than one
unique block the loop exit to.
If we don't disallow loop with multiple loop exit blocks, then with our
current implementation, there can exist exit blocks don't post dominated
by the non pre-header successor of the guard block.
Reviewer: reames, Meinersbur, kbarton, etiotto, bmahjour
Reviewed By: Meinersbur, kbarton
Subscribers: fhahn, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D66529

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

5 years ago[AIX]Emit function descriptor csect in assembly
Xiangling Liao [Thu, 26 Sep 2019 19:38:32 +0000 (19:38 +0000)]
[AIX]Emit function descriptor csect in assembly

This patch emits the function descriptor csect for functions with definitions
under both 32-bit/64-bit mode on AIX.

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

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

5 years ago[NFC][emacs] remove out-of-date comment from tablegen-mode.el
Bob Haarman [Thu, 26 Sep 2019 19:36:01 +0000 (19:36 +0000)]
[NFC][emacs] remove out-of-date comment from tablegen-mode.el

Summary:
The syntax table was originally based on and attributed to
jasmin.el, but was rewritten in r45192, so the comment that
says the code comes from jasmin.el is no longer accurate. This
change removes the comment, shortening the code a bit.

Reviewers: MaskRay, lattner

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

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