1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
Commit Graph

215175 Commits

Author SHA1 Message Date
Fangrui Song
62a6c6bb17 [RISCV][test] Migrate llvm-objdump --riscv-no-aliases to -M no-aliases
--riscv-no-aliases is an internal cl::opt option not intended to be exported.
Use the user-facing -M no-aliases instead.
2021-05-04 10:38:33 -07:00
Dávid Bolvanský
acbdea3582 [InstSimplify] Added tests for PR50173, NFC 2021-05-04 19:32:44 +02:00
Arthur Eubanks
d13aef09f1 [docs] Fix some wording 2021-05-04 10:21:38 -07:00
Fangrui Song
d61b087845 [llvm-objdump] Fix -a after D100433
-a is alias for --archive-headers, not --all-headers
2021-05-04 10:17:36 -07:00
Fraser Cormack
33fa15f2b2 [ValueTypes] Add MVTs for v256i16 and v256f16
This patch adds the two MVTs to fix a legalizer crash when using vector
shuffles of <256 x i16> and <128 x i16> on RISC-V. The legalizer can't
promote the operand of `v256i32 = any_extend_vector_inreg v128i16`.

Reviewed By: craig.topper, RKSimon

Differential Revision: https://reviews.llvm.org/D101769
2021-05-04 18:06:13 +01:00
Ahsan Saghir
46a30bedec [PowerPC] Prevent argument promotion of types with size greater than 128 bits
This patch prevents argument promotion of types having
type size greater than 128 bits.

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

Reviewed By: #powerpc, nemanjai

Differential Revision: https://reviews.llvm.org/D101188
2021-05-04 12:09:25 -05:00
Bjorn Pettersson
4d8434ed17 Revert "Make dependency between certain analysis passes transitive"
This reverts commit 3655f0757f2b4b61419446b326410118658826ba.

It caused assertion failures related to setLastUser in polly builds.
2021-05-04 19:08:41 +02:00
Wei Mi
a40dc394da [SampleFDO] Fix a bug when appending function symbol into the Callees set of
Root node in ProfiledCallGraph.

In ProfiledCallGraph::addProfiledFunction, to add a function symbol into the
ProfiledCallGraph, currently an uninitialized ProfiledCallGraphNode node is
created by ProfiledFunctions[Name] and inserted into Callees set of Root node
before the node is initialized. The Callees set use
ProfiledCallGraphNodeComparer as its comparator so the uninitialized
ProfiledCallGraphNode may fail to be inserted into Callees set if it happens
to contain a name in memory which has been inserted into the Callees set
before. The problem will prevent some function symbols from being annotated
with profiles and cause performance regression. The patch fixes the problem.

Differential Revision: https://reviews.llvm.org/D101815
2021-05-04 10:05:59 -07:00
Fangrui Song
79e86a2cab [llvm-objdump] Improve newline consistency between different pieces of information
When dumping multiple pieces of information (e.g. --all-headers),
there is sometimes no separator between two pieces.
This patch uses the "\nheader:\n" style, which generally improves
compatibility with GNU objdump.

Note: objdump -t/-T does not add a newline before "SYMBOL TABLE:" and "DYNAMIC SYMBOL TABLE:".
We add a newline to be consistent with other information.

`objdump -d` prints two empty lines before the first 'Disassembly of section'.
We print just one with this patch.

Differential Revision: https://reviews.llvm.org/D101796
2021-05-04 09:56:07 -07:00
gbreynoo
daae3b3476 [llvm-objdump] Remove Generic Options group from help text output
Reapply 7368624 after revert and fix

Looking at other tools using tablegen for help output, general options
like --help are not separated from other options. This change removes
the "Generic Options" option group so the options are listed together.
the macho specific option group is left unaffected.

The test help.test was modified to reflect this change.

Differential Revision: https://reviews.llvm.org/D101652
2021-05-04 17:42:20 +01:00
Dimitry Andric
fcb5b8b828 Revert "[llvm-objdump] Remove Generic Options group from help text output"
This reverts commit 73686247ac3e60c91fa5943c98956093df5e49ff, as there
were git stash conflict markers left unresolved.
2021-05-04 18:28:31 +02:00
Christudasan Devadasan
122c3d5088 DAG: Cleanup assertion in EmitFuncArgumentDbgValue
Removing an assertion introduced with D68945. The
patch was later reverted with 6531a78ac4b5, but failed
to remove this assertion. It causes a problem while
trying to split a 64-bit argument into sub registers.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D101594
2021-05-04 21:48:58 +05:30
Dimitry Andric
b9df55d1d3 Reland "[MC][ELF] Work around R_MIPS_LO16 relocation handling problem"
This fixes PR49821, and avoids "ld.lld: error: test.o:(.rodata.str1.1):
offset is outside the section" errors when linking MIPS objects with
negative R_MIPS_LO16 implicit addends.

ld.lld handles R_MIPS_HI16/R_MIPS_LO16 separately, not as a whole, so it
doesn't know that an R_MIPS_HI16 with implicit addend 1 and an
R_MIPS_LO16 with implicit addend -32768 represents 32768, which is in
range of a MergeInputSection. We could introduce a new RelExpr member
(like R_RISCV_PC_INDIRECT for R_RISCV_PCREL_HI20 / R_RISCV_PCREL_LO12)
but the complexity is unnecessary given that GNU as keeps the original
symbol for this case as well.

Adds a new test case for PR49821, and also updates two other test cases
that are affected by this change.

Reviewed By: atanasyan, MaskRay

Differential Revision: https://reviews.llvm.org/D101773
2021-05-04 18:16:09 +02:00
Sanjay Patel
30e39a65e1 [InstCombine] avoid infinite loops with select/icmp transforms
This fixes https://llvm.org/PR48900 , but as seen in the
regression tests prevents some optimizations.

There are a few options to restore those (switch to min/max
intrinsics, add larger pattern matching for select with
dominating condition, improve CVP), but we need to prevent
the bug 1st.
2021-05-04 11:54:06 -04:00
gbreynoo
506fd61a96 [llvm-objdump] Remove Generic Options group from help text output
Looking at other tools using tablegen for help output, general options
like --help are not separated from other options. This change removes
the "Generic Options" option group so the options are listed together.
the macho specific option group is left unaffected.

The test help.test was modified to reflect this change.

Differential Revision: https://reviews.llvm.org/D101652
2021-05-04 16:48:03 +01:00
Amy Kwan
379bc7c651 [PowerPC][NFC] Update atomic patterns to use the refactored load/store implementation
This patch updates the scalar atomic patterns to use the refactored load/store
implementation introduced in D93370.
All existing test cases pass with when the refactored patterns are utilized.

Differential Revision: https://reviews.llvm.org/D94498
2021-05-04 10:46:45 -05:00
gbreynoo
5291a705c1 [llvm-objdump] Remove --cfg option from command guide
The llvm-objdump command guide has the option --cfg which was removed
from the tool by 888320e9fa5eb33194c066f68d50f1e73c5fff5e in 2014. This
change updates the command guide to reflect this.

Differential Revision: https://reviews.llvm.org/D101648
2021-05-04 16:42:13 +01:00
Florian Hahn
31a10de716 [VPlan] Representing backedge def-use feeding reduction phis.
This patch updates the code handling reduction recipes to also keep
track of the incoming value from the latch in the recipe. This is needed
to model the def-use chains completely in VPlan, so that it is possible
to replace the incoming value with an arbitrary VPValue.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D99294
2021-05-04 16:33:22 +01:00
LLVM GN Syncbot
77a6a2e20b [gn build] Port 2021d272ad6c 2021-05-04 15:06:28 +00:00
Brock Wyma
1389385414 [CodeView] Truncate Long Type Names With An MD5 Hash
Replace long CodeView type names with an MD5 hash of the name.

Differential Revision: https://reviews.llvm.org/D97881
2021-05-04 10:51:21 -04:00
Fraser Cormack
1c9a07e9b0 [LangRef] Fix a typo in the vector-type memory layout section 2021-05-04 15:40:53 +01:00
Sander de Smalen
5c92b9bcf1 Reland "[LV] Calculate max feasible scalable VF."
Relands https://reviews.llvm.org/D98509

This reverts commit 51d648c119d7773ce6fb809353bd6bd14bca8818.
2021-05-04 15:44:41 +01:00
Nico Weber
d0f5fa8245 [clang] accept -fsanitize-ignorelist= in addition to -fsanitize-blacklist=
Use that for internal names (including the default ignorelists of the
sanitizers).

Differential Revision: https://reviews.llvm.org/D101832
2021-05-04 10:24:00 -04:00
Bradley Smith
86e5cb5706 [AArch64][SVE] Fold insert(zero, extract(X, 0), 0) -> X, when X is known to zero lanes 1-N
Specifically, this allow us to rely on the lane zero'ing behaviour of
SVE reduce instructions.

Co-authored-by: Paul Walker <paul.walker@arm.com>

Differential Revision: https://reviews.llvm.org/D101369
2021-05-04 15:05:05 +01:00
Simon Pilgrim
46e56cd608 Local.cpp - Avoid DebugLoc copies - use const reference from getDebugLoc. NFCI. 2021-05-04 14:31:50 +01:00
Jan Svoboda
241cc56fc0 [clang][cli][docs] Clarify marshalling infrastructure documentation 2021-05-04 15:16:32 +02:00
Simon Pilgrim
bc6c00e0a4 [Utils] recognizeBSwapOrBitReverseIdiom - support matching from funnel shift roots (PR40058)
We were missing bitreverse matches in cases where InstCombine had seen a byte-level rotation at the end of a bitreverse sequence (replacing or() with fshl()), hindering the exhaustive bitreverse matching in CodeGenPrepare later on.
2021-05-04 13:46:45 +01:00
Simon Pilgrim
9922a8ef58 [CodeGenPrepare][X86] Add bitreverse detection tests
Initially only test for XOP which is the only thing that supports scalar bitreverse - we can add vector tests later.
2021-05-04 13:29:19 +01:00
Simon Pilgrim
3272fe5d28 [X86] Update PR20841 test description to make it clear we SHOULDN'T be folding EFLAGS with XADD 2021-05-04 13:29:19 +01:00
Jan Svoboda
2453167e4d [clang][cli] NFC: Remove confusing EmptyKPM variable 2021-05-04 14:27:57 +02:00
David Stuttard
3835c6cbe2 [AMDGPU][AsmParser] Correct the order of optional operands to mimg
Ordering of operands was incorrect meaning that a16 operand was treated as tfe

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

Change-Id: I3b15e71ef5ff625f19f52823414ab684d76aca33
2021-05-04 13:14:48 +01:00
Florian Hahn
6341a2c54b [IndVarSimplify] Add additional tests using isImpliedViaMerge. 2021-05-04 13:11:47 +01:00
Alexey Bataev
179d4eacf5 Revert "[SLP]Allow masked gathers only if allowed by target."
This reverts commit fd18547e0721983dcb273670d16341921f831e50. Need to
add a check for the size of the vectorization tree to avoid some extra
vectorization.
2021-05-04 04:53:22 -07:00
Dávid Bolvanský
ecdd8079eb [InstCombine] ctpop(X) ^ ctpop(Y) & 1 --> ctpop(X^Y) & 1 (PR50094)
Original pattern: (__builtin_parity(x) ^ __builtin_parity(y))

LLVM rewrites it as: (__builtin_popcount(x) ^ __builtin_popcount(y)) & 1

Optimized form:  __builtin_popcount(X^Y) & 1

Alive proof: https://alive2.llvm.org/ce/z/-GdWFr

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D101802
2021-05-04 13:16:18 +02:00
Jessica Clarke
8283985671 [RISCV] Pre-commit tests for D101342
These tests show inefficient sign extension for AMOs on RISC-V. The
normal CodeGen tests use anyext return values, but if marked signext
then we end up generating unnecessary sign extension instructions. This
can be seen when compiling C that returns an i32 (signed or unsigned),
where the calling convention results in a signext return value.
2021-05-04 11:12:43 +01:00
David Zarzycki
eb97b6a5a1 [llvm] Unbreak no-assertion testing 2021-05-04 06:05:38 -04:00
LLVM GN Syncbot
972f33f6c0 [gn build] Port 1db4dbba24dd 2021-05-04 09:56:46 +00:00
Bjorn Pettersson
620642df44 Make dependency between certain analysis passes transitive
LazyBlockFrequenceInfoPass, LazyBranchProbabilityInfoPass and
LoopAccessLegacyAnalysis all cache pointers to their nestled required
analysis passes. One need to use addRequiredTransitive to describe
that the nestled passes can't be freed until those analysis passes
no longer are used themselves.

There is still a bit of a mess considering the getLazyBPIAnalysisUsage
and getLazyBFIAnalysisUsage functions. Those functions are used from
both Transform, CodeGen and Analysis passes. I figure it is OK to
use addRequiredTransitive also when being used from Transform and
CodeGen passes. On the other hand, I figure we must do it when
used from other Analysis passes. So using addRequiredTransitive should
be more correct here. An alternative solution would be to add a
bool option in those functions to let the user tell if it is a
analysis pass or not. Since those lazy passes will be obsolete when
new PM has conquered the world I figure we can leave it like this
right now.

Intention with the patch is to fix PR49950. It at least solves the
problem for the reproducer in PR49950. However, that reproducer
need five passes in a specific order, so there are lots of various
"solutions" that could avoid the crash without actually fixing the
root cause.

Differential Revision: https://reviews.llvm.org/D100958
2021-05-04 11:50:08 +02:00
Simon Moll
b4f3331ca0 Recommit "[VP,Integer,#2] ExpandVectorPredication pass"
This reverts the revert 02c5ba8679873e878ae7a76fb26808a47940275b

Fix:

Pass was registered as DUMMY_FUNCTION_PASS causing the newpm-pass
functions to be doubly defined. Triggered in -DLLVM_ENABLE_MODULE=1
builds.

Original commit:

This patch implements expansion of llvm.vp.* intrinsics
(https://llvm.org/docs/LangRef.html#vector-predication-intrinsics).

VP expansion is required for targets that do not implement VP code
generation. Since expansion is controllable with TTI, targets can switch
on the VP intrinsics they do support in their backend offering a smooth
transition strategy for VP code generation (VE, RISC-V V, ARM SVE,
AVX512, ..).

Reviewed By: rogfer01

Differential Revision: https://reviews.llvm.org/D78203
2021-05-04 11:47:52 +02:00
Fraser Cormack
236f1fca6b [RISCV] Lower splats of non-constant i1s as SETCCs
This patch adds support for splatting i1 types to fixed-length or
scalable vector types. It does so by lowering the operation to a SETCC
of the equivalent i8 type.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D101465
2021-05-04 09:14:05 +01:00
David Green
5d886bf3f9 [TTI] Replace ceil lambdas with divideCeil. NFCI
As pointed out in D101726, this function already exists in MathExtras.
It uses different types, but with the values used here I believe that
should not make a functional difference.
2021-05-04 09:04:44 +01:00
LLVM GN Syncbot
006f3fb7f2 [gn build] Port ed51156084dd 2021-05-04 06:39:48 +00:00
Reshabh Sharma
748a8df964 [ModuleUtils] NFC: Add unit tests for appendToUsedList
This patch adds initial unit tests for appendToUsedList
in the ModuleUtils. It specifically tests changes from
https://reviews.llvm.org/D101363 which intent to allow
insertion of globals in non-zero address spaces into the
llvm used lists.

Reviewed by: dblaikie

Differential Revision: https://reviews.llvm.org/D101746
2021-05-04 12:05:50 +05:30
Philip Reames
a2c2bf3570 [IndVarSimplify][NFC] Removed mayThrow from if-condition in predicateLoopExits of IndVarSimplify
Instruction has mayHaveSideEffects method that returns true if mayThrow return true because this is called internally in the first method.  As such, the call being removed is redundant.

Patch By: vdsered (Daniil Seredkin)
Differential Revision: https://reviews.llvm.org/D101685
2021-05-03 18:25:07 -07:00
Juneyoung Lee
d9c83d44b9 [InstCombine] generalize select + select/and/or folding using implied conditions
This patch optimizes the remaining possible cases in D101191 by generalizing isImpliedCondition()-based
foldings.

Assume that there is `op a, (select b, _, _)` where op is one of `and i1`, `or i1` or their select forms.

We can do the following optimization based on the result of `isImpliedCondition(a, b)`:

If a = true implies…
- b = true:
    - select a, (select b, A, B), false => select a, A, false : https://alive2.llvm.org/ce/z/WCnZYh
    - and a, (select b, A, B) => select a, A, false : https://alive2.llvm.org/ce/z/uZhcMG
- b = false:
    - select a, (select b, A, B), false => select a, B, false : https://alive2.llvm.org/ce/z/c2hJpV
    - and a, (select b, A, B) => select a, B, false : https://alive2.llvm.org/ce/z/5ggwMM

If a = false implies…
- b = true:
    - select a, true, (select b, A, B) => select a, true, A : https://alive2.llvm.org/ce/z/tidKvH
    - or a, (select b, A, B) =>  select a, true, A : https://alive2.llvm.org/ce/z/cC-uyb
- b = false:
    - select a, true, (select b, A, B) => select a, true, B : https://alive2.llvm.org/ce/z/ZXpJq9
    - or a, (select b, A, B) => select a, true, B : https://alive2.llvm.org/ce/z/hnDrJj

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D101720
2021-05-04 09:42:06 +09:00
Juneyoung Lee
0dabd60ad5 Precommit tests for D101720 (NFC) 2021-05-04 09:30:04 +09:00
Arthur Eubanks
067cefa0c8 [NewPM] Only invalidate modified functions' analyses in CGSCC passes
Previously, any change in any function in an SCC would cause all
analyses for all functions in the SCC to be invalidated. With this
change, we now manually invalidate analyses for functions we modify,
then let the pass manager know that all function analyses should be
preserved.

So far this only touches the inliner, argpromotion, funcattrs, and
updateCGAndAnalysisManager(), since they are the most used.

Slight compile time improvements:
http://llvm-compile-time-tracker.com/compare.php?from=326da4adcb8def2abdd530299d87ce951c0edec9&to=8942c7669f330082ef159f3c6c57c3c28484f4be&stat=instructions

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D100917
2021-05-03 17:21:44 -07:00
LLVM GN Syncbot
744e7df7eb [gn build] Port 7310403e3cdf 2021-05-04 00:04:57 +00:00
Tomasz Miąsko
46d5d397d9 [demangler] Initial support for the new Rust mangling scheme
Add a demangling support for a small subset of a new Rust mangling
scheme, with complete support planned as a follow up work.

Intergate Rust demangling into llvm-cxxfilt and use llvm-cxxfilt for
end-to-end testing. The new Rust mangling scheme uses "_R" as a prefix,
which makes it easy to disambiguate it from other mangling schemes.

The public API is modeled after __cxa_demangle / llvm::itaniumDemangle,
since potential candidates for further integration use those.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D101444
2021-05-03 16:44:30 -07:00
Sam Clegg
6c6f8e1a99 [lld][WebAssembly] Do not merge comdat data segments
When running in relocatable mode any input data segments that are part
of a comdat group should not be merged with other segments of the same
name.  This is because the final linker needs to keep the separate so
they can be included/excluded individually.

Often this is not a problem since normally only one section with a given
name `foo` ends up in the output object file.  However, the problem
occurs when one input contains `foo` which part of a comdat and another
object contains a local symbol `foo` we were attempting to merge them.

This behaviour matches (I believe) that of the ELF linker.  See
`LinkerScript.cpp:addInputSec`.

Fixes: https://github.com/emscripten-core/emscripten/issues/9726

Differential Revision: https://reviews.llvm.org/D101703
2021-05-03 16:43:29 -07:00