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

196688 Commits

Author SHA1 Message Date
Sam McCall
388a71256c Revert "[DAGCombine] Remove the getNegatibleCost to avoid the out of sync with getNegatedExpression"
This reverts commit 3c44c441db0f8d7e210806b5b221cd9ed66f2d7b.

Causes infloops on some inputs, see https://reviews.llvm.org/D77319 for repro
2020-05-11 16:44:01 +02:00
Sanjay Patel
3b3854f085 [x86] add test for funnel shift in loop with cross-block splat variable; NFC 2020-05-11 10:41:49 -04:00
Kirill Bobyrev
5078e2758b [clangd] Fix remote index build for macOS with Homebrew-installed gRPC and Protobuf
Reviewers: sammccall

Reviewed By: sammccall

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79387
2020-05-11 12:28:07 +02:00
Tyker
dd21e1ed58 [AssumeBundles] fix crashes
Summary:
this patch fixe crash/asserts found in the test-suite.
the AssumeptionCache cannot be assumed to have all assumes contrary to what i tought.
prevent generation of information for terminators, because this can create broken IR in transfromation where we insert the new terminator before removing the old one.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79458
2020-05-11 11:52:21 +02:00
OCHyams
ceba7b314a [NFC][DwarfDebug] Add test for variables with a single location which
don't span their entire scope.

The previous commit (6d1c40c171e) is an older version of the test.

Reviewed By: aprantl, vsk

Differential Revision: https://reviews.llvm.org/D79573
2020-05-11 11:49:11 +02:00
OCHyams
5a1aa7d07d [NFC][DwarfDebug] Add test for variables with a single location which
don't span their entire scope.

The previous commit (6d1c40c171e) is an older version of the test.

Reviewed By: aprantl, vsk

Differential Revision: https://reviews.llvm.org/D79573
2020-05-11 09:43:30 +01:00
OCHyams
7cbe1e2d68 [NFC][DwarfDebug] Add test for variables with a single location which
don't span their entire scope.

Reviewed By: aprantl, vsk

Differential Revision: https://reviews.llvm.org/D79573
2020-05-11 09:36:49 +01:00
Djordje Todorovic
9a5aa73b89 [NFC][DwarfDebug] Avoid default capturing when using lambdas
It is bad practice to capture by default (via [&] in this case) when
using lambdas, so we should avoid that as much as possible.

This patch fixes that in the getForwardingRegsDefinedByMI
from DwarfDebug module.

Differential Revision: https://reviews.llvm.org/D79616
2020-05-11 10:02:13 +02:00
Djordje Todorovic
90bc1438f9 [NFC][DwarfDebug] Prefer explicit to auto type deduction
We should use explicit type instead of auto type deduction when
the type is so obvious. In addition, we remove ambiguity, since auto
type deduction sometimes is not that intuitive, so that could lead
us to some unwanted behavior.

This patch fixes that in the collectCallSiteParameters() from
DwarfDebug module.

Differential Revision: https://reviews.llvm.org/D79624
2020-05-11 09:12:58 +02:00
Xun Li
01dc1f624a Remove an unused Module param
Summary:
In D65848 the function getFuncNameInModule was refactored to no longer use module.
This diff removes the parameter and rename the function name to avoid confusion.

Reviewers: wenlei, wmi, davidxl

Reviewed By: wenlei

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79310
2020-05-10 22:09:55 -07:00
Xing GUO
0c2e5066e9 [Object] Remove unused variable after D79560. NFC. 2020-05-11 13:03:53 +08:00
Fangrui Song
5ac915ed2c [gcov] Implement --stdout -t
gcov by default prints to a .gcov file. With --stdout, stdout is used.
Some summary information is omitted. There is no separator for multiple
source files.
2020-05-10 21:02:38 -07:00
Johannes Doerfert
0992aa483d [Attributor] Merge the query set into AbstractAttribute
The old QuerriedAAs contained two vectors, one for required one for
optional dependences (=queries). We now use a single vector and encode
the kind directly in the pointer.

This reduces memory consumption and makes the connection between
abstract attributes and their dependences clearer.

No functional change is intended, changes in the test are due to
different order in the query map. Neither the order before nor now is in
any way special.

---

Single run of the Attributor module and then CGSCC pass (oldPM)
for SPASS/clause.c (~10k LLVM-IR loc):

Before:
```
calls to allocation functions: 543734 (329735/s)
temporary memory allocations: 105895 (64217/s)
peak heap memory consumption: 19.19MB
peak RSS (including heaptrack overhead): 102.26MB
total memory leaked: 269.10KB
```

After:
```
calls to allocation functions: 513292 (341511/s)
temporary memory allocations: 106028 (70544/s)
peak heap memory consumption: 13.35MB
peak RSS (including heaptrack overhead): 95.64MB
total memory leaked: 269.10KB
```

Difference:
```
calls to allocation functions: -30442 (208506/s)
temporary memory allocations: 133 (-910/s)
peak heap memory consumption: -5.84MB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
```

---

Reviewed By: uenoku

Differential Revision: https://reviews.llvm.org/D78729
2020-05-10 22:27:00 -05:00
QingShan Zhang
ad5b7e20d5 [DAGCombine] Remove the getNegatibleCost to avoid the out of sync with getNegatedExpression
We have the getNegatibleCost/getNegatedExpression to evaluate the cost and negate the expression.
However, during negating the expression, the cost might change as we are changing the DAG,
and then, hit the assertion if we negated the wrong expression as the cost is not trustful anymore.

This patch is target to remove the getNegatibleCost to avoid the out of sync with getNegatedExpression,
and check the cost during negating the expression. It also reduce the duplicated code between
getNegatibleCost and getNegatedExpression. And fix the crash for the test in D76638

Reviewed By: RKSimon, spatel

Differential Revision: https://reviews.llvm.org/D77319
2020-05-11 02:41:10 +00:00
Fangrui Song
d7809692f8 [X86] Fix combineVectorCompareAndMaskUnaryOp regression after 0e8e731449d8fbfa6ba4523de928b4812ef9f100 2020-05-10 19:03:38 -07:00
Lang Hames
b54957fa0b [examples] Fix the SpeculativeJIT and ThinLtoJIT examples for 41379f1ec46. 2020-05-10 17:34:31 -07:00
Nico Weber
9a7711e874 Remove a comment that is no longer true after d03838343f2. 2020-05-10 20:15:29 -04:00
Nico Weber
5ebf0e7eef Remove a variable write that is not needed after d03838343f2. 2020-05-10 20:13:45 -04:00
Johannes Doerfert
1e8b1544dc [Attributor][FIX] Carefully handle/ignore/forget argmemonly
When we have an existing `argmemonly` or `inaccessiblememorargmemonly`
we used to "know" that information. However, interprocedural constant
propagation can invalidate these attributes. We now ignore and remove
these attributes for internal functions (which may be affected by IP
constant propagation), if we are deriving new attributes for the
function.
2020-05-10 19:06:11 -05:00
Johannes Doerfert
2251bdf0ea [Attributor] Use "simplify to constant" in genericValueTraversal
As we replace values with constants interprocedurally, we also need to
do this "look-through" step during the generic value traversal or we
would derive properties from replaced values. While this is often not
problematic, it is when we use the "kind" of a value for reasoning,
e.g., accesses to arguments allow `argmemonly`.
2020-05-10 19:06:11 -05:00
Johannes Doerfert
340c8cfa95 [Attributor] Ignore illegal accesses to null
When we categorize a pointer value we bailed at `null` before. If we
know `null` is not a valid memory location we can ignore it as there
won't be an access at all.
2020-05-10 19:06:10 -05:00
Johannes Doerfert
cd3449844d [Attributor] Use existing helpers to determine IR facts
We now use getPointerDereferenceableBytes to determine `nonnull` and
`dereferenceable` facts from the IR. We also use getPointerAlignment in
AAAlign for the same reason. The latter can interfere with callbacks so
we do restrict it to non-function-pointers for now.
2020-05-10 19:06:10 -05:00
Johannes Doerfert
8614729425 [Attributor][NFC] Clang format Attributor*.cpp 2020-05-10 19:06:10 -05:00
Lang Hames
a145c06983 [ORC] Share ownership of JITDylibs between ExecutionSession and
MaterializationResponsibility.

MaterializationResponsibility objects provide a connection between a
materialization process (compiler, jit linker, etc.) and the JIT state held in
the ExecutionSession and JITDylib objects. Switching to shared ownership
extends the lifetime of JITDylibs to ensure they remain accessible until all
materializers targeting them have completed. This will allow (in a follow-up
patch) JITDylibs to be removed from the ExecutionSession and placed in a
pending-destruction state while they are kept alive to communicate errors
to/from any still-runnning materialization processes. The intent is to enable
JITDylibs to be safely removed even if they have running compiles targeting
them.
2020-05-10 16:37:17 -07:00
Fangrui Song
9c7a9b76b2 [gcov] Default coverage version to '407*' and delete CC1 option -coverage-cfg-checksum
Defaulting to -Xclang -coverage-version='407*' makes .gcno/.gcda
compatible with gcov [4.7,8)

In addition, delete clang::CodeGenOptionsBase::CoverageExtraChecksum and GCOVOptions::UseCfgChecksum.
We can infer the information from the version.

With this change, .gcda files produced by `clang --coverage a.o` linked executable can be read by gcov 4.7~7.
We don't need other -Xclang -coverage* options.
There may be a mismatching version warning, though.

(Note, GCC r173147 "split checksum into cfg checksum and line checksum"
 made gcov 4.7 incompatible with previous versions.)
2020-05-10 16:14:07 -07:00
Ricky Zhou
7244405635 [examples] Fix llvm.memset prototype in BrainF example.
Commit 1e68724d24ba38de7c7cdb2e1939d78c8b37cc0d removed the alignment
argument from the memset intrinsic. Update the BrainF example to match.

Reviewed By: jyknight
Differential Revision: https://reviews.llvm.org/D79601
2020-05-10 17:20:56 -04:00
Matt Arsenault
e62da2871c AMDGPU/GlobalISel: Remove -global-isel-abort=0 from tests 2020-05-10 17:19:47 -04:00
Fangrui Song
83e3089026 [gcov] Delete CC1 option -coverage-no-function-names-in-data
rL144865 incorrectly wrote function names for GCOV_TAG_FUNCTION
(this might be part of the reasons the header says
"We emit files in a corrupt version of GCOV's "gcda" file format").

rL176173 and rL177475 realized the problem and introduced -coverage-no-function-names-in-data
to work around the issue. (However, the description is wrong.
libgcov never writes function names, even before GCC 4.2).

In reality, the linker command line has to look like:

clang --coverage -Xclang -coverage-version='407*' -Xclang -coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data

Failing to pass -coverage-no-function-names-in-data can make gcov 4.7~7
either produce wrong results (for one gcov-4.9 program, I see "No executable lines")
or segfault (gcov-7).
(gcov-8 uses an incompatible format.)

This patch deletes -coverage-no-function-names-in-data and the related
function names support from libclang_rt.profile
2020-05-10 12:37:44 -07:00
Craig Topper
1d80166e29 [X86] Add a few more shuffles to hasUndefRegUpdate.
Mostly found by asserting on tests that have undef operands. I'm
sure this isn't an exhaustive list.
2020-05-10 12:30:16 -07:00
Tyker
81116006c1 [AssumeBundles] Remove non-determinisme from assume builder
Summary:
The assume builder was non-deterministic when working on unamed values.
this patch fixes this.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, mgrang, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78616
2020-05-10 21:18:33 +02:00
Andrea Di Biagio
79ed672fa3 [MCA][InstrBuilder] Correctly mark reserved resources in initializeUsedResources.
This fixes a bug reported by Alex Renda on LLVMDev where mca did not correctly
mark a resource group as "reserved".
(See http://lists.llvm.org/pipermail/llvm-dev/2020-May/141485.html).

The issue was caused by a wrong check in function `initializeUsedResources`.
As a consequence of this, a resource group was left unreserved, and its field
`NumUnits` incorrectly reported an unrealistic number of consumed resource
units.

This patch fixes the issue with the handling of reserved resources in the
InstrBuilder class, and adds a simple test for it.  Ideally, as suggested by
Andy Trick, most of these problems will disappear if in the future we will
introduce a (optional) DelayCycles vector for SchedWriteRes.
2020-05-10 19:25:54 +01:00
Tyker
0e4a65ecbd [AssumeBundles] Prevent generation of some redundant assumes
Summary: with this patch the assume salvageKnowledge will not generate assume if all knowledge is already available in an assume with valid context. assume bulider can also in some cases update an existing assume with better information.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78014
2020-05-10 19:23:59 +02:00
Fangrui Song
65e4dbf091 [gcov] Don't skip leading zeros when reading a string
Even a 2003 version of gcov_read_string does not have the behavior
described by rL204881. The wrong impression might come from
libclang_rt.profile (GCDAProfiling.c)'s corrupted output (since the
initial import rL144865). Note, the corrupted output crashes gcov.
2020-05-10 10:16:34 -07:00
Fangrui Song
d7b402943b [gcov] Fix .gcda decoding and support GCC 8, 9 and 10
GCDAProfiling.c unnecessarily writes function names to .gcda files.
GCC 4.2 gcc/libgcov.c (now renamed to libgcc/libgcov*) did not write function
names. gcov-7 (compatible) crashes on .gcda produced by libclang_rt.profile
rL176173 realized the problem and introduced a mode to remove function
names.

llvm-cov code apparently takes GCDAProfiling.c output format as truth
and tries to decode function names.  Additionally, llvm-cov tries to
decode tags in certain order which does not match libgcov emitted .gcda
files.

This patch fixes the .gcda decoder and makes it work with GCC 8 and 9
(10 is compatible with 9). Note, line statistics are broken and not
fixed by this patch.

Add test/tools/llvm-cov/gcov-{4.7,8,9}.c to test compatibility.
2020-05-10 09:55:23 -07:00
Florian Hahn
366aeb3a0b [LAA] Move runtime-check generation to Transforms/Utils/loopUtils (NFC)
Currently LAA's uses of ScalarEvolutionExpander blocks moving the
expander from Analysis to Transforms. Conceptually the expander does not
fit into Analysis (it is only used for code generation) and
runtime-check generation also seems to be better suited as a
transformation utility.

Reviewers: Ayal, anemet

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D78460
2020-05-10 17:39:26 +01:00
Simon Pilgrim
92982f421a CodeMetrics.cpp - remove unused includes. NFC. 2020-05-10 16:59:55 +01:00
Simon Pilgrim
11339b909e LoopUtils.h - remove unused forward declarations. NFC. 2020-05-10 16:59:54 +01:00
Simon Pilgrim
40a706377d Local.h - remove unused forward declaration. NFC. 2020-05-10 16:59:54 +01:00
Sanjay Patel
35504cee33 [InstCombine] canonicalize bitcast after insertelement into undef
We have a transform in the opposite direction only for the x86 MMX type,
Other types are not handled either way before this patch.

The motivating case from PR45748:
https://bugs.llvm.org/show_bug.cgi?id=45748
...is the last test diff. In that example, we are triggering an existing
bitcast transform, so we reduce the number of casts, and that should give
us the ideal x86 codegen.

Differential Revision: https://reviews.llvm.org/D79171
2020-05-10 11:37:47 -04:00
Simon Pilgrim
1c617b6425 [InstCombine] matchOrConcat - match BITREVERSE
Fold or(zext(bitreverse(x)),shl(zext(bitreverse(y)),bw/2) -> bitreverse(or(zext(x),shl(zext(y),bw/2))

Practically this is the same as the BSWAP pattern so we might as well handle it.
2020-05-10 16:00:29 +01:00
Florian Hahn
df2c2d8ea5 Recommit "[LAA] Remove one addRuntimeChecks function (NFC)."
The failing assertion has been fixed and the problematic test case has
been added.

This reverts the revert commit fc44617f28847417e55836193bbe8e9c3f09eca9.
2020-05-10 15:19:57 +01:00
Simon Pilgrim
60d9ce7a78 PassInstrumentation.h - reduce TypeName.h include to StringRef forward declaration. NFC. 2020-05-10 14:22:02 +01:00
Simon Pilgrim
8cba050e0c CoverageMapping.h - remove unused StringSet.h include. NFC. 2020-05-10 14:19:54 +01:00
Simon Pilgrim
bff72fd133 PassManager.h - remove unused raw_ostream.h include. NFC. 2020-05-10 14:17:52 +01:00
Simon Pilgrim
5b9553fe08 Mangler.h - reduce GlobalValue.h include to forward declaration. NFC.
Exposes implicit dependency in ModuleSymbolTable.h - added missing Module forward declaration.
2020-05-10 14:03:27 +01:00
Simon Pilgrim
2fb4b98a95 LoopPass.h - remove unnecessary PMStack forward declaration. NFC.
We have to include LegacyPassManagers.h where its defined.
2020-05-10 14:03:27 +01:00
Florian Hahn
08e92a0b48 Revert "[LAA] Remove one addRuntimeChecks function (NFC)."
This reverts commit c28114c8ffde705d7e16cd4c065fd23269661c81.

This causes some bots to fail:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/30596/steps/build%20android%2Faarch64/logs/stdio
2020-05-10 13:28:00 +01:00
Florian Hahn
08756fc67b [LAA] Remove one addRuntimeChecks function (NFC).
In order to reduce the API surface area (preparation for D78460), remove
a addRuntimeChecks() function and do the additional check in the single
caller.

Reviewers: Ayal, anemet

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D79679
2020-05-10 12:48:55 +01:00
Sanjay Patel
b3c5529405 [InstCombine] fold fpext into exact integer-to-FP cast
We can combine a floating-point extension cast with a conversion
from integer if we know the earlier cast is exact.

This is an optimization suggested in PR36617:
https://bugs.llvm.org/show_bug.cgi?id=36617#c19

However, this patch does not change the example suggested there.
This patch only uses the existing analysis to handle cases where
the integer source value magnitude is narrower than the
intermediate FP mantissa (guarantees that the conversion to FP is
exact). Follow-up patches to the analysis function can enable
more cases.

Differential Revision: https://reviews.llvm.org/D79116
2020-05-10 07:04:54 -04:00
LLVM GN Syncbot
1121238a83 [gn build] Port 35d867a790c 2020-05-10 11:04:15 +00:00