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

199141 Commits

Author SHA1 Message Date
Pengfei Wang
3beff269e6 [X86][NFC] Pre-commit test case for the following patch. 2020-06-24 18:37:01 -07:00
Arthur Eubanks
4cd332044f [NewPM][opt] Assert PassPipeline and Passes don't both contain passes
Reviewers: asbirlea

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82512
2020-06-24 18:00:22 -07:00
Sid Manning
9e71156d6d [Hexagon][llvm-objcopy] Add missing check for SHN_HEXAGON_SCOMMON_1
Differential Revision: https://reviews.llvm.org/D82484
2020-06-24 19:56:01 -05:00
Michele Scandale
80fcca7787 [Inliner] Handle 'no-signed-zeros-fp-math' function attribute.
All other floating point math optimization related attribute are merged
in a conservative way during function inlining. This commit adds the
merge rule for the 'no-signed-zeros-fp-math' attribute.

Differential Revision: https://reviews.llvm.org/D81714
2020-06-24 17:53:59 -07:00
Amara Emerson
e913decb3a Don't inline dynamic allocas that simplify to huge static allocas.
Some sequences of optimizations can generate call sites which may never be
executed during runtime, and through constant propagation result in dynamic
allocas being converted to static allocas with very large allocation amounts.

The inliner tries to move these to the caller's entry block, resulting in the
stack limits being reached/bypassed. Avoid inlining functions if this would
result.

The threshold of 64k currently doesn't get triggered on the test suite with an
-Os LTO build on arm64, care should be taken in changing this in future to avoid
needlessly pessimising inlining behaviour.

Differential Revision: https://reviews.llvm.org/D81765
2020-06-24 17:39:03 -07:00
Xing GUO
cb10895c53 [DWARFYAML][debug_gnu_*] 'Descriptor' field should be 1-byte. NFC.
The 'Descriptor' field of .debug_gnu_pubnames and .debug_gnu_pubtypes
section should be 1-byte rather than 4-byte. This patch helps resolve
this issue.
2020-06-25 08:21:13 +08:00
Kirill Naumov
f6e5cbec4b [InlineCost] PrinterPass prints constants to which instructions are simplified
This patch enables printing of constants to see which instructions were
constant-folded. Needed for tests and better visiual analysis of
inliner's work.

Reviewers: apilipenko, mtrofin, davidxl, fedor.sergeev

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D81024
2020-06-24 22:52:31 +00:00
Fangrui Song
b24b7c4c54 [llvm-profdata] --hot-func-list: fix some style issues in D81800
Reviewed By: wenlei, hoyFB

Differential Revision: https://reviews.llvm.org/D82500
2020-06-24 15:17:03 -07:00
Scott Linder
0dbcb0ca32 [MIR] Fix CFI_INSTRUCTION escape printing
Summary:
The printer seems to intend to not print the trailing comma but has a
copy-paste error for the last value in the escape, and the parser
enforces having no trailing comma, but somehow a test was never included
to actually confirm it.

Reviewers: thegameg, arsenm

Reviewed By: thegameg, arsenm

Subscribers: wdng, arsenm, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82478
2020-06-24 18:15:28 -04:00
LLVM GN Syncbot
1f4236d82d [gn build] Port 1e2691fe238 2020-06-24 22:11:22 +00:00
Roman Lebedev
a3b34b593f [NFCI][InstSimplify] Add CHECK-LABEL to new icmp.ll test 2020-06-25 01:10:35 +03:00
Roman Lebedev
7de805e824 [SROA] convertValue(): we can have <N x iK*> to <M x iQ> cast
Provided test case crashes otherwise.
Much like to the opposite case.
2020-06-25 00:58:54 +03:00
Roman Lebedev
5bd582e3b4 [SROA] convertValue(): we can have <N x iK> to <M x iQ*> cast
Provided test case crashes otherwise.

If NewTy is already DL.getIntPtrType(NewTy),
CreateBitCast() won't actually create any bitcast,
so we are better off just doing the general thing.
2020-06-25 00:58:53 +03:00
Roman Lebedev
59860824ed [IR] GetUnderlyingObject(), stripPointerCastsAndOffsets(): don't crash on bitcast <1 x i8*> to i8*
I'm not sure how to write standalone tests for each of two changes here.
If either one of these two fixes is missing, the test fill crash.
2020-06-25 00:58:53 +03:00
Roman Lebedev
0a9046a444 [InstCombine] visitBitCast(): do not crash on weird bitcast <1 x i8*> to i8*
Even if we know that RHS of a bitcast is a pointer,
we can't assume LHS is, because it might be
a single-element vector of pointer.
2020-06-25 00:58:53 +03:00
Roman Lebedev
1208cc1611 [NFCI] SCEV: promote ScalarEvolutionDivision into an publicly usable class
This makes it usable from outside of SCEV,
while previously it was internal to the ScalarEvolution.cpp

In particular, i want to use it in an WIP alloca promotion helper pass,
to analyze if some SCEV is a multiple of some other SCEV.
2020-06-25 00:58:53 +03:00
Guillaume Chatelet
c67d339083 Revert "Use concrete natural type alignment for masked load/store operations instead of 0."
This reverts commit 39819ccd36b6dd61c9decd29df64fd4e8a7ee9ad.
2020-06-24 21:53:34 +00:00
Yuanfang Chen
dbdc922af7 Remove Passes dependency on CodeGen
The dependency was introduced in
5134020ea62d1e1e125fdac48d251a26b80e9781. The only functional change
from this removal would be the new PM interface for the two codegen
passes. This is not necessary since we don't have codegen pipeline using
new PM yet. This removal is to break the potential circular dependency between
Passes and CodeGen once the codegen begins to gain new PM support.
2020-06-24 14:52:46 -07:00
Fangrui Song
f99e1eaaed [TextAPI/MachO] Fix style issues. NFC
See https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions
2020-06-24 14:43:45 -07:00
Guillaume Chatelet
ea70cf12c0 Use concrete natural type alignment for masked load/store operations instead of 0. 2020-06-24 21:42:05 +00:00
Mitch Phillips
5ab8005ee3 Revert "[BitcodeReader] Fix DelayedShuffle handling for ConstantExpr shuffles."
Patch has a memory leak bug that broke the ASan buildbots. More info
available at: https://reviews.llvm.org/D80330

This reverts commit b5740105d270a2d76da8812cafb63e4b799ada73.
2020-06-24 14:40:45 -07:00
Stefan Agner
a9ba91c009 [ARM] Make cp10 and cp11 usage a warning
The ARM ARM considers p10/p11 valid arguments for MCR/MRC instructions.
MRC instructions with p10 arguments are also used in kernel code which
is shared for different architectures. Turn usage of p10/p11 to warnings
for ARMv7/ARMv8-M.

Reviewers: rengolin, olista01, t.p.northover, efriedma, psmith, simon_tatham

Reviewed By: simon_tatham

Subscribers: hiraditya, danielkiss, jcai19, tpimh, nickdesaulniers, peter.smith, javed.absar, kristof.beyls, jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59733
2020-06-24 23:37:54 +02:00
Kirill Naumov
6bb8eae995 [InlineCost] InlineCostAnnotationWriterPass introduced
This class allows to see the inliner's decisions for better
optimization verifications and tests. To use, use flag
"-passes="print<inline-cost>"".

This is the second attempt to integrate the patch.
The problem from the first try has been discussed and
fixed in D82205.

Reviewers: apilipenko, mtrofin, davidxl, fedor.sergeev

Reviewed By: mtrofin

Differential revision: https://reviews.llvm.org/D81743
2020-06-24 21:27:07 +00:00
Mehdi Amini
7c337c9c89 Add a git hook script that can be manually setup to run some checks on every push
Right now it just catches arcanist noisy tags, and include a script to
automatically clean these.

Follow up on http://lists.llvm.org/pipermail/llvm-dev/2019-December/137848.html

Differential Revision: https://reviews.llvm.org/D80978
2020-06-24 21:13:43 +00:00
Amy Kwan
25f513ca38 [PowerPC][Power10] Implement Count Leading/Trailing Zeroes Builtins under bit Mask in LLVM/Clang
This patch implements builtins for the following prototypes:

unsigned long long __builtin_cntlzdm (unsigned long long, unsigned long long)
unsigned long long __builtin_cnttzdm (unsigned long long, unsigned long long)
vector unsigned long long vec_cntlzm (vector unsigned long long, vector unsigned long long)
vector unsigned long long vec_cnttzm (vector unsigned long long, vector unsigned long long)

Differential Revision: https://reviews.llvm.org/D80941
2020-06-24 16:03:45 -05:00
Jinsong Ji
762f7a192e [NFC][PowerPC] Fix some typos in MachineCombiner comments 2020-06-24 20:40:57 +00:00
Christopher Tetreault
2007fa8c08 [SVE] Remove calls to VectorType::getNumElements from IPO
Reviewers: efriedma, jdoerfert, sdesmalen, kmclaughlin

Reviewed By: efriedma, jdoerfert

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82219
2020-06-24 13:38:51 -07:00
dfukalov
e968fde7cb [NFCI][CostModel] Add const to Value*.
Summary:
Get back `const` partially lost in one of recent changes.
Additionally specify explicit qualifiers in few places.

Reviewers: samparker

Reviewed By: samparker

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82383
2020-06-24 23:16:08 +03:00
Kirill Naumov
9db79a6028 [InlineCost] Added InlineCostCallAnalyzer::print()
For the upcoming changes, we need to have an ability to dump
InlineCostCallAnalyzer info in non-debug builds as well.

Reviewed-By: mtrofin
Differential Revision: https://reviews.llvm.org/D82205
2020-06-24 20:07:27 +00:00
Sanjay Patel
8ccfdd4e5c [x86][AArch64] add tests for fmul-fma combine; NFC
As discussed in D80801, there's a possible overstep in
what is allowed by the 'contract' fast-math-flag.
2020-06-24 15:56:32 -04:00
weihe
4f72d6501a Add --hot-func-list to llvm-profdata show for sample profiles
Summary:
Add the --hot-func-list feature to llvm-profdata show for sample profiles. This feature prints a list of hot functions whose max sample count are above the 99% threshold, with their numbers of total samples, total samples percentage, max samples, entry samples, and their function names.

Test Plan:

Reviewers: wenlei, hoyFB

Reviewed By: wenlei, hoyFB

Subscribers: hoyFB, wenlei, weihe, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82355
2020-06-24 12:49:46 -07:00
Alexander Shaposhnikov
6be775e836 [llvm-objcopy] Update help message tests
This diff merges help message tests for llvm-objcopy, llvm-strip and
llvm-install-name-tool.

Patch by Sameer Arora!

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D82012
2020-06-24 12:40:31 -07:00
Florian Hahn
27cc9a4ca9 [SLP] Limit GEP lists based on width of index computation.
D68667 introduced a tighter limit to the number of GEPs to simplify
together. The limit was based on the vector element size of the pointer,
but the pointers themselves are not actually put in vectors.

IIUC we try to vectorize the index computations here, so we should base
the limit on the vector element size of the computation of the index.

This restores the test regression on AArch64 and also restores the
vectorization for a important pattern in SPEC2006/464.h264ref on
AArch64 (@test_i16_extend). We get a large benefit from doing a single
load up front and then processing the index computations in vectors.

Note that we could probably even further improve the AArch64 codegen, if
we would do zexts to i32 instead of i64 for the sub operands and then do
a single vector sext on the result of the subtractions. AArch64 provides
dedicated vector instructions to do so. Sketch of proof in Alive:
https://alive2.llvm.org/ce/z/A4xYAB

Reviewers: craig.topper, RKSimon, xbolva00, ABataev, spatel

Reviewed By: ABataev, spatel

Differential Revision: https://reviews.llvm.org/D82418
2020-06-24 19:56:53 +01:00
Vedant Kumar
1fc3b9a701 [docs] Fix typo 2020-06-24 11:51:21 -07:00
Joel E. Denny
cbbdc52957 [FileCheck][NFC] Fix typo in test comment 2020-06-24 14:49:23 -04:00
Simon Pilgrim
b8a3d58d88 InstCombineInternal.h - reduce AliasAnalysis.h include to forward declaration. NFC.
Fix implicit include dependencies in source files and replace legacy AliasAnalysis typedef with AAResults where necessary.
2020-06-24 19:27:38 +01:00
Simon Pilgrim
137d80bd21 Local.h - reduce includes to forward declarations. NFC.
Fix implicit include dependencies in source files and replace legacy AliasAnalysis typedef with AAResults where necessary.
2020-06-24 19:27:37 +01:00
Alexander Shaposhnikov
f1ab476248 [llvm-objcopy] Update help messages
This diff updates the help messages for llvm-objcopy, llvm-strip and
llvm-install-name-tool.

Patch by Sameer Arora!

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D81907
2020-06-24 11:19:56 -07:00
tatz.j@northeastern.edu
3bf79d0e44 [NVPTX] Fix for NVPTX module asm regression
Currently module asm ends up emitted twice and at the wrong place in the PTX.
This patch moves module asm generation into emitStartOfAsmFile() which puts at
the correct location in the generated PTX.

Differential Revision: https://reviews.llvm.org/D82280
2020-06-24 11:17:09 -07:00
Craig Topper
d4c83fa05e [X86] Rename O3-pipeline.ll to opt-pipeline.ll and add O1/O2 command lines
Eric Cristopher asked me about possibly disabling some passes at
-O1/Og. Figured a good first step was to test all the pipelines.
They all appear to be the same for now. Hoping we can use FileCheck
prefixes for differences to avoid repeating the contents 3 times.
2020-06-24 11:09:50 -07:00
Teresa Johnson
15d602b26a [WPD] Allow virtual calls to be analyzed with multiple type tests
Summary:
In D52514 I had fixed a bug with WPD after indirect call promotion, by
checking that a type test being analyzed dominates potential virtual
calls. With that fix I included a small effiency enhancement to avoid
processing a devirt candidate multiple times (when there are multiple
type tests). This latter change wasn't in response to any measured
efficiency issues, it was merely theoretical. Unfortuantely, it turns
out to limit optimization opportunities after inlining.

Specifically, consider code that looks like:

class A {
  virtual void foo();
};
class B : public A {
  void foo();
}
void callee(A *a) {
  a->foo(); // Call 1
}
void caller(B *b) {
  b->foo(); // Call 2
  callee(b);
}

After inlining callee into caller, because of the existing call to
b->foo() in caller there will be 2 type tests in caller for the vtable
pointer of b: the original type test against B from Call 2, and the
inlined type test against A from Call 1. If the code was compiled with
-fstrict-vtable-pointers, then after optimization WPD will see that
both type tests are associated with the inlined virtual Call 1.
With my earlier change to only process a virtual call against one type
test, we may only consider virtual Call 1 against the base class A type
test, which can't be devirtualized. With my change here to remove this
restriction, it also gets considered for the type test against the
derived class B type test, where it can be devirtualized.

Note that if caller didn't include it's own earlier virtual call
b->foo() we will not be able to devirtualize after inlining callee even
after this fix, since there would not be a type test against B in the
IR. As a future enhancement we can consider inserting type tests at call
sites that pass pointers to classes with virtual calls, to enable
context-sensitive devirtualization after inlining.

Reviewers: pcc, vitalybuka, evgeny777

Subscribers: Prazek, hiraditya, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79235
2020-06-24 10:51:24 -07:00
Craig Topper
c00cb13f9c [X86] Replace PROC macros with an enum and a lookup table of processor information.
This patch removes the PROC macro in favor of CPUKind enum and a
table that contains information about CPUs.

The current information in the table is the CPU name, CPUKind enum
value, key feature for target multiversioning, and Is64Bit capable.
For the strings that are aliases, I've duplicated the information
in the table. This means there are more rows in the table than
CPUKind enums.

This replaces multiple StringSwitch's with loops through the table.
They are linear searches due to the table being more logically
ordered than alphabetical. The StringSwitch's would have also been
linear. I've used StringLiteral on the strings in the table so we
can quickly check the length while searching.

I contemplated having a CPUKind for each string so there was a 1:1
mapping, but didn't want to spread more names to the places that
use the enum.

My ultimate goal here is to store the features for each CPU as a
bitset within the table. Hoping to use constexpr to make this
composable so we can group features and inherit them. After the
table lookup we can turn the bitset into a list of strings for the
frontend. The current switch we have for selecting features for
CPUs has become difficult to maintain while trying to express
inheritance relationships.

Differential Revision: https://reviews.llvm.org/D82414
2020-06-24 10:46:25 -07:00
LLVM GN Syncbot
98930769dc [gn build] Port 29125ddf132 2020-06-24 17:05:39 +00:00
Daniel Grumberg
706b74d404 Start adding support for generating CC1 command lines from CompilerInvocation
This change includes the following:
- Add additional information in the relevant table-gen files to encode
the necessary information to automatically parse the argument into a
CompilerInvocation instance and to generate the appropriate command
line argument from a CompilerInvocation instance.
- Extend OptParserEmitter to emit the necessary macro tables as well as
constant tables to support parsing and generating command line
arguments for options that provide the necessary information.
- Port some options to use this new system for parsing and generating
command line arguments.

Differential Revision: https://reviews.llvm.org/D79796
2020-06-24 18:05:05 +01:00
LLVM GN Syncbot
ad3a7cef97 [gn build] Port 4fb2116ee7f 2020-06-24 17:00:19 +00:00
Nico Weber
0f79257c63 [gn build] (manually) port bdceefe95ba6a 2020-06-24 13:00:08 -04:00
Simon Pilgrim
615dfd6c17 LoopUtils.h - reduce AliasAnalysis.h include to forward declarations. NFC.
Fix implicit include dependencies in source files and replace legacy AliasAnalysis typedef with AAResults where necessary.
2020-06-24 17:58:38 +01:00
Jonas Devlieghere
30a3e58d7c [llvm] Remove full stop frome error message
Address post-commit feedback from James Henderson in D80959.
2020-06-24 09:41:17 -07:00
Mircea Trofin
99a2bb02c2 Revert "[llvm] Added support for stand-alone cmake object libraries."
This reverts commit 62841415e685fe8857f75edd1fa92b7d1d08b875.

The commit is a misnomer, and it "made its way in" unintentionally,
through a patch that had it as a depdendency. The change itself ended up
to be just a comment update, but the description is completely wrong.
2020-06-24 09:37:15 -07:00
Matt Arsenault
d1412a6be8 GlobalISel: Add unit tests for some utils functions
The test constants were originally constexpr, but this apparently
crashes old versions of gcc.
2020-06-24 12:00:38 -04:00