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

186765 Commits

Author SHA1 Message Date
Simon Atanasyan
a21e854499 [docs] Update link to the MIPS 64-bit ELF object file specification
Patch by Miloš Stojanović

Differential Revision: https://reviews.llvm.org/D69377
2019-10-24 15:56:30 +03:00
Petar Avramovic
c4354e2d3b [MIPS GlobalISel] Select MSA vector generic and builtin fabs
selectImpl is able to select G_FABS when we set bank for vector
operands to fprb. Add detailed tests.
Note: G_FABS is generated from llvm-ir intrinsics llvm.fabs.*,
and at the moment MIPS is not able to generate this intrinsic for
vector type (some targets generate vector llvm.fabs.* from calls
to a builtin function).
We can handle fabs using __builtin_msa_fmax_a_<format> and passing
same vector as both arguments. __builtin_msa_fmax_a_<format> will
be directly selected into FMAX_A_<format> in legalizeIntrinsic.

Differential Revision: https://reviews.llvm.org/D69346
2019-10-24 13:45:26 +02:00
Marek Kurdej
4b723fae58 [libFuzzer] docs: update note to include REDUCE event. 2019-10-24 12:04:12 +02:00
Benjamin Kramer
263418463b Hide implementation details in anonymous namespaces. NFC. 2019-10-24 10:48:43 +02:00
Petar Avramovic
5167c00f3d [MIPS GlobalISel] MSA vector generic and builtin fadd, fsub, fmul, fdiv
Select vector G_FADD, G_FSUB, G_FMUL and G_FDIV for MIPS32 with MSA. We
have to set bank for vector operands to fprb and selectImpl will do the
rest. __builtin_msa_fadd_<format>, __builtin_msa_fsub_<format>,
__builtin_msa_fmul_<format> and __builtin_msa_fdiv_<format> will be
transformed into G_FADD, G_FSUB, G_FMUL and G_FDIV in legalizeIntrinsic
respectively and selected in the same way.

Differential Revision: https://reviews.llvm.org/D69340
2019-10-24 10:15:07 +02:00
Petar Avramovic
aa102b103b [MIPS GlobalISel] MSA vector generic and builtin sdiv, srem, udiv, urem
Select vector G_SDIV, G_SREM, G_UDIV and G_UREM for MIPS32 with MSA. We
have to set bank for vector operands to fprb and selectImpl will do the
rest. __builtin_msa_div_s_<format>, __builtin_msa_mod_s_<format>,
__builtin_msa_div_u_<format> and __builtin_msa_mod_u_<format> will be
transformed into G_SDIV, G_SREM, G_UDIV and G_UREM in legalizeIntrinsic
respectively and selected in the same way.

Differential Revision: https://reviews.llvm.org/D69333
2019-10-24 10:03:36 +02:00
Craig Topper
5caff87fcd [X86] Replace some regular expressions in xray tests with explicit checks to show bad assembly.
We're print 16-bit or 32-bit registers in copy instructions to
64-bit registers. This code will not assemble if it were to be
parsed back in. Emitting to binary works because we'll encode
the register the same way no matter what the size is.
2019-10-23 23:05:09 -07:00
Stanislav Mekhanoshin
56392523c1 [AMDGPU] Allow folding of sgpr to vgpr copy
Potentially sgpr to sgpr copy should also be possible.
That is however trickier because we may end up with a
wrong register class at use because of xm0/xexec permutations.

Differential Revision: https://reviews.llvm.org/D69280
2019-10-23 18:42:48 -07:00
Shoaib Meenai
d14d98a347 [Hexagon] Fix typo. NFC
Testing git push access.
2019-10-23 18:06:28 -07:00
David Tenty
1ecd800968 Use portable flag with nm in extract_symbols.py
Summary:
nm is one of the tools that extract_symbols.py can use to extract
symbols from llvm libraries as part of the build process. This patch
updates the invocation of nm to use the -P POSIX option for "portable
output" so we get a consistently parsable output format on all
platforms.

A link to the relevant nm format: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/nm.html

Reviewers: hubert.reinterpretcast, stevewan, sfertile

Reviewed By: stevewan

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69004
2019-10-23 16:48:22 -04:00
Meike Baumgärtner
e95503bd4f Improve language in GettingStarted.rst
This patch was reviewed and approved by chandlerc.

"Getting Started with the LLVM System" is the first point of contact for many newcomers in the LLVM community.
 * Make the first two paragraphs more welcoming
 * Use more inclusive language
2019-10-23 12:32:57 -07:00
Chandler Carruth
e778f38f69 Remove a no longer accurate sentence from the coding standards.
(And test my commit access. We're working on larger changes here.)
2019-10-23 11:40:45 -07:00
Hans Wennborg
484292eaaa Revert 4334892e7b "[DAGCombine][ARM] x ==/!= c -> (x - c) ==/!= 0 iff '-c' can be folded into the x node."
This broke various Windows builds, see comments on the Phabricator
review.

This also reverts the follow-up 20bf0cf.

> Summary:
> This fold, helps recover from the rest of the D62266 ARM regressions.
> https://rise4fun.com/Alive/TvpC
>
> Note that while the fold is quite flexible, i've restricted it
> to the single interesting pattern at the moment.
>
> Reviewers: efriedma, craig.topper, spatel, RKSimon, deadalnix
>
> Reviewed By: deadalnix
>
> Subscribers: javed.absar, kristof.beyls, llvm-commits
>
> Tags: #llvm
>
> Differential Revision: https://reviews.llvm.org/D62450
2019-10-23 19:52:02 +02:00
Kevin P. Neal
d07004fabd Minor movement of one function with now-correct strictfp attribute to pass
against the latest version of D68233.
2019-10-23 12:23:03 -04:00
Roman Lebedev
b9a64cd7b6 [Analysis] Update Analysis/LazyValueAnalysis/lvi-after-jumpthreading.ll
I should have updated it in 1f665046fbf3b9d47a229714f689cd941f6f1216
but i didn't even realize those tests were there.
2019-10-23 18:39:10 +03:00
stevewan
ae02a44277 Fix non-portable GNU diff option
Summary: This is a fix to revision D68839 and rL375023. This patch substitutes POSIX option "-b" for the non-portable GNU option "--strip-trailing-cr".

Reviewers: daltenty, hubert.reinterpretcast

Reviewed By: daltenty

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69342
2019-10-23 11:19:01 -04:00
Roman Lebedev
bd51ee1e2a [LVI][NFC] Factor solveBlockValueSaturatingIntrinsic() out of solveBlockValueIntrinsic()
Now that there's SaturatingInst class, this is cleaner.
2019-10-23 18:17:33 +03:00
Roman Lebedev
94766775e2 [LVI][CVP] LazyValueInfoImpl::solveBlockValueBinaryOp(): use no-wrap flags from add op
Summary:
This was suggested in https://reviews.llvm.org/D69277#1717210
In this form (this is what was suggested, right?), the results aren't staggering
(especially since given LVI cross-block focus)
this does catch some things (as per test-suite), but not too much:

| statistic                                        |       old |       new | delta | % change |
| correlated-value-propagation.NumAddNSW           |      4981 |      4982 |     1 |  0.0201% |
| correlated-value-propagation.NumAddNW            |     12125 |     12126 |     1 |  0.0082% |
| correlated-value-propagation.NumCmps             |      1199 |      1202 |     3 |  0.2502% |
| correlated-value-propagation.NumDeadCases        |       112 |       111 |    -1 | -0.8929% |
| correlated-value-propagation.NumMulNSW           |       275 |       278 |     3 |  1.0909% |
| correlated-value-propagation.NumMulNUW           |      1323 |      1326 |     3 |  0.2268% |
| correlated-value-propagation.NumMulNW            |      1598 |      1604 |     6 |  0.3755% |
| correlated-value-propagation.NumNSW              |      7158 |      7167 |     9 |  0.1257% |
| correlated-value-propagation.NumNUW              |     13304 |     13310 |     6 |  0.0451% |
| correlated-value-propagation.NumNW               |     20462 |     20477 |    15 |  0.0733% |
| correlated-value-propagation.NumOverflows        |         4 |         7 |     3 | 75.0000% |
| correlated-value-propagation.NumPhis             |     15366 |     15381 |    15 |  0.0976% |
| correlated-value-propagation.NumSExt             |      6273 |      6277 |     4 |  0.0638% |
| correlated-value-propagation.NumShlNSW           |      1172 |      1171 |    -1 | -0.0853% |
| correlated-value-propagation.NumShlNUW           |      2793 |      2794 |     1 |  0.0358% |
| correlated-value-propagation.NumSubNSW           |       730 |       736 |     6 |  0.8219% |
| correlated-value-propagation.NumSubNUW           |      2044 |      2046 |     2 |  0.0978% |
| correlated-value-propagation.NumSubNW            |      2774 |      2782 |     8 |  0.2884% |
| instcount.NumAddInst                             |    277586 |    277569 |   -17 | -0.0061% |
| instcount.NumAndInst                             |     66056 |     66054 |    -2 | -0.0030% |
| instcount.NumBrInst                              |    709147 |    709146 |    -1 | -0.0001% |
| instcount.NumCallInst                            |    528579 |    528576 |    -3 | -0.0006% |
| instcount.NumExtractValueInst                    |     18307 |     18301 |    -6 | -0.0328% |
| instcount.NumOrInst                              |    102660 |    102665 |     5 |  0.0049% |
| instcount.NumPHIInst                             |    318008 |    318007 |    -1 | -0.0003% |
| instcount.NumSelectInst                          |     46373 |     46370 |    -3 | -0.0065% |
| instcount.NumSExtInst                            |     79496 |     79488 |    -8 | -0.0101% |
| instcount.NumShlInst                             |     40654 |     40657 |     3 |  0.0074% |
| instcount.NumTruncInst                           |     62251 |     62249 |    -2 | -0.0032% |
| instcount.NumZExtInst                            |     68211 |     68221 |    10 |  0.0147% |
| instcount.TotalBlocks                            |    843910 |    843909 |    -1 | -0.0001% |
| instcount.TotalInsts                             |   7387448 |   7387423 |   -25 | -0.0003% |

Reviewers: nikic, reames

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69321
2019-10-23 18:17:32 +03:00
Simon Atanasyan
7f867c82df [mips] Use expandLoadAddress for JAL expansion
- Reduce code duplication
- Get partial support of JAL expansion for XGOT.
2019-10-23 17:36:34 +03:00
Simon Atanasyan
b43aa19111 [mips] Implement la macro expansion for N32 ABI 2019-10-23 17:36:34 +03:00
Simon Atanasyan
1c89a3ddce [mips] Add tests to check la / dla expansion in XGOT cases. NFC 2019-10-23 17:36:33 +03:00
Simon Atanasyan
4341bfe60a [mips] Reformat la / dla expansion test cases. NFC 2019-10-23 17:36:33 +03:00
Simon Pilgrim
c05d2287d0 [X86] combineX86ShufflesRecursively - assert the root mask is legal. NFCI. 2019-10-23 07:33:29 -07:00
Sam McCall
e9fc553b3c Reland "[Support] Add a way to run a function on a detached thread""
This reverts commit 7bc7fe6b789d25d48d6dc71d533a411e9e981237.
The immediate callers have been fixed to pass nullopt where appropriate.
2019-10-23 15:51:44 +02:00
Sam McCall
bbb00ef23d Revert "[Support] Add a way to run a function on a detached thread"
This reverts commit 40668abca4d307e02b33345cfdb7271549ff48d0.
This causes clang tests to fail, as stacksize=0 is being explicitly passed and
is no longer a no-op.
2019-10-23 15:10:35 +02:00
Sam McCall
c108937a84 [Support] Add a way to run a function on a detached thread
This roughly mimics `std::thread(...).detach()` except it allows to
customize the stack size. Required for https://reviews.llvm.org/D50993.

I've decided against reusing the existing `llvm_execute_on_thread` because
it's not obvious what to do with the ownership of the passed
function/arguments:

1. If we pass possibly owning functions data to `llvm_execute_on_thread`,
   we'll lose the ability to pass small non-owning non-allocating functions
   for the joining case (as it's used now). Is it important enough?
2. If we use the non-owning interface in the new use case, we'll force
   clients to transfer ownership to the spawned thread manually, but
   similar code would still have to exist inside
   `llvm_execute_on_thread(_async)` anyway (as we can't just pass the same
   non-owning pointer to pthreads and Windows implementations, and would be
   forced to wrap it in some structure, and deal with its ownership.

Patch by Dmitry Kozhevnikov!

Differential Revision: https://reviews.llvm.org/D51103
2019-10-23 12:48:38 +02:00
Mirko Brkusanin
8898b1be97 [Mips] Use appropriate private label prefix based on Mips ABI
MipsMCAsmInfo was using '$' prefix for Mips32 and '.L' for Mips64
regardless of -target-abi option. By passing MCTargetOptions to MCAsmInfo
we can find out Mips ABI and pick appropriate prefix.

Tags: #llvm, #clang, #lldb

Differential Revision: https://reviews.llvm.org/D66795
2019-10-23 12:24:35 +02:00
David Stenberg
731658f937 [DebugInfo] Stop describing imms in TargetInstrInfo's describeLoadedValue() impl
Summary:
The default implementation of the describeLoadedValue() hook uses the
MoveImm property to determine if an instruction moves an immediate. If
an instruction has that property the function returns the second
operand, assuming that that is the immediate value the instruction
moves. As far as I can tell, the MoveImm property does not imply that
the second operand is the immediate value, nor that any other operand
necessarily holds the immediate value; it just means that the
instruction moves some immediate value.

One example where the second operand is not the immediate is SystemZ's
LZER instruction, which moves a zero immediate implicitly: $f0S = LZER.

That case triggered an out-of-bound assertion when getting the operand.
I have added a test case for that instruction.

Another example is ARM's MVN instruction, which holds the logical
bitwise NOT'd value of the immediate that is moved. For the following
reproducer:

  extern void foo(int);
  int main() { foo(-11); }

an incorrect call site value would be emitted:

  $ clang --target=arm foo.c -O1 -g -Xclang -femit-debug-entry-values \
      -c -o - | ./build/bin/llvm-dwarfdump  - | \
      grep -A2 call_site_parameter

  0x00000058:       DW_TAG_GNU_call_site_parameter
                      DW_AT_location (DW_OP_reg0 R0)
                      DW_AT_GNU_call_site_value (DW_OP_lit10)

Another example is the A2_combineii instruction on Hexagon which moves
two immediates to a super-register: $d0 = A2_combineii 20, 10.

Perhaps these are rare exceptions, and most MoveImm instructions hold
the immediate in the second operand, but in my opinion the default
implementation of the hook should only describe values that it can, by
some contract, guarantee are safe to describe, rather than leaving it up
to the targets to override the exceptions, as that can silently result
in incorrect call site values.

This patch adds X86's relevant move immediate instructions to the
target's hook implementation, so this commit should be a NFC for that
target. We need to do the same for ARM and AArch64.

Reviewers: djtodoro, NikolaPrica, aprantl, vsk

Reviewed By: vsk

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #debug-info, #llvm

Differential Revision: https://reviews.llvm.org/D69109
2019-10-23 11:41:29 +02:00
georgerim
c933be212b [lib/ObjectYAML] - Add a full stop to the comment. NFC.
A test commit.
2019-10-23 12:35:43 +03:00
Petar Avramovic
7e4c1ab813 [MIPS GlobalISel] Select MSA vector generic and builtin mul
Select vector G_MUL for MIPS32 with MSA. We have to set bank
for vector operands to fprb and selectImpl will do the rest.
Manual selection of G_MUL is now done for gprb only.
__builtin_msa_mulv_<format> will be transformed into G_MUL
in legalizeIntrinsic and selected in the same way.

Differential Revision: https://reviews.llvm.org/D69310
2019-10-23 11:22:07 +02:00
Petar Avramovic
dfd40f4f0d [MIPS GlobalISel] Select MSA vector generic and builtin sub
Select vector G_SUB for MIPS32 with MSA. We have to set bank
for vector operands to fprb and selectImpl will do the rest.
__builtin_msa_subv_<format> will be transformed into G_SUB
in legalizeIntrinsic and selected in the same way.
__builtin_msa_subvi_<format> will be directly selected into
SUBVI_<format> in legalizeIntrinsic.

Differential Revision: https://reviews.llvm.org/D69306
2019-10-23 11:15:25 +02:00
Roman Lebedev
c3b9f03b45 [TargetLowering] optimizeSetCCToComparisonWithZero(): add extra sanity checks (PR43769)
We should do the fold only if both constants are plain,
non-opaque constants, at least that is the DAG.FoldConstantArithmetic()
requirement.
And if the constant we are comparing with is zero - we shouldn't be
trying to do this fold in the first place.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43769
2019-10-23 12:01:40 +03:00
Jinsong Ji
97ade712c2 [PowerPC][NFC] Remove deprecated Function Attrs comments #2 2019-10-22 21:50:50 +00:00
Kit Barton
b4d367c63a Fix broken sphinx link in CMake.rst.
Reviewers: delcypher, beanz

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69325
2019-10-22 14:49:58 -07:00
Jinsong Ji
42318a0a8a [PowerPC][NFC] Remove deprecated Function Attrs comments 2019-10-22 21:38:31 +00:00
Simon Cook
2fb7212d27 [RISCV] Add support for -ffixed-xX flags
This adds support for reserving GPRs such that the compiler will not
choose a register for register allocation. The implementation follows
the same design as for AArch64; each reserved register becomes a target
feature and used for getting the reserved registers for a given
MachineFunction. The backend checks that it does not need to write to
any reserved register; if it does a relevant error is generated.

Differential Revision: https://reviews.llvm.org/D67185
2019-10-22 21:25:01 +01:00
Roman Lebedev
43ea8ce9c7 [DAGCombine][ARM] x ==/!= c -> (x - c) ==/!= 0 iff '-c' can be folded into the x node.
Summary:
This fold, helps recover from the rest of the D62266 ARM regressions.
https://rise4fun.com/Alive/TvpC

Note that while the fold is quite flexible, i've restricted it
to the single interesting pattern at the moment.

Reviewers: efriedma, craig.topper, spatel, RKSimon, deadalnix

Reviewed By: deadalnix

Subscribers: javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62450
2019-10-22 22:56:35 +03:00
Roman Lebedev
ebc79f9f4b [NFC][LVI][CVP] Tests where pre-specified add no-wrap flags could be used by LVI
There's `ConstantRange::addWithNoWrap()`, LVI could use it to further
constrain the range, if an `add` already has some no-wrap flags specified.
2019-10-22 22:54:57 +03:00
Stanislav Mekhanoshin
2750d7ade4 [AMDGPU] Updated fold-vgpr-copy.mir test. NFC. 2019-10-22 12:43:23 -07:00
Michael Liao
fdd7033910 Relax assertions when there's really no entries. [NFC] 2019-10-22 15:26:30 -04:00
Kit Barton
4478256d9e Test commit - add clarification to README regarding Darwin. 2019-10-22 11:39:15 -07:00
Stanislav Mekhanoshin
e7c07b1783 [AMDGPU] Allow tied operand subreg folding
Turns out it makes sense, contrarily to what comment said.

Differential Revision: https://reviews.llvm.org/D69287
2019-10-22 11:27:36 -07:00
Nico Weber
2a387b2c49 gn build: make sync build work with git revs now that svn is gone 2019-10-22 14:19:35 -04:00
Tom Stellard
765d042114 Update git-llvm script to push to GitHub
Summary:
Note: This patch should not be pushed until SVN has become read-only.
It should be the first patch committed directly to GitHub.

This patch updates git-llvm to check for merge commits and then push
changes to GitHub if none are found.  All logic related to SVN has been
removed.

Reviewers: jyknight

Subscribers: lenary, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67772
2019-10-22 16:23:25 +00:00
David Green
399f8b5b40 [InstCombine] Signed saturation patterns
This adds an instcombine matcher for code that attempts to perform signed
saturating arithmetic by casting to a higher type. Unsigned cases are already
matched, this adds extra matches for the more complex signed cases, which
involves matching the min(max(add a b)) nodes with proper extends to ensure
legality.

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

llvm-svn: 375505
2019-10-22 15:39:47 +00:00
David Green
0d53b2850c [InstCombine] Signed saturation tests. NFC
llvm-svn: 375503
2019-10-22 14:49:40 +00:00
Petar Avramovic
74ae047ff4 [MIParser] Set RegClassOrRegBank during instruction parsing
MachineRegisterInfo::createGenericVirtualRegister sets
RegClassOrRegBank to static_cast<RegisterBank *>(nullptr).
MIParser on the other hand doesn't. When we attempt to constrain
Register Class on such VReg, additional COPY is generated.
This way we avoid COPY instructions showing in test that have MIR
input while they are not present with llvm-ir input that was used
to create given MIR for a -run-pass test.

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

llvm-svn: 375502
2019-10-22 14:25:37 +00:00
Petar Avramovic
20f66ad554 [MIPS GlobalISel] Select MSA vector generic and builtin add
Select vector G_ADD for MIPS32 with MSA. We have to set bank
for vector operands to fprb and selectImpl will do the rest.
__builtin_msa_addv_<format> will be transformed into G_ADD
in legalizeIntrinsic and selected in the same way.
__builtin_msa_addvi_<format> will be directly selected into
ADDVI_<format> in legalizeIntrinsic. MIR tests for it have
unnecessary additional copies. Capture current state of tests
with run-pass=legalizer with a test in test/CodeGen/MIR/Mips.

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

llvm-svn: 375501
2019-10-22 13:51:57 +00:00
Eugene Leviant
27d0d0dd70 [ThinLTO] Add code comment. NFC
llvm-svn: 375500
2019-10-22 12:57:23 +00:00
Guillaume Chatelet
15b5c2e96a [Alignment][NFC] Convert StoreInst to MaybeAlign
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 375499
2019-10-22 12:55:32 +00:00