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

199854 Commits

Author SHA1 Message Date
Arthur Eubanks
7e97cdc019 [NFC] Derive from PassInfoMixin for no-op/printing passes
PassInfoMixin should be used for all NPM passes, rater than a custom
`name()`.

This caused ambiguous references in LegacyPassManager.cpp, so had to
remove "using namespace llvm::legacy" and move some things around.

The passes had to be moved to the llvm namespace, or else they would get
printed as "(anonymous namespace)::FooPass".

Reviewed By: ychen, asbirlea

Differential Revision: https://reviews.llvm.org/D83498
2020-07-09 16:58:30 -07:00
Wei Mi
7fc0e8b3ed [NFC] Change getEntryForPercentile to be a static function in ProfileSummaryBuilder.
Change file static function getEntryForPercentile to be a static member function
in ProfileSummaryBuilder so it can be used by other files.

Differential Revision: https://reviews.llvm.org/D83439
2020-07-09 16:38:19 -07:00
Wei Mi
ac5dfca575 [NFC] Extract the code to write instr profile into function writeInstrProfile
So that the function writeInstrProfile can be used in other places.

Differential Revision: https://reviews.llvm.org/D83521
2020-07-09 16:30:28 -07:00
Eli Friedman
e55928345d [AArch64][SVE] Add lowering for llvm.fma.
This is currently bare-bones; we aren't taking advantage of any of the
FMA variant instructions.  But it's enough to at least generate
code.

Differential Revision: https://reviews.llvm.org/D83444
2020-07-09 16:12:41 -07:00
Albion Fung
6720e74af7 [PowerPC][Power10] Add Instruction definition/MC Tests for Load/Store Rightmost VSX Vector
This patch adds the instruction definitions and the assembly/disassembly
tests for the Load/Store VSX Vector Rightmose instructions.

Differential Revision: https://reviews.llvm.org/D83364
2020-07-09 17:06:03 -05:00
Joel E. Denny
e330e469db [FileCheck] Improve -dump-input documentation
Document the default of `fail` in `-help`.  Extend `-dump-input=help`
to help users find related command-line options, but let `-help`
provide their full documentation.

Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D83091
2020-07-09 18:00:30 -04:00
Craig Topper
74671049dd Recommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser.def."
This time without the change to make operator| use operator&=.
That seems to be the source of the gcc 5.3 miscompile.

Original commit message:
These represent the same thing but 64BIT only showed up from
getHostCPUFeatures providing a list of featuers to clang. While
EM64T showed up from getting the features for a named CPU.

EM64T didn't have a string specifically so it would not be passed
up to clang when getting features for a named CPU. While 64bit
needed a name since that's how it is index.

Merge them by filtering 64bit out before sending features to clang
for named CPUs.
2020-07-09 14:52:16 -07:00
Stanislav Mekhanoshin
8d7345275d [AMDGPU] Return restricted number of regs from TTI
This is practically NFC at the moment because nothing really
asks the real number or does anything useful with it.

Differential Revision: https://reviews.llvm.org/D82202
2020-07-09 14:31:28 -07:00
Sanjay Patel
81806c24bf [DAGCombiner] convert if-chain in store merging to switch; NFC 2020-07-09 17:20:04 -04:00
Sanjay Patel
8c5ccbb984 [DAGCombiner] add helper function for store merging of loaded values; NFC 2020-07-09 17:20:04 -04:00
Sanjay Patel
876f75b66f [DAGCombiner] add helper function for store merging of extracts; NFC 2020-07-09 17:20:03 -04:00
Sanjay Patel
44f6080ee5 [DAGCombiner] add helper function for store merging of constants; NFC 2020-07-09 17:20:03 -04:00
Sanjay Patel
25220109c0 [DAGCombiner] add helper function to manage list of consecutive stores; NFC 2020-07-09 17:20:03 -04:00
Nikita Popov
c71a50e2d9 [PredicateInfo] Print RenamedOp (NFC)
Make it easier to debug renaming issues.
2020-07-09 23:14:24 +02:00
Roman Lebedev
bdc1bebdcc Revert "[CallGraph] Ignore callback uses"
This likely has broken test/Transforms/Attributor/IPConstantProp/ tests.
http://45.33.8.238/linux/22502/step_12.txt

This reverts commit 205dc0922d5f7305226f7457fcbcb4224c92530c.
2020-07-10 00:02:07 +03:00
Eric Christopher
5babc13fa2 Temporarily Revert "[PowerPC] Split s34imm into two types"
as it was failing in Release+Asserts mode with an assert.

This reverts commit bd2068031121adf5a0e28d9306a1741d6f0bbd87.
2020-07-09 13:36:32 -07:00
Fangrui Song
abc516182d Revert D83013 "[LPM] Port CGProfilePass from NPM to LPM"
This reverts commit c92a8c0a0f68fbbb23e3fdde071007e63a552e82.

It breaks builds and has unaddressed review comments.
2020-07-09 13:34:04 -07:00
Giorgis Georgakoudis
ad895bc62a [CallGraph] Ignore callback uses
Summary:
Ignore callback uses when adding a callback function
in the CallGraph. Callback functions are typically
created when outlining, e.g. for OpenMP, so they have
internal scope and linkage. They should not be added
to the ExternalCallingNode since they are only callable
by the specified caller function at creation time.

A CGSCC pass, such as OpenMPOpt, may need to update
the CallGraph by adding a new outlined callback function.
Without ignoring callback uses, adding breaks CGSCC
pass restrictions and results to a broken CallGraph.

Reviewers: jdoerfert

Subscribers: hiraditya, sstefan1, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83370
2020-07-09 13:13:46 -07:00
Roman Lebedev
892d28a558 [llvm-reduce] Reducing attributes
Summary:
This handles all three places where attributes could currently be - `GlobalVariable`, `Function` and `CallBase`.
For last two, it correctly handles all three possible attribute locations (return value, arguments and function itself)

There was a previous attempt at it D73853,
which was committed in rGfc62b36a000681c01e993242b583c5ec4ab48a3c,
but then reverted all the way back in rGb12176d2aafa0ccb2585aa218fc3b454ba84f2a9
due to some (osx?) test failures.

Reviewers: nickdesaulniers, dblaikie, diegotf, george.burgess.iv, jdoerfert, Tyker, arsenm

Reviewed By: nickdesaulniers

Subscribers: wdng, MaskRay, arsenm, llvm-commits, mgorny

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83351
2020-07-09 23:10:43 +03:00
Roman Lebedev
90826c519d [NFC][llvm-reduce] Purify for_each usage in Operand Bundles into range-based for loop
Summary:
As per lengthy/heated disscussion in D83351,
and CodingStandards D83431.

Reviewers: dblaikie, nickdesaulniers

Reviewed By: nickdesaulniers

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83434
2020-07-09 23:10:43 +03:00
Roman Lebedev
1036a9e7d6 [NFCI][llvm-reduce] OperandBundleCounter: drop pointless constructor
Reviewers: nickdesaulniers, dblaikie

Reviewed By: nickdesaulniers

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83435
2020-07-09 23:10:42 +03:00
Roman Lebedev
8aaa6d450e [Docs] CodingStandards: for_each is discouraged
Summary:
As per disscussion in D83351, using `for_each` is potentially confusing,
at least in regards to inconsistent style (there's less than 100 `for_each`
usages in LLVM, but ~100.000 `for` range-based loops

Therefore, it should be avoided.

Reviewers: dblaikie, nickdesaulniers

Reviewed By: dblaikie, nickdesaulniers

Subscribers: hubert.reinterpretcast, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83431
2020-07-09 23:10:42 +03:00
Roman Lebedev
c631301468 Revert "[InstCombine] Lower infinite combine loop detection thresholds"
And just after 3 days, we have a hit in `InstCombiner::mergeStoreIntoSuccessor()`:
https://bugs.llvm.org/show_bug.cgi?id=46661

To be recommitted once that is addressed.

This reverts commit cd7f8051ac7b6f08734102446482c1e5d951bfcc.
2020-07-09 23:10:42 +03:00
Zequan Wu
bee2e9c767 [LPM] Port CGProfilePass from NPM to LPM
Reviewers: hans, chandlerc!, asbirlea, nikic

Reviewed By: hans, nikic

Subscribers: steven_wu, dexonsmith, nikic, echristo, void, zhizhouy, cfe-commits, aeubanks, MaskRay, jvesely, nhaehnle, hiraditya, kerbowa, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D83013
2020-07-09 13:03:42 -07:00
Christopher Tetreault
dc8544dea6 [SVE] Remove calls to VectorType::getNumElements from CodeGen
Reviewers: efriedma, fpetrogalli, sdesmalen, RKSimon, arsenm

Reviewed By: RKSimon

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82210
2020-07-09 12:43:36 -07:00
Craig Topper
ccfc3f1f03 [InstSimplify] Re-enable select ?, undef, X -> X transform when X is provably not poison
Follow up from the transform being removed in D83360. If X is probably not poison, then the transform is safe.

Still plan to remove or adjust the code from ConstantFolding after this.

Differential Revision: https://reviews.llvm.org/D83440
2020-07-09 12:21:03 -07:00
Kyungwoo Lee
498e5d4272 [NFC][AArch64] Refactor getArgumentPopSize
Differential Revision: https://reviews.llvm.org/D83456
2020-07-09 11:58:15 -07:00
Puyan Lotfi
8ad0b9cbfb [NFC][test] Adding fastcc test case for promoted 16-bit integer bitcasts.
The following: https://reviews.llvm.org/D82552

fixed an assert in the SelectionDag ISel legalizer for some CCs on armv7.

I noticed that this fix also fixes the assert when using fastcc, so I am
adding a fastcc regression test here.

Differential Revision: https://reviews.llvm.org/D82443
2020-07-09 11:38:49 -07:00
Craig Topper
c0a4a79579 [InstSimplify] Don't fold vectors of partial undef in SimplifySelectInst if the non-undef element value might produce poison
We can't fold to the non-undef value unless we know it isn't poison. So check each element with isGuaranteedNotToBeUndefOrPoison. This currently rules out all constant expressions.

Differential Revision: https://reviews.llvm.org/D83442
2020-07-09 11:01:12 -07:00
Craig Topper
da66568f24 [X86] Immediately call LowerShift from lowerBuildVectorToBitOp.
If we don't immediately lower the vector shift, the splat
constant vector we created may get turned into a constant pool
load before we get around to lowering the shift. This makes it
a lot more difficult to create a shift by constant. Sometimes we
fail to see through the constant pool at all and end up trying
to lower as if it was a variable shift. This requires custom
handling and may create an unsupported vselect on pre-sse-4.1
targets. Since we're after LegalizeVectorOps we are unable to
legalize the unsupported vselect as that code is in LegalizeVectorOps
rather than LegalizeDAG.

So calling LowerShift immediately ensures that we get see the
splat constant.

Fixes PR46527.

Differential Revision: https://reviews.llvm.org/D83455
2020-07-09 10:51:29 -07:00
David Blaikie
5ccdb04d28 Remove unnecessary 'rm' in llvm-reduce tests
These were initially added to cleanup some transient/leftover files in
r372054. Now that's all cleaned up, these are no longer needed.
2020-07-09 10:49:11 -07:00
Hiroshi Yamauchi
45213c9ada [PGO][PGSO] Add profile guided size optimization to X86 ISel Lowering. 2020-07-09 10:43:45 -07:00
Craig Topper
8717bd1898 [X86] Directly emit X86ISD::BLENDV instead of VSELECT in a few places that were emitting sign bit tests.
Technically a VSELECT expects a vector of all 1s or 0s elements
for its condition. But we aren't guaranteeing that the sign bit
and the non sign bits match in these locations. So we should use
BLENDV which is more relaxed.

Differential Revision: https://reviews.llvm.org/D83447
2020-07-09 10:40:09 -07:00
Florian Hahn
aebe1a106b [ValueLattice] Simplify canTrackGlobalVariableInterprocedurally (NFC).
using all_of and checking for valid users in the lambda seems more
straight forward. Also adds a comment explaining what we are checking.
2020-07-09 18:33:09 +01:00
Hiroshi Yamauchi
b59dcd9fec [PGO][PGSO] Add profile guided size optimization tests to X86 ISel Lowering. 2020-07-09 09:56:01 -07:00
Fred Riss
2c9efde878 [lldb] Use enum constant instead of raw value 2020-07-09 09:43:50 -07:00
Nikita Popov
41b868d315 [AliasSetTracker] More precise AAInfo intersection check
The code currently checks whether the intersection has one of TBAA,
Scope or NoAlias unset -- however, those might have already been
unset in the first place, in which case we will unnecessarily
report a change. Instead, compare the intersection result to the
original AAInfo.

This makes for a 0.5% geomean compile-time saving on CTMark.

Differential Revision: https://reviews.llvm.org/D83430
2020-07-09 18:29:41 +02:00
Stefan Pintilie
ed8f32270b [PowerPC] Split s34imm into two types
Currently the instruction paddi always takes s34imm as the type for the
34 bit immediate. However, the PC Relative form of the instruction should
not produce the same fixup as the non PC Relative form.
This patch splits the s34imm type into s34imm and s34imm_pcrel so that two
different fixups can be emitted.

Reviewed By: kamaub, nemanjai

Differential Revision: https://reviews.llvm.org/D83255
2020-07-09 11:28:32 -05:00
Florian Hahn
64cf7359d3 [SCCP] Move tests using only ipsccp from IPConstantProp to SCCP (NFC).
Some of the tests in the llvm/test/Transforms/IPConstantProp directory
actually only use -ipsccp. Those tests belong to the other (IP)SCCP
tests in llvm/test/Transforms/SCCP/ and this commits moves them there to
avoid confusion with IPConstantProp.
2020-07-09 17:16:15 +01:00
Hans Wennborg
ee78bf3c0c Revert 51b0da73 "Recommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser.def.""
It gets miscompiled with GCC 5.3, causing Clang to crash with
"error: unknown target CPU 'x86-64'"

See the llvm-commits thread for reproduction steps.

This reverts commit 51b0da731af75c68dd521e04cc576d5a611b1612.
2020-07-09 17:55:58 +02:00
Diogo Sampaio
0c042d2f8f [NFC] Add SExt multiuses test 2020-07-09 15:31:16 +01:00
Matt Arsenault
75f9699e55 AMDGPU/GlobalISel: Work around verifier error in test
The unfortunate split between finalizeLowering and the selector pass
means there's a point where the verifier fails. The DAG selector pass
skips the verifier, but this seems to not work when using the
GlobalISel fallback.
2020-07-09 10:24:16 -04:00
Simon Pilgrim
25bfa43832 Fix MSVC "not all control paths return a value" warning. NFC. 2020-07-09 15:01:13 +01:00
David Green
061ec94c71 [BasicAA] Enable -basic-aa-recphi by default
This option was added a while back, to help improve AA around pointer
phi loops. It looks for phi(gep(phi, const), x) loops, checking if x can
then prove more precise aliasing info.

Differential Revision: https://reviews.llvm.org/D82998
2020-07-09 14:54:53 +01:00
Matt Arsenault
dd9c024d3b OpaquePtr: Don't check pointee type for byval/preallocated
Since none of these users really care about the actual type, hide the
type under a new size-getting attribute to go along with
hasPassPointeeByValueAttr. This will work better for the future byref
attribute, which may end up only tracking the byte size and not the IR
type.

We currently have 3 parameter attributes that should carry the type
(technically inalloca does not yet). The APIs are somewhat awkward
since preallocated/inalloca piggyback on byval in some places, but in
others are treated as distinct attributes. Since these are all
mutually exclusive, we should probably just merge all the attribute
infrastructure treating these as totally distinct attributes.
2020-07-09 09:37:41 -04:00
Simon Pilgrim
8e73a34d4d [X86][AVX] Attempt to fold extract_subvector(shuffle(X)) -> extract_subvector(X)
If we're extracting a subvector from a shuffle that is shuffling entire subvectors we can peek through and extract the subvector from the shuffle source instead.

This helps remove some cases where concat_vectors(extract_subvector(),extract_subvector()) legalizations has resulted in BLEND/VPERM2F128 shuffles of the subvectors.
2020-07-09 14:09:24 +01:00
Simon Pilgrim
ddf17279b8 BasicAAResult::constantOffsetHeuristic - pass APInt arg as const reference. NFCI.
Avoids unnecessary APInt copies and silences clang tidy warning.
2020-07-09 14:09:24 +01:00
Sam Elliott
06dbe0b9ab [RISCV] Avoid Splitting MBB in RISCVExpandPseudo
Since the `RISCVExpandPseudo` pass has been split from
`RISCVExpandAtomicPseudo` pass, it would be nice to run the former as
early as possible (The latter has to be run as late as possible to
ensure correctness). Running earlier means we can reschedule these pairs
as we see fit.

Running earlier in the machine pass pipeline is good, but would mean
teaching many more passes about `hasLabelMustBeEmitted`. Splitting the
basic blocks also pessimises possible optimisations because some
optimisations are MBB-local, and others are disabled if the block has
its address taken (which is notionally what `hasLabelMustBeEmitted`
means).

This patch uses a new approach of setting the pre-instruction symbol on
the AUIPC instruction to a temporary symbol and referencing that. This
avoids splitting the basic block, but allows us to reference exactly the
instruction that we need to. Notionally, this approach seems more
correct because we do actually want to address a specific instruction.

This then allows the pass to be moved much earlier in the pass pipeline,
before both scheduling and register allocation. However, to do so we
must leave the MIR in SSA form (by not redefining registers), and so use
a virtual register for the intermediate value. By using this virtual
register, this pass now has to come before register allocation.

Reviewed By: luismarques, asb

Differential Revision: https://reviews.llvm.org/D82988
2020-07-09 13:54:13 +01:00
dfukalov
6a71add7f0 SpeculativeExecution: Fix for logic change introduced in D81730.
Summary:
The test case started to hoist bitcasts to upper BB after D81730.
Reverted unintentional logic change. Some instructions may have zero cost but
will not be hoisted by different limitation so should be counted for threshold.

Reviewers: aprantl, arsenm, nhaehnle

Reviewed By: aprantl

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82761
2020-07-09 15:45:23 +03:00
Benjamin Kramer
5d1934a4c5 [DebugInfo] Fix pessimizing move. NFC.
DWARFDebugPubTable.cpp:80:31: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
2020-07-09 14:23:46 +02:00