1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
Commit Graph

197458 Commits

Author SHA1 Message Date
Craig Topper
4442d11718 [X86] Fix a nullptr dereference in X86Subtarget::classifyLocalReference when compiling with -mcmodel=medium -fpic and using a constant pool
LowerConstantPool passes a nullptr into classifyLocalReference. The medium code model handling for PIC will try to deference it using isa. This patch switches to isa_and_nonnull.

Differential Revision: https://reviews.llvm.org/D80763
2020-05-28 17:20:42 -07:00
Arthur Eubanks
ad4217bf4c Run Coverage pass before other *San passes under new pass manager, round 2
Summary:
This was attempted once before in https://reviews.llvm.org/D79698, but
was reverted due to the coverage pass running in the wrong part of the
pipeline. This commit puts it in the same place as the other sanitizers.

This changes PassBuilder.OptimizerLastEPCallbacks to work on a
ModulePassManager instead of a FunctionPassManager. That is because
SanitizerCoverage cannot (easily) be split into a module pass and a
function pass like some of the other sanitizers since in its current
implementation it conditionally inserts module constructors based on
whether or not it successfully modified functions.

This fixes compiler-rt/test/msan/coverage-levels.cpp under the new pass
manager (last check-msan test).

Currently sanitizers + LTO don't work together under the new pass
manager, so I removed tests that checked that this combination works for
sancov.

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D80692
2020-05-28 17:04:47 -07:00
Vitaly Buka
996efecab9 Test update for a7fa35a629e85a72b8cf07a8f95c7c09d9663808 2020-05-28 16:00:59 -07:00
Craig Topper
85a509fd22 [X86] Add test case to show fast-isel incorrectly emitting a 64-bit movabsq instruction in 32-bit mode when using constant pools with -code-model=large. NFC
-code-model=large isn't supposed to mean anything to 32-bit mode.
But nothing prevents passing it so we shouldn't generate bad code
if someone does.
2020-05-28 15:45:29 -07:00
Ian Levesque
d0514764e5 [xray] Add llvm-xray extract support for 32 bit ARM
Summary:
XRay works on 32-bit ARM but extract didn't support it.

See also another previous attempt in D77858.

Reviewers: MaskRay, dberris, johnislarry

Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80185
2020-05-28 18:41:11 -04:00
Ian Levesque
f3e8d64a87 clang-format xray InstrumentationMap.cpp 2020-05-28 18:41:10 -04:00
Vitaly Buka
c5f99431ce [NFC,StackSafety] Add test flag 2020-05-28 15:38:12 -07:00
Eric Christopher
04de7bc77f unsigned -> Register for readability. 2020-05-28 15:21:55 -07:00
Philip Reames
6b08b81f88 [Tests] Update a few more statepoint tests
Starting to work through the hard ones now, progress likely to slow drammatically.
2020-05-28 15:17:21 -07:00
Craig Topper
853f61f1f4 [X86] Fix a comment reference to registers R8L..R15L to use R8B..R15B like everywhere else. NFC
A new Intel SDM was released today that also fixes this issue in
some documentation.
2020-05-28 15:13:02 -07:00
Arthur Eubanks
ce6bb928cc Revert "Run Coverage pass before other *San passes under new pass manager, round 2"
This reverts commit 922fa2fce38b0bd97921b91ff1cdc57f18d3569c.
2020-05-28 14:38:05 -07:00
Philip Reames
29abd730f2 [Tests] Remove deopt operands from SafepointIRVerfier tests
This linter has nothing to do with deopt, and the operands had clearly been copied blindly from another source.  Rather than migrate to deopt operand bundle, let's just simplify the tests.
2020-05-28 14:36:05 -07:00
Philip Reames
5da27918f4 [Tests] Switch a few statepoint tests to using operand bundles
We've started (D80598) the process of migrating away from the inline operand lists in statepoints to using explicit operand bundles.  Update a few tests to reflect the new preference.  More to come, these were simply the ones outside any obvious grouping.
2020-05-28 14:36:05 -07:00
Vitaly Buka
d16ff8bbdf [NFC,StackSafety] clang-tidy warning fixes 2020-05-28 14:29:55 -07:00
Arthur Eubanks
d743388d68 Run Coverage pass before other *San passes under new pass manager, round 2
Summary:
This was attempted once before in https://reviews.llvm.org/D79698, but
was reverted due to the coverage pass running in the wrong part of the
pipeline. This commit puts it in the same place as the other sanitizers.

This changes PassBuilder.OptimizerLastEPCallbacks to work on a
ModulePassManager instead of a FunctionPassManager. That is because
SanitizerCoverage cannot (easily) be split into a module pass and a
function pass like some of the other sanitizers since in its current
implementation it conditionally inserts module constructors based on
whether or not it successfully modified functions.

This fixes compiler-rt/test/msan/coverage-levels.cpp under the new pass
manager (last check-msan test).

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D80692
2020-05-28 14:25:23 -07:00
Christopher Tetreault
21cc182b13 [SVE] Eliminate calls to default-false VectorType::get() from Analysis
Reviewers: efriedma, fpetrogalli, kmclaughlin, sunfish

Reviewed By: fpetrogalli

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80324
2020-05-28 14:21:32 -07:00
David Green
6307317d50 [ARM] More tests for MVE LSR and float issues. NFC 2020-05-28 22:04:12 +01:00
Vedant Kumar
5fd6a17bda [LiveDebugValues] Add cutoffs to avoid pathological behavior
Summary:
We received a report of LiveDebugValues consuming 25GB+ of RAM when
compiling code generated by Unity's IL2CPP scripting backend.

There's an initial 5GB spike due to repeatedly copying cached lists of
MachineBasicBlocks within the UserValueScopes members of VarLocs.

But the larger scaling issue arises due to the fact that prior to range
extension, there are 81K basic blocks and 156K DBG_VALUEs: given enough
memory, LiveDebugValues would insert 101 million MIs (I counted this by
incrementing a counter inside of VarLoc::BuildDbgValue).

It seems like LiveDebugValues would have to be rearchitected to support
this kind of input (we'd need some new represntation for DBG_VALUEs that
get inserted into ~every block via flushPendingLocs). OTOH, large globs
of auto-generated code are typically not debugged interactively.

So: add cutoffs to disable range extension when the input is too big. I
chose the cutoffs experimentally, erring on the conservative side. When
compiling a large collection of Apple software, range extension never
got disabled.

rdar://63418929

Reviewers: aprantl, friss, jmorse, Orlando

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80662
2020-05-28 13:53:40 -07:00
Vedant Kumar
73e2a5da53 [MachineVerifier] Verify that a DBG_VALUE has a debug location
Summary:
Verify that each DBG_VALUE has a debug location. This is required by
LiveDebugValues, and perhaps by other late passes.

There's an exception for tests: lots of tests use a two-operand form of
DBG_VALUE for convenience. There's no reason to prevent that.

This is an extension of D80665, but there's no dependency.

Reviewers: aprantl, jmorse, davide, chrisjackson

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80670
2020-05-28 13:53:40 -07:00
Vedant Kumar
7f60fb1f6e [MachineLICM] Assert that locations from debug insts are not lost
Summary:
Assert that MachineLICM does not move a debug instruction and then drop
its debug location. Later passes require each debug instruction to have
a location.

Testing: check-llvm, clang stage2 RelWithDebInfo build (x86_64)

Reviewers: aprantl, davide, chrisjackson, jmorse

Subscribers: hiraditya, asbirlea, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80665
2020-05-28 13:53:40 -07:00
Philip Reames
071bbe0177 [Statepoints] Sink routines for grabbing projections to GCStatepointInst [NFC]
Mechanical movement, nothing more.
2020-05-28 13:51:59 -07:00
Philip Reames
56c98b3720 [Statepoint] Sink actual_args and gc_args to GCStatepointInst [NFC]
These are the two operand sets which are expected to survive more than another week or so.  Instead of bothering to update the deopt and gc-transition operands, we'll just wait until those are removed and delete the code.

For those following along, this is likely to be the last (major) change in this sequence for about a week.  I want to wait until all of this has been merged downstream to ensure I haven't introduced any bugs (and migrate some downstream code to the new interfaces).  Once that's done, we should be able to delete Statepoint/ImmutableStatepoint without too much work.
2020-05-28 13:51:59 -07:00
Philip Reames
321a5cfc7a [Statepoint] Use iterate_range.empty [NFC] 2020-05-28 13:51:59 -07:00
Vitaly Buka
507fec3651 [StackSafety] Lazy calculations
We are going to convert this into pure analysis, so
processing will be delayed up to the first safety request.
2020-05-28 13:32:57 -07:00
Vitaly Buka
56ccc916eb [NFC,StackSafety] Move internal offset calculation 2020-05-28 13:32:57 -07:00
Vitaly Buka
1f0315fe17 [StackSafety] Don't run datafow on allocas
We need to process only parameters. Allocas access can be calculated
afterwards.
Also don't create fake function for aliases and just resolve them on
initialization.
2020-05-28 13:32:57 -07:00
Vitaly Buka
2d46ef17e1 [StackSafety] Remove SetMetadata parameter 2020-05-28 13:32:57 -07:00
Arthur Eubanks
4d9ea2c58a Add tests for preallocated + musttail
Summary:
Follow-up to https://reviews.llvm.org/D80581.
Turns out the codegen part already worked, so only needed to add tests.
I manually verified that in these tests the generated code for inalloca
and preallocated were identical.

Reviewers: efriedma, hans

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80742
2020-05-28 12:17:09 -07:00
aartbik
0933dc1711 [llvm] [MatrixIntrinsics] Add row-major support for llvm.matrix.transpose
Summary:
Only column-major was supported so far. This adds row-major support as well.
Note that we probably also want very efficient SIMD implementations for the
various target platforms.

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

Reviewers: nicolasvasilache, reidtatge, bkramer, fhahn, ftynse, andydavis1, craig.topper, dcaballe, mehdi_amini, anemet

Reviewed By: fhahn

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80673
2020-05-28 12:13:32 -07:00
Whitney Tsang
3293aaf092 Revert "[LoopUnroll] Support loops with exiting block that is neither header nor"
This reverts commit 281058226587d8c70172ff0fb1e55d58876da229.

Revert until
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/7334
is resolved.
2020-05-28 19:10:27 +00:00
Sjoerd Meijer
24a060d455 [AArch64] Add native CPU detection for Neoverse N1
Map the CPU ID value 0xd0c to "neoverse-n1".

Patch by James Greenhalgh.

Differential Revision: https://reviews.llvm.org/D80736
2020-05-28 19:54:18 +01:00
Stanislav Mekhanoshin
fde958c35e AMDGPU/GlobalISel: precommit extractelement test. NFC. 2020-05-28 11:46:06 -07:00
Philip Reames
0fb404dfdf [Statepoint] Convert a few more isStatepoint calls to idiomatic isa/cast
I'd apparently only grepped in the lib directories and missed a few used in the Statepoint header itself.  Beyond simple mechanical cleanup, changed the type of one routine to reflect the fact it also returns a statepoint.
2020-05-28 11:35:36 -07:00
Matt Arsenault
44e7d55088 AMDGPU: Handle rewriting ptrmask for more address spaces
If this mask only clears bits in the low 32-bit half of a flat
pointer, these bits are always preserved in the result address
space. If the high bits are modified, they may need to be preserved
for some kind of user pointer tagging.
2020-05-28 14:35:15 -04:00
Whitney Tsang
584ad8bb46 [LoopUnroll] Support loops with exiting block that is neither header nor
latch.

Summary: Remove the limitation in LoopUnrollPass that exiting block must
be either header or latch.
Reviewer: dmgreen, jdoerfert, Meinersbur, kbarton, bmahjour, etiotto,
fhahn, efriedma
Reviewed By: etiotto, fhahn, efriedma
Subscribers: efriedma, lkail, xbolva00, hiraditya, zzheng, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D80477
2020-05-28 18:27:09 +00:00
Matt Arsenault
6507040e1c AMDGPU: Add intrinsic for s_setreg
This will be more useful with fenv access implemented.
2020-05-28 14:26:38 -04:00
Philip Reames
7969a10de1 [Statepoint] Sink logic about actual callee into GCStatepointInst
Sinking logic around actual callee from Statepoint to GCStatepointInst.  While doing so, adjust naming to be consistent about refering to "actual" callee and follow precedent on naming from CallBase otherwise.

Use the result to simplify one consumer.  This is mostly just to ensure the new code is exercised, but is also a helpful cleanup on it's own.
2020-05-28 10:53:39 -07:00
Nikita Popov
2298d7abda [IR] Avoid linear scan in MDNode::intersect() (NFC)
00940fb8544767ba5217922c4ba96677aabe9eb3 changed this code to
construct a set for the B metadata. However, it still performs a
linear is_contained query, rather than making use of the set
structure.
2020-05-28 19:38:46 +02:00
Hiroshi Yamauchi
9896d761e8 [ThinLTO] Compute the basic block count across modules.
Summary:
Count the per-module number of basic blocks when the module summary is computed
and sum them up during Thin LTO indexing.

This is used to estimate the working set size under the partial sample PGO.

This is split off of D79831.

Reviewers: davidxl, espindola

Subscribers: emaste, inglorion, hiraditya, MaskRay, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80403
2020-05-28 10:33:05 -07:00
Philip Reames
546a9c07c3 Default to generating statepoints with deopt and gc-transition bundles if needed
Continues from D80598.

The key point of the change is to default to using operand bundles instead of the inline length prefix argument lists for statepoint nodes. An important subtlety to note is that the presence of a bundle has semantic meaning, even if it is empty. As such, we need to make a somewhat deeper change to the interface than is first obvious.

Existing code treats statepoint deopt arguments and the deopt bundle operands differently during inlining. The former is ignored (resulting in caller state being dropped), the later is merged.

We can't preserve the old behaviour for calls with deopt fed to RS4GC and then inlining, but we can avoid the no-deopt case changing. At least in internal testing, that seem to be the important one. (I'd argue the "stop merging after RS4GC" behaviour for the former was always "unexpected", but that the behaviour for non-deopt calls actually make sense.)

Differential Revision: https://reviews.llvm.org/D80674
2020-05-28 10:14:23 -07:00
Hiroshi Yamauchi
f331ef22e8 [PGO] Guard the memcmp/bcmp size value profiling instrumentation behind flag.
Summary:
Follow up D79751 and put the instrumentation / value collection side (in
addition to the optimization side) behind the flag as well.

Reviewers: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80646
2020-05-28 10:07:04 -07:00
Craig Topper
eccf8034a4 [X86] Add 'avx512vp2intersect' to getHostCPUFeatures. 2020-05-28 09:57:17 -07:00
LLVM GN Syncbot
08b2f1da9b [gn build] Port 7cfdff7b4a6 2020-05-28 16:49:43 +00:00
Nikita Popov
2d0f3c3ccb [SDAG] Don't require LazyBlockFrequencyInfo at optnone
While LazyBlockFrequencyInfo itself is lazy, the dominator tree
and loop info analyses it requires are not. Drop the dependency
on this pass in SelectionDAGIsel at O0.
This makes for a ~0.6% O0 compile-time improvement.

Differential Revision: https://reviews.llvm.org/D80387
2020-05-28 18:48:33 +02:00
Sidharth Baveja
d7febd5baa Create utility function to Merge Adjacent Basic Blocks
Summary: The following code from
/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp can be used by other
transformations:

while (!MergeBlocks.empty()) {
    BasicBlock *BB = *MergeBlocks.begin();
    BranchInst *Term = dyn_cast<BranchInst>(BB->getTerminator());
    if (Term && Term->isUnconditional() &&
L->contains(Term->getSuccessor(0))) {
      BasicBlock *Dest = Term->getSuccessor(0);
      BasicBlock *Fold = Dest->getUniquePredecessor();
      if (MergeBlockIntoPredecessor(Dest, &DTU, LI)) {
        // Don't remove BB and add Fold as they are the same BB
        assert(Fold == BB);
        (void)Fold;
        MergeBlocks.erase(Dest);
      } else
        MergeBlocks.erase(BB);
    } else
      MergeBlocks.erase(BB);
  }
Hence it should be separated into its own utility function.

Authored By: sidbav
Reviewer: Whitney, Meinersbur, asbirlea, dmgreen, etiotto
Reviewed By: asbirlea
Subscribers: hiraditya, zzheng, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D80583
2020-05-28 16:44:37 +00:00
Vy Nguyen
86e59df733 [llvm-exegesis] Make a few counter methods virtual to allow targets to provide target-specific support.
Misc: Also include errno in failure message.

Differential Revision: https://reviews.llvm.org/D80610
2020-05-28 12:38:25 -04:00
Adrian Prantl
d02e7da40e Make VE.def a textual header 2020-05-28 09:35:19 -07:00
alex-t
90d04d1194 [AMDGPU] Reject moving PHI to VALU if the only VGPR input originated from move immediate
Summary:
PHIs result register class is set to VGPR or SGPR depending on the cross block value divergence.
         In some cases uniform PHI need to be converted to return VGPR to prevent the oddnumber of moves values from VGPR to SGPR and back.
         PHI should certainly return VGPR if it has at least one VGPR input. This change adds the exception.
         We don't want to convert uniform PHI to VGPRs in case the only VGPR input is a VGPR to SGPR COPY and definition od the
         source VGPR in this COPY is move immediate.

  bb.0:

     %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
     %2:sreg_32 = .....

  bb.1:
     %3:sreg_32 = PHI %1, %bb.3, %2, %bb.1
     S_BRANCH %bb.3

  bb.3:
     %1:sreg_32 = COPY %0
     S_BRANCH %bb.2

Reviewers: rampitec

Reviewed By: rampitec

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80434
2020-05-28 19:25:51 +03:00
Jean-Michel Gorius
d3e7b3c0e9 [x86] Propagate memory operands during call frame optimization
Summary:
Propagate memory operands when folding load instructions into instructions that directly operate on memory.

The original revision has been split. See D80140 for the other part of the changes.

Reviewers: craig.topper, rnk, lebedev.ri, efriedma

Reviewed By: craig.topper

Subscribers: lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80062
2020-05-28 17:45:53 +02:00
Matt Arsenault
e803204f39 AMDGPU: Add missing test for s_denorm_mode scheduling
Forgot to add this file to 1a9e0d7092145e33175f628f4cdd28acf0d17100
2020-05-28 11:07:22 -04:00