]> granicus.if.org Git - llvm/log
llvm
5 years agogn build: (manually) merge r374271
Nico Weber [Thu, 10 Oct 2019 02:48:47 +0000 (02:48 +0000)]
gn build: (manually) merge r374271

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

5 years ago[codeview] Try to avoid emitting .cv_loc with line zero
Reid Kleckner [Thu, 10 Oct 2019 01:06:01 +0000 (01:06 +0000)]
[codeview] Try to avoid emitting .cv_loc with line zero

Summary:
Visual Studio doesn't like it while stepping. It kicks you out of the
source view of the file being stepped through and tries to fall back to
the disassembly view.

Fixes PR43530

The fix is incomplete, because it's possible to have a basic block with
no source locations at all. In this case, we don't emit a .cv_loc, but
that will result in wrong stepping behavior in the debugger if the
layout predecessor of the location-less BB has an unrelated source
location. We could try harder to find a valid location that dominates or
post-dominates the current BB, but in general it's a dataflow problem,
and one still might not exist. I left a FIXME about this.

As an alternative, we might want to consider having the middle-end check
if its emitting codeview and get it to stop using line zero.

Reviewers: akhuang

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoConservatively add volatility and atomic checks in a few places
Philip Reames [Wed, 9 Oct 2019 23:43:33 +0000 (23:43 +0000)]
Conservatively add volatility and atomic checks in a few places

As background, starting in D66309, I'm working on support unordered atomics analogous to volatile flags on normal LoadSDNode/StoreSDNodes for X86.

As part of that, I spent some time going through usages of LoadSDNode and StoreSDNode looking for cases where we might have missed a volatility check or need an atomic check. I couldn't find any cases that clearly miscompile - i.e. no test cases - but a couple of pieces in code loop suspicious though I can't figure out how to exercise them.

This patch adds defensive checks and asserts in the places my manual audit found. If anyone has any ideas on how to either a) disprove any of the checks, or b) hit the bug they might be fixing, I welcome suggestions.

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

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

5 years agogn build: Merge r374245
GN Sync Bot [Wed, 9 Oct 2019 23:10:49 +0000 (23:10 +0000)]
gn build: Merge r374245

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

5 years ago[WebAssembly] Fix tests missed in rL374235
Thomas Lively [Wed, 9 Oct 2019 23:06:38 +0000 (23:06 +0000)]
[WebAssembly] Fix tests missed in rL374235

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

5 years agoAMDGPU: Don't fold copies to physregs
Matt Arsenault [Wed, 9 Oct 2019 22:51:42 +0000 (22:51 +0000)]
AMDGPU: Don't fold copies to physregs

In a future patch, this will help cleanup m0 handling.

The register coalescer handles copies from a register that
materializes an immediate, but doesn't handle move immediates
itself. The virtual register uses will often be allocated to the same
register, so there end up being no real copy.

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

5 years agoAMDGPU/GlobalISel: Fix crash on wide constant load with VGPR pointer
Matt Arsenault [Wed, 9 Oct 2019 22:44:49 +0000 (22:44 +0000)]
AMDGPU/GlobalISel: Fix crash on wide constant load with VGPR pointer

This was ignoring the register bank of the input pointer, and
isUniformMMO seems overly aggressive.

This will now conservatively assume a VGPR in cases where the incoming
bank hasn't been determined yet (i.e. is from a loop phi).

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

5 years agoAMDGPU: Relax register classes used
Matt Arsenault [Wed, 9 Oct 2019 22:44:48 +0000 (22:44 +0000)]
AMDGPU: Relax register classes used

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

5 years agoAMDGPU: Fix typos
Matt Arsenault [Wed, 9 Oct 2019 22:44:47 +0000 (22:44 +0000)]
AMDGPU: Fix typos

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

5 years agoGlobalISel: Implement fewerElementsVector for G_BUILD_VECTOR
Matt Arsenault [Wed, 9 Oct 2019 22:44:43 +0000 (22:44 +0000)]
GlobalISel: Implement fewerElementsVector for G_BUILD_VECTOR

Turn it into a G_CONCAT_VECTORS of G_BUILD_VECTOR.

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

5 years agogn build: (manually) merge r374219
Nico Weber [Wed, 9 Oct 2019 22:22:36 +0000 (22:22 +0000)]
gn build: (manually) merge r374219

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

5 years ago[GISel] Refactor and split PatternMatchTest. NFC
Marcello Maggioni [Wed, 9 Oct 2019 22:10:10 +0000 (22:10 +0000)]
[GISel] Refactor and split PatternMatchTest. NFC

Split the ConstantFold part into a separate file and
make it use the fixture GISelMITest.

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

5 years ago[InstCombine] Fix PR43617
Evandro Menezes [Wed, 9 Oct 2019 22:03:23 +0000 (22:03 +0000)]
[InstCombine] Fix PR43617

Check for `nullptr` before inspecting composite function.

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

5 years ago[AMDGPU] Fixed dpp combine of VOP1
Stanislav Mekhanoshin [Wed, 9 Oct 2019 22:02:58 +0000 (22:02 +0000)]
[AMDGPU] Fixed dpp combine of VOP1

If original instruction did not have source modifiers they were
not added to the new DPP instruction as well, even if needed.

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

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

5 years ago[IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator
Cameron McInally [Wed, 9 Oct 2019 21:52:15 +0000 (21:52 +0000)]
[IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator

Also update Clang to call Builder.CreateFNeg(...) for UnaryMinus.

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

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

5 years ago[WebAssembly] Make returns variadic
Thomas Lively [Wed, 9 Oct 2019 21:42:08 +0000 (21:42 +0000)]
[WebAssembly] Make returns variadic

Summary:
This is necessary and sufficient to get simple cases of multiple
return working with multivalue enabled. More complex cases will
require block and loop signatures to be generalized to potentially be
type indices as well.

Reviewers: aheejin, dschuff

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

Tags: #llvm

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

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

5 years ago[SampleFDO] Add indexing for function profiles so they can be loaded on demand
Wei Mi [Wed, 9 Oct 2019 21:36:03 +0000 (21:36 +0000)]
[SampleFDO] Add indexing for function profiles so they can be loaded on demand
in ExtBinary format

Currently for Text, Binary and ExtBinary format profiles, when we compile a
module with samplefdo, even if there is no function showing up in the profile,
we have to load all the function profiles from the profile input. That is a
waste of compile time.

CompactBinary format profile has already had the support of loading function
profiles on demand. In this patch, we add the support to load profile on
demand for ExtBinary format. It will work no matter the sections in ExtBinary
format profile are compressed or not. Experiment shows it reduces the time to
compile a server benchmark by 30%.

When profile remapping and loading function profiles on demand are both used,
extra work needs to be done so that the loading on demand process will take
the name remapping into consideration. It will be addressed in a follow-up
patch.

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

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

5 years agollvm-dwarfdump: Support multiple debug_loclists contributions
David Blaikie [Wed, 9 Oct 2019 21:25:28 +0000 (21:25 +0000)]
llvm-dwarfdump: Support multiple debug_loclists contributions

Also fixing the incorrect "offset" field being computed/printed for each
location list.

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

5 years ago[Docs] Adds section for Additional Topics on Reference page
DeForest Richards [Wed, 9 Oct 2019 21:09:09 +0000 (21:09 +0000)]
[Docs] Adds section for Additional Topics on Reference page

Adds a new section for Additional Topics on the Reference documentation page. Also moves Support Library topic to User Guides page.

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

5 years ago[System Model] [TTI] Define AMDGPUTTIImpl::getST and AMDGPUTTIImpl::getTLI
Vitaly Buka [Wed, 9 Oct 2019 20:48:54 +0000 (20:48 +0000)]
[System Model] [TTI] Define AMDGPUTTIImpl::getST and AMDGPUTTIImpl::getTLI

To fix "infinite recursion" warning.

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

5 years ago[System Model] [TTI] Fix virtual destructor warning
Vitaly Buka [Wed, 9 Oct 2019 20:48:52 +0000 (20:48 +0000)]
[System Model] [TTI] Fix virtual destructor warning

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

5 years ago[Docs] Adds Documentation links to sidebar
DeForest Richards [Wed, 9 Oct 2019 20:26:13 +0000 (20:26 +0000)]
[Docs] Adds Documentation links to sidebar

Adds links to Getting Started/Tutorials, User Guides, and Reference documentation pages to sidebar. Also adds a new section for LLVM IR on the Reference documentation page.

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

5 years ago[ConstProp] add tests for extractelement with undef index; NFC
Sanjay Patel [Wed, 9 Oct 2019 20:14:17 +0000 (20:14 +0000)]
[ConstProp] add tests for extractelement with undef index; NFC

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

5 years ago[AMDGPU] Use math constants defined in MathExtras (NFC)
Evandro Menezes [Wed, 9 Oct 2019 20:00:43 +0000 (20:00 +0000)]
[AMDGPU] Use math constants defined in MathExtras (NFC)

Use the the new math constants in `MathExtras.h`.

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

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

5 years ago[Support] Add mathematical constants
Evandro Menezes [Wed, 9 Oct 2019 19:58:01 +0000 (19:58 +0000)]
[Support] Add mathematical constants

Add own version of the mathematical constants from the upcoming C++20 `std::numbers`.

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

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

5 years ago[System Model] [TTI] Update cache and prefetch TTI interfaces
David Greene [Wed, 9 Oct 2019 19:51:48 +0000 (19:51 +0000)]
[System Model] [TTI] Update cache and prefetch TTI interfaces

Re-apply 9fdfb045ae8b/r365676 with fixes for PPC and Hexagon.  This involved
moving defaults from TargetTransformInfoImplBase to MCSubtargetInfo.

Rework the TTI cache and software prefetching APIs to prepare for the
introduction of a general system model.  Changes include:

- Marking existing interfaces const and/or override as appropriate
- Adding comments
- Adding BasicTTIImpl interfaces that delegate to a subtarget
  implementation
- Moving the default TargetTransformInfoImplBase implementation to a default
  MCSubtarget implementation

Only a handful of targets use these interfaces currently: AArch64, Hexagon, PPC
and SystemZ.  AArch64 already has a custom subtarget implementation, so its
custom TTI implementation is migrated to use the new facilities in BasicTTIImpl
to invoke its custom subtarget implementation.  The custom TTI implementations
continue to exist for the other targets with this change.  They are not moved
over to subtarget-based implementations.

The end goal is to have the default subtarget implementation defer to the system
model defined by the target.  With this change, the default MCSubtargetInfo
implementation essentially returns the defaults TargetTransformInfoImplBase used
to return.  Existing users of TTI defaults will hit the defaults now in
MCSubtargetInfo.  Targets that define their own custom TTI implementations won't
use the BasicTTIImpl implementations that route to the subtarget.

Once system models are in place for the targets that use these interfaces, their
custom TTI implementations can be removed.

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

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

5 years agoDebugInfo: Shot in the dark attempt to fix ubsan error from r374122
David Blaikie [Wed, 9 Oct 2019 18:37:13 +0000 (18:37 +0000)]
DebugInfo: Shot in the dark attempt to fix ubsan error from r374122

(specifying an underlying type for the enum might also be suitable - but
this seems better/as good, since there's a clear expectation this can
contain values other than the actual enumerators of this enum)

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

5 years ago[lit] Refactor ProgressDisplay
Julian Lettner [Wed, 9 Oct 2019 18:23:30 +0000 (18:23 +0000)]
[lit] Refactor ProgressDisplay

Move progress display to separate file.  Simplify some code paths.
Decouple from other components via progress callback.  Remove unused
`_Display` class.

Reviewed By: serge-sans-paille

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

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

5 years ago[InstCombine] add another test for gep inbounds; NFC
Sanjay Patel [Wed, 9 Oct 2019 17:52:26 +0000 (17:52 +0000)]
[InstCombine] add another test for gep inbounds; NFC

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

5 years ago[WebAssembly] Add builtin and intrinsic for v8x16.swizzle
Thomas Lively [Wed, 9 Oct 2019 17:45:47 +0000 (17:45 +0000)]
[WebAssembly] Add builtin and intrinsic for v8x16.swizzle

Summary:
This clang builtin and corresponding LLVM intrinsic are necessary to
expose the exact semantics of the underlying WebAssembly instruction
to users. LLVM produces a poison value if the dynamic swizzle indices
are greater than the vector size, but the WebAssembly instruction sets
the corresponding output lane to zero. Users who depend on this
behavior can safely use this builtin.

Depends on D68527.

Reviewers: aheejin, dschuff

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

Tags: #clang, #llvm

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

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

5 years ago[WebAssembly] v8x16.swizzle and rewrite BUILD_VECTOR lowering
Thomas Lively [Wed, 9 Oct 2019 17:39:19 +0000 (17:39 +0000)]
[WebAssembly] v8x16.swizzle and rewrite BUILD_VECTOR lowering

Summary:
Adds the new v8x16.swizzle SIMD instruction as specified at
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#swizzling-using-variable-indices.
In addition to adding swizzles as a candidate lowering in
LowerBUILD_VECTOR, also rewrites and simplifies the lowering to
minimize the number of replace_lanes necessary rather than trying to
minimize code size. This leads to more uses of v128.const instead of
splats, which is expected to increase performance.

The new code will be easier to tune once V8 implements all the vector
construction operations, and it will also be easier to add new
candidate instructions in the future if necessary.

Reviewers: aheejin, dschuff

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

Tags: #llvm

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

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

5 years ago[FPEnv][NFC] Change test to conform to strictfp attribute rules.
Kevin P. Neal [Wed, 9 Oct 2019 17:24:56 +0000 (17:24 +0000)]
[FPEnv][NFC] Change test to conform to strictfp attribute rules.

In particular, the function definition is not marked strictfp despite
containing a function marked strictfp. Also, if any function call is marked
strictfp then all function calls in that function must be marked.

This change to move the one strictfp call to a new properly marked function
meets all the new rules.

Tested with a stricter version of D68233.

Reviewed by: spatel
Approved by: spatel
Differential Revision: https://reviews.llvm.org/D68713

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

5 years ago[SLP] respect target register width for GEP vectorization (PR43578)
Sanjay Patel [Wed, 9 Oct 2019 16:32:49 +0000 (16:32 +0000)]
[SLP] respect target register width for GEP vectorization (PR43578)

We failed to account for the target register width (max vector factor)
when vectorizing starting from GEPs. This causes vectorization to
proceed to obviously illegal widths as in:
https://bugs.llvm.org/show_bug.cgi?id=43578

For x86, this also means that SLP can produce rogue AVX or AVX512
code even when the user specifies a narrower vector width.

The AArch64 test in ext-trunc.ll appears to be better using the
narrower width. I'm not exactly sure what getelementptr.ll is trying
to do, but it's testing with "-slp-threshold=-18", so I'm not worried
about those diffs. The x86 test is an over-reduction from SPEC h264;
this patch appears to restore the perf loss caused by SLP when using
-march=haswell.

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

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

5 years ago[AArch64] Ensure no tagged memory is left in the unallocated portion of the
Momchil Velikov [Wed, 9 Oct 2019 16:31:50 +0000 (16:31 +0000)]
[AArch64] Ensure no tagged memory is left in the unallocated portion of the
stack

This patch makes sure that if we tag some memory, we untag that memory before
the function returns/throws via any exit, reachable from the tag operation. For
that we place the untag operation either at:

  a) the lifetime end call for the alloca, if that call post-dominates the
     lifetime start call (where the tag operation is placed), or it (the
     lifetime end call) dominates all reachable exits, otherwise
  b) at the reachable exits

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

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

5 years ago[NFC] Remove files got accidentally upload in llvm-svn 374179
Jason Liu [Wed, 9 Oct 2019 16:24:25 +0000 (16:24 +0000)]
[NFC] Remove files got accidentally upload in llvm-svn 374179

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

5 years ago[AIX][XCOFF][NFC] Change the SectionLen field name of CSect Auxiliary entry to Sectio...
Jason Liu [Wed, 9 Oct 2019 16:19:39 +0000 (16:19 +0000)]
[AIX][XCOFF][NFC] Change the SectionLen field name of CSect Auxiliary entry to SectionOrLength.

Summary:
According the the XCOFF document,
If
Then
XTY_SD
x_scnlen contains the csect length.
XTY_LD
x_scnlen contains the symbol table index of the containing csect.
XTY_CM
x_scnlen contains the csect length.
XTY_ER
x_scnlen contains 0.

Change the SectionLen member name to SectionOrLength is more reasonable.

Authored By: DiggerLin

Reviewed By: hubert.reinterpretcast

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

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

5 years agoRe-land "[dsymutil] Fix handling of common symbols in multiple object files."
Jonas Devlieghere [Wed, 9 Oct 2019 16:19:13 +0000 (16:19 +0000)]
Re-land "[dsymutil] Fix handling of common symbols in multiple object files."

The original patch got reverted because it hit a long-standing legacy
issue on Windows that prevents files from being named `com`. Thanks
Kristina & Jeremy for pointing this out.

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

5 years ago[MemorySSA] Make the use of moveAllAfterMergeBlocks consistent.
Alina Sbirlea [Wed, 9 Oct 2019 15:54:24 +0000 (15:54 +0000)]
[MemorySSA] Make the use of moveAllAfterMergeBlocks consistent.

Summary:
The rule for the moveAllAfterMergeBlocks API si for all instructions
from `From` to have been moved to `To`, while keeping the CFG edges (and
block terminators) unchanged.
Update all the callsites for moveAllAfterMergeBlocks to follow this.

Pending follow-up: since the same behavior is needed everytime, merge
all callsites into one. The common denominator may be the call to
`MergeBlockIntoPredecessor`.

Resolves PR43569.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

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

5 years agoFix Wdocumentation unknown parameter warning. NFCI.
Simon Pilgrim [Wed, 9 Oct 2019 14:26:09 +0000 (14:26 +0000)]
Fix Wdocumentation unknown parameter warning. NFCI.

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

5 years ago[llvm-exegesis] Ensure that ExecutableFunction are aligned.
Clement Courbet [Wed, 9 Oct 2019 14:25:08 +0000 (14:25 +0000)]
[llvm-exegesis] Ensure that ExecutableFunction are aligned.

Summary: Experiments show that this is the alignment we get (for ELF+Linux), but let's ensure that we have it.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

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

5 years agoAdd and adjust saturating tests. NFC
David Green [Wed, 9 Oct 2019 14:17:38 +0000 (14:17 +0000)]
Add and adjust saturating tests. NFC

This adds some extra testing to the existing [su][add/sub]_sat X86 and AArch64
tests and adds equivalent tests for ARM.

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

5 years ago[LV] Emitting SCEV checks with OptForSize
Sjoerd Meijer [Wed, 9 Oct 2019 13:19:41 +0000 (13:19 +0000)]
[LV] Emitting SCEV checks with OptForSize

When optimising for size and SCEV runtime checks need to be emitted to check
overflow behaviour, the loop vectorizer can run in this assert:

  LoopVectorize.cpp:2699: void llvm::InnerLoopVectorizer::emitSCEVChecks(
  llvm::Loop *, llvm::BasicBlock *): Assertion `!BB->getParent()->hasOptSize()
  && "Cannot SCEV check stride or overflow when opt

We should not generate predicates while optimising for size because
code will be generated for predicates such as these SCEV overflow runtime
checks.

This should fix PR43371.

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

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

5 years ago[mips] Rename local variable. NFC
Simon Atanasyan [Wed, 9 Oct 2019 13:12:27 +0000 (13:12 +0000)]
[mips] Rename local variable. NFC

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

5 years ago[mips] Split expandLoadImmReal into multiple methods. NFC
Simon Atanasyan [Wed, 9 Oct 2019 13:12:21 +0000 (13:12 +0000)]
[mips] Split expandLoadImmReal into multiple methods. NFC

The `expandLoadImmReal` handles four different and almost non-overlapping
cases: loading a "single" float immediate into a GPR, loading a "single"
float immediate into a FPR, and the same couple for a "double" float
immediate.

It's better to move each `else if` branch into separate methods.

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

5 years ago[llvm-exegesis] Fix r374158
Clement Courbet [Wed, 9 Oct 2019 12:37:56 +0000 (12:37 +0000)]
[llvm-exegesis] Fix r374158

Some bots complain about missing 'class':

LlvmState.h:70:40: error: declaration of â€˜std::unique_ptr<const llvm::TargetMachine> llvm::exegesis::LLVMState::TargetMachine’ [-fpermissive]
   std::unique_ptr<const TargetMachine> TargetMachine;

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

5 years ago[CostModel][X86] Add tests for insertelement to non-immediate vector element indices
Simon Pilgrim [Wed, 9 Oct 2019 12:36:34 +0000 (12:36 +0000)]
[CostModel][X86] Add tests for insertelement to non-immediate vector element indices

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

5 years ago[CostModel][X86] Add tests for extractelement from non-immediate vector element indices
Simon Pilgrim [Wed, 9 Oct 2019 12:36:22 +0000 (12:36 +0000)]
[CostModel][X86] Add tests for extractelement from non-immediate vector element indices

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

5 years ago[ARM] Add saturating arithmetic tests for MVE. NFC
David Green [Wed, 9 Oct 2019 12:29:51 +0000 (12:29 +0000)]
[ARM] Add saturating arithmetic tests for MVE. NFC

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

5 years ago[llvm-exegesis][NFC] Remove extra `llvm::` qualifications.
Clement Courbet [Wed, 9 Oct 2019 11:58:42 +0000 (11:58 +0000)]
[llvm-exegesis][NFC] Remove extra `llvm::` qualifications.

Summary: Second patch: in the lib.

Reviewers: gchatelet

Subscribers: nemanjai, tschuett, MaskRay, mgrang, jsji, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-exegesis][NFC] Remove extra `llvm::` qualifications.
Clement Courbet [Wed, 9 Oct 2019 11:29:21 +0000 (11:29 +0000)]
[llvm-exegesis][NFC] Remove extra `llvm::` qualifications.

Summary: First patch: in unit tests.

Subscribers: nemanjai, tschuett, MaskRay, jsji, llvm-commits

Tags: #llvm

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

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

5 years ago[TableGen] Fix crash when using HwModes in CodeEmitterGen
James Molloy [Wed, 9 Oct 2019 09:15:34 +0000 (09:15 +0000)]
[TableGen] Fix crash when using HwModes in CodeEmitterGen

When an instruction has an encoding definition for only a subset of
the available HwModes, ensure we just avoid generating an encoding
rather than crash.

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

5 years ago[llvm-exegesis] Add missing std::move in rL374146.
Clement Courbet [Wed, 9 Oct 2019 09:07:21 +0000 (09:07 +0000)]
[llvm-exegesis] Add missing std::move in rL374146.

This was breaking some bots:

/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/include/llvm/Support/Error.h:483:5:   required from â€˜llvm::Expected<T>::Expected(OtherT&&, typename std::enable_if<std::is_convertible<_Rep2, _Rep>::value>::type*) [with OtherT = std::vector<llvm::exegesis::CodeTemplate>&; T = std::vector<llvm::exegesis::CodeTemplate>; typename std::enable_if<std::is_convertible<_Rep2, _Rep>::value>::type = void]’
/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/tools/llvm-exegesis/lib/X86/Target.cpp:238:20:   required from here
/usr/include/c++/6/bits/stl_construct.h:75:7: error: use of deleted function â€˜llvm::exegesis::CodeTemplate::CodeTemplate(const llvm::exegesis::CodeTemplate&)’
     { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

5 years agoUnify the two CRC implementations
Hans Wennborg [Wed, 9 Oct 2019 09:06:30 +0000 (09:06 +0000)]
Unify the two CRC implementations

David added the JamCRC implementation in r246590. More recently, Eugene
added a CRC-32 implementation in r357901, which falls back to zlib's
crc32 function if present.

These checksums are essentially the same, so having multiple
implementations seems unnecessary. This replaces the CRC-32
implementation with the simpler one from JamCRC, and implements the
JamCRC interface in terms of CRC-32 since this means it can use zlib's
implementation when available, saving a few bytes and potentially making
it faster.

JamCRC took an ArrayRef<char> argument, and CRC-32 took a StringRef.
This patch changes it to ArrayRef<uint8_t> which I think is the best
choice, and simplifies a few of the callers nicely.

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

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

5 years ago[llvm-exegesis][NFC] Fix rL374146.
Clement Courbet [Wed, 9 Oct 2019 09:03:42 +0000 (09:03 +0000)]
[llvm-exegesis][NFC] Fix rL374146.

Remove extra semicolon: Target.cpp:187:2: warning: extra â€˜;’ [-Wpedantic]

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

5 years ago[llvm-exegesis] Explore LEA addressing modes.
Clement Courbet [Wed, 9 Oct 2019 08:49:13 +0000 (08:49 +0000)]
[llvm-exegesis] Explore LEA addressing modes.

Summary:
This will help for PR32326.

This shows the well-known issue with `RBP` and `R13` as base registers.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits, RKSimon, andreadb

Tags: #llvm

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

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

5 years agoRevert r374139, "[dsymutil] Fix handling of common symbols in multiple object files."
Jeremy Morse [Wed, 9 Oct 2019 08:27:48 +0000 (08:27 +0000)]
Revert r374139, "[dsymutil] Fix handling of common symbols in multiple object files."

The added test files ("com", "com1.o", "com2.o") are reserved names on
Windows, and makes 'git checkout' fail with a filesystem error.

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

5 years ago[llvm-exegesis][NFC] Remove unecessary `using llvm::` directives.
Clement Courbet [Wed, 9 Oct 2019 07:52:07 +0000 (07:52 +0000)]
[llvm-exegesis][NFC] Remove unecessary `using llvm::` directives.

We've been in namespace llvm for at least a year.

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

5 years ago[dsymutil] Fix handling of common symbols in multiple object files.
Jonas Devlieghere [Wed, 9 Oct 2019 04:16:18 +0000 (04:16 +0000)]
[dsymutil] Fix handling of common symbols in multiple object files.

For common symbols the linker emits only a single symbol entry in the
debug map. This caused dsymutil to not relocate common symbols when
linking DWARF coming form object files that did not have this entry.
This patch fixes that by keeping track of common symbols in the object
files and synthesizing a debug map entry for them using the address from
the main binary.

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

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

5 years ago[TypeSize] Fix module builds (cassert)
Kristina Brooks [Wed, 9 Oct 2019 04:00:03 +0000 (04:00 +0000)]
[TypeSize] Fix module builds (cassert)

TypeSize.h uses `assert` statements without including
the <cassert> header first which leads to failures
in modular builds.

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

5 years agogn build: unbreak libcxx build after r374116 by restoring gen_link_script.py for gn
Nico Weber [Tue, 8 Oct 2019 23:08:18 +0000 (23:08 +0000)]
gn build: unbreak libcxx build after r374116 by restoring gen_link_script.py for gn

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

5 years ago[Docs] Fixes broken sphinx build - undefined label
DeForest Richards [Tue, 8 Oct 2019 22:45:20 +0000 (22:45 +0000)]
[Docs] Fixes broken sphinx build - undefined label

Removes label ref pointing to non-existent subsystem docs page.

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

5 years ago[IA] Add tests for a few other edge cases
Bill Wendling [Tue, 8 Oct 2019 22:06:09 +0000 (22:06 +0000)]
[IA] Add tests for a few other edge cases

Test with the last eight bits within the range [7F, FF] and with
lower-case hex letters.

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

5 years ago[dsymutil] Improve verbose output (NFC)
Jonas Devlieghere [Tue, 8 Oct 2019 22:03:13 +0000 (22:03 +0000)]
[dsymutil] Improve verbose output (NFC)

The verbose output for finding relocations assumed that we'd always dump
the DIE after (which starts with a newline) and therefore didn't include
one itself. However, this isn't always true, leading to garbled output.

This patch adds a newline to the verbose output and adds a line that
says that the DIE is being kept (which isn't obvious otherwise). It also
adds a 0x prefix to the relocations.

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

5 years agoDebugInfo: Move LLE enum handling to .def to match RLE handling
David Blaikie [Tue, 8 Oct 2019 21:48:46 +0000 (21:48 +0000)]
DebugInfo: Move LLE enum handling to .def to match RLE handling

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

5 years ago[CVP} Replace SExt with ZExt if the input is known-non-negative
Roman Lebedev [Tue, 8 Oct 2019 20:29:48 +0000 (20:29 +0000)]
[CVP} Replace SExt with ZExt if the input is known-non-negative

Summary:
zero-extension is far more friendly for further analysis.
While this doesn't directly help with the shift-by-signext problem, this is not unrelated.

This has the following effect on test-suite (numbers collected after the finish of middle-end module pass manager):
| Statistic                            |     old |     new | delta | percent change |
| correlated-value-propagation.NumSExt |       0 |    6026 |  6026 |   +100.00%     |
| instcount.NumAddInst                 |  272860 |  271283 | -1577 |     -0.58%     |
| instcount.NumAllocaInst              |   27227 |   27226 | -1    |      0.00%     |
| instcount.NumAndInst                 |   63502 |   63320 | -182  |     -0.29%     |
| instcount.NumAShrInst                |   13498 |   13407 | -91   |     -0.67%     |
| instcount.NumAtomicCmpXchgInst       |    1159 |    1159 |  0    |      0.00%     |
| instcount.NumAtomicRMWInst           |    5036 |    5036 |  0    |      0.00%     |
| instcount.NumBitCastInst             |  672482 |  672353 | -129  |     -0.02%     |
| instcount.NumBrInst                  |  702768 |  702195 | -573  |     -0.08%     |
| instcount.NumCallInst                |  518285 |  518205 | -80   |     -0.02%     |
| instcount.NumExtractElementInst      |   18481 |   18482 |  1    |      0.01%     |
| instcount.NumExtractValueInst        |   18290 |   18288 | -2    |     -0.01%     |
| instcount.NumFAddInst                |  139035 |  138963 | -72   |     -0.05%     |
| instcount.NumFCmpInst                |   10358 |   10348 | -10   |     -0.10%     |
| instcount.NumFDivInst                |   30310 |   30302 | -8    |     -0.03%     |
| instcount.NumFenceInst               |     387 |     387 |  0    |      0.00%     |
| instcount.NumFMulInst                |   93873 |   93806 | -67   |     -0.07%     |
| instcount.NumFPExtInst               |    7148 |    7144 | -4    |     -0.06%     |
| instcount.NumFPToSIInst              |    2823 |    2838 |  15   |      0.53%     |
| instcount.NumFPToUIInst              |    1251 |    1251 |  0    |      0.00%     |
| instcount.NumFPTruncInst             |    2195 |    2191 | -4    |     -0.18%     |
| instcount.NumFSubInst                |   92109 |   92103 | -6    |     -0.01%     |
| instcount.NumGetElementPtrInst       | 1221423 | 1219157 | -2266 |     -0.19%     |
| instcount.NumICmpInst                |  479140 |  478929 | -211  |     -0.04%     |
| instcount.NumIndirectBrInst          |       2 |       2 |  0    |      0.00%     |
| instcount.NumInsertElementInst       |   66089 |   66094 |  5    |      0.01%     |
| instcount.NumInsertValueInst         |    2032 |    2030 | -2    |     -0.10%     |
| instcount.NumIntToPtrInst            |   19641 |   19641 |  0    |      0.00%     |
| instcount.NumInvokeInst              |   21789 |   21788 | -1    |      0.00%     |
| instcount.NumLandingPadInst          |   12051 |   12051 |  0    |      0.00%     |
| instcount.NumLoadInst                |  880079 |  878673 | -1406 |     -0.16%     |
| instcount.NumLShrInst                |   25919 |   25921 |  2    |      0.01%     |
| instcount.NumMulInst                 |   42416 |   42417 |  1    |      0.00%     |
| instcount.NumOrInst                  |  100826 |  100576 | -250  |     -0.25%     |
| instcount.NumPHIInst                 |  315118 |  314092 | -1026 |     -0.33%     |
| instcount.NumPtrToIntInst            |   15933 |   15939 |  6    |      0.04%     |
| instcount.NumResumeInst              |    2156 |    2156 |  0    |      0.00%     |
| instcount.NumRetInst                 |   84485 |   84484 | -1    |      0.00%     |
| instcount.NumSDivInst                |    8599 |    8597 | -2    |     -0.02%     |
| instcount.NumSelectInst              |   45577 |   45913 |  336  |      0.74%     |
| instcount.NumSExtInst                |   84026 |   78278 | -5748 |     -6.84%     |
| instcount.NumShlInst                 |   39796 |   39726 | -70   |     -0.18%     |
| instcount.NumShuffleVectorInst       |  100272 |  100292 |  20   |      0.02%     |
| instcount.NumSIToFPInst              |   29131 |   29113 | -18   |     -0.06%     |
| instcount.NumSRemInst                |    1543 |    1543 |  0    |      0.00%     |
| instcount.NumStoreInst               |  805394 |  804351 | -1043 |     -0.13%     |
| instcount.NumSubInst                 |   61337 |   61414 |  77   |      0.13%     |
| instcount.NumSwitchInst              |    8527 |    8524 | -3    |     -0.04%     |
| instcount.NumTruncInst               |   60523 |   60484 | -39   |     -0.06%     |
| instcount.NumUDivInst                |    2381 |    2381 |  0    |      0.00%     |
| instcount.NumUIToFPInst              |    5549 |    5549 |  0    |      0.00%     |
| instcount.NumUnreachableInst         |    9855 |    9855 |  0    |      0.00%     |
| instcount.NumURemInst                |    1305 |    1305 |  0    |      0.00%     |
| instcount.NumXorInst                 |   10230 |   10081 | -149  |     -1.46%     |
| instcount.NumZExtInst                |   60353 |   66840 |  6487 |     10.75%     |
| instcount.TotalBlocks                |  829582 |  829004 | -578  |     -0.07%     |
| instcount.TotalFuncs                 |   83818 |   83817 | -1    |      0.00%     |
| instcount.TotalInsts                 | 7316574 | 7308483 | -8091 |     -0.11%     |

TLDR: we produce -0.11% less instructions, -6.84% less `sext`, +10.75% more `zext`.
To be noted, clearly, not all new `zext`'s are produced by this fold.

(And now i guess it might have been interesting to measure this for D68103 :S)

Reviewers: nikic, spatel, reames, dberlin

Reviewed By: nikic

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

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

5 years ago[CVP][NFC] Revisit sext vs. zext test
Roman Lebedev [Tue, 8 Oct 2019 20:29:36 +0000 (20:29 +0000)]
[CVP][NFC] Revisit sext vs. zext test

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

5 years agoMark several PointerIntPair methods as lvalue-only
Jordan Rose [Tue, 8 Oct 2019 19:01:48 +0000 (19:01 +0000)]
Mark several PointerIntPair methods as lvalue-only

No point in mutating 'this' if it's just going to be thrown away.

https://reviews.llvm.org/D63945

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

5 years ago[tblgen] Add getOperatorAsDef() to Record
Daniel Sanders [Tue, 8 Oct 2019 18:41:32 +0000 (18:41 +0000)]
[tblgen] Add getOperatorAsDef() to Record

Summary:
While working with DagInit's, it's often the case that you expect the
operator to be a reference to a def. This patch adds a wrapper for this
common case to reduce the amount of boilerplate callers need to duplicate
repeatedly.

getOperatorAsDef() returns the record if the DagInit has an operator that is
a DefInit. Otherwise, it prints a fatal error.

There's only a few pre-existing examples in LLVM at the moment and I've
left a few instances of the code this simplifies as they had more specific
error messages than the generic one this produces. I'm going to be using
this a fair bit in my subsequent patches.

Reviewers: bogner, volkan, nhaehnle

Reviewed By: nhaehnle

Subscribers: nhaehnle, hiraditya, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, llvm-commits

Tags: #llvm

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

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

5 years ago[BPF] do compile-once run-everywhere relocation for bitfields
Yonghong Song [Tue, 8 Oct 2019 18:23:17 +0000 (18:23 +0000)]
[BPF] do compile-once run-everywhere relocation for bitfields

A bpf specific clang intrinsic is introduced:
   u32 __builtin_preserve_field_info(member_access, info_kind)
Depending on info_kind, different information will
be returned to the program. A relocation is also
recorded for this builtin so that bpf loader can
patch the instruction on the target host.
This clang intrinsic is used to get certain information
to facilitate struct/union member relocations.

The offset relocation is extended by 4 bytes to
include relocation kind.
Currently supported relocation kinds are
 enum {
    FIELD_BYTE_OFFSET = 0,
    FIELD_BYTE_SIZE,
    FIELD_EXISTENCE,
    FIELD_SIGNEDNESS,
    FIELD_LSHIFT_U64,
    FIELD_RSHIFT_U64,
 };
for __builtin_preserve_field_info. The old
access offset relocation is covered by
    FIELD_BYTE_OFFSET = 0.

An example:
struct s {
    int a;
    int b1:9;
    int b2:4;
};
enum {
    FIELD_BYTE_OFFSET = 0,
    FIELD_BYTE_SIZE,
    FIELD_EXISTENCE,
    FIELD_SIGNEDNESS,
    FIELD_LSHIFT_U64,
    FIELD_RSHIFT_U64,
};

void bpf_probe_read(void *, unsigned, const void *);
int field_read(struct s *arg) {
  unsigned long long ull = 0;
  unsigned offset = __builtin_preserve_field_info(arg->b2, FIELD_BYTE_OFFSET);
  unsigned size = __builtin_preserve_field_info(arg->b2, FIELD_BYTE_SIZE);
 #ifdef USE_PROBE_READ
  bpf_probe_read(&ull, size, (const void *)arg + offset);
  unsigned lshift = __builtin_preserve_field_info(arg->b2, FIELD_LSHIFT_U64);
 #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
  lshift = lshift + (size << 3) - 64;
 #endif
 #else
  switch(size) {
  case 1:
    ull = *(unsigned char *)((void *)arg + offset); break;
  case 2:
    ull = *(unsigned short *)((void *)arg + offset); break;
  case 4:
    ull = *(unsigned int *)((void *)arg + offset); break;
  case 8:
    ull = *(unsigned long long *)((void *)arg + offset); break;
  }
  unsigned lshift = __builtin_preserve_field_info(arg->b2, FIELD_LSHIFT_U64);
 #endif
  ull <<= lshift;
  if (__builtin_preserve_field_info(arg->b2, FIELD_SIGNEDNESS))
    return (long long)ull >> __builtin_preserve_field_info(arg->b2, FIELD_RSHIFT_U64);
  return ull >> __builtin_preserve_field_info(arg->b2, FIELD_RSHIFT_U64);
}

There is a minor overhead for bpf_probe_read() on big endian.

The code and relocation generated for field_read where bpf_probe_read() is
used to access argument data on little endian mode:
        r3 = r1
        r1 = 0
        r1 = 4  <=== relocation (FIELD_BYTE_OFFSET)
        r3 += r1
        r1 = r10
        r1 += -8
        r2 = 4  <=== relocation (FIELD_BYTE_SIZE)
        call bpf_probe_read
        r2 = 51 <=== relocation (FIELD_LSHIFT_U64)
        r1 = *(u64 *)(r10 - 8)
        r1 <<= r2
        r2 = 60 <=== relocation (FIELD_RSHIFT_U64)
        r0 = r1
        r0 >>= r2
        r3 = 1  <=== relocation (FIELD_SIGNEDNESS)
        if r3 == 0 goto LBB0_2
        r1 s>>= r2
        r0 = r1
LBB0_2:
        exit

Compare to the above code between relocations FIELD_LSHIFT_U64 and
FIELD_LSHIFT_U64, the code with big endian mode has four more
instructions.
        r1 = 41   <=== relocation (FIELD_LSHIFT_U64)
        r6 += r1
        r6 += -64
        r6 <<= 32
        r6 >>= 32
        r1 = *(u64 *)(r10 - 8)
        r1 <<= r6
        r2 = 60   <=== relocation (FIELD_RSHIFT_U64)

The code and relocation generated when using direct load.
        r2 = 0
        r3 = 4
        r4 = 4
        if r4 s> 3 goto LBB0_3
        if r4 == 1 goto LBB0_5
        if r4 == 2 goto LBB0_6
        goto LBB0_9
LBB0_6:                                 # %sw.bb1
        r1 += r3
        r2 = *(u16 *)(r1 + 0)
        goto LBB0_9
LBB0_3:                                 # %entry
        if r4 == 4 goto LBB0_7
        if r4 == 8 goto LBB0_8
        goto LBB0_9
LBB0_8:                                 # %sw.bb9
        r1 += r3
        r2 = *(u64 *)(r1 + 0)
        goto LBB0_9
LBB0_5:                                 # %sw.bb
        r1 += r3
        r2 = *(u8 *)(r1 + 0)
        goto LBB0_9
LBB0_7:                                 # %sw.bb5
        r1 += r3
        r2 = *(u32 *)(r1 + 0)
LBB0_9:                                 # %sw.epilog
        r1 = 51
        r2 <<= r1
        r1 = 60
        r0 = r2
        r0 >>= r1
        r3 = 1
        if r3 == 0 goto LBB0_11
        r2 s>>= r1
        r0 = r2
LBB0_11:                                # %sw.epilog
        exit

Considering verifier is able to do limited constant
propogation following branches. The following is the
code actually traversed.
        r2 = 0
        r3 = 4   <=== relocation
        r4 = 4   <=== relocation
        if r4 s> 3 goto LBB0_3
LBB0_3:                                 # %entry
        if r4 == 4 goto LBB0_7
LBB0_7:                                 # %sw.bb5
        r1 += r3
        r2 = *(u32 *)(r1 + 0)
LBB0_9:                                 # %sw.epilog
        r1 = 51   <=== relocation
        r2 <<= r1
        r1 = 60   <=== relocation
        r0 = r2
        r0 >>= r1
        r3 = 1
        if r3 == 0 goto LBB0_11
        r2 s>>= r1
        r0 = r2
LBB0_11:                                # %sw.epilog
        exit

For native load case, the load size is calculated to be the
same as the size of load width LLVM otherwise used to load
the value which is then used to extract the bitfield value.

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

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

5 years agoAMDGPU: Fix i16 arithmetic pattern redundancy
Matt Arsenault [Tue, 8 Oct 2019 17:36:38 +0000 (17:36 +0000)]
AMDGPU: Fix i16 arithmetic pattern redundancy

There were 2 problems here. First, these patterns were duplicated to
handle the inverted shift operands instead of using the commuted
PatFrags.

Second, the point of the zext folding patterns don't apply to the
non-0ing high subtargets. They should be skipped instead of inserting
the extension. The zeroing high code would be emitted when necessary
anyway. This was also emitting unnecessary zexts in cases where the
high bits were undefined.

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

5 years agoRevert "[LoopVectorize][PowerPC] Estimate int and float register pressure separately...
Jinsong Ji [Tue, 8 Oct 2019 17:32:56 +0000 (17:32 +0000)]
Revert "[LoopVectorize][PowerPC] Estimate int and float register pressure separately in loop-vectorize"

Also Revert "[LoopVectorize] Fix non-debug builds after rL374017"

This reverts commit 9f41deccc0e648a006c9f38e11919f181b6c7e0a.
This reverts commit 18b6fe07bcf44294f200bd2b526cb737ed275c04.

The patch is breaking PowerPC internal build, checked with author, reverting
on behalf of him for now due to timezone.

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

5 years ago[SLP] add test with prefer-vector-width function attribute; NFC (PR43578)
Sanjay Patel [Tue, 8 Oct 2019 17:18:32 +0000 (17:18 +0000)]
[SLP] add test with prefer-vector-width function attribute; NFC (PR43578)

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

5 years ago[CodeExtractor] Factor out and reuse shrinkwrap analysis
Vedant Kumar [Tue, 8 Oct 2019 17:17:51 +0000 (17:17 +0000)]
[CodeExtractor] Factor out and reuse shrinkwrap analysis

Factor out CodeExtractor's analysis of allocas (for shrinkwrapping
purposes), and allow the analysis to be reused.

This resolves a quadratic compile-time bug observed when compiling
AMDGPUDisassembler.cpp.o.

Pre-patch (Release + LTO clang):

```
   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
  176.5278 ( 57.8%)   0.4915 ( 18.5%)  177.0192 ( 57.4%)  177.4112 ( 57.3%)  Hot Cold Splitting
```

Post-patch (ReleaseAsserts clang):

```
   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
  1.4051 (  3.3%)   0.0079 (  0.3%)   1.4129 (  3.2%)   1.4129 (  3.2%)  Hot Cold Splitting
```

Testing: check-llvm, and comparing the AMDGPUDisassembler.cpp.o binary
pre- vs. post-patch.

An alternate approach is to hide CodeExtractorAnalysisCache from clients
of CodeExtractor, and to recompute the analysis from scratch inside of
CodeExtractor::extractCodeRegion(). This eliminates some redundant work
in the shrinkwrapping legality check. However, some clients continue to
exhibit O(n^2) compile time behavior as computing the analysis is O(n).

rdar://55912966

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

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

5 years agoAMDGPU: Add offsets to MMO when lowering buffer intrinsics
Tom Stellard [Tue, 8 Oct 2019 17:04:51 +0000 (17:04 +0000)]
AMDGPU: Add offsets to MMO when lowering buffer intrinsics

Summary:
Without offsets on the MachineMemOperands (MMOs),
MachineInstr::mayAlias() will return true for all reads and writes to the
same resource descriptor.  This leads to O(N^2) complexity in the MachineScheduler
when analyzing dependencies of buffer loads and stores.  It also limits
the SILoadStoreOptimizer from merging more instructions.

This patch reduces the compile time of one pathological compute shader
from 12 seconds to 1 second.

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

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

Tags: #llvm

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

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

5 years ago[Attributor][Fix] Temporary fix for windows build bot failure
Hideto Ueno [Tue, 8 Oct 2019 17:01:56 +0000 (17:01 +0000)]
[Attributor][Fix] Temporary fix for windows build bot failure

D65402 causes test failure related to attributor-max-iterations.
This commit removes attributor-max-iterations-verify for now.
I'll examine the factor and the flag should be reverted.

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

5 years agoCodeGenPrepare - silence static analyzer dyn_cast<> null dereference warnings. NFCI.
Simon Pilgrim [Tue, 8 Oct 2019 17:00:01 +0000 (17:00 +0000)]
CodeGenPrepare - silence static analyzer dyn_cast<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases 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@374085 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Disable unused gfx10 dpp instructions
Stanislav Mekhanoshin [Tue, 8 Oct 2019 16:56:01 +0000 (16:56 +0000)]
[AMDGPU] Disable unused gfx10 dpp instructions

Inhibit generation of unused real dpp instructions on gfx10 just
like it is done on other subtargets. This does not change anything
because these are illegal anyway and not accepted, but it does
reduce the number of instruction definitions generated.

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

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

5 years ago[UpdateCCTestChecks] Detect function mangled name on separate line
David Greene [Tue, 8 Oct 2019 16:25:42 +0000 (16:25 +0000)]
[UpdateCCTestChecks] Detect function mangled name on separate line

Sometimes functions with large comment blocks in front of them have their
declarations output on several lines by c-index-test.  Hence the one-line
function name/line/mangled pattern will not work to detect them.  Break the
pattern up into two patterns and keep state after seeing the name/line
information until we finally see the mangled name.

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

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

5 years ago[NFC][CVP] Add tests where we can replace sext with zext
Roman Lebedev [Tue, 8 Oct 2019 16:21:13 +0000 (16:21 +0000)]
[NFC][CVP] Add tests where we can replace sext with zext

If the sign bit of the value that is being sign-extended is not set,
i.e. the value is non-negative (s>= 0), then zero-extension will suffice,
and is better for analysis: https://rise4fun.com/Alive/a8PD

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

5 years ago(Re)generate various tests. NFC
Amaury Sechet [Tue, 8 Oct 2019 16:16:26 +0000 (16:16 +0000)]
(Re)generate various tests. NFC

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

5 years ago[WebAssembly] Fix a bug in 'try' placement
Heejin Ahn [Tue, 8 Oct 2019 16:15:39 +0000 (16:15 +0000)]
[WebAssembly] Fix a bug in 'try' placement

Summary:
When searching for local expression tree created by stackified
registers, for 'block' placement, we start the search from the previous
instruction of a BB's terminator. But in 'try''s case, we should start
from the previous instruction of a call that can throw, or a EH_LABEL
that precedes the call, because the return values of the call's previous
instructions can be stackified and consumed by the throwing call.

For example,
```
  i32.call @foo
  call @bar         ; may throw
  br $label0
```
In this case, if we start the search from the previous instruction of
the terminator (`br` here), we end up stopping at `call @bar` and place
a 'try' between `i32.call @foo` and `call @bar`, because `call @bar`
does not have a return value so it is not a local expression tree of
`br`.

But in this case, unlike when placing 'block's, we should start the
search from `call @bar`, because the return value of `i32.call @foo` is
stackified and used by `call @bar`.

Reviewers: dschuff

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

Tags: #llvm

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

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

5 years ago[DebugInfo][If-Converter] Update call site info during the optimization
Nikola Prica [Tue, 8 Oct 2019 15:43:12 +0000 (15:43 +0000)]
[DebugInfo][If-Converter] Update call site info during the optimization

During the If-Converter optimization pay attention when copying or
deleting call instructions in order to keep call site information in
valid state.

Reviewers: aprantl, vsk, efriedma

Reviewed By: vsk, efriedma

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

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

5 years agogn build: Merge r374062
GN Sync Bot [Tue, 8 Oct 2019 15:34:52 +0000 (15:34 +0000)]
gn build: Merge r374062

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

5 years agogn build: Merge r374061
GN Sync Bot [Tue, 8 Oct 2019 15:28:36 +0000 (15:28 +0000)]
gn build: Merge r374061

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

5 years ago[Attributor][MustExec] Deduce dereferenceable and nonnull attribute using MustBeExecu...
Hideto Ueno [Tue, 8 Oct 2019 15:25:56 +0000 (15:25 +0000)]
[Attributor][MustExec] Deduce dereferenceable and nonnull attribute using MustBeExecutedContextExplorer

Summary:
In D65186 and related patches, MustBeExecutedContextExplorer is introduced. This enables us to traverse instructions guaranteed to execute from function entry. If we can know the argument is used as `dereferenceable` or `nonnull` in these instructions, we can mark `dereferenceable` or `nonnull` in the argument definition:

1. Memory instruction (similar to D64258)
Trace memory instruction pointer operand. Currently, only inbounds GEPs are traced.
```
define i64* @f(i64* %a) {
entry:
  %add.ptr = getelementptr inbounds i64, i64* %a, i64 1
; (because of inbounds GEP we can know that %a is at least dereferenceable(16))
  store i64 1, i64* %add.ptr, align 8
  ret i64* %add.ptr ; dereferenceable 8 (because above instruction stores into it)
}
```

2. Propagation from callsite (similar to D27855)
If `deref` or `nonnull` are known in call site parameter attributes we can also say that argument also that attribute.

```
declare void @use3(i8* %x, i8* %y, i8* %z);
declare void @use3nonnull(i8* nonnull %x, i8* nonnull %y, i8* nonnull %z);

define void @parent1(i8* %a, i8* %b, i8* %c) {
  call void @use3nonnull(i8* %b, i8* %c, i8* %a)
; Above instruction is always executed so we can say that@parent1(i8* nonnnull %a, i8* nonnull %b, i8* nonnull %c)
  call void @use3(i8* %c, i8* %a, i8* %b)
  ret void
}
```

Reviewers: jdoerfert, sstefan1, spatel, reames

Reviewed By: jdoerfert

Subscribers: xbolva00, hiraditya, jfb, llvm-commits

Tags: #llvm

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

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

5 years agoRevert [TextAPI] Introduce TBDv4
Cyndy Ishida [Tue, 8 Oct 2019 15:24:37 +0000 (15:24 +0000)]
Revert [TextAPI] Introduce TBDv4

This reverts r374058 (git commit 5d566c5a46aeaa1fa0e5c0b823c9d5f84036dc9a)

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

5 years ago[Attributor] Add helper class to compose two structured deduction.
Hideto Ueno [Tue, 8 Oct 2019 15:20:19 +0000 (15:20 +0000)]
[Attributor] Add helper class to compose two structured deduction.

Summary: This patch introduces a generic way to compose two structured deductions.  This will be used for composing generic deduction with `MustBeExecutedExplorer` and other existing generic deduction.

Reviewers: jdoerfert, sstefan1

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agogn build: Merge r374058
GN Sync Bot [Tue, 8 Oct 2019 15:12:38 +0000 (15:12 +0000)]
gn build: Merge r374058

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

5 years ago[TextAPI] Introduce TBDv4
Cyndy Ishida [Tue, 8 Oct 2019 15:07:36 +0000 (15:07 +0000)]
[TextAPI] Introduce TBDv4

Summary:
This format introduces new features and platforms
The motivation for this format is to support more than 1 platform since previous versions only supported additional architectures and 1 platform,
for example ios + ios-simulator and macCatalyst.

Reviewers: ributzka, steven_wu

Reviewed By: ributzka

Subscribers: mgorny, hiraditya, mgrang, dexonsmith, llvm-commits

Tags: #llvm

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

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

5 years ago[Mips] Emit proper ABI for _mcount calls
Mirko Brkusanin [Tue, 8 Oct 2019 14:32:03 +0000 (14:32 +0000)]
[Mips] Emit proper ABI for _mcount calls

When -pg option is present than a call to _mcount is inserted into every
function. However since the proper ABI was not followed then the generated
gmon.out did not give proper results. By inserting needed instructions
before every _mcount we can fix this.

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

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

5 years ago[llvm-exegesis] Add options to SnippetGenerator.
Clement Courbet [Tue, 8 Oct 2019 14:30:24 +0000 (14:30 +0000)]
[llvm-exegesis] Add options to SnippetGenerator.

Summary:
This adds a `-max-configs-per-opcode` option to limit the number of
configs per opcode.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

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

5 years agoObject/minidump: Add support for the MemoryInfoList stream
Pavel Labath [Tue, 8 Oct 2019 14:15:32 +0000 (14:15 +0000)]
Object/minidump: Add support for the MemoryInfoList stream

Summary:
This patch adds the definitions of the constants and structures
necessary to interpret the MemoryInfoList minidump stream, as well as
the object::MinidumpFile interface to access the stream.

While the code is fairly simple, there is one important deviation from
the other minidump streams, which is worth calling out explicitly.
Unlike other "List" streams, the size of the records inside
MemoryInfoList stream is not known statically. Instead it is described
in the stream header. This makes it impossible to return
ArrayRef<MemoryInfo> from the accessor method, as it is done with other
streams. Instead, I create an iterator class, which can be parameterized
by the runtime size of the structure, and return
iterator_range<iterator> instead.

Reviewers: amccarth, jhenderson, clayborg

Subscribers: JosephTremoulet, zturner, markmentovai, lldb-commits, llvm-commits

Tags: #llvm

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

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

5 years agoNope, I'm wrong. It looks like someone else removed these on purpose and
Kevin P. Neal [Tue, 8 Oct 2019 14:10:26 +0000 (14:10 +0000)]
Nope, I'm wrong. It looks like someone else removed these on purpose and
it just happened to break the bot right when I did my push. So I'm undoing
this mornings incorrect push. I've also kicked off an email to hopefully
get the bot fixed the correct way.

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

5 years agoRestore documentation that 'svn update' unexpectedly yanked out from under me.
Kevin P. Neal [Tue, 8 Oct 2019 13:38:42 +0000 (13:38 +0000)]
Restore documentation that 'svn update' unexpectedly yanked out from under me.

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

5 years agofix fmls fp16
Sebastian Pop [Tue, 8 Oct 2019 13:23:57 +0000 (13:23 +0000)]
fix fmls fp16

Tim Northover remarked that the added patterns for fmls fp16
produce wrong code in case the fsub instruction has a
multiplication as its first operand, i.e., all the patterns FMLSv*_OP1:

> define <8 x half> @test_FMLSv8f16_OP1(<8 x half> %a, <8 x half> %b, <8 x half> %c) {
> ; CHECK-LABEL: test_FMLSv8f16_OP1:
> ; CHECK: fmls {{v[0-9]+}}.8h, {{v[0-9]+}}.8h, {{v[0-9]+}}.8h
> entry:
>
>   %mul = fmul fast <8 x half> %c, %b
>   %sub = fsub fast <8 x half> %mul, %a
>   ret <8 x half> %sub
> }
>
> This doesn't look right to me. The exact instruction produced is "fmls
> v0.8h, v2.8h, v1.8h", which I think calculates "v0 - v2*v1", but the
> IR is calculating "v2*v1-v0". The equivalent <4 x float> code also
> doesn't emit an fmls.

This patch generates an fmla and negates the value of the operand2 of the fsub.

Inspecting the pattern match, I found that there was another mistake in the
opcode to be selected: matching FMULv4*16 should generate FMLSv4*16
and not FMLSv2*32.

Tested on aarch64-linux with make check-all.

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

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

5 years agoAdd test for rotating truncated vectors. NFC
Amaury Sechet [Tue, 8 Oct 2019 13:08:51 +0000 (13:08 +0000)]
Add test for rotating truncated vectors. NFC

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

5 years ago[SVE][IR] Scalable Vector size queries and IR instruction support
Graham Hunter [Tue, 8 Oct 2019 12:53:54 +0000 (12:53 +0000)]
[SVE][IR] Scalable Vector size queries and IR instruction support

* Adds a TypeSize struct to represent the known minimum size of a type
  along with a flag to indicate that the runtime size is a integer multiple
  of that size
* Converts existing size query functions from Type.h and DataLayout.h to
  return a TypeSize result
* Adds convenience methods (including a transparent conversion operator
  to uint64_t) so that most existing code 'just works' as if the return
  values were still scalars.
* Uses the new size queries along with ElementCount to ensure that all
  supported instructions used with scalable vectors can be constructed
  in IR.

Reviewers: hfinkel, lattner, rkruppe, greened, rovka, rengolin, sdesmalen

Reviewed By: rovka, sdesmalen

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

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

5 years agoAMDGPU: Propagate undef flag during pre-RA exec mask optimizations
Nicolai Haehnle [Tue, 8 Oct 2019 12:46:32 +0000 (12:46 +0000)]
AMDGPU: Propagate undef flag during pre-RA exec mask optimizations

Summary: Issue: https://github.com/GPUOpen-Drivers/llpc/issues/204

Reviewers: arsenm, rampitec

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

Tags: #llvm

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

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

5 years agoMachineSSAUpdater: insert IMPLICIT_DEF at top of basic block
Nicolai Haehnle [Tue, 8 Oct 2019 12:46:20 +0000 (12:46 +0000)]
MachineSSAUpdater: insert IMPLICIT_DEF at top of basic block

Summary:
When getValueInMiddleOfBlock happens to be called for a basic block
that has no incoming value at all, an IMPLICIT_DEF is inserted in that
block via GetValueAtEndOfBlockInternal. This IMPLICIT_DEF must be at
the top of its basic block or it will likely not reach the use that
the caller intends to insert.

Issue: https://github.com/GPUOpen-Drivers/llpc/issues/204

Reviewers: arsenm, rampitec

Subscribers: jvesely, wdng, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[SLP] add test with prefer-vector-width function attribute; NFC
Sanjay Patel [Tue, 8 Oct 2019 12:43:46 +0000 (12:43 +0000)]
[SLP] add test with prefer-vector-width function attribute; NFC

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