1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

199193 Commits

Author SHA1 Message Date
Georgy Komarov
87e6a20dbb [llvm-objcopy] Emit error if removing symtab referenced by group section
SHT_GROUP sections contain a reference to a symbol indicating their
"signature" symbol. The symbol table containing this symbol is referred
to by the group section's sh_link field. If llvm-objcopy is instructed
to remove the symbol table, it will emit an error.

This fixes https://bugs.llvm.org/show_bug.cgi?id=46153.

Reviewed By: jhenderson, Higuoxing

Differential Revision: https://reviews.llvm.org/D82274
2020-06-29 10:42:03 +01:00
Guillaume Chatelet
d423ca71e1 Fix invalid alignment in DAGCombiner::isLegalNarrowLdSt
`ShAmt / 8` can be a non power of two, this can lead to an invalid alignment.
context: https://reviews.llvm.org/D41350#inline-749165

Differential Revision: https://reviews.llvm.org/D82565
2020-06-29 09:22:15 +00:00
LLVM GN Syncbot
63e4803d4d [gn build] Port 8f9ca561a2b 2020-06-29 08:10:01 +00:00
Xing GUO
81f234a2c6 [ObjectYAML][DWARF] Collect diagnostic message when YAMLParser fails.
Before this patch, the diagnostic message is printed to `errs()` directly, which makes it difficult to use `FailedWithMessage()` in unit testing.
In this patch, we add a custom error handler for YAMLParser, which helps collect diagnostic messages and make it easy to use `FailedWithMessage()` to check error messages.

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D82630
2020-06-29 16:13:53 +08:00
Sergey Dmitriev
e668706cd2 [NFC] CallGraph related cleanup
Summary: Tidy up some CallGraph-related code in preparation for D82572.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82686
2020-06-28 15:27:39 -07:00
Nikita Popov
881c1da5d8 [SimplifyCFG] Make test more robust (NFC)
Avoid changing this test if blocks get merged.
2020-06-28 20:51:03 +02:00
Nikita Popov
8a71a5f127 [SimplifyCFG] Regenerate test checks (NFC) 2020-06-28 20:51:02 +02:00
Roman Lebedev
30e818852b [NFC][ScalarEvolution] Add a test showing SCEV failure to recognize 'urem'
While InstCombine trivially converts that `srem` into a `urem`,
it might happen later than wanted. SCEV should recognize this natively.
2020-06-28 20:35:02 +03:00
Xun Li
10e1d5734d [Coroutines] Optimize the lifespan of temporary co_await object
Summary:
If we ever assign co_await to a temporary variable, such as foo(co_await expr),
we generate AST that looks like this: MaterializedTemporaryExpr(CoawaitExpr(...)).
MaterializedTemporaryExpr would emit an intrinsics that marks the lifetime start of the
temporary storage. However such temporary storage will not be used until co_await is ready
to write the result. Marking the lifetime start way too early causes extra storage to be
put in the coroutine frame instead of the stack.
As you can see from https://godbolt.org/z/zVx_eB, the frame generated for get_big_object2 is 12K, which contains a big_object object unnecessarily.
After this patch, the frame size for get_big_object2 is now only 8K. There are still room for improvements, in particular, GCC has a 4K frame for this function. But that's a separate problem and not addressed in this patch.

The basic idea of this patch is during CoroSplit, look for every local variable in the coroutine created through AllocaInst, identify all the lifetime start/end markers and the use of the variables, and sink the lifetime.start maker to the places as close to the first-ever use as possible.

Reviewers: lewissbaker, modocache, junparser

Reviewed By: junparser

Subscribers: hiraditya, llvm-commits, rsmith, ChuanqiXu, cfe-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D82314
2020-06-28 10:18:15 -07:00
Sanjay Patel
6cd9edb9b6 [VectorCombine] add test for scalable vectors; NFC 2020-06-28 12:44:44 -04:00
Sanjay Patel
c102819993 Revert "[VectorCombine] add test for scalable vectors; NFC"
This reverts commit 700ec6b848c02ca3de9751d63a7a5a26671c3fe9.
An extra test diff snuck here.
2020-06-28 12:43:11 -04:00
Sanjay Patel
adcd418d36 [VectorCombine] add test for scalable vectors; NFC 2020-06-28 12:42:00 -04:00
Sanjay Patel
ff8699a103 [x86] add tests for rsqrt opportunities; NFC 2020-06-28 12:42:00 -04:00
Esme-Yi
7c2f3bcb24 [NFC][PowerPC] Add run lines to test DivRemPairsPass. 2020-06-28 16:26:05 +00:00
Nikita Popov
8f6fd95e02 [InstCombine] Add tests for assume implication (NFC) 2020-06-28 16:18:44 +02:00
Nikita Popov
e01bc5e88a [LVI] Refactor value from icmp cond handling (NFC)
Rewrite this in a way that is more amenable to extension.
2020-06-28 15:04:02 +02:00
Nikita Popov
4ff55cbf49 [CVP] Add tests for icmp or and/or edge conds (NFC) 2020-06-28 14:54:55 +02:00
Simon Pilgrim
eefd5fecb7 [X86] combineScalarToVector - handle (v2i64 scalar_to_vector(aextload)) as well as (v2i64 scalar_to_vector(aext))
We already fold (v2i64 scalar_to_vector(aext)) -> (v2i64 bitcast(v4i32 scalar_to_vector(x))), this adds support for similar aextload cases and also handles v2f64 cases that wrap the i64 extension behind bitcasts.

Fixes the remaining issue with PR39016
2020-06-28 13:00:32 +01:00
madhur13490
56cd330ee7 Revert accidentally landed patch citing o build errors
Summary: This reverts commit c73966c2f79290e4eefe6e481f7bc94dd6ca4437.

Reviewers:

Subscribers:
2020-06-28 11:52:33 +00:00
madhur13490
e648e95206 Improve stack object printing. NFC.
Reviewers: madhur13490

Reviewed By: madhur13490

Subscribers: qcolombet, arsenm, jvesely, nhaehnle, hiraditya, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82712
2020-06-28 11:43:33 +00:00
dfukalov
cfda63f7ad SpeculativeExecution: fix incorrect debug info move
Summary:
Debug info related instructions got zero cost so hoisted unconditionally

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

Reviewers: arsenm, nhaehnle, chandlerc, aprantl

Reviewed By: aprantl

Subscribers: ormris, uabelho, wdng, aprantl, hiraditya, llvm-commits

Tags: #llvm, #debug-info

Differential Revision: https://reviews.llvm.org/D81730
2020-06-28 14:35:00 +03:00
Simon Pilgrim
9a2f885bc0 [X86] Rename dagcombine-cse.ll i386 test prefix X86 instead of X32. 2020-06-28 12:11:56 +01:00
Chen Zheng
47d79b5f12 [MachineLICM] testcase for hoisting rematerializable instruction, nfc 2020-06-28 03:16:57 -04:00
Brad Smith
2b7d43c46c Add OpenBSD support to be able to retrieve the thread id 2020-06-27 21:14:44 -04:00
Mike Edwards
5e9ac43a7a [LIT] Correcting max-failures option in lit documentation. 2020-06-27 14:57:04 -07:00
Benjamin Kramer
5780dfaa2c [RISCV] Silence unused variable warning in Release builds. NFC. 2020-06-27 23:24:28 +02:00
Nikita Popov
0df95ef5c0 [ValueTracking] Use a switch statement (NFC) 2020-06-27 22:42:43 +02:00
Simon Pilgrim
b174494694 [X86] SimplifyDemandedVectorEltsForTargetNode - merge shuffle/pack lower demanded elements handling.
Generalize the vector operand extraction code for shuffle/pack ops - we can assume that the vector operands are the same width as the result, and any non-vector values can be reused directly in the smaller width op.
2020-06-27 19:10:13 +01:00
Hsiangkai Wang
baee917da3 [RISCV] Assemble/Disassemble v-ext instructions.
Assemble/disassemble RISC-V V extension instructions according to
latest version spec in https://github.com/riscv/riscv-v-spec/.

I have tested this patch using GNU toolchain. The encoding is aligned
to GNU assembler output. In this patch, there is a test case for each
instruction at least.

The V register definition is just for assemble/disassemble. Its type
is not important in this stage. I think it will be reviewed and modified
as we want to do codegen for scalable vector types.

This patch does not include Zvamo, Zvlsseg, and Zvediv.

Differential revision: https://reviews.llvm.org/D69987
2020-06-28 00:54:07 +08:00
Roman Lebedev
e1cb0d103c [Analysis] isDereferenceableAndAlignedPointer(): don't crash on bitcast <1 x ???*> to ???* 2020-06-27 18:30:59 +03:00
Simon Pilgrim
f33e8eac86 [X86][AVX] SimplifyDemandedVectorEltsForTargetNode - reduce width of X86ISD::VPERMIL2
If we don't need the elements of the upper lanes, reduce the width of the X86ISD::VPERMIL2 node.
2020-06-27 15:06:49 +01:00
Simon Pilgrim
b5d324a7e9 [X86][AVX] SimplifyDemandedVectorEltsForTargetNode - reduce width of X86ISD::VPERMILPV
If we don't need the elements of the upper lanes, reduce the width of the X86ISD::VPERMILPV node.
2020-06-27 14:43:03 +01:00
Simon Pilgrim
95062c5395 ThreadPool.h - remove unused BitVector.h include. NFC. 2020-06-27 11:37:46 +01:00
Simon Pilgrim
ad5f8ef5db FileCollector.h - reduce Twine.h include to forward declaration. NFC. 2020-06-27 11:16:25 +01:00
Simon Pilgrim
652fd662fd [DAG] reduceBuildVecExtToExtBuildVec - don't combine if it would break a splat.
reduceBuildVecExtToExtBuildVec was breaking a splat(zext(x)) pattern into buildvector(x, 0, x, 0, ..) resulting in much more complex insert+shuffle codegen.

We already go to some lengths to avoid this in SimplifyDemandedVectorElts etc. when we encounter splat buildvectors.

It should be OK to fold all splat(aext(x)) patterns - we might need to tighten this if we find a case where we mustn't introduce a buildvector(x, undef, x, undef, ..) but I can't find one.

Fixes PR46461.
2020-06-27 11:03:57 +01:00
Simon Pilgrim
78d47ed6bf [X86] Add PR46461 test case 2020-06-27 10:43:11 +01:00
Simon Pilgrim
25bbd05823 [X86] Add AVX tests buildvec-insertvec.ll 2020-06-27 10:43:11 +01:00
Simon Pilgrim
236b1ecd2b Fix unused type alias warning. NFC.
The "using InsertPointTy" line is an unnecessary copy + paste from other builder tests.
2020-06-27 10:43:10 +01:00
David Zarzycki
48aa39a9ee Reland: [clang driver] Move default module cache from system temporary directory
This fixes a unit test. Otherwise here is the original commit:

1) Shared writable directories like /tmp are a security problem.
2) Systems provide dedicated cache directories these days anyway.
3) This also refines LLVM's cache_directory() on Darwin platforms to use
   the Darwin per-user cache directory.

Reviewers: compnerd, aprantl, jakehehrlich, espindola, respindola, ilya-biryukov, pcc, sammccall

Reviewed By: compnerd, sammccall

Subscribers: hiraditya, llvm-commits, cfe-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D82362
2020-06-27 05:35:15 -04:00
Simon Pilgrim
139cbe87ac Error.h - GenericBinaryError - pass Twine arg by reference not value.
This allows us to reduce the Twine.h include to a forward declaration.
2020-06-27 10:12:20 +01:00
Simon Pilgrim
25f590cc77 CompileOnDemandLayer.h - remove unused Twine.h include. NFC. 2020-06-27 10:03:34 +01:00
Simon Pilgrim
dab79782ef IndirectionUtils.h - reduce Twine.h include to forward declaration. NFC. 2020-06-27 10:03:34 +01:00
Simon Pilgrim
74afdd5cc2 MCSectionWasm.h - reduce includes to forward declarations. NFC. 2020-06-27 10:03:34 +01:00
Simon Pilgrim
c9efaa6f02 AsmPrinter.h - reduce includes to forward declarations. NFC. 2020-06-27 10:03:33 +01:00
Nikita Popov
59d7b160ef [IR] Store attributes that are available "somewhere" (NFC)
I noticed that for some benchmarks we spend quite a bit of time
inside AttributeList::hasAttrSomewhere(), mainly when checking
for the "returned" attribute. Most of the time the attribute will
not be present, in which case this function has to walk through
the whole attribute list and check for the attribute at each index.

This patch adds a cache of all "available somewhere" attributes
inside AttributeListImpl. This makes the structure 12 bytes larger,
but I don't think that's problematic, as attribute lists are uniqued.
Compile-time in terms of instructions retired improves by 0.4% on
average, but >1% for sqlite.

Differential Revision: https://reviews.llvm.org/D81867
2020-06-27 10:44:59 +02:00
Simon Pilgrim
aa0c6eadb5 AsmWriter - printConstVCalls/printNonConstVCalls - avoid std::vector pass by value. NFCI. 2020-06-27 09:38:37 +01:00
Roman Lebedev
11158670ff [SCEV] Make SCEVAddExpr actually always return pointer type if there is pointer operand (PR46457)
Summary:
The added assertion fails on the added test without the fix.

Reduced from test-suite/MultiSource/Benchmarks/MiBench/office-ispell/correct.c
In IR, getelementptr, obviously, takes pointer as it's base,
and returns a pointer.

When creating an SCEV expression, SCEV operands are sorted in hope
that it increases folding potential, and at the same time SCEVAddExpr's
type is the type of the last(!) operand.

Which means, in some exceedingly rare cases, pointer operand may happen to
end up not being the last operand, and as a result SCEV for GEP
will suddenly have a non-pointer return type.
We should ensure that does not happen.

In the end, actually storing the `Type *`, at the cost of increasing
memory footprint of `SCEVAddExpr`, appears to be the solution.
We can't just store a 'is a pointer' bit and create pointer type
on the fly since we don't have data layout in getType().

Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=46457 | PR46457 ]]

Reviewers: efriedma, mkazantsev, reames, nikic

Reviewed By: efriedma

Subscribers: hiraditya, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82633
2020-06-27 11:37:17 +03:00
Roman Lebedev
279b9dd84b [NFCI][SCEV] getPointerBase(): de-recursify
Summary:
This is boringly straight-forward, each iteration we see if
V is some expression that we can look into, and if it has
a single pointer operand, then set V to that operand
and repeat.

Reviewers: efriedma, mkazantsev, reames, nikic

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82632
2020-06-27 11:37:17 +03:00
Fady Ghanim
3b19cc4c92 [OpenMP][OMPBuilder] Remove unused variable in Unittest
Relating to buildbot errors to commit 82b8236cf248ef91968b67d18af23890322cde43
2020-06-27 02:49:43 -04:00
Gui Andrade
7e14b9cae5 [MSAN] Handle x86 {round,min,max}sd intrinsics
These need special handling over the simple vector intrinsics as they
behave more like a shuffle operation: taking the top half of the vector
from one input, and the bottom half separately. Previously, these were
being handled as though all bits of all operands were combined.

Differential Revision: https://reviews.llvm.org/D82398
2020-06-27 06:46:04 +00:00