]> granicus.if.org Git - llvm/log
llvm
5 years agoMove endian constant from Host.h to SwapByteOrder.h, prune include
Reid Kleckner [Sat, 19 Oct 2019 00:48:11 +0000 (00:48 +0000)]
Move endian constant from Host.h to SwapByteOrder.h, prune include

Works on this dependency chain:
  ArrayRef.h ->
  Hashing.h -> --CUT--
  Host.h ->
  StringMap.h / StringRef.h

ArrayRef is very popular, but Host.h is rarely needed. Move the
IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are
more likely to need it.

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

5 years agoPrune two MachineInstr.h includes, fix up deps
Reid Kleckner [Sat, 19 Oct 2019 00:22:07 +0000 (00:22 +0000)]
Prune two MachineInstr.h includes, fix up deps

MachineInstr.h included AliasAnalysis.h, which includes a world of IR
constructs mostly unneeded in CodeGen. Prune it. Same for
DebugInfoMetadata.h.

Noticed with -ftime-trace.

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

5 years agoLiveIntervals: Fix handleMoveUp with subreg def moving across a def
Matt Arsenault [Fri, 18 Oct 2019 23:24:25 +0000 (23:24 +0000)]
LiveIntervals: Fix handleMoveUp with subreg def moving across a def

If a subregister def was moved across another subregister def and
another use, the main range was not correctly updated. The end point
of the moved interval ended too early and missed the use from theh
other lanes in the subreg def.

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

5 years agogn build: Build compiler-rt code with -fvisibility=hidden.
Peter Collingbourne [Fri, 18 Oct 2019 22:52:17 +0000 (22:52 +0000)]
gn build: Build compiler-rt code with -fvisibility=hidden.

This matches the CMake build.

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

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

5 years ago[AMDGPU] move PHI nodes to AGPR class
Stanislav Mekhanoshin [Fri, 18 Oct 2019 22:48:45 +0000 (22:48 +0000)]
[AMDGPU] move PHI nodes to AGPR class

If all uses of a PHI are in AGPR register class we should
avoid unneeded copies via VGPRs.

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

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

5 years ago[SampleFDO] Add profile remapping support for profile on-demand loading used
Wei Mi [Fri, 18 Oct 2019 22:35:20 +0000 (22:35 +0000)]
[SampleFDO] Add profile remapping support for profile on-demand loading used
by ExtBinary format profile

Profile on-demand loading was added for ExtBinary format profile in rL374233,
but currently profile on-demand loading doesn't work well with profile
remapping. The patch adds the support.

Suppose a function in the current module has outline instance in the profile.
The function name in the module is different from the name of the outline
instance, but remapper knows the two names are equal. When loading profile
on-demand, the outline instance has to be loaded with remapper's help.

At the same time SampleProfileReaderItaniumRemapper is changed from a proxy
of SampleProfileReader to a helper member in SampleProfileReader.

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

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

5 years ago[AMDGPU] Remove -amdgpu-spill-sgpr-to-smem.
Jay Foad [Fri, 18 Oct 2019 21:48:22 +0000 (21:48 +0000)]
[AMDGPU] Remove -amdgpu-spill-sgpr-to-smem.

Summary: The implementation was never completed and never used except in tests.

Reviewers: arsenm, mareko

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

Tags: #llvm

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

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

5 years ago[CVP] setDeducedOverflowingFlags(): actually inc per-opcode stats
Roman Lebedev [Fri, 18 Oct 2019 21:19:26 +0000 (21:19 +0000)]
[CVP] setDeducedOverflowingFlags(): actually inc per-opcode stats

This is really embarrassing. Those are pointers, so that offsets the
pointers, not the statistics pointed-by the pointer...

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

5 years agogn build: Merge r375288
GN Sync Bot [Fri, 18 Oct 2019 21:11:20 +0000 (21:11 +0000)]
gn build: Merge r375288

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

5 years agoDisable exit-on-SIGPIPE in lldb
Vedant Kumar [Fri, 18 Oct 2019 21:05:30 +0000 (21:05 +0000)]
Disable exit-on-SIGPIPE in lldb

Occasionally, during test teardown, LLDB writes to a closed pipe.
Sometimes the communication is inherently unreliable, so LLDB tries to
avoid being killed due to SIGPIPE (it calls `signal(SIGPIPE, SIG_IGN)`).
However, LLVM's default SIGPIPE behavior overrides LLDB's, causing it to
exit with IO_ERR.

Opt LLDB out of the default SIGPIPE behavior. I expect that this will
resolve some LLDB test suite flakiness (tests randomly failing with
IO_ERR) that we've seen since r344372.

rdar://55750240

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

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

5 years ago[X86] Fix register parsing in .seh_* in Intel syntax
Reid Kleckner [Fri, 18 Oct 2019 21:01:41 +0000 (21:01 +0000)]
[X86] Fix register parsing in .seh_* in Intel syntax

Previously, the parser checked for a '%' prefix to indicate a register.
In Intel syntax mode, LLVM does not print a '%' prefix on registers, so
LLVM could not parse its own assembly output. Instead, require that
register numbers be integer literals, or at least start with an integer
literal, which is consistent with .cfi_* directive register parsing.

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

5 years ago[NFC][CVP] Some tests for `mul` no-wrap deduction
Roman Lebedev [Fri, 18 Oct 2019 20:36:19 +0000 (20:36 +0000)]
[NFC][CVP] Some tests for `mul` no-wrap deduction

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

5 years ago[WebAssembly] Allow multivalue signatures in object files
Thomas Lively [Fri, 18 Oct 2019 20:27:30 +0000 (20:27 +0000)]
[WebAssembly] Allow multivalue signatures in object files

Summary:
Also changes the wasm YAML format to reflect the possibility of having
multiple return types and to put the returns after the params for
consistency with the binary encoding.

Reviewers: aheejin, sbc100

Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, arphaman, rupprecht, llvm-commits

Tags: #llvm

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

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

5 years ago[GISel][CallLowering] Make isIncomingArgumentHandler a pure virtual method
Quentin Colombet [Fri, 18 Oct 2019 20:13:42 +0000 (20:13 +0000)]
[GISel][CallLowering] Make isIncomingArgumentHandler a pure virtual method

The default implementation of isIncomingArgumentHandler could lead
to generating incorrect code.
Make it a pure virtual method, so that targets know they have to
override it to produce correct code.

NFC

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

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

5 years ago[CVP] After proving that @llvm.with.overflow()/@llvm.sat() don't overflow, also try...
Roman Lebedev [Fri, 18 Oct 2019 19:32:47 +0000 (19:32 +0000)]
[CVP] After proving that @llvm.with.overflow()/@llvm.sat() don't overflow, also try to prove other no-wrap

Summary:
CVP, unlike InstCombine, does not run till exaustion.
It only does a single pass.

When dealing with those special binops, if we prove that they can
safely be demoted into their usual binop form,
we do set the no-wrap we deduced. But when dealing with usual binops,
we try to deduce both no-wraps.

So if we convert e.g. @llvm.uadd.with.overflow() to `add nuw`,
we won't attempt to check whether it can be `add nuw nsw`.

This patch proposes to call `processBinOp()` on newly-created binop,
which is identical to what we do for div/rem already.

Reviewers: nikic, spatel, reames

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[examples] Fix some comments in the LLJITWithJITLink example
Lang Hames [Fri, 18 Oct 2019 18:35:02 +0000 (18:35 +0000)]
[examples] Fix some comments in the LLJITWithJITLink example

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

5 years agoAMDGPU: Relax 32-bit SGPR register class
Matt Arsenault [Fri, 18 Oct 2019 18:26:37 +0000 (18:26 +0000)]
AMDGPU: Relax 32-bit SGPR register class

Mostly use SReg_32 instead of SReg_32_XM0 for arbitrary values. This
will allow the register coalescer to do a better job eliminating
copies to m0.

For GlobalISel, as a terrible hack, use SGPR_32 for things that should
use SCC until booleans are solved.

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

5 years ago[examples] Add an example of how to use JITLink and small-code-model with LLJIT.
Lang Hames [Fri, 18 Oct 2019 18:25:15 +0000 (18:25 +0000)]
[examples] Add an example of how to use JITLink and small-code-model with LLJIT.

JITLink is LLVM's newer jit-linker. It is an alternative to (and hopefully
eventually a replacement for) LLVM's older jit-linker, RuntimeDyld. Unlike
RuntimeDyld which requries JIT'd code to be complied with the large code
model, JITlink can link code compiled with the small code model, which is
the native code model for a number of targets (including all supported MachO
targets).

This example shows how to:

-- Create a JITLink InProcessMemoryManager
-- Set the code model to small
-- Use a JITLink backed ObjectLinkingLayer as the linking layer for LLJIT
   (rather than the default RTDyldObjectLinkingLayer).

Note: This example will only work on platforms supported by JITLink. As of
this commit that's MachO/x86-64 and MachO/arm64.

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

5 years agoAMDGPU: Fix SMEM WAR hazard for gfx10 readlane
Austin Kerbow [Fri, 18 Oct 2019 18:20:30 +0000 (18:20 +0000)]
AMDGPU: Fix SMEM WAR hazard for gfx10 readlane

Summary: Hazard recognizer fails to see hazard with V_READLANE_B32_gfx10.

Reviewers: rampitec

Reviewed By: rampitec

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

Tags: #llvm

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

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

5 years ago[lit] Reduce value of synthesized timeouts
Julian Lettner [Fri, 18 Oct 2019 17:59:46 +0000 (17:59 +0000)]
[lit] Reduce value of synthesized timeouts

Large timeout values (one year, positive infinity) trip up Python on
Windows with "OverflowError: timeout value is too large".  One week
seems to work and is still large enough in practice.

Thanks to Simon Pilgrim for helping me test this.
https://reviews.llvm.org/rL375171

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

5 years ago[lit] Remove unnecessary tracking of test_index
Julian Lettner [Fri, 18 Oct 2019 17:31:48 +0000 (17:31 +0000)]
[lit] Remove unnecessary tracking of test_index

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

5 years ago[lit] Only send back test result from worker process
Julian Lettner [Fri, 18 Oct 2019 17:31:45 +0000 (17:31 +0000)]
[lit] Only send back test result from worker process

Avoid sending back the whole run.Test object (which needs to be pickled)
from the worker process when we are only interested in the test result.

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

5 years ago[Codegen] Link MIRParser into CodeGenTests to fix MachineSizeOptsTest building
Roman Lebedev [Fri, 18 Oct 2019 17:18:21 +0000 (17:18 +0000)]
[Codegen] Link MIRParser into CodeGenTests to fix MachineSizeOptsTest building

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

5 years ago[NFC][CVP] Add @llvm.*.sat tests where we could prove both no-overflows
Roman Lebedev [Fri, 18 Oct 2019 17:18:12 +0000 (17:18 +0000)]
[NFC][CVP] Add @llvm.*.sat tests where we could prove both no-overflows

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

5 years agogn build: Merge r375254
GN Sync Bot [Fri, 18 Oct 2019 16:52:12 +0000 (16:52 +0000)]
gn build: Merge r375254

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

5 years ago[PGO][PGSO] SizeOpts changes.
Hiroshi Yamauchi [Fri, 18 Oct 2019 16:46:01 +0000 (16:46 +0000)]
[PGO][PGSO] SizeOpts changes.

Summary:
(Split of off D67120)

SizeOpts/MachineSizeOpts changes for profile guided size optimization.

Reviewers: davidxl

Subscribers: mgorny, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] combineX86ShufflesRecursively - pull out isTargetShuffleVariableMask. NFCI.
Simon Pilgrim [Fri, 18 Oct 2019 16:39:01 +0000 (16:39 +0000)]
[X86] combineX86ShufflesRecursively - pull out isTargetShuffleVariableMask. NFCI.

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

5 years ago[IR] Reimplement FPMathOperator::classof as a whitelist.
Jay Foad [Fri, 18 Oct 2019 16:16:36 +0000 (16:16 +0000)]
[IR] Reimplement FPMathOperator::classof as a whitelist.

Summary:
This makes it much easier to verify that the implementation matches the
documentation. It uncovered a bug in the unit tests where we were
accidentally setting fast math flags on a load instruction.

Reviewers: spatel, wristow, arsenm, hfinkel, aemerson, efriedma, cameron.mcinally, mcberg2017, jmolloy

Subscribers: wdng, llvm-commits

Tags: #llvm

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

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

5 years agoUpdate docs for fast-math flags.
Jay Foad [Fri, 18 Oct 2019 16:07:09 +0000 (16:07 +0000)]
Update docs for fast-math flags.

This adds fneg, phi and select to the list of operations that may use
fast-math flags.

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

5 years agoUpdate MinidumpYAML to use minidump::Exception for exception stream
Joseph Tremoulet [Fri, 18 Oct 2019 14:56:19 +0000 (14:56 +0000)]
Update MinidumpYAML to use minidump::Exception for exception stream

Reviewers: labath, jhenderson, clayborg, MaskRay, grimar

Reviewed By: grimar

Subscribers: lldb-commits, grimar, MaskRay, hiraditya, llvm-commits

Tags: #llvm, #lldb

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

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

5 years ago[AMDGPU][MC][GFX10] Added sdwa/dpp versions of v_cndmask_b32
Dmitry Preobrazhensky [Fri, 18 Oct 2019 14:49:53 +0000 (14:49 +0000)]
[AMDGPU][MC][GFX10] Added sdwa/dpp versions of v_cndmask_b32

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

Reviewers: arsenm, rampitec

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

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

5 years ago[DFAPacketizer] Fix large compile-time regression for VLIW targets
James Molloy [Fri, 18 Oct 2019 14:48:35 +0000 (14:48 +0000)]
[DFAPacketizer] Fix large compile-time regression for VLIW targets

D68992 / rL375086 refactored the packetizer and removed a bunch of logic. Unfortunately it creates an Automaton object whenever a DFAPacketizer is required. These objects have no longevity, and in particular on a debug build the population of the Automaton's transition map from the underlying table is very slow (because it is called ~10 times per MachineFunction, in the testcase I'm looking at).

This patch changes Automaton to wrap its underlying constant data in std::shared_ptr, which allows trivial copy construction. The DFAPacketizer creation function now creates a static archetypical Automaton and copies that whenever a new DFAPacketizer is required.

This takes a testcase down from ~20s to ~0.5s in debug mode.

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

5 years agoAdd ExceptionStream to llvm::Object::minidump
Joseph Tremoulet [Fri, 18 Oct 2019 14:43:15 +0000 (14:43 +0000)]
Add ExceptionStream to llvm::Object::minidump

Summary:
This will allow updating MinidumpYAML and LLDB to use this common
definition.

Reviewers: labath, jhenderson, clayborg

Reviewed By: labath

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoOne more attempt to fix PS4 buildbot after r375219
Eugene Leviant [Fri, 18 Oct 2019 14:11:19 +0000 (14:11 +0000)]
One more attempt to fix PS4 buildbot after r375219

PS4 buildbot seems to be dropping variable names for some reason

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

5 years agoAttempt to fix PS4 buildbot after r375219
Eugene Leviant [Fri, 18 Oct 2019 13:52:51 +0000 (13:52 +0000)]
Attempt to fix PS4 buildbot after r375219

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

5 years agoRevert r375152 as it is causing failures on EXPENSIVE_CHECKS bot
Nemanja Ivanovic [Fri, 18 Oct 2019 13:38:46 +0000 (13:38 +0000)]
Revert r375152 as it is causing failures on EXPENSIVE_CHECKS bot

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

5 years ago[SCEV] Removing deprecated comment in ScalarEvolutionExpander
Victor Campos [Fri, 18 Oct 2019 13:33:45 +0000 (13:33 +0000)]
[SCEV] Removing deprecated comment in ScalarEvolutionExpander

Removing a comment in the ScalarEvolutionExpander.cpp file that was about the
class SCEVSDivExpr, which has been long gone from LLVM.

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

5 years ago[AMDGPU][MC][GFX9] Corrected parsing of v_cndmask_b32_sdwa
Dmitry Preobrazhensky [Fri, 18 Oct 2019 13:31:53 +0000 (13:31 +0000)]
[AMDGPU][MC][GFX9] Corrected parsing of v_cndmask_b32_sdwa

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

Reviewers: arsenm, rampitec

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

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

5 years ago[NFC][CVP] Count all the no-wraps we proved
Roman Lebedev [Fri, 18 Oct 2019 13:20:16 +0000 (13:20 +0000)]
[NFC][CVP] Count all the no-wraps we proved

Summary:
It looks like this is the only missing statistic in the CVP pass.
Since we prove NSW and NUW separately i'd think we should count them separately too.

Reviewers: nikic, spatel, reames

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[AArch64] Adding support for PMMIR_EL1 register
Victor Campos [Fri, 18 Oct 2019 12:40:29 +0000 (12:40 +0000)]
[AArch64] Adding support for PMMIR_EL1 register

Summary:
The PMMIR_EL1 register is present in Armv8.4 with PMU extension.
This patch adds support for it.

Reviewers: t.p.northover, dnsampaio

Reviewed By: dnsampaio

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[AArch64][SVE] Add SPLAT_VECTOR ISD Node
Graham Hunter [Fri, 18 Oct 2019 11:48:35 +0000 (11:48 +0000)]
[AArch64][SVE] Add SPLAT_VECTOR ISD Node

Adds a new ISD node to replicate a scalar value across all elements of
a vector. This is needed for scalable vectors, since BUILD_VECTOR cannot
be used.

Fixes up default type legalization for scalable vectors after the
new MVT type ranges were introduced.

At present I only use this node for scalable vectors. A DAGCombine has
been added to transform a BUILD_VECTOR into a SPLAT_VECTOR if all
elements are the same, but only if the default operation action of
Expand has been overridden by the target.

I've only added result promotion legalization for scalable vector
i8/i16/i32/i64 types in AArch64 for now.

Reviewers: t.p.northover, javed.absar, greened, cameron.mcinally, jmolloy

Reviewed By: jmolloy

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

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

5 years ago[ThinLTOCodeGenerator] Add support for index-based WPD
Eugene Leviant [Fri, 18 Oct 2019 10:54:14 +0000 (10:54 +0000)]
[ThinLTOCodeGenerator] Add support for index-based WPD

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

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

5 years ago[AArch64] Don't combine callee-save and local stack adjustment when optimizing for...
David Green [Fri, 18 Oct 2019 10:35:46 +0000 (10:35 +0000)]
[AArch64] Don't combine callee-save and local stack adjustment when optimizing for size

For arm64, D18619 introduced the ability to combine bumping the stack pointer
upfront in case it needs to be bumped for both the callee-save area as well as
the local stack area.

That diff already remarks that "This change can cause an increase in
instructions", but argues that even when that happens, it should be still be a
performance benefit because the number of micro-ops is reduced.

We have observed that this code-size increase can be significant in practice.
This diff disables combining stack bumping for methods that are marked as
optimize-for-size.

Example of a prologue with the behavior before this diff (combining stack bumping when possible):
  sub        sp, sp, #0x40
  stp        d9, d8, [sp, #0x10]
  stp        x20, x19, [sp, #0x20]
  stp        x29, x30, [sp, #0x30]
  add        x29, sp, #0x30
  [... compute x8 somehow ...]
  stp        x0, x8, [sp]

And after this  diff, if the method is marked as optimize-for-size:
  stp        d9, d8, [sp, #-0x30]!
  stp        x20, x19, [sp, #0x10]
  stp        x29, x30, [sp, #0x20]
  add        x29, sp, #0x20
  [... compute x8 somehow ...]
  stp        x0, x8, [sp, #-0x10]!

Note that without combining the stack bump there are two auto-decrements,
nicely folded into the stp instructions, whereas otherwise there is a single
sub sp, ... instruction, but not folded.

Patch by Nikolai Tillmann!

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

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

5 years ago[X86] Regenerate memcmp tests and add X64-AVX512 common prefix
Simon Pilgrim [Fri, 18 Oct 2019 09:59:51 +0000 (09:59 +0000)]
[X86] Regenerate memcmp tests and add X64-AVX512 common prefix

Should help make the changes in D69157 clearer

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

5 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Fri, 18 Oct 2019 09:59:40 +0000 (09:59 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

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

5 years agoFix MSVC "result of 32-bit shift implicitly converted to 64 bits" warnings. NFCI.
Simon Pilgrim [Fri, 18 Oct 2019 09:59:31 +0000 (09:59 +0000)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warnings. NFCI.

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

5 years ago[Codegen] Alter the default promotion for saturating adds and subs
David Green [Fri, 18 Oct 2019 09:47:48 +0000 (09:47 +0000)]
[Codegen] Alter the default promotion for saturating adds and subs

The default promotion for the add_sat/sub_sat nodes currently does:
    ANY_EXTEND iN to iM
    SHL by M-N
    [US][ADD|SUB]SAT
    L/ASHR by M-N

If the promoted add_sat or sub_sat node is not legal, this can produce code
that effectively does a lot of shifting (and requiring large constants to be
materialised) just to use the overflow flag. It is simpler to just do the
saturation manually, using the higher bitwidth addition and a min/max against
the saturating bounds. That is what this patch attempts to do.

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

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

5 years ago[AArch64][SVE] Implement unpack intrinsics
Kerry McLaughlin [Fri, 18 Oct 2019 09:40:16 +0000 (09:40 +0000)]
[AArch64][SVE] Implement unpack intrinsics

Summary:
Implements the following intrinsics:
  - int_aarch64_sve_sunpkhi
  - int_aarch64_sve_sunpklo
  - int_aarch64_sve_uunpkhi
  - int_aarch64_sve_uunpklo

This patch also adds AArch64ISD nodes for UNPK instead of implementing
the intrinsics directly, as they are required for a future patch which
implements the sign/zero extension of legal vectors.

This patch includes tests for the Subdivide2Argument type added by D67549

Reviewers: sdesmalen, SjoerdMeijer, greened, rengolin, rovka

Reviewed By: greened

Subscribers: tschuett, kristof.beyls, rkruppe, psnobl, cfe-commits, llvm-commits

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

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

5 years ago[InstCombine] Fix miscompile bug in canEvaluateShuffled
Bjorn Pettersson [Fri, 18 Oct 2019 07:42:02 +0000 (07:42 +0000)]
[InstCombine] Fix miscompile bug in canEvaluateShuffled

Summary:
Add restrictions in canEvaluateShuffled to prevent that we for example
transform

  %0 = insertelement <2 x i16> undef, i16 %a, i32 0
  %1 = srem <2 x i16> %0, <i16 2, i16 1>
  %2 = shufflevector <2 x i16> %1, <2 x i16> undef, <2 x i32> <i32 undef, i32 0>

into

   %1 = insertelement <2 x i16> undef, i16 %a, i32 1
   %2 = srem <2 x i16> %1, <i16 undef, i16 2>

as having an undef denominator makes the srem undefined (for all
vector elements).

Fixes: https://bugs.llvm.org/show_bug.cgi?id=43689
Reviewers: spatel, lebedev.ri

Reviewed By: spatel, lebedev.ri

Subscribers: lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[InstCombine] Pre-commit of test case showing miscompile bug in canEvaluateShuffled
Bjorn Pettersson [Fri, 18 Oct 2019 07:41:53 +0000 (07:41 +0000)]
[InstCombine] Pre-commit of test case showing miscompile bug in canEvaluateShuffled

Adding the reproducer from  https://bugs.llvm.org/show_bug.cgi?id=43689,
showing that instcombine is doing a bad transform. It transforms

  %0 = insertelement <2 x i16> undef, i16 %a, i32 0
  %1 = srem <2 x i16> %0, <i16 2, i16 1>
  %2 = shufflevector <2 x i16> %1, <2 x i16> undef, <2 x i32> <i32 undef, i32 0>

into

   %1 = insertelement <2 x i16> undef, i16 %a, i32 1
   %2 = srem <2 x i16> %1, <i16 undef, i16 2>

The undef denominator makes the whole srem undefined.

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

5 years ago[X86] Emit KTEST when possible
David Zarzycki [Fri, 18 Oct 2019 03:45:52 +0000 (03:45 +0000)]
[X86] Emit KTEST when possible

https://reviews.llvm.org/D69111

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

5 years ago[lit] Move resolving of XFAIL result codes out of Test.setResult
Julian Lettner [Fri, 18 Oct 2019 00:50:37 +0000 (00:50 +0000)]
[lit] Move resolving of XFAIL result codes out of Test.setResult

This will allow us to serialize just the result object instead of the
whole lit.Test object back from the worker to the main lit process.

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

5 years ago[lit] worker.py: Improve code for executing a single test
Julian Lettner [Fri, 18 Oct 2019 00:50:34 +0000 (00:50 +0000)]
[lit] worker.py: Improve code for executing a single test

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

5 years ago[IndVars] Factor out some common code into a utility function
Philip Reames [Thu, 17 Oct 2019 23:49:46 +0000 (23:49 +0000)]
[IndVars] Factor out some common code into a utility function

As requested in review of D69009

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

5 years ago[Test] Precommit test for D69006
Philip Reames [Thu, 17 Oct 2019 23:32:35 +0000 (23:32 +0000)]
[Test] Precommit test for D69006

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

5 years agoDebugInfo: Move loclist base address from DwarfFile to DebugLocStream
David Blaikie [Thu, 17 Oct 2019 23:02:19 +0000 (23:02 +0000)]
DebugInfo: Move loclist base address from DwarfFile to DebugLocStream

There's no need to have more than one of these (there can be two
DwarfFiles - one for the .o, one for the .dwo - but only one loc/loclist
section (either in the .o or the .dwo) & certainly one per
DebugLocStream, which is currently singular in DwarfDebug)

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

5 years agoDebugInfo: Remove unused parameter (from DwarfDebug.cpp:emitListsTableHeaderStart)
David Blaikie [Thu, 17 Oct 2019 22:11:40 +0000 (22:11 +0000)]
DebugInfo: Remove unused parameter (from DwarfDebug.cpp:emitListsTableHeaderStart)

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

5 years agoReland [llvm-objdump] Use a counter for llvm-objdump -h instead of the section index.
Jordan Rupprecht [Thu, 17 Oct 2019 21:55:43 +0000 (21:55 +0000)]
Reland [llvm-objdump] Use a counter for llvm-objdump -h instead of the section index.

This relands r374931 (reverted in r375088). It fixes 32-bit builds by using the right format string specifier for uint64_t (PRIu64) instead of `%d`.

Original description:

When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF).

While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped.

Reviewers: grimar, jhenderson, espindola

Reviewed By: grimar

Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay

Tags: #llvm

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

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

5 years ago[Error] Make llvm::cantFail include the original error messages
Don Hinton [Thu, 17 Oct 2019 21:54:15 +0000 (21:54 +0000)]
[Error] Make llvm::cantFail include the original error messages

Summary:
The current implementation eats the current errors and just outputs
the message parameter passed to llvm::cantFail.  This change appends
the original error message(s), so the user can see exactly why
cantFail failed.  New logic is conditional on NDEBUG.

Reviewed By: lhames

Tags: #llvm

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

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

5 years ago[AMDGPU] drop getIsFP td helper
Stanislav Mekhanoshin [Thu, 17 Oct 2019 21:46:56 +0000 (21:46 +0000)]
[AMDGPU] drop getIsFP td helper

We already have isFloatType helper, and they are out of sync.
Drop one and merge the type list.

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

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

5 years ago[lit] Move computation of deadline up into base class
Julian Lettner [Thu, 17 Oct 2019 21:12:45 +0000 (21:12 +0000)]
[lit] Move computation of deadline up into base class

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

5 years ago[llvm-objcopy] Add support for shell wildcards
Jordan Rupprecht [Thu, 17 Oct 2019 20:51:00 +0000 (20:51 +0000)]
[llvm-objcopy] Add support for shell wildcards

Summary: GNU objcopy accepts the --wildcard flag to allow wildcard matching on symbol-related flags. (Note: it's implicitly true for section flags).

The basic syntax is to allow *, ?, \, and [] which work similarly to how they work in a shell. Additionally, starting a wildcard with ! causes that wildcard to prevent it from matching a flag.

Use an updated GlobPattern in libSupport to handle these patterns. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway).

Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap

Reviewed By: MaskRay

Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits

Tags: #llvm

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

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

5 years agoReland "[lit] Synthesize artificial deadline"
Julian Lettner [Thu, 17 Oct 2019 20:22:32 +0000 (20:22 +0000)]
Reland "[lit] Synthesize artificial deadline"

We always want to use a deadline when calling `result.await`.  Let's
synthesize an artificial deadline (now plus one year) to simplify code
and do less busy waiting.

Thanks to Reid Kleckner for diagnosing that a deadline for of "positive
infinity" does not work with Python 3 anymore.  See commit:
4ff1e34b606d9a9fcfd8b8b5449a558315af94e5

I tested this patch with Python 2 and Python 3.

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

5 years ago[x86] add test for setcc to shift transform; NFC
Sanjay Patel [Thu, 17 Oct 2019 19:32:24 +0000 (19:32 +0000)]
[x86] add test for setcc to shift transform; NFC

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

5 years ago[cmake] Pass external project source directories to sub-configures
Shoaib Meenai [Thu, 17 Oct 2019 19:24:58 +0000 (19:24 +0000)]
[cmake] Pass external project source directories to sub-configures

We're passing LLVM_EXTERNAL_PROJECTS to cross-compilation configures, so
we also need to pass the source directories of those projects, otherwise
configuration can fail from not finding them.

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

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

5 years ago[Object] Fix the return type of getOffset/getSize
Alexander Shaposhnikov [Thu, 17 Oct 2019 18:48:07 +0000 (18:48 +0000)]
[Object] Fix the return type of getOffset/getSize

Header64.offset/Header64.size are uint64_t, thus we should not
truncate them to unit32_t. Moreover, there are a number of places
where we sum the offset and the size (e.g. in various checks in MachOUniversal.cpp),
the truncation causes issues since the offset/size can perfectly fit into uint32_t,
while the sum overflows.

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

Test plan: make check-all

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

5 years ago[NFC][InstCombine] Some more preparatory cleanup for dropRedundantMaskingOfLeftShiftI...
Roman Lebedev [Thu, 17 Oct 2019 18:30:03 +0000 (18:30 +0000)]
[NFC][InstCombine] Some more preparatory cleanup for dropRedundantMaskingOfLeftShiftInput()

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

5 years ago[PowerPC] Turn on CR-Logical reducer pass
Nemanja Ivanovic [Thu, 17 Oct 2019 18:24:28 +0000 (18:24 +0000)]
[PowerPC] Turn on CR-Logical reducer pass

Quite a while ago, we implemented a pass that will reduce the number of
CR-logical operations we emit. It does so by converting a CR-logical operation
into a branch. We have kept this off by default because it seemed to cause a
significant regression with one benchmark.
However, that regression turned out to be due to a completely unrelated
reason - AADB introducing a self-copy that is a priority-setting nop and it was
just exacerbated by this pass.

Now that we understand the reason for the only degradation, we can turn this
pass on by default. We have long since fixed the cause for the degradation.

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

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

5 years agoReapply r375051: [support] GlobPattern: add support for `\` and `[!...]`, and allow...
Jordan Rupprecht [Thu, 17 Oct 2019 18:09:05 +0000 (18:09 +0000)]
Reapply r375051: [support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in more places

Reland r375051 (reverted in r375052) after fixing lld tests on Windows in r375126 and r375131.

Original description: Update GlobPattern in libSupport to handle a few more cases. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway).

This will be used to implement the `--wildcard` flag in llvm-objcopy to be more compatible with GNU objcopy.

This is split off of D66613 to land the libSupport changes separately. The llvm-objcopy part will land soon.

Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap

Reviewed By: MaskRay

Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits

Tags: #llvm

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

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

5 years agoNFC: Fix variable only used in asserts by propagating the value.
Sterling Augustine [Thu, 17 Oct 2019 18:08:16 +0000 (18:08 +0000)]
NFC: Fix variable only used in asserts by propagating the value.

Summary:
This fixes builds with assertions disabled that would otherwise
fail with unused variable warnings

Subscribers: nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

Tags: #llvm

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

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

5 years agoRevert [lit] Synthesize artificial deadline
Reid Kleckner [Thu, 17 Oct 2019 17:44:35 +0000 (17:44 +0000)]
Revert [lit] Synthesize artificial deadline

Python on Windows raises this OverflowError:
      gotit = waiter.acquire(True, timeout)
  OverflowError: timestamp too large to convert to C _PyTime_t

So it seems this API behave the same way on every OS.

Also reverts the dependent commit a660dc590a5e8dafa1ba6ed56447ede151d17bd9.

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

5 years ago[PowerPC] add tests for popcount with zext; NFC
Sanjay Patel [Thu, 17 Oct 2019 17:44:04 +0000 (17:44 +0000)]
[PowerPC] add tests for popcount with zext; NFC

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

5 years ago[IndVars] Split loop predication out of optimizeLoopExits [NFC]
Philip Reames [Thu, 17 Oct 2019 17:29:07 +0000 (17:29 +0000)]
[IndVars] Split loop predication out of optimizeLoopExits [NFC]

In the process of writing D69009, I realized we have two distinct sets of invariants within this single function, and basically no shared logic.  The optimize loop exit transforms (including the new one in D69009) only care about *analyzeable* exits.  Loop predication, on the other hand, has to reason about *all* exits.  At the moment, we have the property (due to the requirement for an exact btc) that all exits are analyzeable, but that will likely change in the future as we add widenable condition support.

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

5 years ago[codeview] Workaround for PR43479, don't re-emit instr labels
Reid Kleckner [Thu, 17 Oct 2019 17:28:31 +0000 (17:28 +0000)]
[codeview] Workaround for PR43479, don't re-emit instr labels

Summary:
In the long run we should come up with another mechanism for marking
call instructions as heap allocation sites, and remove this workaround.
For now, we've had two bug reports about this, so let's apply this
workaround. SLH (the other client of instruction labels) probably has
the same bug, but the solution there is more likely to be to mark the
call instruction as not duplicatable, which doesn't work for debug info.

Reviewers: akhuang

Subscribers: aprantl, hiraditya, aganea, chandlerc, llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][InstCombine] Tests for "fold variable mask before variable shift-of-trunc"...
Roman Lebedev [Thu, 17 Oct 2019 17:20:12 +0000 (17:20 +0000)]
[NFC][InstCombine] Tests for "fold variable mask before variable shift-of-trunc" (PR42563)

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

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

5 years ago[IndVars] Factor out a helper function for readability [NFC]
Philip Reames [Thu, 17 Oct 2019 16:55:34 +0000 (16:55 +0000)]
[IndVars] Factor out a helper function for readability [NFC]

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

5 years ago[lit] Move computation of deadline up into base class
Julian Lettner [Thu, 17 Oct 2019 16:01:21 +0000 (16:01 +0000)]
[lit] Move computation of deadline up into base class

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

5 years ago[lit] Synthesize artificial deadline
Julian Lettner [Thu, 17 Oct 2019 16:01:18 +0000 (16:01 +0000)]
[lit] Synthesize artificial deadline

We always want to use a deadline when calling `result.await`.  Let's
synthesize an artificial deadline (positive infinity) to simplify code
and do less busy waiting.

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

5 years ago[lit] Create derived classes for serial/parallel test runs
Julian Lettner [Thu, 17 Oct 2019 16:01:15 +0000 (16:01 +0000)]
[lit] Create derived classes for serial/parallel test runs

The hope is that with a little OO we can nicely factor out the
differences.

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

5 years agoRevert r375114: "[lit] Make internal diff work in pipelines"
Joel E. Denny [Thu, 17 Oct 2019 14:43:42 +0000 (14:43 +0000)]
Revert r375114: "[lit] Make internal diff work in pipelines"

This series of patches still breaks a Windows bot.

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

5 years agoRevert r375116: "[lit] Extend internal diff to support `-` argument"
Joel E. Denny [Thu, 17 Oct 2019 14:43:26 +0000 (14:43 +0000)]
Revert r375116: "[lit] Extend internal diff to support `-` argument"

This series of patches still breaks a Windows bot.

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

5 years ago[clangd] Use our own relation kind.
Haojian Wu [Thu, 17 Oct 2019 14:08:28 +0000 (14:08 +0000)]
[clangd] Use our own relation kind.

Summary:
Move the RelationKind from Serialization.h to Relation.h. This patch doesn't
introduce any breaking changes.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

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

5 years ago[lit] Extend internal diff to support `-` argument
Joel E. Denny [Thu, 17 Oct 2019 14:03:06 +0000 (14:03 +0000)]
[lit] Extend internal diff to support `-` argument

When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-` as a command-line option.  This patch adds support for
`-` to mean stdin.

Reviewed By: probinson, rnk

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

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

5 years ago[lit] Make internal diff work in pipelines
Joel E. Denny [Thu, 17 Oct 2019 14:02:42 +0000 (14:02 +0000)]
[lit] Make internal diff work in pipelines

When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
 # RUN: not diff file1 file2 | FileCheck %s
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` cannot
currently be used in pipelines and doesn't recognize `-` as a
command-line option.

To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation.  A
follow-up patch will implement `-` to mean stdin.

Reviewed By: probinson, stella.stamenova

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

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

5 years ago[AIX] TOC pseudo expansion for 64bit large + 64bit small + 32bit large models
Xiangling Liao [Thu, 17 Oct 2019 13:20:25 +0000 (13:20 +0000)]
[AIX] TOC pseudo expansion for 64bit large + 64bit small + 32bit large models

This patch provides support for peudo ops including ADDIStocHA8, ADDIStocHA, LWZtocL,
LDtoc, LDtocL for AIX, lowering them from MIR to assembly.

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

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

5 years ago[AMDGPU] Improve code size cost model
Daniil Fukalov [Thu, 17 Oct 2019 12:15:35 +0000 (12:15 +0000)]
[AMDGPU] Improve code size cost model

Summary:
Added estimation for zero size insertelement, extractelement
and llvm.fabs operators.
Updated inline/unroll parameters default values.

Reviewers: rampitec, arsenm

Reviewed By: arsenm

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

Tags: #llvm

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

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

5 years ago[ARM][MVE] Enable truncating masked stores
Sam Parker [Thu, 17 Oct 2019 12:11:18 +0000 (12:11 +0000)]
[ARM][MVE] Enable truncating masked stores

Allow us to generate truncating masked store which take v4i32 and
v8i16 vectors and can store to v4i8, v4i16 and v8i8 and memory.
Removed support for unaligned masked stores.

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

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

5 years ago[docs][llvm-ar] Fix option:: O after r375106
Fangrui Song [Thu, 17 Oct 2019 11:56:26 +0000 (11:56 +0000)]
[docs][llvm-ar] Fix option:: O after r375106

docs-llvm-html fails => unknown option: O

There are lots of formatting issues in the file but they will be fixed by D68998.

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

5 years ago[llvm-ar] Implement the O modifier: display member offsets inside the archive
Fangrui Song [Thu, 17 Oct 2019 11:34:29 +0000 (11:34 +0000)]
[llvm-ar] Implement the O modifier: display member offsets inside the archive

Since GNU ar 2.31, the 't' operation prints member offsets beside file
names if the 'O' modifier is specified. 'O' is ignored for thin
archives.

Reviewed By: gbreynoo, ruiu

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

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

5 years ago[llvm-objcopy] --add-symbol: fix crash if SHT_SYMTAB does not exist
Fangrui Song [Thu, 17 Oct 2019 11:21:54 +0000 (11:21 +0000)]
[llvm-objcopy] --add-symbol: fix crash if SHT_SYMTAB does not exist

Exposed by D69041. If SHT_SYMTAB does not exist, ELFObjcopy.cpp:handleArgs will crash due
to a null pointer dereference.

  for (const NewSymbolInfo &SI : Config.ELF->SymbolsToAdd) {
    ...
    Obj.SymbolTable->addSymbol(

Fix this by creating .symtab and .strtab on demand in ELFBuilder<ELFT>::readSections,
if --add-symbol is specified.

Reviewed By: grimar

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

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

5 years agoJumpThreadingPass::UnfoldSelectInstr - silence static analyzer dyn_cast<> null derefe...
Simon Pilgrim [Thu, 17 Oct 2019 11:19:41 +0000 (11:19 +0000)]
JumpThreadingPass::UnfoldSelectInstr - 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@375103 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LoopIdiom] BCmp: check, not assert that loop exits exit out of the loop (PR43687)
Roman Lebedev [Thu, 17 Oct 2019 11:01:29 +0000 (11:01 +0000)]
[LoopIdiom] BCmp: check, not assert that loop exits exit out of the loop (PR43687)

We can't normally stumble into that assertion because a tautological
*conditional* `br` in loop body is required, one that always
branches to loop latch. But that should have been always folded
to an unconditional branch before we get it.
But that is not guaranteed if the pass is run standalone.
So let's just promote the assertion into a proper check.

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

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

5 years ago[llvm-readobj] - Refine the LLVM-style output to be consistent.
George Rimar [Thu, 17 Oct 2019 10:23:48 +0000 (10:23 +0000)]
[llvm-readobj] - Refine the LLVM-style output to be consistent.

Our LLVM-style output was inconsistent.
This patch changes the output in the following way:

SHT_GNU_verdef { -> VersionDefinitions [
SHT_GNU_verneed { -> VersionRequirements [
Version symbols [ -> VersionSymbols [
EH_FRAME Header [ -> EHFrameHeader {

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

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

5 years agoReland: Dead Virtual Function Elimination
Oliver Stannard [Thu, 17 Oct 2019 09:58:57 +0000 (09:58 +0000)]
Reland: Dead Virtual Function Elimination

Remove dead virtual functions from vtables with
replaceNonMetadataUsesWith, so that CGProfile metadata gets cleaned up
correctly.

Original commit message:

Currently, it is hard for the compiler to remove unused C++ virtual
functions, because they are all referenced from vtables, which are referenced
by constructors. This means that if the constructor is called from any live
code, then we keep every virtual function in the final link, even if there
are no call sites which can use it.

This patch allows unused virtual functions to be removed during LTO (and
regular compilation in limited circumstances) by using type metadata to match
virtual function call sites to the vtable slots they might load from. This
information can then be used in the global dead code elimination pass instead
of the references from vtables to virtual functions, to more accurately
determine which functions are reachable.

To make this transformation safe, I have changed clang's code-generation to
always load virtual function pointers using the llvm.type.checked.load
intrinsic, instead of regular load instructions. I originally tried writing
this using clang's existing code-generation, which uses the llvm.type.test
and llvm.assume intrinsics after doing a normal load. However, it is possible
for optimisations to obscure the relationship between the GEP, load and
llvm.type.test, causing GlobalDCE to fail to find virtual function call
sites.

The existing linkage and visibility types don't accurately describe the scope
in which a virtual call could be made which uses a given vtable. This is
wider than the visibility of the type itself, because a virtual function call
could be made using a more-visible base class. I've added a new
!vcall_visibility metadata type to represent this, described in
TypeMetadata.rst. The internalization pass and libLTO have been updated to
change this metadata when linking is performed.

This doesn't currently work with ThinLTO, because it needs to see every call
to llvm.type.checked.load in the linkage unit. It might be possible to
extend this optimisation to be able to use the ThinLTO summary, as was done
for devirtualization, but until then that combination is rejected in the
clang driver.

To test this, I've written a fuzzer which generates random C++ programs with
complex class inheritance graphs, and virtual functions called through object
and function pointers of different types. The programs are spread across
multiple translation units and DSOs to test the different visibility
restrictions.

I've also tried doing bootstrap builds of LLVM to test this. This isn't
ideal, because only classes in anonymous namespaces can be optimised with
-fvisibility=default, and some parts of LLVM (plugins and bugpoint) do not
work correctly with -fvisibility=hidden. However, there are only 12 test
failures when building with -fvisibility=hidden (and an unmodified compiler),
and this change does not cause any new failures for either value of
-fvisibility.

On the 7 C++ sub-benchmarks of SPEC2006, this gives a geomean code-size
reduction of ~6%, over a baseline compiled with "-O2 -flto
-fvisibility=hidden -fwhole-program-vtables". The best cases are reductions
of ~14% in 450.soplex and 483.xalancbmk, and there are no code size
increases.

I've also run this on a set of 8 mbed-os examples compiled for Armv7M, which
show a geomean size reduction of ~3%, again with no size increases.

I had hoped that this would have no effect on performance, which would allow
it to awlays be enabled (when using -fwhole-program-vtables). However, the
changes in clang to use the llvm.type.checked.load intrinsic are causing ~1%
performance regression in the C++ parts of SPEC2006. It should be possible to
recover some of this perf loss by teaching optimisations about the
llvm.type.checked.load intrinsic, which would make it worth turning this on
by default (though it's still dependent on -fwhole-program-vtables).

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

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

5 years agoTry to fix the assert in Alignment::alignAddr to work on 32-bit
Hans Wennborg [Thu, 17 Oct 2019 09:01:39 +0000 (09:01 +0000)]
Try to fix the assert in Alignment::alignAddr to work on 32-bit

Hopefully fixing the AlignmentDeathTest.AlignAddr failures (e.g. at
http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10925)

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

5 years ago[Analysis] Don't assume that unsigned overflow can't happen in EmitGEPOffset (PR42699)
Mikhail Maltsev [Thu, 17 Oct 2019 08:59:06 +0000 (08:59 +0000)]
[Analysis] Don't assume that unsigned overflow can't happen in EmitGEPOffset (PR42699)

Summary:
Currently when computing a GEP offset using the function EmitGEPOffset
for the following instruction

  getelementptr inbounds i32, i32* %p, i64 %offs

we get

  mul nuw i64 %offs, 4

Unfortunately we cannot assume that unsigned wrapping won't happen
here because %offs is allowed to be negative.

Making such assumptions can lead to miscompilations: see the new test
test24_neg_offs in InstCombine/icmp.ll. Without the patch InstCombine
would generate the following comparison:

   icmp eq i64 %offs, 4611686018427387902; 0x3ffffffffffffffe

Whereas the correct value to compare with is -2.

This patch replaces the NUW flag with NSW in the multiplication
instructions generated by EmitGEPOffset and adjusts the test suite.

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

Reviewers: chandlerc, craig.topper, ostannard, lebedev.ri, spatel, efriedma, nlopes, aqjune

Reviewed By: lebedev.ri

Subscribers: reames, lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoRevert r374931 "[llvm-objdump] Use a counter for llvm-objdump -h instead of the secti...
Hans Wennborg [Thu, 17 Oct 2019 08:52:29 +0000 (08:52 +0000)]
Revert r374931 "[llvm-objdump] Use a counter for llvm-objdump -h instead of the section index."

This broke llvm-objdump in 32-bit builds, see e.g.
http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10925

> Summary:
> When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF).
>
> While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped.
>
> Reviewers: grimar, jhenderson, espindola
>
> Reviewed By: grimar
>
> Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay
>
> Tags: #llvm
>
> Differential Revision: https://reviews.llvm.org/D68848

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

5 years ago[ARM][MVE] Change VPST to use, not def, VPR
Sam Parker [Thu, 17 Oct 2019 08:46:31 +0000 (08:46 +0000)]
[ARM][MVE] Change VPST to use, not def, VPR

Unlike VPT, VPST just uses the current value of VPR.P0.

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

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

5 years ago[DFAPacketizer] Use DFAEmitter. NFC.
James Molloy [Thu, 17 Oct 2019 08:34:29 +0000 (08:34 +0000)]
[DFAPacketizer] Use DFAEmitter. NFC.

Summary:
This is a NFC change that removes the NFA->DFA construction and emission logic from DFAPacketizerEmitter and instead uses the generic DFAEmitter logic. This allows DFAPacketizer to use the Automaton class from Support and remove a bunch of logic there too.

After this patch, DFAPacketizer is mostly logic for grepping Itineraries and collecting functional units, with no state machine logic. This will allow us to modernize by removing the 16-functional-unit limit and supporting non-itinerary functional units. This is all for followup patches.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[DAGCombine][ARM] Enable extending masked loads
Sam Parker [Thu, 17 Oct 2019 07:55:55 +0000 (07:55 +0000)]
[DAGCombine][ARM] Enable extending masked loads

Add generic DAG combine for extending masked loads.

Allow us to generate sext/zext masked loads which can access v4i8,
v8i8 and v4i16 memory to produce v4i32, v8i16 and v4i32 respectively.

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

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